public function indexAction() { $translate = Zend_Registry::get('Zend_Translate'); $this->view->title = 'Duyệt đánh giá phân loại - ' . $translate->_('TEXT_DEFAULT_TITLE'); $this->view->headTitle($this->view->title); $layoutPath = APPLICATION_PATH . '/templates/' . TEMPLATE_USED; $option = array('layout' => '1_column/layout', 'layoutPath' => $layoutPath); Zend_Layout::startMvc($option); $date = new Zend_Date(); $date->subMonth(1); $thang = $this->_getParam('thang', $date->toString("M")); $nam = $this->_getParam('nam', $date->toString("Y")); $auth = Zend_Auth::getInstance(); $identity = $auth->getIdentity(); $em_id = $identity->em_id; $emModel = new Front_Model_Employees(); $phongbanModel = new Front_Model_Phongban(); $list_phong_ban = $phongbanModel->fetchAll(); $pb_selected = $this->_getParam('phongban', 0); $phong_ban = array(); $list_phong_ban_option = $phongbanModel->fetchData(0, $phong_ban); $phong_ban_choosed = array(); $phongbanModel->fetchData($pb_selected, $phong_ban_choosed); $pb_ids = array($pb_selected); foreach ($phong_ban_choosed as $pb) { $pb_ids[] = $pb->pb_id; } if (!$pb_selected) { //$list_employees = $emModel->fetchData(array('em_delete' => 0)); $list_employees = $emModel->callGetListNhanVien(); } else { //$select = $emModel->select()->where('em_phong_ban in (?)', $pb_ids); $list_employees = $emModel->callGetListNhanVien($pb_ids); } $tieuchiModel = new Front_Model_TieuChiDanhGiaCB(); $list_tieuchi = $tieuchiModel->fetchData(array('tcdgcb_status' => 1), 'tcdgcb_order ASC'); $ketquaModel = new Front_Model_DanhGiaKetQuaCV(); $list_ketqua = $ketquaModel->fetchData(array('dgkqcv_status' => 1), 'dgkqcv_order ASC'); $this->view->tieu_chi = $list_tieuchi; $this->view->ket_qua = $list_ketqua; $this->view->thang = $thang; $this->view->nam = $nam; $this->view->list_nhan_vien = $list_employees; $this->view->list_phong_ban = $list_phong_ban; $this->view->list_phong_ban_option = $list_phong_ban_option; $this->view->pb_id = $pb_selected; }
public function indexAction() { $translate = Zend_Registry::get('Zend_Translate'); $this->view->title = 'Duyệt đơn xin nghỉ phép - ' . $translate->_('TEXT_DEFAULT_TITLE'); $this->view->headTitle($this->view->title); $layoutPath = APPLICATION_PATH . '/templates/' . TEMPLATE_USED; $option = array('layout' => '1_column/layout', 'layoutPath' => $layoutPath); Zend_Layout::startMvc($option); $auth = Zend_Auth::getInstance(); $identity = $auth->getIdentity(); $em_id = $identity->em_id; $date = time(); $thang = $this->_getParam('thang', date('m', $date)); $nam = $this->_getParam('nam', date('Y', $date)); $emModel = new Front_Model_Employees(); $phongbanModel = new Front_Model_Phongban(); $xnpModel = new Front_Model_XinNghiPhep(); $list_phong_ban = $phongbanModel->fetchAll(); $pb_selected = $this->_getParam('phongban', 0); $phong_ban = array(); $list_phong_ban_option = $phongbanModel->fetchData(0, $phong_ban); $phong_ban_choosed = array(); $phongbanModel->fetchData($pb_selected, $phong_ban_choosed); $pb_ids = array($pb_selected); foreach ($phong_ban_choosed as $pb) { $pb_ids[] = $pb->pb_id; } if (!$pb_selected) { $list_nghi_phep = $xnpModel->fetchByPhongBan(array(), "{$nam}-{$thang}-01 00:00:00", "{$nam}-{$thang}-31 23:59:59"); } else { $list_nghi_phep = $xnpModel->fetchByPhongBan($pb_ids, "{$nam}-{$thang}-01 00:00:00", "{$nam}-{$thang}-31 23:59:59"); } $this->view->list_nghi_phep = $list_nghi_phep; $this->view->thang = $thang; $this->view->nam = $nam; $this->view->list_phong_ban = $list_phong_ban; $this->view->list_phong_ban_option = $list_phong_ban_option; $this->view->pb_id = $pb_selected; }
public function indexAction() { $translate = Zend_Registry::get('Zend_Translate'); $this->view->title = 'Quản lý yêu cầu cập nhật thông tin - ' . $translate->_('TEXT_DEFAULT_TITLE'); $this->view->headTitle($this->view->title); $layoutPath = APPLICATION_PATH . '/templates/' . TEMPLATE_USED; $option = array('layout' => '1_column/layout', 'layoutPath' => $layoutPath); Zend_Layout::startMvc($option); $employeesEditModel = new Front_Model_EmployeesEdit(); $chucvuModel = new Front_Model_Chucvu(); $list_chuc_vu = $chucvuModel->fetchData(array('cv_status' => 1)); $phongbanModel = new Front_Model_Phongban(); $list_phong_ban = $phongbanModel->fetchAll(); $pb_selected = $this->_getParam('phongban', 0); $phong_ban = array(); $list_phong_ban_option = $phongbanModel->fetchData(0, $phong_ban); $phong_ban_choosed = array(); $phongbanModel->fetchData($pb_selected, $phong_ban_choosed); $pb_ids = array($pb_selected); foreach ($phong_ban_choosed as $pb) { $pb_ids[] = $pb->pb_id; } if (!$pb_selected) { $list_employees = $employeesEditModel->fetchData(array(), 'eme_date_modified DESC'); } else { $list_employees = $employeesEditModel->fetchByPhongBan($pb_ids); } $paginator = Zend_Paginator::factory($list_employees); $paginator->setItemCountPerPage(NUM_PER_PAGE); $paginator->setCurrentPageNumber($this->_page); $this->view->page = $this->_page; $this->view->paginator = $paginator; $this->view->list_chuc_vu = $list_chuc_vu; $this->view->list_phong_ban = $list_phong_ban; $this->view->list_phong_ban_option = $list_phong_ban_option; $this->view->pb_id = $pb_selected; }
public function indexAction() { $translate = Zend_Registry::get('Zend_Translate'); $this->view->title = 'Duyệt khai báo làm thêm giờ - ' . $translate->_('TEXT_DEFAULT_TITLE'); $this->view->headTitle($this->view->title); $layoutPath = APPLICATION_PATH . '/templates/' . TEMPLATE_USED; $option = array('layout' => '1_column/layout', 'layoutPath' => $layoutPath); Zend_Layout::startMvc($option); $date = time(); $thang = $this->_getParam('thang', date('m', $date)); $nam = $this->_getParam('nam', date('Y', $date)); $emModel = new Front_Model_Employees(); $phongbanModel = new Front_Model_Phongban(); $ltgModel = new Front_Model_LamThemGio(); $list_phong_ban = $phongbanModel->fetchAll(); $pb_selected = $this->_getParam('phongban', 0); $phong_ban = array(); $list_phong_ban_option = $phongbanModel->fetchData(0, $phong_ban); $phong_ban_choosed = array(); $phongbanModel->fetchData($pb_selected, $phong_ban_choosed); $pb_ids = array($pb_selected); foreach ($phong_ban_choosed as $pb) { $pb_ids[] = $pb->pb_id; } if (!$pb_selected) { $list_lam_them_gio = $ltgModel->fetchByPhongBan(array(), "{$nam}-{$thang}-01 00:00:00", "{$nam}-{$thang}-31 23:59:59"); } else { $list_lam_them_gio = $ltgModel->fetchByPhongBan($pb_ids, "{$nam}-{$thang}-01 00:00:00", "{$nam}-{$thang}-31 23:59:59"); } $this->view->lam_them_gio = $list_lam_them_gio; $this->view->thang = $thang; $this->view->nam = $nam; $this->view->list_phong_ban = $list_phong_ban; $this->view->list_phong_ban_option = $list_phong_ban_option; $this->view->pb_id = $pb_selected; }
public function indexAction() { $translate = Zend_Registry::get('Zend_Translate'); $this->view->title = 'Thống kê phân loại tháng - ' . $translate->_('TEXT_DEFAULT_TITLE'); $this->view->headTitle($this->view->title); $layoutPath = APPLICATION_PATH . '/templates/' . TEMPLATE_USED; $option = array('layout' => '1_column/layout', 'layoutPath' => $layoutPath); Zend_Layout::startMvc($option); $date = new Zend_Date(); $thang = $this->_getParam('thang', $date->toString("M")); $nam = $this->_getParam('nam', $date->toString("Y")); $auth = Zend_Auth::getInstance(); $identity = $auth->getIdentity(); $em_id = $identity->em_id; $emModel = new Front_Model_Employees(); $phongbanModel = new Front_Model_Phongban(); $chucvuModel = new Front_Model_Chucvu(); $chuc_vu = $chucvuModel->fetchAll(); $list_phong_ban = $phongbanModel->fetchAll(); $pb_selected = $this->_getParam('phongban', 0); $phong_ban = array(); $list_phong_ban_option = $phongbanModel->fetchData(0, $phong_ban); $phong_ban_choosed_info = $phongbanModel->fetchRow("pb_id={$pb_selected} and pb_status=1"); $phong_ban_choosed = array(); $phongbanModel->fetchData($pb_selected, $phong_ban_choosed); $pb_ids = array($pb_selected); foreach ($phong_ban_choosed as $pb) { $pb_ids[] = $pb->pb_id; } if (!$pb_selected) { //$list_employees = $emModel->fetchData(array('em_delete' => 0)); $list_employees = $emModel->callGetListNhanVien(); } else { //$select = $emModel->select()->where('em_phong_ban in (?)', $pb_ids); $list_employees = $emModel->callGetListNhanVien($pb_ids); } $tieuchiModel = new Front_Model_TieuChiDanhGiaCB(); $list_tieuchi = $tieuchiModel->fetchData(array('tcdgcb_status' => 1), 'tcdgcb_order ASC'); $ketquaModel = new Front_Model_DanhGiaKetQuaCV(); $list_ketqua = $ketquaModel->fetchData(array('dgkqcv_status' => 1), 'dgkqcv_order ASC'); if ($this->_request->isPost()) { $inputFileName = APPLICATION_PATH . "/../tmp/BANG_TONG_HOP_PHAN_LOAI_THANG.xlsx"; $objPHPExcel = PHPExcel_IOFactory::load($inputFileName); $styleArray = array('borders' => array('allborders' => array('style' => PHPExcel_Style_Border::BORDER_THIN)), 'font' => array('bold' => false, 'color' => array('rgb' => '000000'), 'size' => 11, 'name' => 'Times New Roman')); $objPHPExcel->getProperties()->setCreator("Cục Hải Quan Hà Tĩnh"); $objPHPExcel->getProperties()->setLastModifiedBy("Cục Hải Quan Hà Tĩnh"); $objPHPExcel->getProperties()->setTitle("Thống kê tháng"); $objPHPExcel->getProperties()->setSubject("Bảng chấm công"); $objPHPExcel->getProperties()->setDescription("Bảng chấm công Cục Hải Quan Hà Tĩnh"); $objPHPExcel->setActiveSheetIndex(0); $objPHPExcel->getActiveSheet()->SetCellValue('A5', "(Tháng {$thang} Năm {$nam})"); $phong_ban_st = array($phong_ban_choosed_info); $list_phongban_selected = $phongbanModel->fetchDataStatus($pb_selected, $phong_ban_st); if ($list_employees) { $k = 0; $stt = 0; $stt_1 = 0; foreach ($list_phongban_selected as $phong_ban_info) { $stt_1 = 0; $k++; $objPHPExcel->setActiveSheetIndex(0)->mergeCells("A" . ($k + 8) . ":J" . ($k + 8)); $objPHPExcel->getActiveSheet()->getStyle("A" . ($k + 8))->getFill()->applyFromArray(array('type' => PHPExcel_Style_Fill::FILL_SOLID, 'startcolor' => array('rgb' => 'F28A8C'))); $objPHPExcel->getActiveSheet()->SetCellValue('A' . ($k + 8), $phong_ban_info->pb_name); foreach ($list_employees as $nhan_vien) { if ($phong_ban_info->pb_id == $nhan_vien['em_phong_ban']) { $phan_loai = $this->view->viewGetPhanLoai($nhan_vien['em_id'], (int) $thang, (int) $nam); $pl_ptccb = ''; if ($phan_loai) { if ($phan_loai->dg_ptccb_status != 'O') { $pl_ptccb = $phan_loai->dg_ptccb_status; } else { $pl_ptccb = '-'; } } $stt_1++; $k++; $stt++; $objPHPExcel->getActiveSheet()->SetCellValue('A' . ($k + 8), $stt); $objPHPExcel->getActiveSheet()->SetCellValue('B' . ($k + 8), $stt_1); $objPHPExcel->getActiveSheet()->SetCellValue('C' . ($k + 8), $nhan_vien['em_ho'] . ' ' . $nhan_vien['em_ten']); $objPHPExcel->getActiveSheet()->SetCellValue('D' . ($k + 8), $nhan_vien['cv_name']); switch ($pl_ptccb) { case 'A': $objPHPExcel->getActiveSheet()->SetCellValue('E' . ($k + 8), 'X'); break; case 'B': $objPHPExcel->getActiveSheet()->SetCellValue('F' . ($k + 8), 'X'); break; case 'C': $objPHPExcel->getActiveSheet()->SetCellValue('G' . ($k + 8), 'X'); break; case 'D': $objPHPExcel->getActiveSheet()->SetCellValue('H' . ($k + 8), 'X'); break; case '-': $objPHPExcel->getActiveSheet()->SetCellValue('I' . ($k + 8), 'X'); break; } } $objPHPExcel->getActiveSheet()->getStyle('A' . ($k + 8) . ':J' . ($k + 8))->applyFromArray($styleArray); } } $objPHPExcel->getActiveSheet()->SetCellValue('A' . ($k + 13), 'Ghi chú: Để trống là chưa phân loại hoặc chưa xét duyệt'); $objPHPExcel->getActiveSheet()->setTitle('Thống kê phân loại tháng' . $thang . '-' . $nam); $file_name = 'Thong_Ke_Phan_Loai_Thang_' . $thang . '-' . $nam . '.xls'; header('Content-type: application/vnd.ms-excel; charset=UTF-8'); header('Content-Disposition: attachment;filename="' . $file_name . '"'); header('Cache-Control: max-age=0'); $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007'); $objWriter->save('php://output'); die; } } $this->view->tieu_chi = $list_tieuchi; $this->view->ket_qua = $list_ketqua; $this->view->thang = $thang; $this->view->nam = $nam; $this->view->list_nhan_vien = $list_employees; $this->view->list_phong_ban = $list_phong_ban; $this->view->list_phong_ban_option = $list_phong_ban_option; $this->view->pb_id = $pb_selected; }
public function indexAction() { $translate = Zend_Registry::get('Zend_Translate'); $this->view->title = 'Duyệt chấm công - ' . $translate->_('TEXT_DEFAULT_TITLE'); $this->view->headTitle($this->view->title); $layoutPath = APPLICATION_PATH . '/templates/' . TEMPLATE_USED; $option = array('layout' => '1_column/layout', 'layoutPath' => $layoutPath); Zend_Layout::startMvc($option); $date = new Zend_Date(); $date->subMonth(1); $thang = $this->_getParam('thang', $date->toString("M")); $nam = $this->_getParam('nam', $date->toString("Y")); $days_in_month = cal_days_in_month(0, (int) $thang, (int) $nam); $auth = Zend_Auth::getInstance(); $identity = $auth->getIdentity(); $em_id = $identity->em_id; $emModel = new Front_Model_Employees(); $phongbanModel = new Front_Model_Phongban(); $letetModel = new Front_Model_NghiLe(); $list_phong_ban = $phongbanModel->fetchAll(); $check_le_tet = $letetModel->fetchByMonth($nam, $thang); $le_tet_array = array(); foreach ($check_le_tet as $le_tet) { $ngay_ket_thuc = new Zend_Date($le_tet->nn_den_ngay); $ngay_bat_dau = new Zend_Date($le_tet->nn_tu_ngay); for ($n = 1; $n <= $days_in_month; $n++) { $date_check = new Zend_Date("{$nam}-{$thang}-{$n}"); if ($date_check >= $ngay_bat_dau && $date_check <= $ngay_ket_thuc) { $le_tet_array[$n] = 1; } } } $pb_selected = $this->_getParam('phongban', 0); $nv_selected = $this->_getParam('nhanvien', 0); $list_nhan_vien = $phong_ban_id = $list_phongban = $phong_ban = array(); $phong_ban_id[] = $pb_selected; $list_phongban = $phongbanModel->fetchDataStatus($pb_selected, $phong_ban); $phong_ban_options = array(); $list_phong_ban_option = $phongbanModel->fetchData(0, $phong_ban_options); if (sizeof($list_phongban)) { foreach ($list_phongban as $phong_ban_info) { $phong_ban_id[] = $phong_ban_info->pb_id; } } $phong_ban_id = implode(',', $phong_ban_id); if ($pb_selected) { $list_nhan_vien = $emModel->fetchAll("em_phong_ban in ({$phong_ban_id}) and em_status=1"); } $holidaysModel = new Front_Model_Holidays(); $holidays = $holidaysModel->fetchData(); $listHoliday = array(); foreach ($holidays as $holiday) { $listHoliday[$holiday['hld_id']] = array('code' => $holiday['hld_code'], 'ngay_cong' => $holiday['hld_ngay_cong']); } $this->view->listHoliday = $listHoliday; $this->view->list_nhan_vien = $list_nhan_vien; $this->view->thang = $thang; $this->view->nam = $nam; $this->view->pb_id = $pb_selected; $this->view->nv_id = $nv_selected; $this->view->list_phong_ban = $list_phong_ban; $this->view->list_phong_ban_option = $list_phong_ban_option; $this->view->le_tet = $le_tet_array; }
public function editAction() { $layoutPath = APPLICATION_PATH . '/templates/' . TEMPLATE_USED; $option = array('layout' => 'hethong/layout', 'layoutPath' => $layoutPath); Zend_Layout::startMvc($option); $translate = Zend_Registry::get('Zend_Translate'); $this->view->title = 'Quản lý phòng ban - ' . $translate->_('TEXT_DEFAULT_TITLE'); $this->view->headTitle($this->view->title); $id = $this->_getParam('id', 0); $phongbanModel = new Front_Model_Phongban(); $error_message = array(); $success_message = ''; $pb_info = $phongbanModel->fetchRow('pb_id=' . $id); if (!$pb_info) { $error_message[] = 'Không tìm thấy thông tin.'; } if ($this->_request->isPost()) { $pb_name = trim($this->_arrParam['pb_name']); $pb_order = trim($this->_arrParam['pb_order']); $pb_parent = $this->_arrParam['pb_parent']; $pb_status = $this->_arrParam['pb_status']; if (!is_numeric($pb_order)) { $pb_order = 0; } $validator_length = new Zend_Validate_StringLength(array('min' => 4, 'max' => 100)); //kiem tra dữ liệu if (!$validator_length->isValid($pb_name)) { $error_message[] = 'Tên phòng ban phải bằng hoặc hơn 4 ký tự và nhỏ hơn hoặc bằng 100 ký tự.'; } if (!sizeof($error_message)) { $current_time = new Zend_Db_Expr('NOW()'); $phongbanModel->update(array('pb_name' => $pb_name, 'pb_parent' => $pb_parent, 'pb_status' => $pb_status, 'pb_order' => $pb_order, 'pb_date_modified' => $current_time), 'pb_id=' . $id); $pb_info->pb_name = $pb_name; $pb_info->pb_status = $pb_status; $pb_info->pb_order = $pb_order; $success_message = 'Đã cập nhật thông tin thành công.'; } } $phong_ban = array(); $list_phongban = $phongbanModel->fetchData(0, $phong_ban, $id); $this->view->pb_info = $pb_info; $this->view->list_phongban = $list_phongban; $this->view->success_message = $success_message; $this->view->error_message = $error_message; }
public function nangluongAction() { $translate = Zend_Registry::get('Zend_Translate'); $this->view->title = 'Quản lý cán bộ - ' . $translate->_('TEXT_DEFAULT_TITLE'); $this->view->headTitle($this->view->title); $layoutPath = APPLICATION_PATH . '/templates/' . TEMPLATE_USED; $option = array('layout' => '1_column/layout', 'layoutPath' => $layoutPath); Zend_Layout::startMvc($option); $pb_selected = $this->_getParam('phongban', 0); $chucvuModel = new Front_Model_Chucvu(); $list_chuc_vu = $chucvuModel->fetchData(array('cv_status' => 1)); $ngachcongchucModel = new Front_Model_NgachCongChuc(); $list_ngach_cong_chuc = $ngachcongchucModel->fetchData(array('ncc_status' => 1)); $phongbanModel = new Front_Model_Phongban(); $list_phong_ban = $phongbanModel->fetchAll(); $phong_ban = array(); $list_phong_ban_option = $phongbanModel->fetchData(0, $phong_ban); $phong_ban_choosed = array(); $phongbanModel->fetchData($pb_selected, $phong_ban_choosed); $pb_ids = array($pb_selected); foreach ($phong_ban_choosed as $pb) { $pb_ids[] = $pb->pb_id; } $list_nang_luong = $this->_helper->global->checkNangLuong(); $this->view->pb_id = $pb_selected; $this->view->list_nhan_vien = $list_nang_luong; $this->view->list_chuc_vu = $list_chuc_vu; $this->view->list_phong_ban = $list_phong_ban; $this->view->list_phong_ban_option = $list_phong_ban_option; $this->view->list_ngach_cong_chuc = $list_ngach_cong_chuc; }
public function intheophongAction() { $translate = Zend_Registry::get('Zend_Translate'); $this->view->title = 'In lương - ' . $translate->_('TEXT_DEFAULT_TITLE'); $this->view->headTitle($this->view->title); $layoutPath = APPLICATION_PATH . '/templates/' . TEMPLATE_USED; $option = array('layout' => '1_column/layout', 'layoutPath' => $layoutPath); Zend_Layout::startMvc($option); $date = time(); $thang = $this->_getParam('thang', date('m', $date)); $nam = $this->_getParam('nam', date('Y', $date)); $emModel = new Front_Model_Employees(); $phongbanModel = new Front_Model_Phongban(); $chucvuModel = new Front_Model_Chucvu(); $pb_selected = $this->_getParam('phongban', 0); $phong_ban_id = $list_phongban_selected = $phong_ban = array(); $phong_ban_id[] = $pb_selected; $list_phongban_selected = $phongbanModel->fetchDataStatus($pb_selected, $phong_ban); $list_chuc_vu = $chucvuModel->fetchAll(); $phong_ban_options = array(); $list_phong_ban_option = $phongbanModel->fetchData(0, $phong_ban_options); if (sizeof($list_phongban_selected)) { foreach ($list_phongban_selected as $phong_ban_info) { $phong_ban_id[] = $phong_ban_info->pb_id; } } $phong_ban_id = implode(',', $phong_ban_id); $list_nhan_vien = $emModel->fetchAll("em_phong_ban in ({$phong_ban_id}) and em_status=1"); $this->view->list_nhan_vien = $list_nhan_vien; $this->view->thang = $thang; $this->view->nam = $nam; $this->view->pb_id = $pb_selected; $this->view->list_phong_ban_option = $list_phong_ban_option; $this->view->list_chuc_vu = $list_chuc_vu; }
public function auto02Action() { $translate = Zend_Registry::get('Zend_Translate'); $this->view->title = 'Tính lương hệ số 0.2 - ' . $translate->_('TEXT_DEFAULT_TITLE'); $this->view->headTitle($this->view->title); $layoutPath = APPLICATION_PATH . '/templates/' . TEMPLATE_USED; $option = array('layout' => '1_column/layout', 'layoutPath' => $layoutPath); Zend_Layout::startMvc($option); $auth = Zend_Auth::getInstance(); $identity = $auth->getIdentity(); $my_id = $identity->em_id; $date = new Zend_Date(); $date->subMonth(1); $thang = $this->_getParam('thang', $date->toString('M')); $nam = $this->_getParam('nam', $date->toString('Y')); $emModel = new Front_Model_Employees(); $phongbanModel = new Front_Model_Phongban(); $chucvuModel = new Front_Model_Chucvu(); $hesocbModel = new Front_Model_HeSo(); $hesoModel = new Front_Model_EmployeesHeso(); $bangluongModel = new Front_Model_BangLuong(); $danhgiaModel = new Front_Model_DanhGia(); $lastHeSoLuong = $hesocbModel->fetchOneData(array('hs_ngay_bat_dau' => date("{$nam}-{$thang}-1")), 'hs_ngay_bat_dau DESC'); $he_so_tang_them = 0.5; $he_so_phan_loai = array('O' => 0, 'A' => 1.2, 'B' => 1, 'C' => 0.8, 'D' => 0); $pb_selected = $this->_getParam('phongban', 0); $phong_ban_id = $list_phongban_selected = $phong_ban = array(); $phong_ban_id[] = $pb_selected; $list_phongban_selected = $phongbanModel->fetchDataStatus($pb_selected, $phong_ban); $list_chuc_vu = $chucvuModel->fetchAll(); $list_nhan_vien = $phong_ban_options = array(); $list_phong_ban_option = $phongbanModel->fetchData(0, $phong_ban_options); if (sizeof($list_phongban_selected)) { foreach ($list_phongban_selected as $phong_ban_info) { $phong_ban_id[] = $phong_ban_info->pb_id; } } $phong_ban_id = implode(',', $phong_ban_id); if ($pb_selected) { $list_nhan_vien = $emModel->fetchAll("em_phong_ban in ({$phong_ban_id}) and em_status=1"); } if ($this->_request->isPost()) { $item = $this->getRequest()->getPost('cid'); foreach ($item as $k => $v) { $bang_luong = $bangluongModel->fetchByDate($v, "{$nam}-{$thang}-01 00:00:00", "{$nam}-{$thang}-31 23:59:59"); if ($bang_luong && $bang_luong->bl_tong_he_so > 0) { $luong_toi_thieu = $bang_luong->bl_luong_toi_thieu; //luong co ban $tong_hs_luong_pc = $bang_luong->bl_tong_he_so; $tam_chi_dau_vao = $tong_hs_luong_pc * $luong_toi_thieu * 0.5; $data = array('bl_ptccb_id' => $my_id, 'bl_tam_chi_dau_vao_02' => $tam_chi_dau_vao, 'bl_02' => 1); $bl_id = $bang_luong->bl_id; $bangluongModel->update($data, "bl_id={$bl_id}"); } } } $this->view->list_nhan_vien = $list_nhan_vien; $this->view->thang = $thang; $this->view->nam = $nam; $this->view->pb_id = $pb_selected; $this->view->list_phong_ban_option = $list_phong_ban_option; $this->view->list_chuc_vu = $list_chuc_vu; }
public function editAction() { $layoutPath = APPLICATION_PATH . '/templates/' . TEMPLATE_USED; $option = array('layout' => '1_column/layout', 'layoutPath' => $layoutPath); Zend_Layout::startMvc($option); $translate = Zend_Registry::get('Zend_Translate'); $this->view->title = 'Quản lý cán bộ - ' . $translate->_('TEXT_DEFAULT_TITLE'); $this->view->headTitle($this->view->title); $employeesModel = new Front_Model_Employees(); $success_message = ''; $id = $this->_getParam('id', 0); if ($this->_getParam('mess') == 'success') { $success_message = 'Đã thêm mới thành công.'; } $employee_info = $employeesModel->fetchRow('em_id=' . $id); if (!$employee_info) { $error_message[] = 'Không tìm thấy thông tin.'; } $tinhModel = new Front_Model_Tinh(); $list_tinh = $tinhModel->fetchData(array('tinh_status' => 1)); $huyenModel = new Front_Model_Huyen(); $list_huyen = $huyenModel->fetchData(array('huyen_status' => 1)); $dantocModel = new Front_Model_Dantoc(); $list_dan_toc = $dantocModel->fetchData(array('dt_status' => 1)); $chucvuModel = new Front_Model_Chucvu(); $list_chuc_vu = $chucvuModel->fetchData(array('cv_status' => 1)); $phongbanModel = new Front_Model_Phongban(); $phong_ban = array(); $list_phong_ban = $phongbanModel->fetchData(0, $phong_ban); $ngachcongchucModel = new Front_Model_NgachCongChuc(); $list_ngach_cong_chuc = $ngachcongchucModel->fetchData(array('ncc_status' => 1)); $hochamModel = new Front_Model_Hocham(); $list_hoc_ham = $hochamModel->fetchData(array('hh_status' => 1)); $bangcapModel = new Front_Model_Bangcap(); $list_bang_cap = $bangcapModel->fetchData(array('bc_status' => 1)); $chungchiModel = new Front_Model_Chungchi(); $list_chung_chi = $chungchiModel->fetchData(array('cc_status' => 1)); $chucvudoanModel = new Front_Model_ChucVuDoan(); $list_chuc_vu_doan = $chucvudoanModel->fetchData(array('cvdoan_status' => 1)); $chucvudangModel = new Front_Model_ChucVuDang(); $list_chuc_vu_dang = $chucvudangModel->fetchData(array('cvdang_status' => 1)); $chucvucongdoanModel = new Front_Model_ChucVuCongDoan(); $list_chuc_vu_cong_doan = $chucvucongdoanModel->fetchData(array('cvcdoan_status' => 1)); $lyluanModel = new Front_Model_LyLuanChinhTri(); $list_ly_luan_chinh_tri = $lyluanModel->fetchData(array('llct_status' => 1)); $quanlynnModel = new Front_Model_QuanLyNhaNuoc(); $list_quan_ly_nn = $quanlynnModel->fetchData(array('qlnn_status' => 1)); $error_message = array(); $min = 10; $max = 20 * 1024 * 1024; //20MB $dir = '/avatars'; //thu muc uploads $dir_upload = UPLOAD_PATH . $dir; //duong dan $upload = new Zend_File_Transfer_Adapter_Http(); $upload->setDestination($dir_upload); $upload->addValidator('Count', false, array('min' => 1, 'max' => 1))->addValidator('Size', false, array('min' => $min, 'max' => $max))->addValidator('Extension', false, 'jpg,png,gif,jpeg'); $files = $upload->getFileInfo(); if ($this->_request->isPost()) { $data = array(); if ($upload->isValid()) { foreach ($files as $file => $info) { if ($info['name'] != '') { $validator = new Zend_Validate_File_Exists($dir_upload); if ($validator->isValid($info['name'])) { $file_name = $upload->getFileName($info['name']); preg_match("/\\.([^\\.]+)\$/", $file_name, $matches); $file_ext = $matches[1]; $file_name = time() . '.' . $file_ext; $arrFileName[$file] = $file_name; $upload->addFilter('Rename', $dir_upload . '/' . $file_name); } else { $arrFileName[$file] = $info['name']; } $upload->receive($file); } } $data['em_anh_the'] = $arrFileName['em_anh_the']; } $em_ho = trim($this->_arrParam['em_ho']); $em_ten = trim($this->_arrParam['em_ten']); $em_ten_khac = trim($this->_arrParam['em_ten_khac']); $em_so_chung_minh_thu = trim($this->_arrParam['em_so_chung_minh_thu']); $em_gioi_tinh = $this->_arrParam['em_gioi_tinh']; $ngay_sinh = trim($this->_arrParam['ngay_sinh']); $em_home_phone = trim($this->_arrParam['em_home_phone']); $em_phone = trim($this->_arrParam['em_phone']); $em_noi_sinh = trim($this->_arrParam['em_noi_sinh']); $em_que_quan = trim($this->_arrParam['em_que_quan']); $em_dia_chi = trim($this->_arrParam['em_dia_chi']); $em_dia_chi_tinh = $this->_arrParam['em_dia_chi_tinh']; $em_dia_chi_huyen = $this->_arrParam['em_dia_chi_huyen']; $em_dan_toc = $this->_arrParam['em_dan_toc']; $em_so_cong_chuc = trim($this->_arrParam['em_so_cong_chuc']); $em_chuc_vu = $this->_arrParam['em_chuc_vu']; $em_phong_ban = $this->_arrParam['em_phong_ban']; $ngay_tuyen_dung = $this->_arrParam['em_ngay_tuyen_dung']; $em_ngach_cong_chuc = $this->_arrParam['em_ngach_cong_chuc']; $em_cong_viec = trim($this->_arrParam['em_cong_viec']); $em_chuyen_mon = trim($this->_arrParam['em_chuyen_mon']); $em_chuc_vu_dang = $this->_arrParam['em_chuc_vu_dang']; $ngay_dang = $this->_arrParam['ngay_dang']; $em_chuc_vu_doan = $this->_arrParam['em_chuc_vu_doan']; $ngay_doan = $this->_arrParam['ngay_doan']; $em_chuc_vu_cong_doan = $this->_arrParam['em_chuc_vu_cong_doan']; $em_van_hoa_pt = trim($this->_arrParam['em_van_hoa_pt']); $em_hoc_ham = $this->_arrParam['em_hoc_ham']; $em_bang_cap = $this->_arrParam['em_bang_cap']; $em_ngoai_ngu = $this->_arrParam['em_ngoai_ngu']; $em_tin_hoc = $this->_arrParam['em_tin_hoc']; $em_chung_chi_khac = $this->_arrParam['em_chung_chi_khac']; $em_bang_scan_upload = $this->_arrParam['anh_bang_cap']; $em_tai_lieu_khac = $this->_arrParam['anh_tai_lieu_khac']; $em_status = $this->_arrParam['em_status']; /* Moi them */ $em_ton_giao = trim($this->_arrParam['em_ton_giao']); $em_noi_sinh_huyen = trim($this->_arrParam['em_noi_sinh_huyen']); $em_noi_sinh_tinh = trim($this->_arrParam['em_noi_sinh_tinh']); $em_que_quan_huyen = trim($this->_arrParam['em_que_quan_huyen']); $em_que_quan_tinh = trim($this->_arrParam['em_que_quan_tinh']); $em_noi_o = trim($this->_arrParam['em_noi_o']); $em_noi_o_huyen = $this->_arrParam['em_noi_o_huyen']; $em_noi_o_tinh = $this->_arrParam['em_noi_o_tinh']; $em_co_quan_tuyen_dung = trim($this->_arrParam['em_co_quan_tuyen_dung']); $em_cong_viec_khi_tuyen_dung = trim($this->_arrParam['em_cong_viec_khi_tuyen_dung']); $em_khen_thuong = trim($this->_arrParam['em_khen_thuong']); $em_ky_luat = trim($this->_arrParam['em_ky_luat']); $em_ngay_nhap_ngu = trim($this->_arrParam['em_ngay_nhap_ngu']); $em_ngay_xuat_ngu = trim($this->_arrParam['em_ngay_xuat_ngu']); $em_time_cong_tac = trim($this->_arrParam['em_time_cong_tac']); $em_cmt_ngay_cap = trim($this->_arrParam['em_cmt_ngay_cap']); $em_quan_ham = trim($this->_arrParam['em_quan_ham']); $em_danh_hieu = trim($this->_arrParam['em_danh_hieu']); $em_so_bhxh = trim($this->_arrParam['em_so_bhxh']); $em_tinh_trang_suc_khoe = trim($this->_arrParam['em_tinh_trang_suc_khoe']); $em_chieu_cao = trim($this->_arrParam['em_chieu_cao']); $em_can_nang = trim($this->_arrParam['em_can_nang']); $em_nhom_mau = trim($this->_arrParam['em_nhom_mau']); $em_thuong_binh = trim($this->_arrParam['em_thuong_binh']); $em_gia_dinh_chinh_sach = trim($this->_arrParam['em_gia_dinh_chinh_sach']); $em_lich_su_dao_tao = $this->_arrParam['em_lich_su_dao_tao']; $em_qua_trinh_cong_tac = $this->_arrParam['em_qua_trinh_cong_tac']; $em_gia_dinh_ban_than = $this->_arrParam['em_gia_dinh_ban_than']; $em_gia_dinh_vo = $this->_arrParam['em_gia_dinh_vo']; $em_qua_trinh_luong = $this->_arrParam['em_qua_trinh_luong']; $em_bi_bat = trim($this->_arrParam['em_bi_bat']); $em_tham_gia_to_chuc = trim($this->_arrParam['em_tham_gia_to_chuc']); $em_than_nhan_nuoc_ngoai = trim($this->_arrParam['em_than_nhan_nuoc_ngoai']); $em_ly_luan_chinh_tri = trim($this->_arrParam['em_ly_luan_chinh_tri']); $em_quan_ly_nha_nuoc = trim($this->_arrParam['em_quan_ly_nha_nuoc']); $validator_length = new Zend_Validate_StringLength(array('min' => 2, 'max' => 255)); //kiem tra dữ liệu if (!$validator_length->isValid($em_ho)) { $error_message[] = 'Họ không được bỏ trống và phải lớn hơn hoặc bằng 2 ký tự.'; } if (!$validator_length->isValid($em_ten)) { $error_message[] = 'Họ không được bỏ trống và phải lớn hơn hoặc bằng 2 ký tự.'; } if (!sizeof($error_message)) { $current_time = new Zend_Db_Expr('NOW()'); if ($ngay_sinh != '') { $ngay_sinh = str_replace('/', '-', $ngay_sinh); $ngay_sinh = date('Y-m-d', strtotime($ngay_sinh)); } $data['em_ngay_sinh'] = $ngay_sinh; if ($em_time_cong_tac != '') { $em_time_cong_tac = str_replace('/', '-', $em_time_cong_tac); $em_time_cong_tac = date('Y-m-1', strtotime($em_time_cong_tac)); } $data['em_time_cong_tac'] = $em_time_cong_tac; if ($ngay_tuyen_dung != '') { $ngay_tuyen_dung = str_replace('/', '-', $ngay_tuyen_dung); $ngay_tuyen_dung = date('Y-m-d', strtotime($ngay_tuyen_dung)); } $data['em_ngay_tuyen_dung'] = $ngay_tuyen_dung; if ($ngay_dang != '') { $ngay_dang = str_replace('/', '-', $ngay_dang); $ngay_dang = date('Y-m-d', strtotime($ngay_dang)); } $data['em_ngay_vao_dang'] = $ngay_dang; if ($ngay_doan != '') { $ngay_doan = str_replace('/', '-', $ngay_doan); $ngay_doan = date('Y-m-d', strtotime($ngay_doan)); } $data['em_ngay_vao_doan'] = $ngay_doan; if ($em_ngay_nhap_ngu != '') { $em_ngay_nhap_ngu = str_replace('/', '-', $em_ngay_nhap_ngu); $em_ngay_nhap_ngu = date('Y-m-d', strtotime($em_ngay_nhap_ngu)); } $data['em_ngay_nhap_ngu'] = $em_ngay_nhap_ngu; if ($em_ngay_xuat_ngu != '') { $em_ngay_xuat_ngu = str_replace('/', '-', $em_ngay_xuat_ngu); $em_ngay_xuat_ngu = date('Y-m-d', strtotime($em_ngay_xuat_ngu)); } $data['em_ngay_xuat_ngu'] = $em_ngay_xuat_ngu; if ($em_cmt_ngay_cap != '') { $em_cmt_ngay_cap = str_replace('/', '-', $em_cmt_ngay_cap); $em_cmt_ngay_cap = date('Y-m-d', strtotime($em_cmt_ngay_cap)); } $data['em_cmt_ngay_cap'] = $em_cmt_ngay_cap; $data['em_ho'] = $em_ho; $data['em_ten'] = $em_ten; $data['em_ten_khac'] = $em_ten_khac; $data['em_so_chung_minh_thu'] = $em_so_chung_minh_thu; $data['em_gioi_tinh'] = $em_gioi_tinh; $data['em_home_phone'] = $em_home_phone; $data['em_phone'] = $em_phone; $data['em_noi_sinh'] = $em_noi_sinh; $data['em_que_quan'] = $em_que_quan; $data['em_dia_chi'] = $em_dia_chi; $data['em_dia_chi_tinh'] = $em_dia_chi_tinh; $data['em_dia_chi_huyen'] = $em_dia_chi_huyen; $data['em_dan_toc'] = $em_dan_toc; $data['em_so_cong_chuc'] = $em_so_cong_chuc; $data['em_chuc_vu'] = $em_chuc_vu; $data['em_phong_ban'] = $em_phong_ban; $data['em_ngach_cong_chuc'] = $em_ngach_cong_chuc; $data['em_cong_viec'] = $em_cong_viec; $data['em_chuyen_mon'] = $em_chuyen_mon; $data['em_chuc_vu_dang'] = $em_chuc_vu_dang; $data['em_chuc_vu_doan'] = $em_chuc_vu_doan; $data['em_chuc_vu_cong_doan'] = $em_chuc_vu_cong_doan; $data['em_van_hoa_pt'] = $em_van_hoa_pt; $data['em_hoc_ham'] = $em_hoc_ham; $data['em_bang_cap'] = $em_bang_cap; $data['em_ngoai_ngu'] = $em_ngoai_ngu; $data['em_tin_hoc'] = $em_tin_hoc; $data['em_chung_chi_khac'] = $em_chung_chi_khac; $data['em_anh_bang_cap'] = serialize($em_bang_scan_upload); $data['em_tai_lieu_khac'] = serialize($em_tai_lieu_khac); $data['em_status'] = $em_status; /* Moi them */ $data['em_ton_giao'] = $em_ton_giao; $data['em_noi_sinh_huyen'] = $em_noi_sinh_huyen; $data['em_noi_sinh_tinh'] = $em_noi_sinh_tinh; $data['em_que_quan_huyen'] = $em_que_quan_huyen; $data['em_que_quan_tinh'] = $em_que_quan_tinh; $data['em_noi_o'] = $em_noi_o; $data['em_noi_o_huyen'] = $em_noi_o_huyen; $data['em_noi_o_tinh'] = $em_noi_o_tinh; $data['em_co_quan_tuyen_dung'] = $em_co_quan_tuyen_dung; $data['em_cong_viec_khi_tuyen_dung'] = $em_cong_viec_khi_tuyen_dung; $data['em_khen_thuong'] = $em_khen_thuong; $data['em_ky_luat'] = $em_ky_luat; $data['em_quan_ham'] = $em_quan_ham; $data['em_danh_hieu'] = $em_danh_hieu; $data['em_so_bhxh'] = $em_so_bhxh; $data['em_tinh_trang_suc_khoe'] = $em_tinh_trang_suc_khoe; $data['em_chieu_cao'] = $em_chieu_cao; $data['em_can_nang'] = $em_can_nang; $data['em_nhom_mau'] = $em_nhom_mau; $data['em_thuong_binh'] = $em_thuong_binh; $data['em_gia_dinh_chinh_sach'] = $em_gia_dinh_chinh_sach; $data['em_lich_su_dao_tao'] = serialize($em_lich_su_dao_tao); $data['em_qua_trinh_cong_tac'] = serialize($em_qua_trinh_cong_tac); $data['em_gia_dinh_ban_than'] = serialize($em_gia_dinh_ban_than); $data['em_gia_dinh_vo'] = serialize($em_gia_dinh_vo); $data['em_qua_trinh_luong'] = serialize($em_qua_trinh_luong); $data['em_bi_bat'] = $em_bi_bat; $data['em_tham_gia_to_chuc'] = $em_tham_gia_to_chuc; $data['em_than_nhan_nuoc_ngoai'] = $em_than_nhan_nuoc_ngoai; $data['em_ly_luan_chinh_tri'] = $em_ly_luan_chinh_tri; $data['em_quan_ly_nha_nuoc'] = $em_quan_ly_nha_nuoc; $data['em_date_modified'] = $current_time; $employeesModel->update($data, 'em_id=' . $id); $employee_info = $employeesModel->fetchRow('em_id=' . $id); $success_message = 'Đã cập nhật thông tin thành công.'; } } $this->view->employee_info = $employee_info; $this->view->success_message = $success_message; $this->view->error_message = $error_message; $this->view->list_tinh = $list_tinh; $this->view->list_huyen = $list_huyen; $this->view->list_dan_toc = $list_dan_toc; $this->view->list_chuc_vu = $list_chuc_vu; $this->view->list_phong_ban = $list_phong_ban; $this->view->list_ngach_cong_chuc = $list_ngach_cong_chuc; $this->view->list_hoc_ham = $list_hoc_ham; $this->view->list_bang_cap = $list_bang_cap; $this->view->list_chung_chi = $list_chung_chi; $this->view->list_chuc_vu_doan = $list_chuc_vu_doan; $this->view->list_chuc_vu_dang = $list_chuc_vu_dang; $this->view->list_chuc_vu_cong_doan = $list_chuc_vu_cong_doan; $this->view->list_ly_luan_chinh_tri = $list_ly_luan_chinh_tri; $this->view->list_quan_ly_nha_nuoc = $list_quan_ly_nn; }
public function heso02Action() { $translate = Zend_Registry::get('Zend_Translate'); $this->view->title = 'In lương hệ số 0.2 - ' . $translate->_('TEXT_DEFAULT_TITLE'); $this->view->headTitle($this->view->title); $layoutPath = APPLICATION_PATH . '/templates/' . TEMPLATE_USED; $option = array('layout' => '1_column/layout', 'layoutPath' => $layoutPath); Zend_Layout::startMvc($option); $date = new Zend_Date(); $date->subMonth(1); $thang = $this->_getParam('thang', $date->toString("M")); $nam = $this->_getParam('nam', $date->toString("Y")); $emModel = new Front_Model_Employees(); $phongbanModel = new Front_Model_Phongban(); $chucvuModel = new Front_Model_Chucvu(); $heso02Model = new Front_Model_HeSo02(); $check_he_so_02 = $heso02Model->fetchRow("nam={$nam}"); $pb_selected = $this->_getParam('phongban', 0); $phong_ban_id = $list_phongban_selected = $phong_ban = array(); $phong_ban_id[] = $pb_selected; $list_phongban_selected = $phongbanModel->fetchDataStatus($pb_selected, $phong_ban); $list_chuc_vu = $chucvuModel->fetchAll(); $phong_ban_options = array(); $list_phong_ban_option = $phongbanModel->fetchData(0, $phong_ban_options); if (sizeof($list_phongban_selected)) { foreach ($list_phongban_selected as $phong_ban_info) { $phong_ban_id[] = $phong_ban_info->pb_id; } } $phong_ban_id = implode(',', $phong_ban_id); $list_nhan_vien = $emModel->fetchAll("em_phong_ban in ({$phong_ban_id}) and em_status=1"); $this->view->list_nhan_vien = $list_nhan_vien; $this->view->thang = $thang; $this->view->nam = $nam; $this->view->pb_id = $pb_selected; $this->view->list_phong_ban_option = $list_phong_ban_option; $this->view->list_chuc_vu = $list_chuc_vu; if (!$check_he_so_02) { $this->_helper->viewRenderer->setRender('loi02'); } }