/** * 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 SpareStatus the loaded model * @throws CHttpException */ public function loadModel($id) { $model = SparePartsStatus::model()->findByPk($id); if ($model === null) { throw new CHttpException(404, 'The requested page does not exist.'); } return $model; }
echo $form->labelEx($model, 'brand_id'); ?> <?php echo $form->dropDownList($model, 'brand_id', CHtml::listData(Brand::model()->findAll(array('condition' => 'active = 1', 'order' => 'name')), 'id', 'name'), array('empty' => 'Seleccionar Marca')); ?> <?php echo $form->error($model, 'brand_id'); ?> </div> <div class="row"> <?php echo $form->labelEx($model, 'spare_parts_status_id'); ?> <?php echo $form->dropDownList($model, 'spare_parts_status_id', CHtml::listData(SparePartsStatus::model()->findAll(array('condition' => 'active = 1', 'order' => 'description')), 'id', 'description'), array('empty' => 'Seleccionar Estado', 'options' => array(4 => array('selected' => 'selected')))); ?> <?php echo $form->error($model, 'spare_parts_status_id'); ?> </div> <div class="row"> <?php echo $form->labelEx($model, 'provider_id'); ?> <?php echo $form->dropDownList($model, 'provider_id', CHtml::listData(Provider::model()->findAll('active = 1'), 'id', 'name'), array('empty' => 'Seleccionar Proveedor')); ?> <?php echo $form->error($model, 'provider_id');