Esempio n. 1
1
 public function edit($department_id)
 {
     $query = $this->department->get_detail_by_id($department_id);
     if ($query->num_rows() > 0) {
         $query = $query->row_array();
         $data = $this->_default_value();
         $data['form_url'] = site_url('admin/Department/save_edit');
         $data['department_id'] = $department_id;
         $data['dropdown_institution'] = $this->institution->getListForDropDown();
         $data['value_department_name'] = $query['DName'];
         $data['value_department_desc'] = $query['DDesc'];
         $data['value_institution_id'] = $query['D_INSID'];
         parent::setHeaderAdmin("แก้ไขแผนก");
         $this->load->view('admin/department/department_add', $data);
         parent::setFooterAdmin();
     } else {
         echo swalc('ไม่พบรายการที่ต้องการ', '', 'error', 'window.location.href = "' . site_url('admin/Department/') . '"');
     }
 }
Esempio n. 2
1
 public function assignment($id)
 {
     if (empty($id)) {
         redirect(site_url($this->urlList));
         exit;
     }
     if ($_POST) {
         $this->_saveAssignment();
         echo swalc("บันทึกเรียบร้อยแล้ว", "", "success");
         //exit();
     }
     $queryEmpShiftwork = $this->empshiftwork->getList($id);
     $queryEmp = $this->employees->getList();
     $data = array();
     $data["dataEmpList"] = $queryEmp->result_array();
     $data["dataEmpShiftworkList"] = $queryEmpShiftwork->result_array();
     $data["valueId"] = $id;
     parent::setHeaderAdmin("เวลาเข้า-ออก");
     $this->load->view("admin/Shiftwork/Shiftwork_assignment", $data);
     parent::setFooterAdmin();
 }
Esempio n. 3
0
 public function leave()
 {
     $this->load->model("Leavecondition_model", "leavecon");
     $this->load->model("Leavetype_model", "leavetype");
     $data = array();
     $data["queryLeaveCondition"] = $this->leavecon->getList();
     $data["query_leave_type"] = $this->leavetype->getListForDropDown();
     parent::setHeaderAdmin("ตั้งค่าเงื่อนไขการลา");
     $this->load->view("admin/config/Leave", $data);
     parent::setFooterAdmin();
 }
Esempio n. 4
0
 public function edit($roleID)
 {
     $data = array();
     $data['topicTitle'] = 'แก้ไข Role';
     $data['formURL'] = site_url('admin/roles/saveRole');
     $data['varName'] = $this->acl->getRoleNameFromID($roleID);
     $data['queryRolePerm'] = $this->acl->getRolePerms($roleID);
     $data['queryPerm'] = $this->acl->getAllPerms('full');
     $data['roleID'] = $roleID;
     parent::setHeaderAdmin("แก้ไข Role");
     $this->load->view('admin/roles/add', $data);
     parent::setFooterAdmin();
 }
Esempio n. 5
0
 public function edit($bank_id)
 {
     $query = $this->bank->get_detail_by_id($bank_id);
     if ($query->num_rows() > 0) {
         $query = $query->row_array();
         $data = $this->default_value();
         $data['form_url'] = site_url('admin/Bank/save_edit/');
         $data['value_bank_id'] = $bank_id;
         $data['value_bank_name'] = $query['BName'];
         $data['value_bank_desc'] = $query['BDesc'];
         parent::setHeaderAdmin();
         $this->load->view('admin/bank/bank_add', $data);
         parent::setFooterAdmin();
     } else {
         redirect(site_url('admin/Bank/'));
     }
 }
Esempio n. 6
0
 public function edit_ot_condition($cond_id)
 {
     $query = $this->otconditions->get_detail_by_id($cond_id);
     if ($query->num_rows() > 0) {
         $query = $query->row_array();
         $data = array();
         $data['form_url'] = site_url('admin/Worktime/save_edit_ot_condition');
         $data['ot_condition_id'] = $cond_id;
         $data['value_ot_hour'] = $query['wotcond_ot_hour'];
         $data['value_money'] = $query['wotcond_money'] == 0 ? '' : $query['wotcond_money'];
         $data['value_leave'] = $query['wotcond_leave'] == 0 ? '' : $query['wotcond_leave'];
         parent::setHeaderAdmin();
         $this->load->view('admin/config/ot_condition_add', $data);
         parent::setFooterAdmin();
     } else {
         redirect(site_url('admin/Worktime/'));
     }
 }
