<commit_before><?php
class Employeegateleader_model extends CI_Model {

    public function __construct()
    {
        parent::__construct();
    }
	
	public function get_subordinate($where = array())
    {   
        $this->db->select('uh.*, ov.*, u.name as subname, u.emp_id as subemp_id, l.name as leader_name, l.id as leader_id, l.emp_id as leader_empid');
		$this->db->from('user_hirearki uh');
		$this->db->join('users l', 'l.id = uh.leader_id','left');
		$this->db->join('bucket_overtime ov', 'ov.user_id = uh.user_id');
		$this->db->join('users u', 'u.id = ov.user_id');
        $this->db->where($where);
        $query = $this->db->get();
        return $query->result_array();
    }
	
	public function add_overtime($user_id, $data = array())
    {
        // construct access menu priviledge
		$check = $this->get_overtime(array('user_id' => $user_id, '(acc_stat = \'queue\' or acc_stat = \'accept\') = ' => 1, 'start_in >=' => date('Y-m-d',$data['start_in']).' 00:00:00', 'start_in <=' => date('Y-m-d',$data['start_in']).' 23:59:59'));

		if(empty($check)){
			$datainsert = array(
				'start_in' => date('Y-m-d H:i:s',$data['start_in']), 
				'end_out' => date('Y-m-d H:i:s',$data['end_out']), 
				'reason' => $data['reason'],
				'user_id' => $user_id
			);
			//print_r(date('Y-m-d H:i:s',$data['start_in']));exit();
			return $this->db->insert('bucket_overtime', $datainsert);
		}else{
			return 0;
		}
    }
    
    public function approval_overtime($id,$leader_id,$isApprove)
    {
		echo $leader_id;exit();
        $this->db->where('id',$id);<commit_msg>fixing<commit_after><?php
class Employeegateleader_model extends CI_Model {

    public function __construct()
    {
        parent::__construct();
    }
	
	public function get_subordinate($where = array())
    {   
        $this->db->select('uh.*, ov.*, u.name as subname, u.emp_id as subemp_id, l.name as leader_name, l.id as leader_id, l.emp_id as leader_empid');
		$this->db->from('user_hirearki uh');
		$this->db->join('users l', 'l.id = uh.leader_id','left');
		$this->db->join('bucket_overtime ov', 'ov.user_id = uh.user_id');
		$this->db->join('users u', 'u.id = ov.user_id');
        $this->db->where($where);
        $query = $this->db->get();
        return $query->result_array();
    }
	
	public function add_overtime($user_id, $data = array())
    {
        // construct access menu priviledge
		$check = $this->get_overtime(array('user_id' => $user_id, '(acc_stat = \'queue\' or acc_stat = \'accept\') = ' => 1, 'start_in >=' => date('Y-m-d',$data['start_in']).' 00:00:00', 'start_in <=' => date('Y-m-d',$data['start_in']).' 23:59:59'));

		if(empty($check)){
			$datainsert = array(
				'start_in' => date('Y-m-d H:i:s',$data['start_in']), 
				'end_out' => date('Y-m-d H:i:s',$data['end_out']), 
				'reason' => $data['reason'],
				'user_id' => $user_id
			);
			//print_r(date('Y-m-d H:i:s',$data['start_in']));exit();
			return $this->db->insert('bucket_overtime', $datainsert);
		}else{
			return 0;
		}
    }
    
    public function approval_overtime($id,$leader_id,$isApprove)
    {
		//echo $leader_id;exit();
        $this->db->where('id',$id);
{'fraction_non_alphanumeric': 0.22575516693163752, 'fraction_numerical': 0.00890302066772655, 'mean_word_length': 3.552821997105644, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 61, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3862724', 'n_tokens_mistral': 1327, 'n_tokens_neox': 1208, 'n_words': 199}