/**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function edit($id = NULL)
 {
     $currUser = Auth::user();
     $oCountries = Countries::all();
     $aRegion = NULL;
     foreach ($oCountries as $item) {
         $aCountries[$item->id] = $item->name;
     }
     if ($id > 0) {
         $aRegion = Regions::find($id);
     }
     if ($currUser->is_admin == 0) {
         return Redirect::route('user-dashboard', array());
     }
     return View::make('/region/edit', array('aRegion' => $aRegion, 'aCountries' => $aCountries, 'currUser' => $currUser, 'id' => $id));
 }
Exemplo n.º 2
0
 /**
  * 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));
 }
Exemplo n.º 3
0
 public function view_details()
 {
     $id = $this->input->get('emp_id');
     $data['departments'] = Departments_model::all();
     $data['job_titles'] = Job_titles_model::all();
     $data['employment_type'] = Employment_type_model::all();
     $data['countryy'] = Countries::all();
     $data['user_level'] = View_user_level::all();
     $data['record'] = Dependent_model::find('all', array('conditions' => "employee_id='{$id}'"));
     //get dependents by id
     $data['info'] = Emp_info_model::find($id);
     //Tab 1a - Personal Tab
     $data['gov_id'] = Gov_id_model::find($id);
     //Tab 1b - Gov ID Tab
     $data['address'] = View_emp_address::find($id);
     //Tab 2a - Contact Tab
     $data['contact'] = Emp_contact_model::find($id);
     //Tab 2b - Contact Tab
     $data['contactP'] = Emp_contact_person::find($id);
     //Tab 2c - Contact Tab
     $data['school'] = Emp_school_model::find($id);
     //Tab 3 - School Tab
     $data['job_hist'] = Job_history_model::find('all', array('conditions' => "employee_id ='{$id}'"));
     //Tab 4 - Job History Tab
     $data['emp'] = View_job_history::find($id);
     //Tab 5 - Employment Tab
     $data['leaves'] = View_leaves_left::find('all', array('conditions' => "employee_id ='{$id}'"));
     //Tab 6 - Leaves Tab
     $data['asset'] = View_assigned_assets_model::find('all', array('conditions' => "emp_id ='{$id}'"));
     //Tab 7 - Asset Tab
     $data['project'] = View_project_workers::find('all', array('conditions' => "emp_id ='{$id}'"));
     //Tab 8 - Project Tab
     $data['account'] = View_users_model::find_by_employee_id($id);
     //Tab 9 - Users Tab
     $data['pageTitle'] = 'Employee Details - MSInc.';
     $data['content'] = 'employee/employee_details';
     $this->load->view($this->master_layout, $data);
     $this->display_notif();
 }
 /**
  * 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();
     $aCountry = NULL;
     $aCountries['0'] = 'Root Node';
     foreach ($oCountries as $item) {
         $aCountries[$item->id] = $item->name;
     }
     if ($id > 0) {
         $aCountry = Countries::find($id);
     }
     if ($currUser->is_admin == 0) {
         return Redirect::route('user-dashboard', array());
     }
     return View::make('/country/edit', array('aCountry' => $aCountry, 'currUser' => $currUser, 'id' => $id));
 }