コード例 #1
0
 /**
  * Lists all City models.
  * @return mixed
  */
 public function actionIndex()
 {
     //$params=Yii::$app->request->get();
     $params = $_REQUEST;
     $filter = array();
     $sort = "";
     $page = 1;
     $limit = 5;
     if (isset($params['page'])) {
         $page = $params['page'];
         unset($params['page']);
     }
     if (isset($params['limit'])) {
         $limit = $params['limit'];
         unset($params['limit']);
     }
     $offset = $limit * ($page - 1);
     if (isset($params['filter'])) {
         $filter = (array) json_decode($params['filter']);
     }
     if (isset($params['sort'])) {
         $sort = $params['sort'];
     }
     $models = City::find()->offset($offset)->limit($limit)->where($filter)->orderBy($sort)->all();
     $totalItems = City::find()->count();
     $data = array();
     foreach ($models as $m) {
         $data[] = $m->attributes;
     }
     $this->getHeader(200);
     echo json_encode(array('status' => 1, 'data' => $data, 'totalItems' => $totalItems), JSON_PRETTY_PRINT);
 }
コード例 #2
0
 public function actionDeliveryCost($code)
 {
     //check the api for the returned data
     //check country
     $city = City::find()->where('Name="' . $code . '"')->one();
     //var_dump($city);
     if ($city->CountryCode == 'EGY') {
         //calculate weight
         $sum = 0;
         foreach (Shopcart::goods() as $good) {
             $sum += $good->item->product_weight;
         }
         // return "the new cost--".$city->Name .$city->CountryCode;
         //$city->CountryCode;
         $cost = $this->GetCost($city->Name, $sum);
         if ($cost == '' or $cost == 0) {
             return Setting::get('deliver_cost');
         } else {
             return $cost;
         }
     } else {
         return Setting::get('deliver_cost');
         //.'-99'. $city->CountryCode;
     }
 }
コード例 #3
0
 public function actionIndex($mid = '', $f = 0)
 {
     $user = User::findIdentity(Yii::$app->user->id);
     $regFrm = new RegisterForm();
     $rstFrm = new RestorePswForm();
     $spOffs = new SpecialOffer();
     $spOffs = $spOffs->getAllSpecialOffers();
     if ($f) {
         $logFrm = new LoginForm(['scenario' => LoginForm::SCENARIO_LOGIN_CAPTCHA]);
     } else {
         $logFrm = new LoginForm(['scenario' => LoginForm::SCENARIO_LOGIN]);
     }
     $city = City::find()->all();
     $address = new Address();
     $distr = $address->getDistrict();
     $category = Category::find()->all();
     $brand = Brand::find()->all();
     $msg = '';
     switch ($mid) {
         case 1:
             $msg = Common::M_EMAIL_SEND;
             break;
         case 2:
             $msg = Common::M_PSW_EMAIL_SEND;
             break;
         case 3:
             $msg = Common::M_PSW_RESTORE_SUCCESS;
             break;
     }
     return $this->render('index', ['msg' => $msg, 'user' => $user, 'spOffs' => $spOffs, 'regFrm' => $regFrm, 'logFrm' => $logFrm, 'rstFrm' => $rstFrm, 'city' => $city, 'distr' => $distr, 'category' => $category, 'brand' => $brand]);
 }
コード例 #4
0
ファイル: DependentController.php プロジェクト: EduSec/EduSec
 public function actionGetorgcity($id)
 {
     $rows = \app\models\City::find()->where(['state_id' => $id, 'is_status' => 0])->ALL();
     echo Html::tag('option', Html::encode(Yii::t('app', '--- Select City ---')), ['value' => '']);
     foreach ($rows as $row) {
         echo Html::tag('option', Html::encode($row->city_name), ['value' => $row->city_id]);
     }
 }
