コード例 #1
0
ファイル: StoreController.php プロジェクト: psykomo/kutump
 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 . "'");
     }
 }