Ejemplo n.º 1
0
 /**
  * Add apartment page
  * @return \Illuminate\View\View
  */
 public function home()
 {
     $apartment = new ListApartment();
     //Hard code
     $apartment->username = Auth::user()->username;
     // Get all district
     $district = ListDistrict::lists('name_district', 'id_district');
     // Get all province
     $province = ListProvice::lists('name_province', 'id_province');
     // Get all project
     $projects = ListProject::lists('name', 'ID');
     //Get project
     $project_id = Input::get('project');
     $apartment->project = $project_id;
     // Get all furniture
     $furnitures = Furniture::lists('name', 'ID');
     // Get all management company
     $directions = Direction::lists('name', 'ID');
     // Get all floor material
     $floor_materials = FloorMaterial::lists('name', 'ID');
     // Clear Session
     for ($i = -2; $i < 8; $i++) {
         if (Session::has("image[{$i}]")) {
             Session::remove("image[{$i}]");
         }
     }
     return View::make('pages.apartment', compact('apartment', 'district', 'province', 'projects', 'project_id', 'furnitures', 'directions', 'floor_materials'));
 }
Ejemplo n.º 2
0
 /**
  * Index page
  * @return \Illuminate\Http\RedirectResponse
  */
 public function index()
 {
     // Get all project
     $projects = ListProject::lists('name', 'ID');
     return View::make('pages.index', compact('projects'));
 }