/** * Creates a new model. * If creation is successful, the browser will be redirected to the 'view' page. */ public function actionCreate() { $model = new Vacate(); // Uncomment the following line if AJAX validation is needed // $this->performAjaxValidation($model); if (isset($_POST['Vacate'])) { $allot = Allotment::model()->findByAttributes(array('room_no' => $_POST['Vacate']['room_no'], 'status' => 'S')); $reg = Registration::model()->DeleteAllByAttributes(array('student_id' => $allot->student_id)); $mess = MessFee::model()->DeleteAllByAttributes(array('student_id' => $allot->student_id)); $model->attributes = $_POST['Vacate']; $model->allot_id = $allot->id; $allot->status = 'C'; $allot->student_id = NULL; $allot->created = NULL; $allot->save(); if ($model->save()) { $this->redirect(array('view', 'id' => $model->id)); } } $this->render('create', array('model' => $model)); }
public function actionPrint() { $model = new MessManage(); $list = MessFee::model()->findByAttributes(array('student_id' => $_REQUEST['id'])); $html2pdf = Yii::app()->ePdf->HTML2PDF(); $html2pdf->WriteHTML($this->renderPartial('print', array('model' => $model, 'studentid' => $_REQUEST['id']), true)); $html2pdf->Output(); }
?> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="247" valign="top"> <?php $this->renderPartial('/settings/hostel_left'); ?> </td> <td valign="top"> <div class="cont_right"> <h1><?php echo Yii::t('hostel', 'Mess Manage'); ?> </h1> <?php $mess = MessFee::model()->findAll('status=:x AND student_id IS NOT NULL', array(':x' => 'C')); ?> <div class="pdtab_Con" style="padding:0px;"> <table width="100%" cellpadding="0" cellspacing="0" border="0" > <tr class="pdtab-h"> <td align="center"><?php echo Yii::t('hostel', 'Student Name'); ?> </td> <td align="center"><?php echo Yii::t('hostel', 'Hostel'); ?> </td> <td align="center"><?php echo Yii::t('hostel', 'Room No'); ?>
$this->renderPartial('/settings/hostel_left'); ?> </td> <td valign="top"> <div class="cont_right"> <h1><?php echo Yii::t('hostel', 'Student Details'); ?> </h1> <?php $allot = Allotment::model()->findByAttributes(array('student_id' => $studentid, 'status' => 'S')); if ($allot != NULL) { $stud = Students::model()->findByAttributes(array('id' => $allot->student_id)); $register = Registration::model()->findByAttributes(array('student_id' => $allot->student_id)); $food = FoodInfo::model()->findByAttributes(array('id' => $register->food_preference)); $mess = MessFee::model()->findByAttributes(array('student_id' => $allot->student_id)); $floor = Floor::model()->findByAttributes(array('id' => $allot->floor)); $hostel = Hosteldetails::model()->findByAttributes(array('id' => $floor->hostel_id)); ?> <div class="pdtab_Con" style="padding:0px;"> <table width="100%" cellpadding="0" cellspacing="0" border="0" > <tr class="pdtab-h"> <td align="center"><?php echo Yii::t('hostel', 'Student Name'); ?> </td> <td align="center"><?php echo Yii::t('hostel', 'Hostel'); ?> </td> <td align="center"><?php
echo Yii::t('hostel', 'Bed'); ?> </td> <td align="center"><?php echo Yii::t('hostel', 'Mess'); ?> </td> </tr> <?php if ($list == NULL) { echo '<tr><td align="center" colspan="6"><strong>' . Yii::t('hostel', 'OOPS!! Its an invalid search.Try again..') . '</strong></td></tr>'; } else { foreach ($list as $list_1) { if ($list_1->student_id != NULL) { $student = Students::model()->findByAttributes(array('id' => $list_1->student_id)); $mess = MessFee::model()->findByAttributes(array('student_id' => $list_1->student_id, 'status' => 'C')); $floordetails = Floor::model()->findByAttributes(array('id' => $list_1->floor)); $hostel = Hosteldetails::model()->findByAttributes(array('id' => $floordetails->hostel_id)); ?> <tr> <td align="center"><?php echo $student->last_name . ' ' . $student->first_name; ?> </td> <td align="center"><?php echo $hostel->hostel_name; ?> </td> <td align="center"><?php echo $floordetails->floor_no; ?>
$this->breadcrumbs = array('Settings' => array('/hostel'), 'View'); ?> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="247" valign="top"> <?php $this->renderPartial('/settings/hostel_left'); ?> </td> <td valign="top"> <div class="cont_right"> <?php echo '<div align="center"><strong>' . Yii::t('hostel', 'Un paid students') . '</strong></div> '; $fee = MessFee::model()->findAll('is_paid=:x AND student_id IS NOT NULL', array(':x' => '0')); ?> <?php Yii::app()->clientScript->registerScript('myHideEffect', '$(".flash-success").animate({opacity: 1.0}, 3000).fadeOut("slow");', CClientScript::POS_READY); ?> <?php if (Yii::app()->user->hasFlash('notification')) { ?> <span class="flash-success" style="color:#F00; padding-left:25px; font-size:12px"> <?php echo Yii::app()->user->getFlash('notification'); ?> </span>
<tr> <td width="247" valign="top"> <?php $this->renderPartial('/settings/hostel_left'); ?> </td> <td valign="top"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td valign="top" width="75%"> <?php $vacant = Allotment::model()->findAll('status=:x', array(':x' => 'C')); $allot = Allotment::model()->findAll('status=:x', array(':x' => 'S')); $mess = MessFee::model()->findAll('is_paid=:x', array(':x' => ')')); ?> <div class="cont_right"> <h1><?php echo Yii::t('hostel', 'Hostel Dashboard'); ?> </h1> <div class="overview"> <div class="overviewbox ovbox1"> <h1><strong><?php echo Yii::t('hostel', 'Vacant Rooms'); ?> </strong></h1> <div class="ovrBtm"><?php echo count($vacant); ?>
/** * 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 = MessFee::model()->findByPk($id); if ($model === null) { throw new CHttpException(404, 'The requested page does not exist.'); } return $model; }
font-weight:bold; text-align:center; } .tableinnerlist th{ border-right:1px #b9c7d0 solid; border-bottom:1px #b9c7d0 solid; padding:4px 10px; font-size:12px; font-weight:bold; text-align:center; } </style> <?php $list = MessFee::model()->findByAttributes(array('student_id' => $studentid, 'is_paid' => 1)); $posts = Students::model()->findByAttributes(array('id' => $studentid)); $allot = Allotment::model()->findByAttributes(array('student_id' => $studentid, 'status' => 'S')); $register = Registration::model()->findByAttributes(array('student_id' => $allot->student_id)); $food = FoodInfo::model()->findByAttributes(array('id' => $register->food_preference)); $batch = Batches::model()->findByAttributes(array('id' => $posts->batch_id)); $course = Courses::model()->findByAttributes(array('id' => $batch->course_id)); ?> <table width="600" border="1" bgcolor="#f9feff"> <tr> <td> <div style="padding:10px 20px;"> <table width="600" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="150"> <?php