<?php echo CHtml::dropDownList('city', $search['city'], $city_update, array('class' => 'width118 select', 'empty' => '请选择市')); ?> </p> <p class='form-row'> <label class="label">适用车型:</label> <?php $brand_data = TransportMake::model()->findAll(); $brand = CHtml::listData($brand_data, "Code", "Make"); ?> <?php echo CHtml::dropDownList('vehicleMake', $search['vehicleMake'], $brand, array('class' => 'width118 select', 'empty' => '请选择品牌', 'ajax' => array('type' => 'GET', 'url' => Yii::app()->request->baseUrl . '/common/getcar', 'update' => '#vehicleModel', 'data' => 'js:"make="+jQuery(this).val()'))); ?> <?php if ($search['vehicleMake']) { $vehicleModel_data = TransportCar::model()->findAll("Make=:parent", array(":parent" => $search['vehicleMake'])); $vehicleModel = CHtml::listData($vehicleModel_data, "Code", "Car"); } ?> <?php $vehicleModel_update = $search['vehicleMake'] ? $vehicleModel : array(); ?> <?php echo CHtml::dropDownList('vehicleModel', $search['vehicleModel'], $vehicleModel_update, array('class' => 'width118 select', 'empty' => '请选择车系')); ?> <label class="label"> 嘉配号: </label> <?php echo CHtml::textField('jiapartID', $search['jiapartID'], array('class' => "width231 input")); ?> </label>
/** * 根据车型获取车系 * Enter description here ... */ public function actionGetcar() { echo CHtml::tag("option", array("value" => ''), '请选择车系', true); if ($_GET["make"]) { $data = TransportCar::model()->findAll("Make=:Make", array(":Make" => $_GET["make"])); $data = CHtml::listData($data, "Code", "Car"); foreach ($data as $value => $name) { echo CHtml::tag("option", array("value" => $value), CHtml::encode($name), true); } } }
} ?> > <span id="zyxl" class='checkbox-add tags repair <?php if ($search['repair'] == "全车系") { ?> bg-green <?php } ?> '>全车系</span> <span class="checkbox-add">|</span> <?php echo CHtml::dropDownList('repair-make', $search['repair-make'], $brand, array('class' => 'width118 select', 'empty' => '请选择品牌', 'ajax' => array('type' => 'GET', 'url' => Yii::app()->request->baseUrl . '/common/getcarbyid', 'update' => '#repair-car', 'data' => 'js:"make="+jQuery(this).val()'))); ?> <?php $repair_data = TransportCar::model()->findAll("Make=:Make", array(":Make" => $search['repair-make'])); $repair = CHtml::listData($repair_data, "Code", "Car"); ?> <?php echo CHtml::dropDownList('repair-car', $search['repair-car'], $repair, array('class' => 'width118 select', 'empty' => '请选择车系')); ?> </span> <span id="insuranceService" <?php if ($search['category'] != "车险服务") { ?> style="display: none;" <?php } ?> >