File manager - Edit - /home/wwwroot/camplus.hk/master.camplus.hk/public_html/application/modules/overtime/models/Overtime_approval_model.php
Back
<?php Class Overtime_approval_model extends CI_Model{ function getOvertimes($past=0) { $this->db->select('ot_overtime.*,ot_approval_record.id as otapp_id,ot_approval_record.level_id, '); $this->db->from('ot_overtime'); $this->db->join('ot_approval_record','ot_approval_record.ot_id=ot_overtime.id'); if($past==0) $this->db->where('ot_approval_record.status','N'); else $this->db->where('ot_approval_record.status !=','N'); $this->db->where('ot_approval_record.uid',$this->session->userdata("id")); return $this->db->get()->result_array(); } function getOvertimesDT($past=0) { $this->db->select('ot_overtime.*,ot_approval_record.id as otapp_id,ot_approval_record.reason, ot_approval_record.status as approval_status, ot_approval_record.created_date'); $this->db->from('ot_overtime'); $this->db->join('ot_approval_record','ot_approval_record.ot_id=ot_overtime.id'); $this->db->join('users','ot_overtime.uid=users.id'); if(get_cookie('language')=='en') $this->db->select('users.name_english as username'); else $this->db->select('users.name_chinese as username'); if($past==0) $this->db->where('ot_approval_record.status','N'); else $this->db->where('ot_approval_record.status !=','N'); $db = $this->db->where('ot_approval_record.uid',$this->session->userdata("id")); $this->datatable->get($db,$_POST); } function getOvertime($id = 0) { return $this->db->get_where('ot_overtime',array('id' => $id))->row_array(); } function getOvertimeApproval($id) { return $this->db->get_where('ot_approval_record',array('id' => $id))->row_array(); } function editOvertime_approval_record($id,$status,$reason) { $data_status=array('reason'=>$reason,'status'=>$status); $this->db->update('ot_approval_record',$data_status,array('id' => $id)); return true; } function editOvertime($id,$status) { $data_status=array('status'=>$status); $this->db->update('ot_overtime',$data_status,array('id' => $id)); return true; } }
| ver. 1.4 |
Github
|
.
| PHP 7.2.34 | Generation time: 0.28 |
proxy
|
phpinfo
|
Settings