Esempio n. 7
0
 public function edit($leavegroup_id)
 {
     $rules = array(array("field" => "input_name", "label" => "ชื่อ", "rules" => "trim|required"));
     $this->form_validation->set_rules($rules);
     if ($this->form_validation->run() === true) {
         $this->_save_edit();
         redirect("admin/Leavegroup/");
         exit;
     } else {
         $query = $this->leavegroup->get_detail_by_id($leavegroup_id);
         $query = $query->row_array();
         $data = array();
         $data["value_name"] = $query["LGName"];
         $data["value_desc"] = $query["LGDesc"];
         $data["value_leavegroup_id"] = $leavegroup_id;
         parent::setHeaderAdmin("แก้ไขกรุ๊ปลา");
         $this->load->view('admin/Leave/leavegroup_add', $data);
         parent::setFooterAdmin();
     }
 }
Esempio n. 8
0
 public function edit($leavetype_id)
 {
     $rules = array(array("field" => "select_group", "label" => "กรุ๊ป", "rules" => "greater_than[0]"), array("field" => "input_name", "label" => "ชื่อ", "rules" => "trim|required"));
     $this->form_validation->set_rules($rules);
     if ($this->form_validation->run() === true) {
         $this->_save_edit();
         redirect("admin/Leavetype/");
         exit;
     } else {
         $query = $this->leavetype->get_detail_by_id($leavetype_id);
         $query = $query->row_array();
         $data = array();
         $data["data_group"] = $this->leavegroup->getListForDropDown();
         $data["value_group_id"] = $query["LTGroup"];
         $data["value_name"] = $query["LTName"];
         $data["value_desc"] = $query["LTDesc"];
         $data["value_leavetype_id"] = $leavetype_id;
         parent::setHeaderAdmin("แก้ไขประเภทการลา");
         $this->load->view('admin/Leave/leavetype_add', $data);
         parent::setFooterAdmin();
     }
 }
Esempio n. 9
0
 public function edit($inst_id)
 {
     $rules = array(array("field" => "input_name", "label" => "ชื่อหน่วยงาน", "rules" => "trim|required"));
     $this->form_validation->set_rules($rules);
     $this->form_validation->set_message("required", "- ชื่อหน่วยงาน");
     if ($this->form_validation->run() === true) {
         $this->_save_edit();
         redirect("admin/Institution/");
         exit;
     } else {
         $query = $this->inst->get_detail_by_id($inst_id);
         $query = $query->row_array();
         $data = array();
         $data["value_inst_name"] = $query["INSName"];
         $data["value_inst_desc"] = $query["INSDesc"];
         $data["value_inst_id"] = $inst_id;
         parent::setHeaderAdmin("เพิ่มหน่วยงาน");
         $this->load->view('admin/institution/inst_add', $data);
         parent::setFooterAdmin();
     }
 }
Esempio n. 10
0
 private function edit_process($id)
 {
     $data = array();
     if ($_POST) {
         $post = $this->input->post(NULL, TRUE);
         $worker_id = array();
         $worker_id = explode(",", $post["hd_worker_id"]);
         $i = 1;
         $this->wfprocess->delete_process_by_condition_id($post["select_condition"]);
         foreach ($worker_id as $wfw) {
             $data["wfp_wfc_id"] = $post["select_condition"];
             $data["wfp_wfw_id"] = $wfw;
             $data["wfp_order"] = $i;
             $this->wfprocess->insert($data);
             $i++;
         }
         redirect("admin/workflow/process");
         exit;
     } else {
         $query = $this->wfprocess->get_detail_by_id($id);
         if ($query->num_rows() > 0) {
             $data = $query->row_array();
             $data["select_workflow"] = $this->get_workflow_for_select();
             $data["select_condition"] = $this->get_condition_for_select($data["WFID"]);
             $data["select_worker"] = $this->get_worker_for_select();
             $data["value_workflow"] = $data["WFID"];
             $data["value_worker"] = 0;
             $data["value_condition"] = $id;
             $data["query_process"] = $query->result_array();
             parent::setHeaderAdmin();
             $this->load->view("admin/workflow/process_add.php", $data);
             parent::setFooterAdmin();
         }
     }
 }
