/**
  * 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));
 }
 /**
  * Creates a new model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  */
 public function actionCreate()
 {
     $model = new Allotment();
     $model_1 = new MessFee();
     // Uncomment the following line if AJAX validation is needed
     // $this->performAjaxValidation($model);
     if (isset($_POST['Allotment'])) {
         $model_1 = new MessFee();
         $data = Allotment::model()->findByAttributes(array('student_id' => $_REQUEST['studentid']));
         $allot = Allotment::model()->findByAttributes(array('id' => $_REQUEST['allotid']));
         if ($data != NULL) {
             if ($allot->status == 'S') {
                 $this->redirect(array('alloterror'));
             }
             $vacate = new Vacate();
             $request = Roomrequest::model()->findByAttributes(array('student_id' => $data->student_id, 'status' => 'C'));
             if ($request != NULL) {
                 $request->status = 'S';
                 $request->save();
             }
             //$bed=RoomDetails::model()->findByAttributes(array('bed_no'=>$data->bed_no));
             $data->student_id = NULL;
             $data->status = 'C';
             $data->created = '';
             $vacate->student_id = $_REQUEST['studentid'];
             $vacate->room_no = $data->room_no;
             $vacate->allot_id = $data->id;
             $vacate->status = 'C';
             $vacate->admit_date = $data->created;
             $vacate->vacate_date = date('Y-m-d');
             $vacate->save();
             $data->save();
         } else {
             $model_1->student_id = $_REQUEST['studentid'];
             $model_1->created = date('Y-m-d');
             $model_1->status = 'C';
             $model_1->save();
         }
         $allot->student_id = $_REQUEST['studentid'];
         $allot->status = 'S';
         $allot->floor = $_REQUEST['floor_id'];
         $allot->created = date('Y-m-d');
         $allot->save();
         $this->redirect(array('view', 'id' => $allot->id));
         //$bed->save();
         //else
         //{
         //$model_1->student_id=$allot->id;
         //}
         //$model->attributes=$_POST['Allotment'];
         //$model->student_id=$_REQUEST['studentid'];
         //$model->status='S';
         //$bed_info=RoomDetails::model()->findByAttributes(array('bed_no'=>$_POST['Allotment']['bed_no'],'status'=>'C'));
         //if($bed_info==NULL)
         //{
         //$this->redirect(array('/allotment/roominfo/'));
         //}
         //else
         //{
         //$model->room_no=$bed_info->room_no;
         //if($model->save())
         //}
     }
     $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();
 }
Example #4
0
?>
<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');
?>
Example #5
0
$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 
Example #6
0
    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!!&nbsp;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;
                ?>
Example #7
0
$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>&nbsp;';
$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>
Example #8
0
  <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;
 }
Example #10
0
	 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