public function softwareAssetsReports()
 {
     if (Session::has('username') && (Session::get('user_type') == "Root" || Session::get('user_type') == "Admin" || Session::get("user_type") == "User")) {
         $view = View::make("Reports.software_assets_reports");
         $view->nav = "system";
         $view->tab = "software";
         $totalSoftwareAssets = Software::all()->count();
         $softwareTypes = SoftwareType::orderBy("software_type")->get();
         $available = Software::where("status", "=", "Available")->count();
         $pwu = Software::where("status", "=", "PWU")->count();
         $retired = Software::where("status", "=", "Retired")->count();
         $test_case = Software::where("status", "=", "Test Case")->count();
         $lost = Software::where("status", "=", "Lost")->count();
         $view->softwareTypes = $softwareTypes;
         $view->available = $available;
         $view->pwu = $pwu;
         $view->retired = $retired;
         $view->test_case = $test_case;
         $view->lost = $lost;
         $view->totalSoftwareAssets = $totalSoftwareAssets;
         return $view;
     } else {
         return Redirect::to("/");
     }
 }
 public function exportSoftware()
 {
     if (Session::has('username') && (Session::get('user_type') == "Root" || Session::get('user_type') == "Admin")) {
         $view = View::make("Export.export_software");
         $view->nav = "system";
         $view->tab = "software";
         $view->software = Software::orderBy("asset_tag")->paginate(25);
         $view->results = Software::all()->count();
         $getSoftwareTypes = SoftwareType::all();
         $softwareTypes = array("" => "--Select One--");
         foreach ($getSoftwareTypes as $gst) {
             $softwareTypes[$gst->id] = $gst->software_type;
         }
         $view->softwareTypes = $softwareTypes;
         return $view;
     } else {
         return Redirect::to("/");
     }
 }
 public function advancedSearch()
 {
     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_advanced_search");
         $view->nav = "assets";
         $view->tab = "search";
         $view->software = Software::orderBy("asset_tag")->paginate(25);
         $view->results = Software::all()->count();
         $getSoftwareTypes = SoftwareType::all();
         $softwareTypes = array("" => "--Select One--");
         foreach ($getSoftwareTypes as $gst) {
             $softwareTypes[$gst->id] = $gst->software_type;
         }
         $view->softwareTypes = $softwareTypes;
         return $view;
     } else {
         return Redirect::to("/");
     }
 }
Example #4
0
 /**
  * Gets all installed software from this server
  *
  * @param array $scopes optional
  *
  * @return array List of PatrolSdk\Software
  */
 public function allSoftware($scopes = [])
 {
     if (!$this->id) {
         throw new Exception("The server has no ID, can\\'t get software");
     }
     $software = new Software($this->patrol);
     $software->defaults(['server_id' => $this->id]);
     return $software->all($scopes);
 }