public function hesoAction()
 {
     $this->_helper->layout()->disableLayout();
     $date = time();
     $thang = $this->_getParam('thang', date('m', $date));
     $nam = $this->_getParam('nam', date('Y', $date));
     $em_id = $this->_getParam('id', 0);
     $emModel = new Front_Model_Employees();
     $em_info = $emModel->fetchRow("em_id={$em_id}");
     $hesoModel = new Front_Model_EmployeesHeso();
     $bacluongModel = new Front_Model_BacLuong();
     $he_so = $hesoModel->getCurrentHeSo($thang, $nam, $em_id);
     $bac_luong = $bacluongModel->fetchAll('bl_status=1', 'bl_order ASC');
     $error_message = array();
     $success_message = '';
     if ($this->_request->isPost()) {
         $update_em_id = $this->_request->getParam('pc_cap_nhat_em_id', 0);
         $eh_loai_luong = $this->_request->getParam('eh_loai_luong', 0);
         $eh_giai_doan = $this->_request->getParam('eh_giai_doan', 0);
         $eh_he_so = $this->_request->getParam('eh_he_so', 0);
         $eh_thang_dieu_chinh = $this->_request->getParam('eh_thang_dieu_chinh', 0);
         $eh_nam_dieu_chinh = $this->_request->getParam('eh_nam_dieu_chinh', 0);
         $eh_bac_luong = $this->_request->getParam('eh_bac_luong', 0);
         $eh_thang_ap_dung = $this->_request->getParam('eh_thang_ap_dung', 0);
         $eh_nam_ap_dung = $this->_request->getParam('eh_nam_ap_dung', 0);
         if (!$eh_bac_luong) {
             $error_message = array('Bạn phải chọn bậc lương.');
         }
         if (!is_numeric($eh_he_so)) {
             $error_message = array('Hệ số phải có dạng số.');
         }
         if (!sizeof($error_message)) {
             if ($em_id != $update_em_id) {
                 $error_message = array('Có lỗi xảy ra, xin hãy tắt form này và mở lại.');
             } else {
                 $current_time = new Zend_Db_Expr('NOW()');
                 $date_dieu_chinh = date_create($eh_nam_dieu_chinh . '-' . $eh_thang_dieu_chinh . '-1');
                 $date_ap_dung = date_create($eh_nam_ap_dung . '-' . $eh_thang_ap_dung . '-1');
                 $data = array('eh_loai_luong' => $eh_loai_luong, 'eh_giai_doan' => $eh_giai_doan, 'eh_bac_luong' => $eh_bac_luong, 'eh_he_so' => $eh_he_so, 'eh_date_modified' => $current_time, 'eh_han_dieu_chinh' => date_format($date_dieu_chinh, "Y-m-d H:iP"));
                 $he_so = $hesoModel->checkHeSo($eh_thang_ap_dung, $eh_nam_ap_dung, $em_id);
                 if (!$he_so) {
                     $data['eh_em_id'] = $update_em_id;
                     $data['eh_date_added'] = $current_time;
                     $data['eh_han_ap_dung'] = date_format($date_ap_dung, "Y-m-d H:iP");
                     $hesoModel->insert($data);
                     $he_so_id = $hesoModel->getAdapter()->lastInsertId();
                 } else {
                     $he_so_id = $he_so->eh_id;
                     $hesoModel->update($data, "eh_id={$he_so_id}");
                 }
                 $he_so = $hesoModel->fetchRow("eh_id={$he_so_id}");
                 $success_message = 'Đã cập nhật thông tin thành công.';
             }
         }
     }
     $this->view->error_message = $error_message;
     $this->view->success_message = $success_message;
     $this->view->he_so = $he_so;
     $this->view->bac_luong = $bac_luong;
     $this->view->em_id = $em_id;
     $this->view->em_info = $em_info;
 }