Пример #1
0
 public function rptsummaryExchangeAction()
 {
     // Get Session User
     $user_id = -1;
     $from_date = date('Y-m-d');
     $to_date = date('Y-m-d');
     if ($this->getRequest()->isPost()) {
         $search = $this->getRequest()->getPost();
         $user_id = $search['user_id'];
         $from_date = $search['from_date'];
         $to_date = $search['to_date'];
     } else {
         $search = array('from_date' => $from_date, 'to_date' => $to_date, 'user_id' => -1);
     }
     $usr_mod = new Application_Model_DbTable_DbUsers();
     $this->view->users = $usr_mod->getUserListSelect();
     $this->view->user_id = $user_id;
     $this->view->from_date = $from_date;
     $this->view->to_date = $to_date;
     // For view
     $db = new Application_Model_DbTable_DbExchange();
     $rs = $db->getAllExchangeList($search);
     $this->view->rs_tran = $rs;
     $db_exc = new Application_Model_DbTable_DbExchange();
     $trans = $db_exc->getDataAll($user_id, $from_date, $to_date);
     if (empty($rs)) {
         $trans = array('err' => 1, 'msg' => 'មិន​ទាន់​មាន​ទន្និន័យ​នូវ​ឡើយ​ទេ!');
     }
     $this->view->tranlist = $trans;
 }
Пример #2
0
 public function exchangeAction()
 {
     // action body
     //user name for report
     $session_user = new Zend_Session_Namespace('auth');
     $this->view->user_name = $session_user->last_name . ' ' . $session_user->first_name;
     $db_keycode = new Application_Model_DbTable_DbKeycode();
     $this->view->keycode = $db_keycode->getKeyCodeMiniInv();
     $cur = new Application_Model_DbTable_DbCurrencies();
     $currency = $cur->getCurrencyList();
     $this->view->currency = $this->_helpfilteroption($currency);
     $this->view->inv_no = Application_Model_GlobalClass::getInvoiceNo();
     if ($this->getRequest()->isPost()) {
         $formdata = $this->getRequest()->getPost();
         $db_exc = new Application_Model_DbTable_DbExchange();
         try {
             $id = $db_exc->save($formdata);
             Application_Form_FrmMessage::Sucessfull('ការ​បញ្ចូល​​ជោគ​ជ័យ', self::REDIRECT_URL . '/index/add');
         } catch (Exception $e) {
             $this->view->msg = 'ការ​បញ្ចូល​មិន​ជោគ​ជ័យ';
         }
     }
 }