コード例 #5
0
 /**
  * Lists all Locale models.
  * @return mixed
  */
 public function actionIndex()
 {
     // $searchModel = new LocaleSearch();
     // $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
     $this->layout = 'main2';
     $model = City::find()->all();
     return $this->render('index', ['model' => $model]);
 }
コード例 #6
0
ファイル: SiteController.php プロジェクト: islamham/125ent
 public function actionGetRegionCities($region_id)
 {
     $cities = \app\models\City::find()->where(['region_id' => $region_id])->all();
     $content = '';
     foreach ($cities as $city) {
         $content .= '<option value="' . $city->id . '">' . $city->title . '</option>';
     }
     return $content;
 }
コード例 #7
0
ファイル: HomeController.php プロジェクト: vuongabc92/ot
 /**
  * @todo Save location by session
  *
  * @param \Illuminate\Http\Request $request
  * @param int                      $id City id
  *
  * @return Redirect
  */
 public function selectLocation($id)
 {
     $id = (int) $id;
     if (!is_null(City::find($id))) {
         Session::put(_const('SESSION_LOCATION'), $id);
         Session::save();
     }
     return redirect(route('front_home'));
 }
コード例 #8
0
ファイル: CitySearch.php プロジェクト: Konsul117/phonebook
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = City::find();
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     if (!($this->load($params) && $this->validate())) {
         return $dataProvider;
     }
     $query->andFilterWhere(['id' => $this->id, 'parent_id' => $this->parent_id, 'region_id' => $this->region_id, 'region_global_id' => $this->region_global_id, 'gmt' => $this->gmt, 'sort_id' => $this->sort_id, 'old_region_id' => $this->old_region_id, 'is_deleted' => $this->is_deleted, 'is_published' => $this->is_published, 'timezone' => $this->timezone]);
     $query->andFilterWhere(['like', 'id_1c', $this->id_1c])->andFilterWhere(['like', 'code', $this->code])->andFilterWhere(['like', 'region_1c', $this->region_1c])->andFilterWhere(['like', 'title', $this->title])->andFilterWhere(['like', 'title_1c', $this->title_1c])->andFilterWhere(['like', 'geoip_city', $this->geoip_city])->andFilterWhere(['like', 'path', $this->path])->andFilterWhere(['like', 'alternative_path', $this->alternative_path])->andFilterWhere(['like', 'old_path', $this->old_path])->andFilterWhere(['like', 'service_center', $this->service_center])->andFilterWhere(['like', 'manufacturer_service_center', $this->manufacturer_service_center])->andFilterWhere(['like', 'yandex_confirm_code', $this->yandex_confirm_code])->andFilterWhere(['like', 'yandex_confirm_code_tp', $this->yandex_confirm_code_tp])->andFilterWhere(['like', 'yandex_confirm_code_bazar', $this->yandex_confirm_code_bazar]);
     return $dataProvider;
 }
コード例 #9
0
ファイル: CitySearch.php プロジェクト: tejrajs/yii2RestAPI
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = City::find();
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     if (!($this->load($params) && $this->validate())) {
         return $dataProvider;
     }
     $query->andFilterWhere(['id' => $this->id, 'createdAt' => $this->createdAt, 'updatedAt' => $this->updatedAt]);
     $query->andFilterWhere(['like', 'name', $this->name]);
     return $dataProvider;
 }
コード例 #10
0
 public function actionEmp_p_city($id)
 {
     $rows = \app\models\City::find()->where(['city_state_id' => $id, 'is_status' => 0])->all();
     echo "<option value=''>---Select City---</option>";
     if (count($rows) > 0) {
         foreach ($rows as $row) {
             echo "<option value='{$row->city_id}'>{$row->city_name}</option>";
         }
     } else {
         echo "";
     }
 }
コード例 #11
0
ファイル: KhlController.php プロジェクト: roman1970/lis
 public function actionFillTeams()
 {
     foreach ($this->arrOfTeams as $team => $city) {
         $model = new Khlteams();
         $model->name = $team;
         $city_id = City::find()->where("name like('" . $city . "')")->one()->id;
         if (!$city_id) {
             $city_id = 1513;
         }
         $model->city_id = $city_id;
         $model->save(false);
     }
 }
