Пример #1
0
 /**
  * Lists all User models.
  * @return mixed
  */
 public function actionIndex()
 {
     $searchModel = new UserSearch();
     $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
     Yii::$app->appLog->writeLog('View all system users');
     return $this->render('index', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]);
 }
Пример #2
0
 /**
  * Lists all User models.
  * @return mixed
  */
 public function actionIndex()
 {
     $searchModel = new UserSearch();
     $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
     //$user = $this->findModel(Yii::$app->user->id);
     return $this->render('index', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]);
 }
 /**
  * Lists all User models.
  * @return mixed
  */
 public function actionIndex()
 {
     Url::remember(Yii::$app->getRequest()->getUrl());
     $searchModel = new UserSearch();
     $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
     return $this->render('index', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]);
 }
Пример #4
0
 /**
  * Lists all User models.
  * @return mixed
  */
 public function actionIndex()
 {
     $searchModel = new UserSearch();
     $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
     $dataProvider->pagination->pageSize = 20;
     return $this->render('index', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]);
 }
Пример #5
0
 public function actionIndex()
 {
     $searchModel = new UserSearch();
     $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
     $uid = Yii::$app->user->identity->user_id;
     $accessUpdate = Access2::find()->where(['user_id' => $uid, 'sub_module_id' => 24])->one();
     return $this->render('index', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider, 'accessUpdate' => $accessUpdate]);
 }
Пример #6
0
 public function actionAdminIndex()
 {
     $searchModel = new UserSearch();
     $filter = Yii::$app->request->queryParams;
     //setup type filter
     $filter['UserSearch']['type'] = 'admin';
     $dataProvider = $searchModel->search($filter);
     return $this->render('index' . ucfirst($filter['UserSearch']['type']), ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]);
 }
 /**
  * Lists all User models.
  * @return mixed
  */
 public function actionIndex()
 {
     $query = Yii::$app->request->queryParams;
     $searchModel = new UserSearch();
     if (!Yii::$app->user->can('admin')) {
         $searchModel->id = Yii::$app->user->identity->id;
     }
     $dataProvider = $searchModel->search($query);
     return $this->render('index', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]);
 }
Пример #8
0
 public function actionUsers()
 {
     if (Yii::$app->user->can('viewAdminPanelUsers')) {
         $userSearch = new UserSearch();
         $userProvider = $userSearch->search(Yii::$app->request->queryParams);
         return $this->render('users', ['userSearch' => $userSearch, 'userProvider' => $userProvider]);
     } else {
         throw new ForbiddenHttpException();
     }
 }
Пример #9
0
 /**
  * Lists all User models.
  * @return mixed
  */
 public function actionIndex()
 {
     if (Yii::$app->user->can('user')) {
         $searchModel = new UserSearch();
         $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
         return $this->render('index', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]);
     } else {
         Yii::$app->session->setFlash('error', 'Нет доступа!');
         $this->redirect('/');
     }
 }
Пример #10
0
 /**
  * Lists all User models.
  * @return mixed
  */
 public function actionIndex()
 {
     if (\Yii::$app->user->isGuest) {
         return $this->goHome();
     }
     $user = \Yii::$app->user->identity;
     if (!$user->admin) {
         return $this->actionView($user->getId());
     }
     $searchModel = new UserSearch();
     $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
     return $this->render('index', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]);
 }
Пример #11
0
 /**
  * Lists all User models.
  * @return mixed
  */
 public function actionIndex()
 {
     $searchModel = new UserSearch();
     $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
     /*
                     $_columns = ['username', 'full_name', 'name', 'email'];
                     $dataProvider = (new Query())->
                     select($_columns)->
                     from(User::tableName())->
                     join('JOIN', Country::tableName(),'country_id = country.id')->
                     all();*/
     return $this->render('new-index', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]);
 }
Пример #12
0
 /**
  * Lists all User models.
  * @return mixed
  */
 public function actionIndex()
 {
     $searchModel = new UserSearch();
     $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
     //$dataProvider->query->parent_id($id);
     return $this->render('index', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]);
     /*$dataProvider = new ActiveDataProvider([
                 'query' => User::find(),
     
             ]);
     
             return $this->render('index', [
                 'dataProvider' => $dataProvider,
             ]);*/
 }
