public function detail($otpay_id) { //get detail ot pay log $query_pay = $this->otpaylog->get_detail_by_id($otpay_id); $query_pay = $query_pay->row_array(); //get detail ot $query_ot = $this->ot->hr_get_list_report_detail($query_pay["otpay_user_id"], $query_pay["otpay_year"], $query_pay["otpay_month"]); $query_ot = $query_ot->result_array(); //set data $data = array(); $data["query_pay"] = $query_pay; $data["query_ot"] = $query_ot; $data["emp_detail"] = getEmployeeDetailByUserID($query_pay["otpay_user_id"]); //load view parent::setHeader("รายละเอียดรายงานทำงานล่วงเวลา", "HR"); $this->load->view("hr/Overtime/Report_detail.php", $data); parent::setFooter(); }
public function search($year = 0, $month = 0) { $this->load->model("Salary_pay_log_model"); $this->topic_page = "เงินเดือน"; $this->emp_detail = getEmployeeDetailByUserID($this->user_id); $data = array('emp_id' => $this->emp_id, 'year' => $year, 'month' => $month); $query_salary; if ($year > 0 and $month > 0) { $query_salary = $this->Salary_pay_log_model->get_detail_by_year_and_month($this->emp_detail['UserID'], $year, $month); } else { $query_salary = $this->Salary_pay_log_model->get_latest_log($this->emp_detail['UserID']); $query = $query_salary->row_array(); $data['year'] = $query['sapay_year']; $data['month'] = $query['sapay_month']; } $data['query_salary'] = $query_salary->row_array(); parent::setHeader($this->topic_page, $this->title_topic); $this->load->view("Userprofile/Usersalary", $data); parent::setFooter(); }
public function manage_user_permissions($user_id) { $data = array(); $data['user_id'] = intval($user_id); $data['form_url'] = site_url('hr/Employees/save_user_permissions'); $data['emp_detail'] = getEmployeeDetailByUserID(intval($user_id)); parent::setHeader('จัดการ Permissions', 'Permissions'); $this->load->view('hr/Employee/manage_user_permissions', $data); parent::setFooter(); }
public function shiftworkinfo($emp_id = "") { $this->load->model("Emp_shiftwork_model"); $this->load->model("Shiftwork_model"); $this->topic_page = "กะงาน"; $this->data_open["emp_id"] = $emp_id; $emp_id = $this->change_user_id($emp_id); $emp_detail = getEmployeeDetailByUserID($this->user_id); $query = $this->Emp_shiftwork_model->getListByUserId($this->user_id); $query = $query->result_array(); $data = array(); $data["queryEmpShiftwork"] = $query; $this->data = $data; $this->_load_view("Shiftworkinfo"); }
public function printpdf($ot_id) { $this->load->helper('pdf_helper'); $query = $this->ot->get_detail_by_id($ot_id); $query = $query->row_array(); $query_log = $this->otlog->get_list_only_approve($ot_id); $query_log = $query_log->result_array(); $date = explode("-", $query["wot_date"]); $month = $date[1]; $year = $date[0]; $day = $date[2]; $data = array(); $data["emp_detail"] = getEmployeeDetailByUserID($query["wot_request_by"]); //date $data["day"] = $day; $data["month"] = $month; $data["month_name"] = get_month_name_thai($month); $data["year"] = $year; $data["year_thai"] = year_thai($year); //created date $date1 = explode(" ", $query["wot_request_date"]); $date = explode("-", $date1[0]); $month = $date[1]; $year = $date[0]; $day = $date[2]; $data["created_day"] = $day; $data["created_month"] = $month; $data["created_month_name"] = get_month_name_thai($month); $data["created_year"] = $year; $data["created_year_thai"] = year_thai($year); $data["query"] = $query; $data["query_log"] = $query_log; $this->load->view('report/Overtimedetail', $data); }
<input readonly="true" type="text" id="input_position_name" name="input_position_name" value="<?php echo $query["PositionName"]; ?> "> <label for="input_position_name" class="green-text">ตำแหน่ง</label> </div> </div> </div> <!-- Headman --> <div class="row"> <div class="col s12"> <?php foreach ($query_headman as $row) { ?> <?php $detail = getEmployeeDetailByUserID($row["eh_headman_user_id"]); ?> <div class="input-field col s4"> <input readonly="true" type="text" id="inputHeadmanLevel<?php echo $row["eh_headman_level"]; ?> " name="inputHeadmanLevel<?php echo $row["eh_headman_level"]; ?> " value="<?php echo $detail["EmpFullnameThai"]; ?> "> <label for="inputHeadmanLevel<?php echo $row["eh_headman_level"]; ?>
public function printpdf($leave_id) { $this->load->helper('pdf_helper'); $query = $this->leave->getDetailByLeaveID($leave_id); $query = $query->row_array(); $query_time_detail = $this->leavetimedetail->getDetailByLeaveID($leave_id); $query_time_detail = $query_time_detail->result_array(); //section headman approve $query_log = $this->leavelog->get_list_only_approve($leave_id); $query_log = $query_log->result_array(); $date = explode("-", $query["LStartDate"]); $month = $date[1]; $year = $date[0]; $day = $date[2]; //section used quota $query_used = $this->leavequota->get_stat($query["L_UserID"], $year); $query_used = $query_used->result_array(); //set data $data = array(); $data["emp_detail"] = getEmployeeDetailByUserID($query["L_UserID"]); $data["day"] = $day; $data["month"] = $month; $data["year"] = $year; $data["query"] = $query; $data["query"]["sum_leave_time"] = sum_show_leave_time($query_time_detail); $data["query"]["sum_leave_time_only_day"] = sum_show_leave_time($query_time_detail, TRUE); $data["query_used"] = $query_used; $data["query_log"] = $query_log; $this->load->view('report/leave_detail', $data); }
/** * ส่งรายละเอียด OT ให้ HR * @param [type] * @return [type] */ private function _send_email_ot_to_hr($ot_id) { $body = ''; $search = array(); $replace = array(); //var owner request detail $owner_user_id = 0; $owner_emp_id = ""; $owner_fullname = ''; $owner_department = ''; $owner_position = ''; //var headman detail $headman_user_id = 0; $headman_emp_id = ""; $headman_fullname = array(); $headman_department = ""; $headman_position = ""; //var hr detail $hr_user_id = ''; $hr_fullname = ''; $hr_email = ''; //var ot detail $ot_date = ''; $ot_time_from = ''; $ot_time_to = ''; $query = $this->ot->get_detail_by_id($ot_id); if ($query->num_rows() > 0) { $query = $query->row_array(); //ot detail $ot_date = $query['wot_date']; $ot_time_from = $query['wot_time_from']; $ot_time_to = $query['wot_time_to']; //owner detail $owner_user_id = $query['wot_request_by']; $owner_detail = getEmployeeDetailByUserID($owner_user_id); $owner_emp_id = $owner_detail['EmpID']; $owner_fullname = $owner_detail['EmpFullnameThai']; $owner_department = $owner_detail['DepartmentName']; $owner_position = $owner_detail['PositionName']; //headman detail $headman_detail = getEmployeeDetailByUserID($query["wot_headman_user_id_send_instead"]); $headman_fullname = $headman_detail['EmpFullnameThai']; $headman_emp_id = $headman_detail['EmpID']; $headman_fullname = $headman_detail['EmpFullnameThai']; $headman_department = $headman_detail['DepartmentName']; $headman_position = $headman_detail['PositionName']; //hr detail $hr_detail = get_hr_detail(); //send mail library //non config because default set in phpmailer class $this->load->library('phpmailer'); $this->phpmailer->ClearAllRecipients(); $this->phpmailer->IsSMTP(); foreach ($hr_detail as $hr) { $hr_user_id = $hr['userid']; $hr_fullname = $hr['fullname']; $hr_email = $hr['email']; $mail_subject = '[' . dateThaiFormatFromDB($ot_date) . '] ส่งคำขอทำงานล่วงเวลาแทนโดยหัวหน้า'; $body = file_get_contents(APPPATH . 'views/Email/ot/Send_instead_team_to_hr.html'); $search = array("{{emp_id}}", "{{emp_fullname}}", "{{emp_department}}", "{{emp_position}}", "{{ot_date}}", "{{ot_time_from}}", "{{ot_time_to}}", "{{headman_emp_id}}", "{{headman_fullname}}", "{{headman_department}}", "{{headman_position}}"); $replace = array($owner_emp_id, $owner_fullname, $owner_department, $owner_position, dateThaiFormatFromDB($ot_date), $ot_time_from, $ot_time_to, $headman_emp_id, $headman_fullname, $headman_department, $headman_position); $body = str_replace($search, $replace, $body); $this->phpmailer->Subject = $mail_subject; $this->phpmailer->Body = $body; //ส่วนนี้รายละเอียดสามารถส่งเป็นรูปแบบ HTML ได้ $this->phpmailer->AddAddress($hr_email, $hr_fullname); if (!$this->phpmailer->Send()) { return $this->phpmailer->ErrorInfo; } else { return 'success'; } } } }
<br/> จำนวนคนที่ต้องการ <?php echo $row["REAmount"]; ?> <br/> คุณสมบัติที่ต้องการ <?php echo $row["REAttribute"]; ?> <br/> หมายเหตุเพิ่มเติม <?php echo $row["RERequestRemark"]; ?> <br/> คำร้องขอบุคคลากรเพิ่มโดย <?php $empDetail = getEmployeeDetailByUserID($row["RERequestBy"]); echo $empDetail["EmpNameTitleThai"] . $empDetail["EmpFirstnameThai"] . " " . $empDetail["EmpLastnameThai"]; ?> <br/> ส่งคำร้องขอเมื่อ <?php echo $row["RERequestDate"]; } echo form_open("headman/Requestemployee/saveApprove"); ?> <div> จำนวนคนที่อนุมัติ <input type="text" name="inputApproveAmount" id="inputApproveAmount"/> <br/> หมายเหตุเพิ่มเติม <textarea name="inputApproveRemark" id="inputApproveRemark"></textarea> <br/> <a href="javascript:void(0);" class="btn btn-success btn-md" onclick="approveThis();">อนุมัติ</a> <a href="javascript:void(0);" class="btn btn-danger btn-md" onclick="disApproveThis();">ไม่อนุมัติ</a>