Esempio n. 1
0
 public function addLocation()
 {
     //create a new location here
     $validator = Validator::make(Input::all(), LocationsForPm::$rules);
     if ($validator->passes()) {
         LocationsForPm::create(array('location' => Request::get('location'), 'numberOfHouses' => Request::get('number_of_houses')));
         return Redirect::to('/pm')->with('message', 'Location Added Succsfully');
     } else {
         return Redirect::to('/pm')->with('message', 'Something Went Wrong. Location was not added!');
     }
 }
Esempio n. 2
0
 public function pm()
 {
     //return the pm view
     return view('pmDashboard', array('title' => 'PM | Welcome', 'reports' => \App\PmReport::all(), 'locations' => \App\LocationsForPm::all()));
 }
Esempio n. 3
0
 public static function getNumberOfHouses($loc)
 {
     $location = LocationsForPm::where('location', 'like', $loc)->first();
     $number = $location->numberOfHouses;
     return $number;
 }