コード例 #12
0
ファイル: CitySearch.php プロジェクト: damisadam/FMS
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = City::find();
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     $this->load($params);
     if (!$this->validate()) {
         // uncomment the following line if you do not want to return any records when validation fails
         // $query->where('0=1');
         return $dataProvider;
     }
     $query->andFilterWhere(['id' => $this->id, 'country_id' => $this->country_id, 'state_id' => $this->state_id, 'created_by' => $this->created_by, 'modified_by' => $this->modified_by, 'created_date' => $this->created_date, 'modified_date' => $this->modified_date]);
     $query->andFilterWhere(['like', 'name', $this->name])->andFilterWhere(['like', 'status', $this->status]);
     return $dataProvider;
 }
コード例 #13
0
ファイル: CitySearch.php プロジェクト: unix-admin/profitday
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = City::find();
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     $this->load($params);
     if (!$this->validate()) {
         // uncomment the following line if you do not want to return any records when validation fails
         // $query->where('0=1');
         return $dataProvider;
     }
     $query->andFilterWhere(['id' => $this->id, 'have_event' => $this->have_event]);
     $query->andFilterWhere(['like', 'title_uk', $this->title_uk])->andFilterWhere(['like', 'title_ru', $this->title_ru])->andFilterWhere(['like', 'title_en', $this->title_en]);
     return $dataProvider;
 }
コード例 #14
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = City::find();
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     $this->load($params);
     if (!$this->validate()) {
         // uncomment the following line if you do not want to any records when validation fails
         // $query->where('0=1');
         return $dataProvider;
     }
     $query->andFilterWhere(['id' => $this->id, 'province_id' => $this->province_id]);
     $query->andFilterWhere(['like', 'name', $this->name])->andFilterWhere(['like', 'description', $this->description])->andFilterWhere(['like', 'citycol', $this->citycol]);
     return $dataProvider;
 }
コード例 #15
0
ファイル: CitySearch.php プロジェクト: slavam/placement
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = City::find();
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     $this->load($params);
     if (!$this->validate()) {
         // uncomment the following line if you do not want to return any records when validation fails
         // $query->where('0=1');
         return $dataProvider;
     }
     $query->andFilterWhere(['id' => $this->id, 'rec_status_id' => $this->rec_status_id, 'user_id' => $this->user_id, 'dc' => $this->dc]);
     $query->andFilterWhere(['like', 'name', $this->name])->andFilterWhere(['like', 'note', $this->note]);
     return $dataProvider;
 }
コード例 #16
0
 public function create($input)
 {
     $user = new $this->model();
     $user->first_name = $input['first_name'];
     $user->user_type = $input['user_type'];
     $user->last_name = $input['last_name'];
     $user->pseudo = $input['pseudo'];
     $user->phone = $input['phone'];
     $user->email = $input['email'];
     $user->valid = '0';
     $user->temp = '0';
     $user->city()->associate(City::find($input['id_city']));
     $user->password = Hash::make($input['password']);
     return $user;
 }
コード例 #17
0
 /**
  * @todo Save location by session
  *
  * @param \Illuminate\Http\Request $request
  * @param int                      $id City id
  *
  * @return \Illuminate\Http\JsonResponse
  */
 public function ajaxSelectLocation(Request $request, $id)
 {
     //Only accept ajax request
     if ($request->ajax()) {
         $id = (int) $id;
         if (City::find($id) !== null) {
             //Start session if it wasn't started
             if (!$request->session()->isStarted()) {
                 $request->session()->start();
             }
             $request->session()->put(_const('SESSION_LOCATION'), $id);
             return pong(1, _t('saved_info'));
         }
     }
 }
