Пример #1
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function getIndex()
 {
     if (Session::get('user_level') < Config::get('cms.viewContacts')) {
         return Redirect::to(_l(URL::action('AdminHomeController@getIndex')))->with('message', Lang::get('admin.notPermitted'))->with('notif', 'warning');
     }
     $this->setLayout();
     if (Input::get('q')) {
         $marks = Mark::whereHas('user', function ($q) {
             $q->where('first_name', 'like', '%' . Input::get('q') . '%')->orWhere('last_name', 'like', '%' . Input::get('q') . '%');
         })->orWhere('note', 'like', '%' . Input::get('q') . '%')->paginate(20);
     } else {
         $marks = Mark::orderBy('created_at', 'desc')->paginate(20);
     }
     View::share('title', __(Lang::get('admin.marks')));
     View::share('marks', $marks);
     $this->layout->content = View::make('backend.puskice.marks.index');
 }
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $marks = Mark::orderBy('name')->get();
     return View::make("admin.mark.list", array("marks" => $marks));
 }