public function getMenuPagos() { return CHtml::listData(Pago::model()->findAll(), "id", "descripcion"); }
<?php echo $form->labelEx($ficha_usuario, 'Alumno'); ?> <?php echo $form->dropDownList($ficha_usuario, 'id_usuario', CHtml::listData(FichaUsuario::model()->findAll($criteria), 'id_usuario', 'nombre', 'apellido'), array('ajax' => array('type' => 'POST', 'url' => CController::createUrl('Pago/SeleccionarAño'), 'update' => '#' . CHtml::activeId($pago, 'anio')), 'prompt' => 'Seleccione un alumno', 'class' => "form-control", "onchange" => "lista_pagos();")); ?> <?php echo $form->error($ficha_usuario, 'Alumno'); ?> </div> <div class="form-group"> <?php echo $form->labelEx($pago, 'Anio'); ?> <?php echo $form->dropDownList($pago, 'anio', CHtml::listData(Pago::model()->findAll(), 'anio', 'anio'), array('ajax' => array('type' => 'POST', 'url' => CController::createUrl('Pago/SeleccionarMes'), 'update' => '#' . CHtml::activeId($pago, 'mes')), 'prompt' => 'Seleccione el año', 'class' => "form-control", "onchange" => "lista_pagos();")); ?> <?php echo $form->error($pago, 'anio'); ?> </div> <div class="form-group"> <?php echo $form->labelEx($pago, 'mes'); ?> <?php echo $form->dropDownList($pago, 'mes', array('' => 'Seleccione el mes'), array("class" => "form-control", 'prompt' => 'Seleccione el mes', "onchange" => "lista_pagos();")); ?> <?php echo $form->error($pago, 'mes'); ?>
/** * 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 Pago the loaded model * @throws CHttpException */ public function loadModel($id) { $model = Pago::model()->findByPk($id); if ($model === null) { throw new CHttpException(404, 'The requested page does not exist.'); } return $model; }
public function actionSeleccionarMes() { $id_usuario = $_POST['FichaUsuario']['id_usuario']; $anio = $_POST['Pago']['anio']; $criteria = new CDbCriteria(); $criteria->condition = 'id_usuario = :id_usuario and anio = :anio'; $criteria->params = array(':id_usuario' => $id_usuario, ':anio' => $anio); $pagos = Pago::model()->findAll($criteria); $pagos = CHtml::listData($pagos, 'mes', 'mes'); echo CHtml::tag('option', array('value' => ''), 'Seleccione el mes', true); foreach ($pagos as $valor => $p) { echo CHtml::tag('option', array('value' => $valor), CHtml::encode($p), true); } }
public function actionGenerarPdf() { $model = Pago::model()->findAll(); $mPDF1 = Yii::app()->ePdf->mpdf('utf-8', 'A4', '', '', 15, 15, 35, 25, 9, 9, 'P'); $mPDF1->useOnlyCoreFonts = true; $mPDF1->SetTitle("Reporte de Pagos"); $mPDF1->SetAuthor("Veronica Nin"); $mPDF1->SetDisplayMode('fullpage'); $mPDF1->WriteHTML($this->renderPartial('pdfReport', array('model' => $model), true)); $mPDF1->Output('Reporte_Pagos' . date('YmdHis'), 'I'); exit; }
public function actionEliminar() { if (isset($_POST['actividad'])) { Pago::model()->deleteAll("id_actividad='" . $_POST['actividad'] . "'"); ActividadHorario::model()->deleteAll("id_actividad='" . $_POST['actividad'] . "'"); ActividadAlumno::model()->deleteAll("id_actividad='" . $_POST['actividad'] . "'"); Actividad::model()->deleteAll("id_actividad='" . $_POST['actividad'] . "'"); echo "ok"; } }