Exemplo n.º 1
0
 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();
 }
Exemplo n.º 2
0
 public function printpdf($year, $month)
 {
     $this->load->helper('pdf_helper');
     $query_now_salary = $this->salarypay->get_detail_by_year_and_month($this->user_id, $year, $month);
     $data = array();
     $data["emp_detail"] = getEmployeeDetail($this->emp_id);
     $data["month"] = $month;
     $data["month_name"] = get_month_name_thai($month);
     $data["year"] = $year;
     $data["year_thai"] = year_thai($year);
     $data["query_now_salary"] = $query_now_salary->row_array();
     $this->load->view('report/Usersalaryprint', $data);
 }
Exemplo n.º 3
0
 private function change_user_id($emp_id)
 {
     $returner = "";
     $checker = FALSE;
     $headman_level = 0;
     if ($emp_id !== "") {
         //check can see this profile is_your_headman or is_hr
         $user_detail = getEmployeeDetail($emp_id);
         list($checker, $headman_level) = is_your_headman($user_detail["UserID"], $this->user_id);
         if ($checker || is_hr()) {
             $this->emp_id = $emp_id;
             $this->user_id = $user_detail["UserID"];
             $returner = $emp_id;
         }
     }
     return $returner;
 }
Exemplo n.º 4
0
 private function _set_emp_detail($emp_id)
 {
     $this->emp_detail = getEmployeeDetail($emp_id);
 }
Exemplo n.º 5
0
 /**
  * จัดการสิทธิ์การเข้าใช้งานของพนักงาน
  * @param  [int,string] $user_id [description]
  * @return [type]          [description]
  */
 public function userroles($emp_id)
 {
     $emp_detail = getEmployeeDetail($emp_id);
     $data = array();
     $data['user_id'] = $emp_detail["UserID"];
     $data['emp_detail'] = $emp_detail;
     parent::setHeader('จัดการสิทธิ์ ' . $data["emp_detail"]["EmpFullnameThai"], 'Roles');
     $this->load->view('hr/Employee/user_roles_list', $data);
     parent::setFooter();
 }
Exemplo n.º 6
0
	public function setHeader($title="หน้าแรก",$title_eng='Home',$show_header_title = TRUE,$show_card_panel = TRUE)
	{
		self::$instance =& $this;

		$userID = $this->session->userdata('userid');
		$empID = $this->session->userdata('empid');

		$this->load->model("Leave_model", "leave");
		$this->load->model("Worktime_ot_model","ot");

		$data = array();
		$data['title'] 		= $title;
		$data['title_eng'] 	= $title_eng;
		$data['emp_detail'] = getEmployeeDetail($empID);
		$data["show_header_title"] = $show_header_title;
		$data["show_card_panel"] = $show_card_panel;

		$data["count_all_can_leave"] = $this->leave->count_all_can_leave($this->user_id);
		$data["notifyLate"] = 0;
		$data["notifyAbsense"] = 0;
		$data["notifyLeave"] = $this->leave->count_all_can_leave($this->user_id);
		$data["notifyOvertime"] = $this->ot->countAllSuccess($this->user_id);
		$data["notifyHeadmanLeave"] = $this->leave->countNotifyHeadmanLeave($this->user_id);
		$data["notifyHeadmanOvertime"] = $this->ot->countNotifyHeadmanOvertime($this->user_id);

		$this->load->view("header",$data);
	}
Exemplo n.º 7
0
 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();
 }
