Esempio n. 1
0
 public function search_old()
 {
     $empID = "";
     $userID = 0;
     //ส่ง userid = 0 คือคนที่ไม่มีหัวหน้าให้ส่งเรื่องโดยตรงถึง HR ได้เลย
     if ($_POST) {
         $empID = $this->input->post("txtEmpID");
         if ($empID != "") {
             $userID = getUserIDByEmpID($empID);
             if ($userID == 0) {
                 swalc('ไม่พบรหัสพนักงานนี้', '', 'error');
                 $userID = -1;
             }
         }
     }
     $searchKeyword = "";
     $searchType = "";
     $config = array();
     $config["total_rows"] = $this->leave->hr_count_all($userID, $searchType, $searchKeyword);
     $this->pagination->initialize($config);
     $page = $this->uri->segment(4) ? $this->uri->segment(4) : 0;
     $data = array();
     $query = $this->leave->getListForVerify($userID, $this->pagination->per_page, $page, $searchType, $searchKeyword);
     $data["query"] = $query;
     $data["empID"] = $empID;
     parent::setHeader("ตรวจสอบใบลา");
     $this->load->view("hr/Leave/verifylist", $data);
     parent::setFooter();
 }
Esempio n. 2
0
 public function showTime($empID, $from = "hrworktime")
 {
     $userID = getUserIDByEmpID($empID);
     $this->load->model("WorkTime_Model", "worktime");
     $this->load->model("Common_Model", "common");
     $data = array();
     $data["topic"] = "ตรวจสอบเวลา เข้า-ออก";
     $data["returner"] = $from == "hrworktime" ? site_url("hr/Employee") : "";
     $data["beforeEmpID"] = 'ของ ';
     $data["empID"] = $empID;
     $data["ddlMonth"] = $this->common->getMonth1To12();
     $data["ddlYear"] = $this->common->getYearForDropDown();
     $data["vddlMonth"] = 0;
     $data["vddlYear"] = 0;
     if ($_POST) {
         $data["vddlMonth"] = $this->input->post("ddlMonth");
         $data["vddlYear"] = $this->input->post("ddlYear");
     }
     $config = array();
     $config["total_rows"] = $this->worktime->countAll($userID);
     $this->pagination->initialize($config);
     $page = $this->uri->segment(3) ? $this->uri->segment(3) : 0;
     $data["query"] = $this->worktime->getList($userID, $this->pagination->per_page, $page, $data["vddlYear"], $data["vddlMonth"]);
     $data["linksPaging"] = $this->pagination->create_links();
     if ($data["returner"] != "") {
         parent::setHeader("ตรวจสอบเวลา เข้า-ออก " . $empID);
     } else {
         parent::setHeader("ตรวจสอบเวลา เข้า-ออก");
     }
     $this->load->view("hr/Employee/WorkTime.php", $data);
     parent::setFooter();
 }
Esempio n. 3
0
 public function saveSalary()
 {
     if ($_POST) {
         $post = $this->input->post();
         $emp_id = $post['hd_emp_id'];
         //data salary
         $salary = $post['txt_salary'];
         //now salary
         $increase = $post['txt_salary_increase'];
         //increase
         $net = $post['txt_salary_net'];
         //total salary
         $remark = $post['txt_remark'];
         //prepare data for update employee
         $emp = array('EmpSalary' => $net);
         $where_emp = array('EmpID' => $emp_id);
         //update employee
         $this->employees->edit($emp, $where_emp);
         //prepare data for insert salary log
         $log = array();
         $log['sal_user_id'] = getUserIDByEmpID($emp_id);
         $log['sal_salary_from'] = $salary;
         $log['sal_salary_increase'] = $increase;
         $log['sal_salary_to'] = $net;
         $log['sal_change_date'] = getDateTimeNow();
         $log['sal_change_by'] = $this->user_id;
         $log['sal_remark'] = $remark;
         //insert salary log
         $this->salarylog->insert($log);
         echo swalc('สำเร็จ', 'บันทึกการปรับเงินเดือนเรียบร้อยแล้ว', 'success', 'window.location.href = "' . site_url('hr/Employees/increaseSalary/' . $emp_id) . '"');
     }
 }