コード例 #1
0
 public function index($sortby = null, $order = null)
 {
     if (Session::has('username') && (Session::get('user_type') == "Root" || Session::get('user_type') == "Admin" || Session::get("user_type") == "User")) {
         $view = View::make("Assets.Software.software_assets");
         $view->nav = "assets";
         $view->tab = "software";
         if (empty($sortby) || empty($order)) {
             $software = Software::orderBy("asset_tag")->paginate(25);
         } else {
             $software = Software::orderBy($sortby, $order)->paginate(25);
         }
         $result = Software::count();
         $view->sortby = $sortby;
         $view->order = $order;
         $view->software = $software;
         $view->result = $result;
         return $view;
     } else {
         return Redirect::to('/');
     }
 }