Your IP : 216.73.216.124


Current Path : /var/www/html/affiliate/backend/controllers/
Upload File :
Current File : /var/www/html/affiliate/backend/controllers/ReportController.php

<?php

namespace backend\controllers;

use Yii;
use yii\web\Controller;
use yii\web\NotFoundHttpException;
use yii\filters\VerbFilter;
use yii\web\UploadedFile;
use yii\helpers\Url;
use yii\data\ActiveDataProvider;
use yii\db\Query;
use backend\modules\payment\models\PaymentSearch;

class ReportController extends Controller {

    public function behaviors() {
        return [
            'verbs' => [
                'class' => VerbFilter::className(),
                'actions' => [
                    'delete' => ['POST'],
                ],
            ],
        ];
    }

    public function actionIndex() {
        return $this->render('index');
    }

    public function actionReport1() {
        $searchModel = new PaymentSearch();
        $dataProvider = $searchModel->searchreport(Yii::$app->request->queryParams);
        return $this->render('report1', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider,]);
    }

    public function actionReport2($start_date = '', $end_date = '') {

        if (empty($start_date))
            $start_date = date('Y-m-01');

        if (empty($end_date))
            $end_date = date('Y-m-d');

        $searchModel = new PaymentSearch();
        $searchModel->start_date = $start_date;
        $searchModel->end_date = $end_date;
        $dataProvider = $searchModel->searchreport2(Yii::$app->request->queryParams);
        return $this->render('report2', [
                    'searchModel' => $searchModel,
                    'dataProvider' => $dataProvider,
                    'start_date' => $start_date,
                    'end_date' => $end_date,
        ]);
    }

    public function actionReport3() {
        $searchModel = new PaymentSearch();
        $dataProvider = $searchModel->searchreport3(Yii::$app->request->queryParams);
        return $this->render('report3', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider,]);
    }

    public function actionReport4() {
        return $this->render('report4');
    }
}