コード例 #18
0
ファイル: CitySearch.php プロジェクト: aoopvn/EduSec4.0.0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = City::find()->where(['is_status' => 0]);
     $dataProvider = new ActiveDataProvider(['query' => $query, 'sort' => ['defaultOrder' => ['city_id' => SORT_DESC]]]);
     $this->load($params);
     if (!$this->validate()) {
         // uncomment the following line if you do not want to any records when validation fails
         // $query->where('0=1');
         return $dataProvider;
     }
     $query->andFilterWhere(['city_id' => $this->city_id, 'city_state_id' => $this->city_state_id, 'city_country_id' => $this->city_country_id, 'created_at' => $this->created_at, 'created_by' => $this->created_by, 'updated_at' => $this->updated_at, 'updated_by' => $this->updated_by, 'is_status' => $this->is_status]);
     $query->andFilterWhere(['like', 'city_name', $this->city_name]);
     unset($_SESSION['exportData']);
     $_SESSION['exportData'] = $dataProvider;
     return $dataProvider;
 }
コード例 #19
0
 public function actionIndex()
 {
     $query = Users::find()->leftJoin('media', array('id' => 'user_id'))->where(['type' => 1, 'active' => 1]);
     $countQuery = clone $query;
     $pages = new Pagination(['totalCount' => $countQuery->count()]);
     echo $pages;
     die;
     $page = 1;
     if (isset($_REQUEST["page"])) {
         $page = intVal($_REQUEST["page"]);
     }
     $limit = 12;
     $offset = $limit * ($page - 1);
     $pageSize = ceil($countQuery->count() / $limit);
     $pages->setPageSize($pageSize);
     $models = $query->offset($offset)->limit($limit)->all();
     $city = City::find()->all();
     return $this->render('index', ['models' => $models, 'pages' => $pages, 'city' => $city]);
 }
コード例 #20
0
ファイル: CityController.php プロジェクト: study-code/yii2
 function actionIndex()
 {
     //查询城市的关联国家
     //$city = City::findOne(1);
     //$country = $city->country;
     //var_dump($country);
     //findOne 已经返回了一条数据的对象
     //$city = City::findOne(1);
     //var_dump($city);exit;
     //$addresses = $city->getAddresses()->all();
     //关联查询返回的是 yii\db\ActiveQuery 的实例,如果像特性(如类属性)那样连接关联数据,
     //返回的结果是关联查询的结果,即 yii\db\ActiveRecord 的实例, 或者是数组,或者是 null ,取决于关联关系的多样性
     //还没搞懂这是为啥?????
     //        $addresses = $city->districtAddress;
     //        var_dump($addresses);
     $addresses = City::find()->joinWith('country')->all();
     var_dump($addresses);
     return $this->render('index');
 }
コード例 #21
0
 public function actionIndex($id)
 {
     if (Yii::$app->user->isGuest) {
         return $this->redirect(Url::home());
     }
     $user = User::findOne(Yii::$app->user->id);
     if ($user->company->id != $id) {
         return $this->redirect(Url::home());
     }
     $company = Company::findOne($id);
     $shedule = Shedule::getSheduleString($company->id, $company->twenty_four_hours);
     $categories = Category::find()->all();
     $countries = Country::find()->all();
     $cInfFrm = new CompanyInfoForm();
     $cInfFrm->loadInfo($id);
     $cPasFrm = new ChangePasswordForm();
     $cEmailFrm = new ChangeEmailForm();
     $cEmailFrm->loadEmail();
     $cOptFrm = new OptionsForm();
     $cOptFrm->loadData($id);
     $cities = City::find()->asArray()->all();
     $cities = ArrayHelper::map($cities, 'name', 'name');
     return $this->render('/private-room/private-room', ['company' => $company, 'shedule' => $shedule, 'categories' => $categories, 'countries' => $countries, 'cInfFrm' => $cInfFrm, 'cPasFrm' => $cPasFrm, 'cEmailFrm' => $cEmailFrm, 'cOptFrm' => $cOptFrm, 'cities' => $cities]);
 }
