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 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 formnghihuuAction() { $this->_helper->layout()->disableLayout(); $emID = $this->_getParam('id', 0); $emModel = new Front_Model_Employees(); $em_info = $emModel->fetchRow('em_id =' . $emID); $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('pb_status=1'); $error_message = array(); $success_message = ''; if ($this->_request->isPost()) { $current_time = new Zend_Db_Expr('NOW()'); $data = array(); $data['em_nghi_huu'] = 1; $data['em_ngay_nghi_huu'] = $current_time; $success_message = $emModel->update($data, 'em_id=' . $emID); if ($success_message) { $thongbao_model = new Front_Model_ThongBao(); $data = array(); $data['tb_from'] = 0; $data['tb_to'] = $emID; $data['tb_tieu_de'] = '[Nghỉ hưu] Bạn vừa được duyệt nghỉ hưu'; $data['tb_noi_dung'] = 'Phòng tổ chức vừa chuyển trạng thái của bạn sang nghỉ hưu.'; $data['tb_status'] = 0; $data['tb_date_added'] = $current_time; $data['tb_date_modified'] = $current_time; $thongbao_model->insert($data); } $em_info = $emModel->fetchRow('em_id =' . $emID); } $this->view->error_message = $error_message; $this->view->success_message = $success_message; $this->view->em_id = $emID; $this->view->employee_info = $em_info; $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; }