Esempio n. 11
0
 public function edit($position_id)
 {
     $data = $this->default_value();
     $query = $this->position->get_detail_by_id($position_id);
     if ($query->num_rows() > 0) {
         $query = $query->row_array();
         $data['form_url'] = site_url('admin/Position/save_edit');
         $data['value_position_id'] = $position_id;
         $data['dropdown_institution'] = $this->get_list_for_dropdown('institution');
         $data['dropdown_department'] = $this->get_list_for_dropdown('department', $query['D_INSID']);
         $data['dropdown_position'] = $this->get_list_for_dropdown('position', $query['P_DID']);
         $data['value_position_name'] = $query['PName'];
         $data['value_position_desc'] = $query['PDesc'];
         $data['value_department_id'] = $query['P_DID'];
         $data['value_institution_id'] = $query['D_INSID'];
         $data['value_headman_position_id'] = $query['Headman_PID'];
     }
     parent::setHeaderAdmin("แก้ไขตำแหน่ง");
     $this->load->view('admin/position/position_add', $data);
     parent::setFooterAdmin();
 }
Esempio n. 12
0
 public function add()
 {
     //form validation
     $rules = array(array("field" => "input_newstype", "label" => "ประเภทข่าว", "rules" => "greater_than[0]"), array("field" => "input_topic", "label" => "หัวข้อข่าว", "rules" => "trim|required|max_length[200]"));
     $this->form_validation->set_rules($rules);
     $this->form_validation->set_message("greater_than", "- เลือกประเภทข่าว");
     $this->form_validation->set_message("required", "- กรอกหัวข้อข่าว");
     if ($this->form_validation->run() === true) {
         $this->_save();
         redirect("admin/News");
         exit;
     } else {
         //set data
         $data = array();
         $data["dropdownlist_newstype"] = $this->newstype->get_list_for_dropdownlist();
         $data["value_newstype"] = 0;
         $data["value_topic"] = "";
         $data["value_detail"] = "";
         $data["value_show_start_date"] = "";
         $data["value_show_end_date"] = "";
         $data["value_news_image"] = array();
         $data["value_news_id"] = 0;
         //load view
         parent::setHeaderAdmin($this->lang->line("title_page_news_add"));
         $this->load->view("admin/News/Add", $data);
         parent::setFooterAdmin();
     }
 }
Esempio n. 13
0
 private function _groupEdit($id)
 {
     //form validation
     $rules = array(array("field" => "inputName", "label" => "ชื่อ", "rules" => "trim|required"), array("field" => "inputParent", "label" => "ฝ่าย", "rules" => "is_natural|required"));
     $this->form_validation->set_rules($rules);
     if ($this->form_validation->run() === TRUE) {
         $this->_saveGroup("edit");
         redirect($this->redirectDepartmentUrl);
         exit;
     } else {
         $query = $this->unit->getDetail($id);
         $query = $query->row_array();
         $ddlParent = $this->section->getListForDropdownlist();
         $data = array();
         $data["dataParent"] = $ddlParent;
         $data["valueParent"] = $query["cu_csid"];
         $data["disabledParent"] = "";
         $data["valueId"] = $id;
         $data["valueName"] = $query["cuname"];
         $data["valueDesc"] = $query["cudesc"];
         parent::setHeaderAdmin("แก้ไขหน่วยงาน");
         $this->load->view("admin/company/unit_add", $data);
         parent::setFooterAdmin();
     }
 }
Esempio n. 14
0
 public function edit($id)
 {
     //form validation
     $rules = array(array("field" => "inputName", "label" => "ชื่อ", "rules" => "trim|required"), array("field" => "inputCode", "label" => "รหัส", "rules" => "trim|required"));
     $this->form_validation->set_rules($rules);
     if ($this->form_validation->run() === TRUE) {
         $this->_save("edit");
         redirect($this->urlList);
         exit;
     } else {
         $query = $this->providentfund->getDetailById($id);
         $row = $query->row_array();
         $data = array();
         $data["valueCode"] = $row["pvdcode"];
         $data["valueName"] = $row["pvdname"];
         $data["valueResponsible"] = $row["pvdresponsibleman"];
         $data["valueDesc"] = $row["pvddesc"];
         $data["valueRate"] = $row["pvdratepercent"];
         $data["valueId"] = $id;
         parent::setHeaderAdmin("แก้ไขกองทุนสำรองเลี้ยงชีพ");
         $this->load->view("admin/Providentfund/providentfund_add", $data);
         parent::setFooterAdmin();
     }
 }
Esempio n. 15
0
 public function search()
 {
     parent::setHeaderAdmin();
     $this->load->view('admin/dashboard');
     parent::setFooterAdmin();
 }