コード例 #22
0
 /**
  * Get current location (city)
  *
  * @return \App\Models\City
  */
 function current_location()
 {
     $currentId = session(_const('SESSION_LOCATION'), _const('DEFAULT_LOCATION'));
     $location = \App\Models\City::find($currentId);
     return $location;
 }
コード例 #23
0
ファイル: address_info.php プロジェクト: EduSec/EduSec
	</div>
	<div class="col-xs-12 col-sm-6 col-lg-6">	
	    <?php 
echo $form->field($address, 'stu_padd_state')->dropDownList(ArrayHelper::map(\app\models\State::find()->where(['state_country_id' => $address->stu_padd_country, 'is_status' => 0])->all(), 'state_id', 'state_name'), ['prompt' => Yii::t('stu', '--- Select State ---'), 'onchange' => '
                        $.get( "' . Url::toRoute('dependent/ustud_p_city') . '", { id: $(this).val() } )
                            .done(function( data ) {
                                $( "#' . Html::getInputId($address, 'stu_padd_city') . '" ).html( data );
                            }
                        );']);
?>
	</div>
 </div>
  <div class="col-xs-12 col-sm-12 col-lg-12 no-padding">
      <div class="col-xs-12 col-sm-6 col-lg-6">	
  	  <?php 
echo $form->field($address, 'stu_padd_city')->dropDownList(ArrayHelper::map(\app\models\City::find()->where(['city_state_id' => $address->stu_padd_state, 'is_status' => 0])->all(), 'city_id', 'city_name'), ['prompt' => Yii::t('stu', '--- Select City ---')]);
?>
     </div>
      <div class="col-xs-12 col-sm-6 col-lg-6">			
	    <?php 
echo $form->field($address, 'stu_padd_pincode')->textInput(['maxlength' => 6]);
?>
      </div>
 </div>
<div class="col-xs-12 col-sm-12 col-lg-12 no-padding">
      <div class="col-xs-12 col-sm-6 col-lg-6">		
	    <?php 
echo $form->field($address, 'stu_padd_house_no')->textInput(['maxlength' => 25]);
?>
      </div>
      <div class="col-xs-12 col-sm-6 col-lg-6">		
コード例 #24
0
ファイル: main2.php プロジェクト: frankpaul142/chaide
<?php

use yii\helpers\Html;
use yii\bootstrap\Nav;
use yii\bootstrap\NavBar;
use yii\widgets\Breadcrumbs;
use app\assets\AppAsset;
use yii\web\View;
use yii\helpers\Url;
use app\models\Line;
use app\models\City;
/* @var $this \yii\web\View */
/* @var $content string */
$lines = Line::find()->where(['status' => 'ACTIVE'])->all();
$cities = City::find()->all();
$script = '$(document).ready(function() {
$("#menu-chaide").click(function(){
        $(this).toggleClass("active");
        $("#menu-mobile").toggleClass("menu-active");
        $("#general").toggleClass("general-active");
    });  
});
   (function(){ var widget_id = "QcMOZSFvGS";
var s = document.createElement("script"); s.type = "text/javascript"; s.async = true; s.src = "//code.jivosite.com/script/widget/"+widget_id; var ss = document.getElementsByTagName("script")[0]; ss.parentNode.insertBefore(s, ss);})(); ';
$this->registerJs($script, View::POS_END);
AppAsset::register($this);
$this->beginPage();
?>
<!DOCTYPE html>
<html lang="<?php 
echo Yii::$app->language;
コード例 #25
0
ファイル: index.php プロジェクト: Akelcehg/psycho
    <div class="container">
        <h2>Тренинги</h2>
        <div class="gap"></div>
        <div class="col-md-12">
            <div class="row">
                <?php 
$form = ActiveForm::begin(['action' => ['index'], 'method' => 'get', 'id' => 'event-search-form']);
?>
                <div class="col-md-3">
                    <?php 