Пример #13
0
 /**
  * Lists all User models.
  *
  * @return string
  */
 public function actionIndex()
 {
     /**
      * How many users we want to display per page.
      * @var int
      */
     $pageSize = 11;
     /**
      * Only theCreator role can see all users.
      * Lower roles will not be able to see theCreator @see: search(). 
      * @var boolean
      */
     $theCreator = Yii::$app->user->can('theCreator') ? true : false;
     $searchModel = new UserSearch();
     $dataProvider = $searchModel->search(Yii::$app->request->queryParams, $pageSize, $theCreator);
     return $this->render('index', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]);
 }
Пример #14
0
 /**
  * Lists all User models.
  * @return mixed
  */
 public function actionIndex()
 {
     $searchModel = new UserSearch();
     $dataProvider = $searchModel->search(Yii::$app->request->getQueryParams());
     return $this->render('index', ['dataProvider' => $dataProvider, 'searchModel' => $searchModel]);
 }
 public function actionPrint()
 {
     $searchModel = new UserSearch();
     $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
     $this->render('usuarios', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]);
     $pdf = new Pdf(['mode' => Pdf::MODE_CORE, 'format' => Pdf::FORMAT_A4, 'orientation' => Pdf::ORIENT_PORTRAIT, 'destination' => Pdf::DEST_BROWSER, 'cssFile' => '@vendor/kartik-v/yii2-mpdf/assets/kv-mpdf-bootstrap.min.css', 'cssInline' => '* {font-size:14px}', 'content' => $this->renderPartial('usuarios', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]), 'options' => ['title' => 'Listado de Usuarios', 'subject' => 'Generating PDF files via yii2-mpdf extension has never been easy'], 'methods' => ['SetHeader' => ['Generado el: ' . date("d-M-y")], 'SetFooter' => ['|Page {PAGENO}|']]]);
     return $pdf->render();
 }
Пример #16
0
 /**
  * Lists all User models.
  * @return mixed
  */
 public function actionAdmin()
 {
     $searchModel = new UserSearch();
     $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
     return $this->render('admin', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]);
 }
Пример #17
0
 /**
  * вывод списка магазинов
  * @return type
  */
 public function actionShopList()
 {
     $searchModel = new UserSearch(['role' => User::ROLE_SHOP]);
     $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
     $dataProvider->sort->attributes['url'] = ['asc' => ['profile.url' => SORT_ASC], 'desc' => ['profile.url' => SORT_DESC]];
     $dataProvider->sort->attributes['recommender_bonus'] = ['asc' => ['profile.recommender_bonus' => SORT_ASC], 'desc' => ['profile.recommender_bonus' => SORT_DESC]];
     $dataProvider->sort->attributes['buyer_bonus'] = ['asc' => ['profile.buyer_bonus' => SORT_ASC], 'desc' => ['profile.buyer_bonus' => SORT_DESC]];
     return $this->render('shopList', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]);
 }
Пример #18
0
 public function actionExcel()
 {
     $searchModel = new UserSearch();
     $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
     $modelAttribute = new User();
     $not = Util::excelNot();
     foreach ($modelAttribute->attributeLabels() as $k => $v) {
         if (!in_array($k, $not)) {
             $attributes[$k] = $v;
         }
     }
     $models = $dataProvider->getModels();
     $objReader = \PHPExcel_IOFactory::createReader('Excel5');
     $objPHPExcel = $objReader->load(Yii::getAlias(Util::templateExcel()));
     $excelChar = Util::excelChar();
     return $this->render('_excel', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider, 'attributes' => $attributes, 'models' => $models, 'objReader' => $objReader, 'objPHPExcel' => $objPHPExcel, 'excelChar' => $excelChar]);
 }
Пример #19
0
 /**
  * List of possible candidates.
  * @param integer $electionId
  * @return mixed
  */
 public function actionAddCandidateList($electionId)
 {
     $model = $this->findModel($electionId);
     $searchModel = new UserSearch();
     $users = $model->users;
     foreach ($users as $user) {
         $userIds[] = $user->id;
     }
     $searchModel->addCandidateFlag = true;
     $searchModel->ids = $userIds;
     return $this->render('add-candidate-list', ['model' => $model, 'searchModel' => $searchModel, 'electionId' => $electionId, 'dataProvider' => $searchModel->search(Yii::$app->request->queryParams)]);
 }
Пример #20
0
 public function actionIndex()
 {
     $userSearch = new UserSearch();
     $activeDataProvider = $userSearch->search(Yii::$app->request->get());
     return $this->render("index", ["dataProviders" => ["userSearch" => $userSearch, "activeDataProvider" => $activeDataProvider]]);
 }