public function billingAction() { $this->_checkAuth(); $modelUserFinance = new Kutu_Core_Orm_Table_UserFinance(); $rowset = $modelUserFinance->getUserFinance($this->_user->kopel); $this->view->rowset = $rowset; $modelOrder = new Kutu_Core_Orm_Table_Order(); $outstandingAmount = $modelOrder->outstandingUserAmout($this->_userFinanceInfo->userId); $this->view->outstandingAmount = $outstandingAmount; if ($this->_request->isPost()) { $data['taxNumber'] = $this->_request->getParam('taxNumber'); $data['taxCompany'] = $this->_request->getParam('taxCompany'); $data['taxAddress'] = $this->_request->getParam('taxAddress'); $data['taxCity'] = $this->_request->getParam('taxCity'); $data['taxProvince'] = $this->_request->getParam('taxProvince'); $data['taxZip'] = $this->_request->getParam('taxZip'); $data['taxPhone'] = $this->_request->getParam('taxPhone'); $data['taxFax'] = $this->_request->getParam('taxFax'); $data['taxCountryId'] = $this->_request->getParam('taxCountryId'); $where = "userId = '" . $this->_user->kopel . "'"; $userFinance = new Kutu_Core_Orm_Table_UserFinance(); $userFinance->update($data, $where); $this->_helper->redirector('bilupdsuc'); } }
public function billingAction() { $this->_checkAuth(); $userFinance = new Kutu_Core_Orm_Table_UserFinance(); $userId = @$this->_userInfo->userId; $rowset = $userFinance->getUserFinance($userId); /*echo '<pre>'; print_r($rowset); echo '</pre>';*/ $tblOrder = new Kutu_Core_Orm_Table_Order(); //table kutuOrder //select previous transaction that are postpaid based on userid $outstandingAmount = @$tblOrder->outstandingUserAmout($this->_userInfo->userId); $this->view->rowset = $rowset; $this->view->outstandingAmount = $outstandingAmount; //print_r($this->_request->getParams()); if ($this->_request->isPost('save')) { $data['taxNumber'] = $this->_request->getParam('taxNumber'); $data['taxCompany'] = $this->_request->getParam('taxCompany'); $data['taxAddress'] = $this->_request->getParam('taxAddress'); $data['taxCity'] = $this->_request->getParam('taxCity'); $data['taxProvince'] = $this->_request->getParam('taxProvince'); $data['taxZip'] = $this->_request->getParam('taxZip'); $data['taxCountryId'] = $this->_request->getParam('taxCountryId'); $where = "userId = '" . $userId . "'"; $userFinance->update($data, $where); $this->_helper->redirector('bilupdsuc'); } else { //echo 'falset'; } }
public function postpaidaddAction() { $act = $this->_request->get('act'); $this->view->action = $act; if ($act == 'select') { $tblUserFinance = new Kutu_Core_Orm_Table_UserFinance(); $userList = $tblUserFinance->getUser($this->_request->getParam('username')); $this->view->userList = $userList; $this->view->Query = $this->_request->getParam('username'); $lmt = $this->_request->getParam('creditLimit'); if (empty($lmt)) { $limit = 'unlimited'; } else { $limit = $this->_request->getParam('creditLimit'); } $this->view->creditLimit = $limit; } elseif ($act == 'conf') { $id = $this->_request->getParam('id'); $CL = $this->_request->getParam('CL'); $tblUserFinance = new Kutu_Core_Orm_Table_UserFinance(); $rowset = $tblUserFinance->getUserFinance($id); $this->view->rowset = $rowset; $this->view->CL = $CL; //print_r($this->_request->getParams()); } elseif ($act == 'done') { $tblUserFinance = new Kutu_Core_Orm_Table_UserFinance(); if ($this->_request->getParam('CL') == 'unlimited') { $data['creditLimit'] = 0; } else { $data['creditLimit'] = $this->_request->getParam('CL'); } $data['isPostpaid'] = 1; $userId = $this->_request->getParam('id'); $tblUserFinance->update($data, "userId = '" . $userId . "'"); } }