public function actionConnection()
 {
     $searchModel = new UserSearch();
     $dataProvider = $searchModel->searchUserConnection(Yii::$app->request->queryParams);
     $model = new ActivityHistory();
     return $this->render('connection', ['dataProvider' => $dataProvider]);
 }
 /**
  * Выводиим все записи.
  * @return mixed
  */
 public function actionIndex()
 {
     $searchModel = new UserSearch();
     $dataProvider = $searchModel->search(Yii::$app->request->get());
     $roleArray = User::getRoleArray();
     $statusArray = User::getStatusArray();
     return $this->render('index', ['dataProvider' => $dataProvider, 'searchModel' => $searchModel, 'roleArray' => $roleArray, 'statusArray' => $statusArray]);
 }
 /**
  * Lists all User models.
  * @return mixed
  */
 public function actionIndex()
 {
     $searchModel = new UserSearch();
     $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
     return $this->render('index', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]);
 }
 /**
  * Creates a new Pay model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  * @param integer $user_id
  * @return mixed
  */
 public function actionCreate($user_id = false)
 {
     if ($user_id) {
         $profile = Profile::findOne(['user_id' => $user_id]);
         if (!$profile) {
             throw new HttpException(404);
         }
         $model = new Pay();
         $model->setScenario('pay-create');
         $model->maxBonusBalance = $profile->bonus_balance;
         $tickets = SeasonTicket::getTicketArray();
         //ajax validation
         if (Yii::$app->request->isAjax && $model->load(Yii::$app->request->post())) {
             Yii::$app->response->format = Response::FORMAT_JSON;
             return ActiveForm::validate($model);
         }
         if ($model->load(Yii::$app->request->post()) && $model->save()) {
             return $this->redirect(['view', 'id' => $model->id]);
         } else {
             $groups = Group::getGroupArray();
             return $this->render('create', ['model' => $model, 'profile' => $profile, 'tickets' => $tickets, 'groups' => $groups]);
         }
     } else {
         $searchModel = new UserSearch();
         $dataProvider = $searchModel->search(Yii::$app->request->get());
         return $this->render('listusers', ['dataProvider' => $dataProvider, 'searchModel' => $searchModel]);
     }
 }