echo $form->field($searchModel, 'type')->dropDownList(ArrayHelper::map(EventType::find()->all(), 'id', 'name'), ['prompt' => 'Любой тип тренинга'])->label(false);
?>
                </div>
                <div class="col-md-3">
                    <?php 
echo $form->field($searchModel, 'city_id')->dropDownList(ArrayHelper::map(City::find()->where(['region_id' => '10373'])->orderBy('name')->all(), 'city_id', 'name'), ['prompt' => 'В любом городе'])->label(false);
?>
                </div>
                <div class="col-md-6">
                    <!--<button type="submit" class="btn-style">Искать</button>-->
                    <?php 
echo Html::submitButton('Искать', ['class' => 'btn-style']);
?>
                </div>
                <?php 
ActiveForm::end();
?>
            </div>
        </div>
    </div>
</div>
コード例 #26
0
ファイル: form.php プロジェクト: tqsq2005/dotplant2
echo $form->field($model, 'is_active')->widget(\kartik\switchinput\SwitchInput::className());
?>
        <?php 
echo $form->field($model, 'shipping_center')->widget(\kartik\switchinput\SwitchInput::className());
?>
        <?php 
echo $form->field($model, 'issuing_center')->widget(\kartik\switchinput\SwitchInput::className());
?>
        <?php 
echo $form->field($model, 'name');
?>
        <?php 
echo $form->field($model, 'country_id')->dropDownList(ArrayHelper::map(Country::find()->all(), 'id', 'name'));
?>
        <?php 
echo $form->field($model, 'city_id')->dropDownList(ArrayHelper::map(City::find()->all(), 'id', 'name'));
?>
        <?php 
echo $form->field($model, 'address')->textarea();
?>
        <?php 
echo $form->field($model, 'description')->textarea();
?>
        <?php 
echo $form->field($model, 'map_latitude');
?>
        <?php 
echo $form->field($model, 'map_longitude');
?>
        <?php 
echo $form->field($model, 'sort_order');
コード例 #27
0
ファイル: Clubs.php プロジェクト: arsik/xfit
 public static function getCityList()
 {
     // Выбираем только те категории, у которых есть дочерние категории
     $parents = City::find()->select(['id', 'name'])->all();
     return ArrayHelper::map($parents, 'id', 'name');
 }
コード例 #28
0
echo Html::submitButton('Գեներացնել (Generate)', ['class' => 'btn btn-primary']);
?>


<?php 
ActiveForm::end();
?>

