Exemplo n.º 1
0
 public function rptPcsAction()
 {
     try {
         $db_tran = new Application_Model_DbTable_Dbpsc();
         // create sesesion
         $from_date = date("Y-m-d");
         $to_date = date("Y-m-d");
         $type_money = -1;
         $staff_name = -1;
         $this->view->from_date = $from_date;
         $this->view->to_date = $to_date;
         $this->view->staff = $staff_name;
         $cur = new Application_Model_DbTable_DbCurrencies();
         $this->view->currencylist = $cur->getCurrencyList();
         $this->view->type_money = $type_money;
         if ($this->getRequest()->isPost()) {
             $formdata = $this->getRequest()->getPost();
             $this->view->type_money = $formdata['type_money'];
             $this->view->staff_name = $formdata['staff_name'];
             $this->view->from_date = $formdata['from_date'];
             $this->view->to_date = $formdata['to_date'];
         } else {
             $formdata = array('from_date' => $from_date, 'to_date' => $to_date, 'type_money' => $type_money, 'staff_name' => $staff_name);
         }
         $trans = $db_tran->countAllStaffpcsAmount($formdata);
         if (empty($trans)) {
             $trans = array('err' => 1, 'msg' => 'មិន​ទាន់​មាន​ទន្និន័យ​នូវ​ឡើយ​ទេ!');
         }
         $this->view->rpt_list = $trans;
         $this->view->curr_type = $this->curr_typesimble;
         $usr_mod = new Application_Model_DbTable_DbUsers();
         $user_list = $usr_mod->getUserListSelect();
         array_unshift($user_list, array('id' => '-1', "name" => "ជ្រើសរើសឈ្មោះបុគ្គលិក"));
         $this->view->users = $user_list;
         $session_user = new Zend_Session_Namespace('auth');
         $this->view->user_name = $session_user->last_name . ' ' . $session_user->first_name;
     } catch (Exception $e) {
     }
 }
Exemplo n.º 2
0
 public function deleteAction()
 {
     if ($this->getRequest()->isPost()) {
         $data = $this->getRequest()->getPost();
         $id = $data['id'];
         $db_tran = new Application_Model_DbTable_Dbpsc();
         $suc = $db_tran->deleteRecordpsc($id);
         print_r(Zend_Json::encode($suc));
         exit;
     }
 }