Exemplo n.º 8
0
 public function edit($userID, $leaveID)
 {
     $this->load->model("Configuration_Model", "configuration");
     $this->load->model("LeaveQuota_Model", "leavequota");
     $query = $this->leave->getDetail($this->user_id, $leaveID);
     $query = $query->row_array();
     $leaveTypeID = $query["L_LTID"];
     $data = array();
     $data['pagetype'] = 'edit';
     if ($query["L_WFID"] == 11) {
         $data['pagetype'] = 'editdoc';
     }
     $data["FormUrl"] = site_url("Leave/save");
     $data["leaveID"] = $query["LID"];
     $data["empID"] = $this->emp_id;
     $data["userID"] = $this->user_id;
     $data["nowTitle"] = "แก้ไขใบลา";
     $data["title"] = $data["nowTitle"];
     $data["ddlLeaveType"] = $this->leavetype->getListForDropDown();
     $data["vddlLeaveType"] = $query["L_LTID"];
     $data["queryEmployee"] = getEmployeeDetail($data["empID"]);
     $queryLeaveType = $this->leavetype->getDetailByID($leaveTypeID)->result_array();
     $queryLeaveType = $queryLeaveType[0];
     $queryQuota = $this->leavequota->getQuota($this->user_id, $leaveTypeID)->result_array();
     $queryQuota = $queryQuota[0];
     $quotaDetail = "<p>คุณมีสิทธิ์ในการลาได้ทั้งหมด " . $queryQuota["LQQuota"] . " วัน";
     $quotaDetail .= "<br/>คุณใช้สิทธิ์ในการลาไปแล้ว " . $queryQuota["LQUsedDay"] . " วัน " . $queryQuota["LQUsedHour"] . " ชั่วโมง</p>";
     $data["vdetailLeave"] = $queryLeaveType["LTDesc"] . $quotaDetail;
     $data["vleaveBecause"] = $query["LBecause"];
     $queryWork = $this->configuration->getWorkTimeStartTimeEnd()->result_array();
     $data["workTimeStart"] = $queryWork[0]["CFValue"];
     $data["workTimeEnd"] = $queryWork[1]["CFValue"];
     $queryWork = $this->configuration->getWorkDateStartDateEnd()->result_array();
     $data["workDateStart"] = $queryWork[0]["CFValue"];
     $data["workDateEnd"] = $queryWork[1]["CFValue"];
     //ที่ใช้แตกต่างกับอันอื่นเพราะเป็นหน้าข้างในต่างหาก ไม่เหมือนพวกหน้ารายการ
     $data["vworkDateStart"] = dateThaiFormatUn543FromDB($query["LStartDate"]);
     $data["vworkDateEnd"] = dateThaiFormatUn543FromDB($query["LEndDate"]);
     $data["vworkTimeStart"] = timeFormatNotSecond($query["LStartTime"]);
     $data["vworkTimeEnd"] = timeFormatNotSecond($query["LEndTime"]);
     //get leave documents
     $query = $this->leavedoc->get_list_by_leave_id($leaveID);
     $data["query_leave_doc"] = $query->result_array();
     parent::setHeader('แก้ไขใบลา', "Leave");
     $this->load->view("Leave/Add", $data);
     parent::setFooter();
 }
Exemplo n.º 9
0
							</ul>
						</li>
						<li class="dropdown">
							<a href="javascript:void(0);" class="dropdown-toggle" data-toggle="dropdown">
								Headman <span class="caret"></span>
							</a>
							<ul class="dropdown-menu">
								<li><a href="#">รายชื่อบุคคลากรภายในทีม</a></li>
								<li><a href="#">ส่งคำขอเพิ่มบุคคลากร</a></li>
							</ul>
						</li>
					</ul>
				</div>
			</nav>
			<?php 
$query = getEmployeeDetail($this->session->userdata('empid'));
?>
			<?php 
if (count($query) > 0) {
    ?>
				<div class="row">
					<div class="col-md-9">
						<div class="col-md-3">
							<img src="<?php 
    echo base_url() . $query['EmpPictureImg'];
    ?>
" class="img-thumbnail img-responsive"/>
						</div>
						<div class="col-md-9">
							<?php 
    echo $query['EmpNameTitleThai'] . $query['EmpFirstnameThai'] . ' ' . $query['EmpLastnameThai'];