Example #1
0
<?php

$form = $this->beginWidget('bootstrap.widgets.TbActiveForm', array('id' => 'sala-funcion-form', 'enableAjaxValidation' => false));
?>

	<p class="help-block">Fields with <span class="required">*</span> are required.</p>

	<?php 
echo $form->errorSummary($model);
?>

	<?php 
echo $form->dropDownListRow($model, 'funcion_id', CHtml::listData(Funcion::model()->findAll(), 'id', 'nombre'), array('prompt' => 'Seleccione una Funcion', 'class' => 'span5'));
?>

	<?php 
echo $form->dropDownListRow($model, 'sala_id', CHtml::listData(Sala::model()->findAll(), 'id', 'nombre'), array('prompt' => 'Seleccione una Sala', 'class' => 'span5'));
?>


	<?php 
echo $form->textFieldRow($model, 'fecha', array('class' => 'span5'));
?>

	<?php 
echo $form->textFieldRow($model, 'hora', array('class' => 'span5'));
?>

	<?php 
echo $form->textFieldRow($model, 'precio', array('class' => 'span5'));
?>
 /**
  * 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 the ID of the model to be loaded
  */
 public function loadModel($id)
 {
     $model = Funcion::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }