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(); }
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(); }
public function search($emp_id = "0", $year = 0, $month = 0) { $user_id = 0; if ($emp_id !== "0") { $emp_detail = getEmployeeDetail($emp_id); $user_id = $emp_detail["UserID"]; } //pagination $config = array(); $config['total_rows'] = $this->otpaylog->headman_count_all($this->user_id, $user_id, $year, $month); $this->pagination->initialize($config); $page = $this->uri->segment(7) ? $this->uri->segment(7) : 0; //get data $query = $this->otpaylog->headman_get_list($this->pagination->per_page, $page, $this->user_id, $user_id, $year, $month); //set data $data = array(); $data["query"] = $query->result_array(); $data["ddlTeam"] = get_team_for_dropdownlist($this->user_id); $data["value_team"] = $emp_id; $data["ddlMonth"] = $this->common->getMonth1To12("thai"); $data["value_month"] = $month; $data["ddlYear"] = $this->common->getYearForDropDown("thai"); $data["value_year"] = $year; //load view parent::setHeader("รายงานการทำงานล่วงเวลาผู้ใต้บังคับบัญชา", "OT"); $this->load->view("headman/Ot/report_list.php", $data); parent::setFooter(); }
public function show() { $data = array(); $data["topicPage"] = ""; parent::setHeader("รายงานการลา", "Report"); $this->load->view("report/leave", $data); parent::setFooter(); }
public function show() { $data = array(); $data["chartData"] = $this->makeChartList(0); $data["topicPage"] = "แผนผังองค์กร"; parent::setHeader($data["topicPage"]); $this->load->view("company/Organization", $data); parent::setFooter(); }
public function detail($reqID) { $query = $this->requestemp->getDetail($reqID); $data = array(); $data["query"] = $query; $data["reqID"] = $reqID; parent::setHeader("รายละเอียดคำร้องขอเพิ่มบุคคลากร"); $this->load->view("headman/Request/Employeedetail", $data); parent::setFooter(); }
public function search($keyword = "") { $keyword = urldecode($keyword); $data = array(); $data["query"] = $this->empheadman->get_team_list_by_headman_user_id($this->user_id, $keyword); $data["value_keyword"] = $keyword; parent::setHeader("รายชื่อทีมของคุณ", "Headman"); $this->load->view("headman/Yourteam", $data); parent::setFooter(); }
public function history($year = 0) { if ($year == 0) { $year = date("Y"); } $config = array('user_id' => $this->user_id, 'year' => $year); $empsal = new Employeesalary($config); $data = array('history' => $empsal->history_salary(), 'year' => $year); parent::setHeader("ประวัติการจ่ายเงินเดือน", "Salary"); $this->load->view("Userprofile/Usersalaryhistory", $data); parent::setFooter(); }
public function defaults() { $this->load->model("News_model"); $this->load->model("Employees_model"); # 3 = ข่าวด่วน $query = $this->News_model->get_list(4, 0, 3); # limit 4,0 $query_new_emp = $this->Employees_model->get_latest_new_employee(); $data["query_news_alert"] = $query->result_array(); $data["query_new_emp"] = $query_new_emp->result_array(); parent::setHeader("", "", FALSE); $this->load->view("home", $data); parent::setFooter(); }
public function show() { $data = array(); $data["content"] = ""; $query = $this->configuration->getDetailByNameEnglish("Regulations"); if ($query->num_rows() > 0) { $query = $query->result_array(); $query = $query[0]; $data["content"] = $query["CFDesc"]; } parent::setHeader("กฎเกณฑ์-ข้อบังคับ"); $this->load->view("hr/Regulation", $data); parent::setFooter(); }
public function show() { $this->load->model("Holiday_model"); $year = $date("Y"); $topicPage = $this->lang->line("title_page_holiday"); $titleMenuCompany = $this->lang->line("title_menu_company"); $query = $this->Holiday_model->getList($year); $query = $query->result_array(); $data = array(); $data["ajaxUrl"] = "Holiday/feed"; $data["topicPage"] = $topicPage; $data["query"] = $query; parent::setHeader($topicPage, $titleMenuCompany); $this->load->view("company/Holiday", $data); parent::setFooter(); }
public function add() { if ($_POST) { $this->_save(); exit; } $query = $this->headman->get_team_list_by_headman_user_id($this->user_id); $query = $query->result_array(); $data = array(); $data["form_url"] = site_url("headman/Sendotinsteadteam/save"); $data["dropdown_team"] = $this->convert_array_to_dropdown($query, "UserID", "EmpFullnameThai"); $data["value_team"] = 0; parent::setHeader("ส่งใบคำขอทำงานล่วงเวลาแทน", "Headman"); $this->load->view("headman/Ot/send_instead_add", $data); parent::setFooter(); }
public function search($keyword = "") { $keyword = urldecode($keyword); $config = array(); $config['total_rows'] = $this->news->count_all($this->newstype_id, $keyword); $config['uri_segment'] = $this->page_segment; $this->load->library('pagination', $config); $page = $this->uri->segment($this->page_segment) ? $this->uri->segment($this->page_segment) : 0; $query = $this->news->get_list($this->pagination->per_page, $page, $this->newstype_id, $keyword); $query = $query->result_array(); $data = array(); $data["query"] = $query; parent::setHeader("รายการกิจกรรม", "Activity"); $this->load->view("News/news_list.php", $data); parent::setFooter(); }
public function detail($messageID) { $query = $this->message->getDetail($messageID); if ($query->num_rows() > 0) { $query = $query->row_array(); $subject = $query["MSubject"]; $data = array(); $data["query"] = $query; $data["queryReply"] = $this->message->getListReply($messageID); $data["MID"] = $messageID; parent::setHeader($subject, "Message"); $this->load->view("Message/Detail", $data); parent::setFooter(); } else { redirect("Message"); } }
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() { $config = array(); $config["total_rows"] = $this->message->countAll(); $config["per_page"] = 30; $config["uri_segment"] = 3; $this->pagination->initialize($config); $page = $this->uri->segment(3) ? $this->uri->segment(3) : 0; $query = $this->message->getList("", $config["per_page"], $page); $query = $query->result_array(); $data = array(); $data["query"] = $query; $data["links"] = $this->pagination->create_links(); $data["topic"] = "ข้อความถึง HR"; parent::setHeader("ข้อความ", "HR"); $this->load->view("Message/HRList", $data); parent::setFooter(); }
public function show() { $this->load->model("Configuration_model"); $config_desc = ""; $topicPage = $this->lang->line("title_regulation_page"); $titleMenuCompany = $this->lang->line("title_menu_company"); $query = $this->Configuration_model->getDetailByNameEnglish("Regulations"); $query = $query->row_array(); if (count($query) > 0) { $config_desc = $query["CFDesc"]; } $data = array(); $data["topicPage"] = $topicPage; $data["configDesc"] = $config_desc; parent::setHeader($topicPage, $titleMenuCompany); $this->load->view("company/Showdesc", $data); parent::setFooter(); }
public function detail($news_id) { $this->load->model("News_model"); $this->load->model("News_image_model"); $titleTopic = "Activity"; $topicPage = ""; $query = $this->News_model->get_detail_by_id($news_id); $query = $query->row_array(); $topicPage = $query["news_topic"]; $query_image = $this->News_image_model->get_list_by_news_id($news_id); $query_image = $query_image->result_array(); $data = array(); $data["query"] = $query; $data["query_image"] = $query_image; $data["return_url"] = site_url("Activity"); parent::setHeader($topicPage, "Activity"); $this->load->view("Newsalert/news_detail.php", $data); parent::setFooter(); }
public function search($keyword = '0', $leavetype_id = "0", $workflow_id = '0') { $searchKeyword = $keyword !== "0" ? urldecode($keyword) : ""; $searchType = $leavetype_id !== "0" ? $leavetype_id : "0"; $searchWorkflow = $workflow_id !== "0" ? $workflow_id : "0"; $config = array(); $config["total_rows"] = $this->leave->count_list_for_verify($this->userID, $searchType, $searchKeyword, $searchWorkflow); $this->pagination->initialize($config); $page = $this->uri->segment(4) ? $this->uri->segment(4) : 0; $data = array(); $data["query"] = $this->leave->get_list_for_verify($this->user_id, $this->pagination->per_page, $page, $searchType, $searchKeyword, $searchWorkflow); $data["value_keyword"] = $searchKeyword; $data["ddlLeaveType"] = $this->leavetype->getListForDropDown("ประเภทการลา"); $data["vddlLeaveType"] = $searchType; $data["ddlWorkFlow"] = $this->workflow->getListForDropDown(); $data["vddlWorkFlow"] = $searchWorkflow; parent::setHeader("รายการใบลาผู้ใต้บังคับบัญชา", 'Leave'); $this->load->view("headman/leave/verifylist", $data); parent::setFooter(); }
public function search($emp_id = '0', $year = '0', $month = '0') { $query = $this->ot->headman_get_list($this->user_id, $emp_id, $year, $month); $query = $query->result_array(); $data = array(); $data["query"] = $query; $data["ddlTeam"] = $this->get_team_for_dropdownlist(); $data["value_team"] = $emp_id; $data["ddlMonth"] = $this->common->getMonth1To12("thai"); $data["value_month"] = $month; $data["ddlYear"] = $this->common->getYearForDropDown("thai"); $data["value_year"] = $year; // $data["value_keyword"] = $searchKeyword; // $data["ddlLeaveType"] = $this->leavetype->getListForDropDown("ประเภทการลา"); // $data["vddlLeaveType"] = $searchType; // $data["ddlWorkFlow"] = $this->workflow->getListForDropDown(); // $data["vddlWorkFlow"] = $searchWorkflow; parent::setHeader("ตรวจสอบ OT", "Headman"); $this->load->view('headman/verify_ot_list', $data); parent::setFooter(); }
public function search($keyword = '0', $year = '0', $month = '0') { $keyword = $keyword === "0" ? "" : urldecode($keyword); //pagination $config = array(); $config['total_rows'] = $this->ot->hr_count_all($keyword, $year, $month); $this->pagination->initialize($config); $page = $this->uri->segment(7) ? $this->uri->segment(7) : 0; //get data $query = $this->ot->hr_get_list($this->pagination->per_page, $page, $keyword, $year, $month); //set data $data = array(); $data["query"] = $query->result_array(); $data["value_keyword"] = $keyword; $data["ddlMonth"] = $this->common->getMonth1To12("thai"); $data["value_month"] = $month; $data["ddlYear"] = $this->common->getYearForDropDown("thai"); $data["value_year"] = $year; parent::setHeader("ตรวจสอบ OT", "HR"); $this->load->view('hr/Overtime/ot_list', $data); parent::setFooter(); }
private function _load_views($your_view, $data) { parent::setHeader($this->topic_page, $this->title_topic); $this->load->view('hr/Moneydata/sub_menu', $data); $this->load->view('hr/Moneydata/' . $your_view, $data); $this->load->view('hr/Moneydata/close'); parent::setFooter(); }
public function detail($newsID) { $query = $this->news->getDetail($newsID); $data = array(); $data["query"] = $query; $topic = ""; if ($query->num_rows() > 0) { //change topic $dQuery = $query->result_array(); $dQuery = $dQuery[0]; $topic = "ข่าวสาร " . $dQuery["NSTopic"]; //update num view $view = $dQuery["NSView"] + 1; $uData = array("NSView" => $view); $uWhere = array("NSID" => $newsID); $this->news->update($uData, $uWhere); } parent::setHeader($topic); $this->load->view("hr/News/Detail", $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(); }
private function _load_view($page_name) { parent::setHeader($this->topic_page, $this->title_topic); $this->load->view("Userprofile/Open", $this->data_open); $this->load->view('Userprofile/' . $page_name, $this->data); $this->load->view("Userprofile/Close"); parent::setFooter(); }
/** * จะเอามาใช้แทน detailLeave ซึ่งส่วนนี้จะรวมทั้งส่วนที่อนุมัติ/ไม่อนุมัติของทั้ง hr/headman * @param [type] $leave_id [description] * @return [type] [description] */ public function detail($leave_id) { //variable. $is_my_leave = FALSE; $is_headman = FALSE; $headman_level = 0; $is_hr = FALSE; $can_approve = FALSE; $query; $url_list = site_url('Leave'); $data = array(); //if not have $leave_id then exit and redirect. if (is_null($leave_id) === TRUE) { redirect($url_list); exit; } //get all permission for see. $is_my_leave = is_your_leave($this->user_id, $leave_id); list($is_headman, $headman_level) = is_your_leave_headman($this->user_id, $leave_id); $is_hr = is_hr(); //if not all can see exit and redirect. if ($is_my_leave !== TRUE && $is_headman !== TRUE && $is_hr !== TRUE) { redirect($url_list); exit; } //Get data to variable $query if ($is_my_leave === TRUE) { $query = $this->leave->getDetail($this->user_id, $leave_id); } else { if ($is_headman === TRUE || $is_hr === TRUE) { $query = $this->leave->get_detail_for_verify($leave_id); } } //gen data to view $query = $query->row_array(); if (count($query) > 0) { //get leave documents. $query_leave_doc = $this->leavedoc->get_list_by_leave_id($leave_id); $query_leave_doc = $query_leave_doc->result_array(); //get leave log detail. $query_log = $this->leavelog->get_list_by_leave_id($leave_id); $query_log = $query_log->result_array(); //get leave time detail. $query_time = $this->leavetimedetail->getDetailByLeaveID($leave_id); $query_time = $query_time->result_array(); //check workflow equal headman level if ($query["WFName"] === "รออนุมัติจากหัวหน้างาน Level " . $headman_level) { $can_approve = TRUE; } //set data to view. $data["leave_detail"] = $query; $data["leave_id"] = $leave_id; $data["emp_detail"] = getEmployeeDetailByUserID($query["L_UserID"]); $data["user_id"] = $this->user_id; $data["leave_owner"] = $is_my_leave; $data["is_headman"] = $is_headman; $data["headman_level"] = $headman_level; $data["is_hr"] = $is_hr; $data["can_approve"] = $can_approve; $data["query_leave_doc"] = $query_leave_doc; $data["query_log"] = $query_log; $data["leave_time_detail"] = $query_time; parent::setHeader("รายละเอียดใบลา", "Leave"); $this->load->view("Leave/Detail", $data); parent::setFooter(); } else { redirect($url_list); exit; } }
public function edit($hid) { //form validation $rules = array(array("field" => "input_name", "label" => "ชื่อวันหยุด", "rules" => "trim|required|max_length[200]"), array("field" => "input_date", "label" => "วันหยุด", "rules" => "trim|required")); $this->form_validation->set_rules($rules); $this->form_validation->set_message("max_length", "- ข้อความไม่เกิน 200 ตัวอักษร"); $this->form_validation->set_message("required", "- กรอกหัวข้อข่าว"); if ($this->form_validation->run() === TRUE) { $this->_save(); redirect("hr/Holiday"); exit; } else { $query = $this->holiday->get_detail_by_id($hid); $query = $query->row_array(); $data = array(); $data["value_name"] = $query["HName"]; $data["value_desc"] = $query["HDesc"]; $data["value_date"] = dateThaiFormatUn543FromDB($query["HDate"]); $data["value_hid"] = $hid; parent::setHeader("แก้ไขวันหยุด", "HR"); $this->load->view("hr/Holiday/add", $data); parent::setFooter(); } }
public function myShiftwork($id = "") { $empDetail = array(); if ($id !== "") { $checker; $headman_level; list($checker, $headman_level) = is_your_headman($id, $this->user_id); if ($checker || is_hr()) { $empDetail = getEmployeeDetail($id); } else { redirect(site_url("Worktime")); exit; } } else { $id = $this->user_id; } $this->load->model("Shiftwork_model", "shiftwork"); $query = $this->shiftwork->getDetailByUserId($id); $data = array(); $data["dataDetail"] = $query->row_array(); $data["dataList"] = $query->result_array(); $data["empDetail"] = $empDetail; parent::setHeader("ตารางเวลาเข้าออกงาน", "User Profile"); $this->load->view("Worktime_my_shiftwork.php", $data); parent::setFooter(); }
public function edit($actID) { $query = $this->activity->getDetail($actID); if ($query->num_rows() > 0) { $query = $query->result_array(); $query = $query[0]; $data = array(); $data["formURL"] = site_url("hr/Activity/saveEdit/"); $data["actID"] = $actID; $data["valueTopic"] = $query["ACTTopic"]; $data["valueContent"] = $query["ACTContent"]; $data["valueStartDate"] = dateThaiFormatFromDB($query["ACTStartDate"]); $data["valueEndDate"] = dateThaiFormatFromDB($query["ACTEndDate"]); $data["valueShowDateFrom"] = dateThaiFormatFromDB($query["ACTShowDateFrom"]); $data["valueShowDateTo"] = dateThaiFormatFromDB($query["ACTShowDateTo"]); parent::setHeader("แก้ไขกิจกรรม"); $this->load->view("hr/Activity/Add", $data); parent::setFooter(); } else { redirect(site_url("hr/Activity/")); } }
public function report($year = 0, $month = 0) { //pagination $config = array(); $config['total_rows'] = $this->otpaylog->count_all($this->user_id, $year, $month); $this->pagination->initialize($config); $page = $this->uri->segment(5) ? $this->uri->segment(5) : 0; //get data $query = $this->otpaylog->get_list($this->pagination->per_page, $page, $this->user_id, $year, $month); //set data $data = array(); $data["query"] = $query->result_array(); $data["ddlMonth"] = $this->common->getMonth1To12("thai"); $data["value_month"] = $month; $data["ddlYear"] = $this->common->getYearForDropDown("thai"); $data["value_year"] = $year; parent::setHeader("รายงานการทำงานล่วงเวลา", "OT"); $this->load->view("worktime/ot_report", $data); parent::setFooter(); }