public function update_asset_request() { $details = array('request_status' => $this->input->get('asset_request'), 'approved_by' => $this->session->userdata('user_level') . ' ' . $this->session->userdata('first_name'), 'date_approved' => date("Y-m-d")); $approved = Asset_request::find($this->input->get('asset_request_id')); if ($approved->update_attributes($details)) { redirect('ams/asset_request_table'); } }
public function emp_dashboard() { $id = $this->session->userdata('employee_id'); $data['leaves'] = View_leaves_left::find('all', array('conditions' => "employee_id ='{$id}'")); $data['announcement'] = Announcement_model::find_by_sql('SELECT * FROM tbl_announcement ORDER BY announcement_id DESC LIMIT 3 '); $data['birthday'] = Emp_info_model::find_by_sql('SELECT * FROM tbl_emp_info where MONTH(birthday) = MONTH(now()) ORDER BY DAY(birthday) ASC'); $data['asset'] = View_assigned_assets_model::find('all', array('conditions' => "emp_id ='{$id}'")); //Tab 7 - Asset Tab $data['requested_asset'] = Asset_request::find('all', array('conditions' => "employee_id ='{$id}'")); //Tab 7 - Asset Tab $data['project'] = View_project_workers::find('all', array('conditions' => "emp_id ='{$id}'")); //Tab 8 - Project Tab $data['total_employee'] = count(View_employees_list::find('all')); $data['total_asset'] = count(Projects_model::find('all')); $data['total_projects'] = count(Projects_model::find('all')); $data['request'] = View_leaves_request::find('all', array('conditions' => "emp_id ='{$id}'")); $data['pageTitle'] = 'Dashboard - MSInc.'; $data['content'] = 'employee/employee_dashboard'; $this->load->view($this->master_layout, $data); $this->display_notif(); }
public function asset_request_table() { if ($this->input->get('pressed')) { Asset_request::update_asset_request(); } $data['record'] = View_asset_request::all(); $data['pageTitle'] = 'Asset Request - MSInc.'; $data['content'] = 'asset/asset_request_table'; $this->load->view($this->master_layout, $data); $this->display_notif(); }