?> </div> <div style="float:left;width:200px;" > <?php echo $form->labelEx($model, 'vehicle_type'); ?> <?php echo $form->dropDownList($model, 'vehicle_type', CHtml::listData(VehicleType::model()->findAll(array('order' => 'type ASC')), 'id', 'type'), array('span' => 5, 'maxlength' => 45)); ?> </div> <div style="float:left;width:200px;" > <?php echo $form->labelEx($model, 'vehicle_make_id'); ?> <?php echo $form->dropDownList($model, 'vehicle_make_id', CHtml::listData(VehicleMake::model()->findAll(array('order' => 'vehicle_make ASC', 'condition' => 'vehicle_make not like ""')), 'id', 'vehicle_make'), array('empty' => '--Select vehicle make--', 'span' => 5, 'maxlength' => 45)); ?> </div> </div> <div class="row"> <div style="float:left;width:200px;" > <?php echo $form->labelEx($model, 'challan_state_id'); ?> <?php echo $form->dropDownList($model, 'challan_state_id', CHtml::listData(States::model()->findAllByPk(array(19, 7, 32), array('order' => 'name ASC')), 'id', 'name'), array('ajax' => array('type' => 'POST', 'url' => CController::createUrl('states/dynamicdistrict1'), 'update' => '#Challan_challan_district_id'), 'empty' => 'Select State'), array('span' => 5)); ?> </div>
/** * Returns the data model based on the primary key given in the GET variable. * If the data model is not found, an HTTP exception will be raised. * @param integer $id the ID of the model to be loaded * @return VehicleMake the loaded model * @throws CHttpException */ public function loadModel($id) { $model = VehicleMake::model()->findByPk($id); if ($model === null) { throw new CHttpException(404, 'The requested page does not exist.'); } return $model; }