public function getMenuBodega() { // return CHtml::listData(Bodega::model()->findAll('estatus=?',array(1)),'Id','selectName'); return CHtml::listData(Bodega::model()->findAll(), 'CodBodega', 'Descripcion'); }
public function getMenuBodega() { return CHtml::listData(Bodega::model()->findAll(), 'CodBodega', 'Descripcion'); }
echo $form->labelEx($model, 'Proveedor'); ?> <?php echo $form->dropDownList($model, 'CodProveedor', CHtml::listData(Proveedor::model()->findAll(), 'CodProveedor', 'Descripcion'), array('empty' => ' ')); ?> <?php echo $form->error($model, 'CodProveedor'); ?> </th> <th> <?php echo $form->labelEx($model, 'Bodega'); ?> <?php echo $form->dropDownList($model, 'CodBodega', CHtml::listData(Bodega::model()->findAll(), 'CodBodega', 'Descripcion'), array('empty' => ' ')); ?> <?php echo $form->error($model, 'CodBodega'); ?> </th> </tr> </table> <table> <th> <?php echo $form->labelEx($model, 'ForPago'); ?> <?php echo $form->dropDownList($model, 'ForPago', CHtml::listData(Formapago::model()->findAll(), 'Id', 'Descripcion'), array('empty' => ' '));
/** * 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 Bodega the loaded model * @throws CHttpException */ public function loadModel($id) { $model = Bodega::model()->findByPk($id); if ($model === null) { throw new CHttpException(404, 'The requested page does not exist.'); } return $model; }