Example #1
0
 public function actionView_user()
 {
     $user = new User();
     /*$user->find()->where(['vk_id' => Cookie::get('vk_id')])->one();*/
     $viewUser = $user->find()->where(['id' => $_GET['id']])->one();
     $region = new GeobaseRegion();
     $city = new GeobaseCity();
     $regionUser = $region->find()->where(['id' => $viewUser['region_id']])->one();
     $cytiUser = $city->find()->where(['id' => $user->city_id])->one();
     $this->app->parser->render('view_user', ['viewUser' => $viewUser, 'regionUser' => $regionUser, 'cityUser' => $cytiUser], true);
 }
Example #2
0
 public function actionMy()
 {
     $vk_id = Cookie::get('vk_id');
     $user = new User();
     $user->find()->where(['vk_id' => $vk_id])->one();
     $user->status = $_GET['status'] == 1 ? 2 : 1;
     $user->save();
     $region = new GeobaseRegion();
     $city = new GeobaseCity();
     $regionAll = $region->find()->orderBy('name', 'ASC')->all();
     $this->app->parser->render('profile', ['user' => $user, 'regionAll' => $regionAll]);
 }
Example #3
0
 public function actionMy()
 {
     $vk_id = Cookie::get('vk_id');
     $user = new User();
     $user->find()->where(['vk_id' => $vk_id])->one();
     /*$user->status = ($_GET['status'] == 1) ? 2 : 1;
       $user->save();*/
     $region = new GeobaseRegion();
     $regionAll = $region->find()->orderBy('name', 'ASC')->all();
     $services = new Services();
     $serv = $services->find()->all();
     $usServ = new UserServices();
     $usServAll = $usServ->find()->where(['user_id' => $user->id])->all();
     $usServAllArr = [];
     foreach ($usServAll as $us) {
         $usServAllArr[] = $us['service_id'];
     }
     $this->app->parser->render('profile', ['user' => $user, 'regionAll' => $regionAll, 'services' => $serv, 'usServ' => $usServ, 'selectServ' => $usServAllArr]);
 }
Example #4
0
 public function actionIndex()
 {
     $region = new GeobaseRegion();
     $city = new GeobaseCity();
     $this->app->parser->render('index', ['region' => $region->find()->orderBy('name', 'ASC')->all(), 'city' => $city->find()->orderBy('name', 'ASC')->all()]);
 }