public function actionTabulado() { if ($_SESSION['perfil'] == 3) { $params['active'] = 6; $params['vista'] = '_tabulado'; $alumno = Alumno::model()->find('idUsuario=:usuario', array('usuario' => $_SESSION['idUsuario'])); $params['electivas'] = ElectivaAlumno::model()->findAll(array('condition' => 't.idAlumno =:alumno', 'params' => array('alumno' => $alumno->idAlumno))); } else { $params['active'] = 0; $params['vista'] = "_sinPermisos"; } $this->render('panel', array('params' => $params)); }
<tr> <td>Identificacion</td> <td>Estudiante</td> <td>Fecha de matricula</td> </tr> <?php foreach ($alumnos as $alumno) { ?> <tr> <td><?php echo Alumno::model()->findByPk($alumno->idAlumno)->identificacion; ?> </td> <td><?php echo Alumno::model()->findByPk($alumno->idAlumno)->apellidos . " " . Alumno::model()->findByPk($alumno->idAlumno)->nombres; ?> </td> <td><?php echo $alumno->fechaInscripcion; ?> </td> </tr> <?php } ?> </table> <?php } else { ?>
/** * 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 = Alumno::model()->findByPk($id); if ($model === null) { throw new CHttpException(404, 'The requested page does not exist.'); } return $model; }
<?php $form=$this->beginWidget('bootstrap.widgets.TbActiveForm',array( 'id'=>'matricula-form', 'enableAjaxValidation'=>false, )); ?> <p class="help-block">Campos con <span class="required">*</span> son obligatorios.</p> <?php echo $form->errorSummary($model); ?> <?php echo $form->labelEx($model, 'idAlumno');?> <?php echo $form->dropDownList($model,'idAlumno',CHtml::listData(Alumno::model()->findAll(array('order'=>'idAlumno')),'idAlumno', 'nombreCompleto'),array('empty'=>'Seleccionar..' ));?> <?php echo $form->labelEx($model, 'Cuenta');?> <?php echo $form->dropDownList($model,'idCuenta',CHtml::listData(Persona::model()->findAll(array('order'=>'idPersona')),'idPersona', 'apellido', 'nombre'),array('empty'=>'Seleccionar..' ));?> <?php echo $form->datepickerRow($model,'fechaInicio',array('options'=>array(),'htmlOptions'=>array('class'=>'span5')),array('prepend'=>'<i class="icon-calendar"></i>','append'=>'Click on Month/Year at top to select a different year or type in (mm/dd/yyyy).')); ?> <?php echo $form->datepickerRow($model,'fechaFin',array('options'=>array(),'htmlOptions'=>array('class'=>'span5')),array('prepend'=>'<i class="icon-calendar"></i>','append'=>'Click on Month/Year at top to select a different year or type in (mm/dd/yyyy).')); ?> <?php echo $form->textFieldRow($model,'motivoBaja',array('class'=>'span5','maxlength'=>100)); ?> <?php echo $form->labelEx($model,'idCurso'); ?> <?php echo $form->dropDownList($model,'idCurso',CHtml::listData(Curso::model()->findAll(array('order'=>'idCurso')),'idCurso', 'descripcion'),array('empty'=>'Seleccionar..' ));?> <?php echo $form->labelEx($model,'Descuento'); ?> <?php echo $form->dropDownList($model,'idDescuento',CHtml::listData(Descuento::model()->findAll(array('order'=>'idDescuento')),'idDescuento', 'descripcion'),array('empty'=>'Seleccionar..' ));?> <?php echo $form->textFieldRow($model,'ciclo',array('maxlength'=>5)); ?> <div class="form-actions"> <?php $this->widget('bootstrap.widgets.TbButton', array(