Example #1
0
 public function getEdit($id)
 {
     $data = provinces::find($id);
     $regions = Regions::all();
     $country = Countries::where('region_id', '=', $data->country->region->id)->get();
     $options = array('data' => $data, 'regions' => $regions, 'country' => $country);
     return View::make('home/dashboard', array())->nest('content', 'provinces/edit', $options);
 }
Example #2
0
 public function getEdit($id)
 {
     $data = guest::find($id);
     $regions = Regions::all();
     $country = Countries::where('region_id', '=', $data->city->province->country->region->id)->get();
     $province = Provinces::where('country_id', '=', $data->city->province->country->id)->get();
     $city = Cities::where('province_id', '=', $data->city->province->id)->get();
     $options = array('data' => $data, 'regions' => $regions, 'country' => $country, 'province' => $province, 'city' => $city, 'identity' => Identity::all(), 'job' => Jobs::all());
     return View::make('home/dashboard', array())->nest('content', 'guest/edit', $options);
 }
Example #3
0
 public function getIndex()
 {
     $hotel = Hotel::find(1);
     $regions = Regions::all();
     $country = Countries::where('region_id', '=', $hotel->city->province->country->region->id)->get();
     $province = Provinces::where('country_id', '=', $hotel->city->province->country->id)->get();
     $city = Cities::where('province_id', '=', $hotel->city->province->id)->get();
     $options = array('hotel' => $hotel, 'regions' => $regions, 'country' => $country, 'province' => $province, 'city' => $city);
     return View::make('home/dashboard', array())->nest('content', 'hotel/profile', $options);
 }
Example #4
0
 public function getEdit($id)
 {
     $data = employee::find($id);
     $regions = Regions::all();
     $country = Countries::where('region_id', '=', $data->city->province->country->region->id)->get();
     $province = Provinces::where('country_id', '=', $data->city->province->country->id)->get();
     $city = Cities::where('province_id', '=', $data->city->province->id)->get();
     $options = array('data' => $data, 'regions' => $regions, 'country' => $country, 'province' => $province, 'city' => $city, 'position' => $this->Position());
     return View::make('home/dashboard', array())->nest('content', 'employee/edit', $options);
 }
 /**
  * Show the GET form for editing the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function edit($id = NULL)
 {
     $currUser = Auth::user();
     $oCountries = Countries::all();
     $oRegions = Regions::all();
     $aCity = NULL;
     foreach ($oCountries as $item) {
         $aCountries[$item->name] = array();
         $aRegions = Regions::where('country_id', '=', $item->id)->get();
         foreach ($aRegions as $region) {
             $aCountries[$item->name][$region->id] = $region->name;
         }
     }
     if ($id > 0) {
         $aCity = Cities::find($id);
     }
     if ($currUser->is_admin == 0) {
         return Redirect::route('user-dashboard', array());
     }
     return View::make('/city/edit', array('aCity' => $aCity, 'aCountries' => $aCountries, 'oRegions' => $oRegions, 'currUser' => $currUser, 'id' => $id));
 }
 /**
  * Show the GET form for editing the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function edit($id = NULL)
 {
     $currUser = Auth::user();
     $oRegions = Regions::all();
     $oCity = Cities::all();
     $aCompany = NULL;
     $oQuery = Regions::join('country', 'country.id', '=', 'country_id')->select('regions.id as id', 'regions.name', 'country.name as country_name', 'country.id as country_id');
     if ($oRegions = $oQuery->get()) {
     }
     foreach ($oRegions as $item) {
         $aRegions[$item->country_name] = array();
         $aCity = Cities::where('region_id', '=', $item->id)->get();
         foreach ($aCity as $city) {
             $aRegions[$item->name][$city->id] = $city->name;
         }
     }
     if ($id > 0) {
         $aCompany = Companies::find($id);
     }
     if ($currUser->is_admin == 0 && (empty($aCompany) === false && $aCompany->user_id != $currUser->id)) {
         return Redirect::route('company-list', array('user_id' => $currUser->id));
     }
     return View::make('/company/edit', array('aCompany' => $aCompany, 'aCity' => $aCity, 'aRegions' => $aRegions, 'currUser' => $currUser, 'id' => $id));
 }