You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

3 vuotta sitten
1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. use common\components\zActiveForm;
  3. use backend\modules\zzcs\models\BaseAreaView;
  4. use yii\helpers\ArrayHelper;
  5. /* @var $this yii\web\View */
  6. /* @var $model backend\modules\motorcade\models\BaseDriver */
  7. /* @var $form yii\widgets\zActiveForm */
  8. /* @var $pid array */
  9. if(!isset($form)){
  10. $end = true;
  11. $form = zActiveForm::begin();
  12. }
  13. \yii\widgets\Pjax::begin(['id' => '_province', 'enablePushState' => false, 'options'=>['class'=>'_province','style'=>'display:inline-block']]);
  14. $tmp = '<div class="form-group required field-basedriver-area_id">';
  15. $tmp .= $form->field($model, 'province')->dropDownList(ArrayHelper::map(BaseAreaView::getBaseArea($pid['id1']), 'AREA_ID', 'AREA_NAME'), [
  16. 'style' => 'width: 91px'
  17. ])->label(false);
  18. $tmp .= $form->field($model, 'city')->dropDownList(ArrayHelper::map(BaseAreaView::getBaseArea($pid['id2']), 'AREA_ID', 'AREA_NAME'), [
  19. 'style' => 'width: 91px'
  20. ])->label(false);
  21. if($pid['id3'] != '')
  22. $tmp2 = ArrayHelper::map(BaseAreaView::getBaseArea($pid['id3']), 'AREA_ID', 'AREA_NAME');
  23. else
  24. $tmp2 = [];
  25. $tmp .= $form->field($model, 'country')->dropDownList($tmp2, [
  26. 'style' => 'width: 91px;'. ($tmp2 == null? 'display:none': '')
  27. ])->label(false);
  28. $tmp .= '</div>';
  29. echo $tmp;
  30. \yii\widgets\Pjax::end();
  31. if(isset($end)){
  32. zActiveForm::end();
  33. }
  34. ?>