예제 #1
0
 public function actionView($id = 200)
 {
     $transactions = new Transactions('search');
     $transactions->unsetAttributes();
     $transactions->num = $id;
     $this->render('index', array('model' => $transactions));
 }
예제 #2
0
 private function reach($type, $yaer)
 {
     $cheques = new Transactions('search');
     $cheques->unsetAttributes();
     $sums = array();
     for ($x = 1; $x <= 12; $x++) {
         if ($x <= 9) {
             $a = "0{$x}";
         } else {
             $a = $x;
         }
         $last = 31;
         while (!checkdate($x, $last, date("Y"))) {
             $last--;
         }
         $result = $this->sum($cheques, $type, $yaer . "-{$a}-01" . " 00:00:00", $yaer . "-{$a}-{$last}" . " 23:59:59");
         if ($result == 0) {
             array_push($sums, "0");
         } else {
             if ($type == 2) {
                 $result = $result * -1;
             }
             array_push($sums, round($result));
         }
     }
     return $sums;
 }
예제 #3
0
 public function search($id)
 {
     //echo $id . uniqid();
     $transactions = new Transactions('search');
     $transactions->unsetAttributes();
     $transactions->account_id = $id;
     $transactions->from_date = $this->from_date;
     $transactions->to_date = $this->to_date;
     return $transactions->search();
 }
예제 #4
0
 public function actionTransaction($id = 200)
 {
     $model = new Transactions('search');
     $model->unsetAttributes();
     if (isset($_POST['Transactions'])) {
         $model->attributes = $_POST['Transactions'];
     }
     $model->account_id = $id;
     $this->render('transaction', array('model' => $model, 'account' => $this->loadModel($id)));
 }
예제 #5
0
 public function actionIndex($user_id = NULL)
 {
     Yii::import('application.modules.deposit.extensions.Deposit.Deposit');
     $model = new Transactions('search');
     $model->unsetAttributes();
     if (isset($_GET['Transactions'])) {
         $model->setAttributes($_GET['Transactions']);
     }
     $dataProvider = $model->search();
     $this->render('//transactions/index', array('dataProvider' => $dataProvider, 'model' => $model, 'aggregatorsList' => Deposit::getAggregatorsList()));
 }
예제 #6
0
 /**
  * Просмотр транзакций юзера
  *
  * @param int $user_id
  */
 public function actionTransactionHistory($user_id)
 {
     Yii::import('application.modules.deposit.extensions.Deposit.Deposit');
     $model = new Transactions('search');
     $model->unsetAttributes();
     if (isset($_GET['Transactions'])) {
         $model->setAttributes($_GET['Transactions']);
     }
     $dataProvider = $model->search();
     $dataProvider->criteria->mergeWith(array('condition' => 't.user_id = :user_id', 'params' => array('user_id' => $user_id)));
     $this->render('//users/transaction-history', array('user' => Users::model()->findByPk($user_id), 'model' => $model, 'dataProvider' => $dataProvider, 'aggregatorsList' => Deposit::getAggregatorsList()));
 }
예제 #7
0
 public function actionIntmatchajax()
 {
     $in = new Transactions('search');
     $out = new Transactions('search');
     $in->unsetAttributes();
     $out->unsetAttributes();
     if (isset($_POST['FormIntmatch'])) {
         $in->attributes = $_POST['FormIntmatch'];
         $out->attributes = $_POST['FormIntmatch'];
     }
     $this->renderPartial('intmatchajax', array('in' => $in, 'out' => $out));
 }
예제 #8
0
 public function actionJournal()
 {
     $model = new Transactions('search');
     $model->unsetAttributes();
     $vl = 'transactions-grid';
     //echo Yii::app()->request->isAjaxRequest;
     //Yii::app()->end();
     if (isset($_POST['Transactions'])) {
         $model->attributes = $_POST['Transactions'];
     }
     if (Yii::app()->request->isAjaxRequest || isset($_POST['ajax']) && $_POST['ajax'] === $vl) {
         // Render partial file created in Step 1
         $this->renderPartial('journal', array('model' => $model));
         Yii::app()->end();
     }
     $this->render('journal', array('model' => $model));
 }
예제 #9
0
 public function actionExtmatchajax()
 {
     $model = new Bankbook('search');
     $trans = new Transactions('search');
     $model->unsetAttributes();
     $trans->unsetAttributes();
     //$model->account_id=$account_id;
     if (isset($_POST['FormExtmatch'])) {
         $model->attributes = $_POST['FormExtmatch'];
         $trans->attributes = $_POST['FormExtmatch'];
     }
     $model->extCorrelation = 0;
     $trans->extCorrelation = 0;
     $this->renderPartial('extmatchajax', array('model' => $model, 'trans' => $trans));
 }