/** * 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 = Entrada::model()->findByPk($id); if ($model === null) { throw new CHttpException(404, 'The requested page does not exist.'); } return $model; }
<p class="help-block">Fields with <span class="required">*</span> are required.</p> <?php //echo $idSalaFuncion; ?> <?php echo $form->errorSummary($model); ?> <?php //echo $form->hiddenField($model,'user_id',array('value'=>Yii::app()->user->id)); ?> <?php for ($i = 1; $i <= Entrada::model()->numAsientoSala($idSalaFuncion); $i++) { $aux = 0; foreach (Entrada::model()->listAsientoOcupado($idSalaFuncion) as $numAsiento) { if ($numAsiento == $i) { $aux = 1; } } if ($aux == 0) { echo "<label class='checkbox' for='Entrada_num_asiento'>"; echo "<input name='Asiento[" . $i . "]'type='checkBox' value='" . $i . "'>"; echo "" . $i . "</label>"; } if ($i % 10 == 0) { echo "<br>"; } } ?>