<div class="site-index" style="width: 3500px;">

    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['class' => 'yii\\grid\\ActionColumn', 'template' => '{update}{delete}', 'urlCreator' => function ($action, $model, $key, $index) {
    if ($action === 'update') {
        $arrayParams = ['MainSearch' => ['region' => $model->region]];
        $arrayParams['id'] = $model->id;
        $params = array_merge(["site/main"], $arrayParams);
        $url = Yii::$app->urlManager->createUrl($params);
        return $url;
    }
    if ($action === 'delete') {
        $arrayParams = ['MainSearch' => ['region' => $model->region], 'id' => $model->id];
        $params = array_merge(["site/delete"], $arrayParams);
        $url = Yii::$app->urlManager->createUrl($params);
        return $url;
    }
}], ['class' => 'yii\\grid\\SerialColumn'], ['attribute' => 'city', 'value' => 'city0.nameBothShort', 'filter' => Html::activeDropDownList($searchModel, 'city', ArrayHelper::map(City::find()->all(), 'id', 'nameBothShort'), ['class' => 'form-control', 'prompt' => 'Select Category'])], ['attribute' => 'type', 'value' => 'type0.nameBothShort', 'filter' => Html::activeDropDownList($searchModel, 'type', ArrayHelper::map(Type::find()->all(), 'id', 'nameBothShort'), ['class' => 'form-control', 'prompt' => 'Select Category'])], 'resident', 'children', 'employee', 'retiree', ['attribute' => 'dominant', 'value' => 'dominant0.nameBothShort', 'filter' => Html::activeDropDownList($searchModel, 'retiree', ArrayHelper::map(Dominant::find()->all(), 'id', 'nameBothShort'), ['class' => 'form-control', 'prompt' => 'Select Category'])], ['attribute' => 'mainTrashPlaces.trash_place_id', 'value' => 'trashPlaceMulti', 'filter' => Html::activeDropDownList($searchModel, 'mainTrashPlaces.trash_place_id', ArrayHelper::map(TrashPlace::find()->all(), 'id', 'nameBothShort'), ['class' => 'form-control', 'prompt' => 'Select Category']), 'contentOptions' => ['style' => 'width: ' . $width . ';']], ['attribute' => 'mainTrashMen.trash_man_id', 'value' => 'trashManMulti', 'filter' => Html::activeDropDownList($searchModel, 'mainTrashMen.trash_man_id', ArrayHelper::map(TrashMan::find()->all(), 'id', 'nameBothShort'), ['class' => 'form-control', 'prompt' => 'Select Category']), 'contentOptions' => ['style' => 'width: ' . $width . ';']], ['attribute' => 'filter_trash_out', 'value' => 'trash_out', 'filter' => Html::activeDropDownList($searchModel, 'filter_trash_out', array('1' => '1-5', '2' => '6-10', '3' => '11-20', '4' => '20+'), ['class' => 'form-control', 'prompt' => 'Select Category'])], ['attribute' => 'filter_trash_count', 'value' => 'trash_count', 'filter' => Html::activeDropDownList($searchModel, 'filter_trash_count', array('1' => '1-5', '2' => '6-10', '3' => '11-20', '4' => '20+'), ['class' => 'form-control', 'prompt' => 'Select Category'])], ['attribute' => 'filter_summer_1', 'value' => 'summer_count_1', 'filter' => Html::activeDropDownList($searchModel, 'filter_summer_1', array('1' => '1-5', '2' => '6-10', '3' => '11-20', '4' => '20+'), ['class' => 'form-control', 'prompt' => 'Select Category'])], ['attribute' => 'filter_summer_2', 'value' => 'summer_count_2', 'filter' => Html::activeDropDownList($searchModel, 'filter_summer_2', array('1' => '1-5', '2' => '6-10', '3' => '11-20', '4' => '20+'), ['class' => 'form-control', 'prompt' => 'Select Category'])], ['attribute' => 'filter_summer_3', 'value' => 'summer_count_3', 'filter' => Html::activeDropDownList($searchModel, 'filter_summer_3', array('1' => '1-5', '2' => '6-10', '3' => '11-20', '4' => '20+'), ['class' => 'form-control', 'prompt' => 'Select Category'])], ['attribute' => 'filter_summer_4', 'value' => 'summer_count_4', 'filter' => Html::activeDropDownList($searchModel, 'filter_summer_4', array('1' => '1-5', '2' => '6-10', '3' => '11-20', '4' => '20+'), ['class' => 'form-control', 'prompt' => 'Select Category'])], ['attribute' => 'filter_winter_1', 'value' => 'winter_count_1', 'filter' => Html::activeDropDownList($searchModel, 'filter_winter_1', array('1' => '1-5', '2' => '6-10', '3' => '11-20', '4' => '20+'), ['class' => 'form-control', 'prompt' => 'Select Category'])], ['attribute' => 'filter_winter_2', 'value' => 'winter_count_2', 'filter' => Html::activeDropDownList($searchModel, 'filter_winter_2', array('1' => '1-5', '2' => '6-10', '3' => '11-20', '4' => '20+'), ['class' => 'form-control', 'prompt' => 'Select Category'])], ['attribute' => 'filter_winter_3', 'value' => 'winter_count_3', 'filter' => Html::activeDropDownList($searchModel, 'filter_winter_3', array('1' => '1-5', '2' => '6-10', '3' => '11-20', '4' => '20+'), ['class' => 'form-control', 'prompt' => 'Select Category'])], ['attribute' => 'filter_winter_4', 'value' => 'winter_count_4', 'filter' => Html::activeDropDownList($searchModel, 'filter_winter_4', array('1' => '1-5', '2' => '6-10', '3' => '11-20', '4' => '20+'), ['class' => 'form-control', 'prompt' => 'Select Category'])], ['attribute' => 'paper', 'value' => 'paper0.nameBothShort', 'filter' => Html::activeDropDownList($searchModel, 'paper', ArrayHelper::map(Paper::find()->all(), 'id', 'nameBothShort'), ['class' => 'form-control', 'prompt' => 'Select Category']), 'contentOptions' => ['style' => 'width: ' . $width . ';']], ['attribute' => 'mainTrashRelations.trash_relation_id', 'value' => 'trashRelationMulti', 'filter' => Html::activeDropDownList($searchModel, 'mainTrashRelations.trash_relation_id', ArrayHelper::map(TrashRelation::find()->all(), 'id', 'nameBothShort'), ['class' => 'form-control', 'prompt' => 'Select Category']), 'contentOptions' => ['style' => 'width: ' . $width . ';']], ['attribute' => 'mainTrashRecycles.trash_recycle_id', 'value' => 'trashRecycleMulti', 'filter' => Html::activeDropDownList($searchModel, 'mainTrashRecycles.trash_recycle_id', ArrayHelper::map(TrashRecycle::find()->all(), 'id', 'nameBothShort'), ['class' => 'form-control', 'prompt' => 'Select Category'])], ['attribute' => 'mainRubberItems.rubber_item_id', 'value' => 'rubberItemsMulti', 'filter' => Html::activeDropDownList($searchModel, 'mainRubberItems.rubber_item_id', ArrayHelper::map(RubberItems::find()->all(), 'id', 'nameBoth'), ['class' => 'form-control', 'prompt' => 'Select Category'])], 'answer_count', 'woman_count', ['attribute' => 'person', 'value' => 'person0.nameBothShort', 'filter' => Html::activeDropDownList($searchModel, 'person', ArrayHelper::map(Person::find()->all(), 'id', 'nameBothShort'), ['class' => 'form-control', 'prompt' => 'Select Category'])], 'date', 'interrogatory']]);
?>


</div>
コード例 #29
0
ファイル: AdvertController.php プロジェクト: aiskimzhi/advert
 public function actionGetCity($id)
 {
     $countCities = City::find()->where(['region_id' => $id])->count();
     $cities = City::find()->where(['region_id' => $id])->orderBy('id ASC')->all();
     if ($countCities > 0) {
         echo '<option value="">- Choose a City -</option>';
         foreach ($cities as $city) {
             echo "<option value='" . $city->id . "'>" . $city->name . "</option>";
         }
     } else {
         echo "<option></option>";
     }
     echo Json::encode(['output' => '', 'selected' => '']);
 }
コード例 #30
0
ファイル: company.php プロジェクト: unix-admin/profitday
echo $form->field($model, 'ideas');
?>
        <?php 
echo $form->field($model, 'telephone');
?>
        <?php 
echo $form->field($model, 'e_mail');
?>
        <?php 
echo $form->field($model, 'site');
?>
        <?php 
echo $form->field($model, 'skype');
?>
        <?php 
echo $form->field($model, 'logo_url');
?>
        <?php 
echo $form->field($model, 'cities[]')->listBox(ArrayHelper::map(\app\models\City::find()->asArray()->all(), 'id', 'title_' . Yii::$app->language), ['multiple' => 'multiple']);
?>
        <div class="form-group">
            <?php 
echo Html::submitButton('Save', ['class' => 'btn btn-primary']);
?>
        </div>
    <?php 
ActiveForm::end();
?>

</div><!-- site-company -->