Example #1
0
 public function tranxbyusersubmit2Action()
 {
     $array_of_params = $this->_request->getParams();
     $this->view->param = $array_of_params;
     $tReport = new TReport();
     if (isset($array_of_params['ajax']) && $array_of_params['ajax'] == 1) {
         $tranxs = $tReport->getUserTransStatus($array_of_params['tranxid'], $array_of_params['localtime']);
         $this->view->tranxs = $tranxs;
         echo $this->view->render('index/app_tranxbyuser_detail.phtml');
         exit;
     }
     if (!isset($array_of_params['fromdate']) || $array_of_params['fromdate'] == '' || !isset($array_of_params['todate']) || $array_of_params['todate'] == '') {
     } else {
         $fromdate = $array_of_params['fromdate'] . ' 00:00:00';
         $todate = $array_of_params['todate'] . ' 23:59:59';
         if (isset($array_of_params['tranxid']) && $array_of_params['tranxid'] != '') {
             try {
                 $reporter = new Reporter();
                 $tranxs = $reporter->getDetailTranx($array_of_params['tranxid'], $fromdate, $todate);
                 $this->view->tranxs = array($tranxs);
             } catch (Exception $e) {
                 var_dump($e);
                 die;
             }
         } else {
             if (isset($array_of_params['username']) && $array_of_params['username'] != '') {
                 try {
                     //check page paramater
                     if (!isset($array_of_params['page']) || $array_of_params['page'] == '' || intval($array_of_params['page']) < 1) {
                         $array_of_params['page'] = 1;
                     }
                     $this->view->param = $array_of_params;
                     $count = 100;
                     $index = intval($array_of_params['page']) * $count - $count;
                     $reporter = new Reporter();
                     $tranxs = $reporter->getTransByUser($this->getIDByName($array_of_params['username']), $array_of_params['username'], $fromdate, $todate, $index, $count);
                     $this->view->tranxs = $tranxs;
                 } catch (Exception $e) {
                     var_dump($e);
                     die;
                 }
             }
         }
     }
     $this->view->frmSearch = $this->view->render('index/app_tranxbyuser_db2.phtml');
     $this->view->container = $this->view->render('index/index.phtml');
 }