Example #1
0
?>
    	<h1><strong>Total Students</strong></h1>

        <div class="ovrBtm"><?php 
echo count($total);
?>
</div>
    </div>
    <div class="overviewbox ovbox2">
    	<h1><strong>New Admissions</strong></h1>
        <div class="ovrBtm">122</div>
    </div>
    <div class="overviewbox ovbox3">
    	<h1><strong>Pending Leads</strong></h1>
     <?php 
$fees = FinanceFees::model()->findAll('is_paid=:status group by student_id', array(':status' => '0'));
?>
        <div class="ovrBtm"><?php 
echo count($fees);
?>
</div>
    </div>
  <div class="clear"></div>
    
</div>
<div class="clear"></div>
  <div style="margin-top:20px; width:80%" id="container"></div>
 	</div></td>
        
      </tr>
    </table>
 public function actionAjax_delete()
 {
     $id = $_POST['id'];
     $deleted = $this->loadModel($id);
     if ($deleted->delete()) {
         FinanceFeeParticulars::model()->DeleteAllByAttributes(array('finance_fee_category_id' => $id));
         //FinanceFeeCollections::model()->DeleteAllByAttributes(array('fee_category_id'=>$id));
         $fee_collections = FinanceFeeCollections::model()->findAllByAttributes(array('fee_category_id' => $id));
         foreach ($fee_collections as $fee_collection) {
             FinanceFees::model()->DeleteAllByAttributes(array('fee_collection_id' => $fee_collection->id));
             FinanceTransaction::model()->deleteAll('collection_id=:x', array(':x' => $fee_collection->id));
         }
         FinanceFeeCollections::model()->DeleteAllByAttributes(array('fee_category_id' => $id));
         echo json_encode(array('success' => true));
         exit;
     } else {
         echo json_encode(array('success' => false));
         exit;
     }
 }
 public function actionAjax_Create()
 {
     if (isset($_POST['FinanceFeeParticulars'])) {
         //return the JSON result to provide feedback.
         $list = $_POST['FinanceFeeParticulars'];
         $count = sizeof($list['id']);
         for ($i = 0; $i < $count; $i++) {
             $model = new FinanceFeeParticulars();
             //set the submitted values
             $model->attributes = $_POST['FinanceFeeParticulars'];
             $model->student_category_id = $list['id'][$i];
             $model->amount = str_replace(",", "", $model->amount);
             if ($model->save(false)) {
                 $finance_fee_collections = FinanceFeeCollections::model()->findAll(array('condition' => 'fee_category_id = :id', 'params' => array(':id' => $model->finance_fee_category_id)));
                 foreach ($finance_fee_collections as $finance_fee_collection) {
                     $finance_fees = FinanceFees::model()->findAll(array('condition' => 'fee_collection_id = :id', 'params' => array(':id' => $finance_fee_collection->id)));
                     foreach ($finance_fees as $finance_fee) {
                         $finance_fee->is_paid = 0;
                         $finance_fee->save(false);
                     }
                 }
             }
         }
         echo json_encode(array('success' => true, 'id' => $model->primaryKey));
         exit;
     }
 }
 public function actionDeactivate($id)
 {
     $model = Courses::model()->findByPk($id);
     $model->is_deleted = 1;
     if ($model->save()) {
         // Batch Deletion
         $batches = Batches::model()->findAllByAttributes(array('course_id' => $id));
         //Selecting all batches under the course with id = $id
         foreach ($batches as $batch) {
             // Student Deletion
             $students = Students::model()->findAllByAttributes(array('batch_id' => $batch->id));
             foreach ($students as $student) {
                 //Making student user inactive
                 if ($student->uid != NULL and $student->uid != 0) {
                     $student_user = User::model()->findByAttributes(array('id' => $student->uid));
                     if ($student_user != NULL) {
                         $student_user->saveAttributes(array('status' => '0'));
                     }
                 }
                 //Making parent user inactive
                 $parent = Guardians::model()->findByAttributes(array('ward_id' => $student->id));
                 if ($parent->uid != NULL and $parent->uid != 0) {
                     $parent_user = User::model()->findByAttributes(array('id' => $parent->uid));
                     if ($parent_user != NULL) {
                         $parent_user->saveAttributes(array('status' => '0'));
                     }
                 }
                 $student->saveAttributes(array('is_active' => '0', 'is_deleted' => '1'));
                 // Student Deleted
             }
             // Subject Association Deletion
             $subjects = Subjects::model()->findAllByAttributes(array('batch_id' => $batch->id));
             foreach ($subjects as $subject) {
                 EmployeesSubjects::model()->DeleteAllByAttributes(array('subject_id' => $subject->id));
                 $subject->delete();
             }
             // Exam Group Deletion
             $examgroups = ExamGroups::model()->findAllByAttributes(array('batch_id' => $batch->id));
             foreach ($examgroups as $examgroup) {
                 // Exams Deletion
                 $exams = Exams::model()->findAllByAttributes(array('exam_group_id' => $examgroup->id));
                 foreach ($exams as $exam) {
                     //Exam Score Deletion
                     $examscores = ExamScores::model()->DeleteAllByAttributes(array('exam_id' => $exam->id));
                     $exam->delete();
                     //Exam Deleted
                 }
                 $examgroup->delete();
                 //Exam Group Deleted
             }
             //Fee Collection Deletion
             $collections = FinanceFeeCollections::model()->findAllByAttributes(array('batch_id' => $batch->id));
             foreach ($collections as $collection) {
                 // Finance Fees Deletion
                 $student_fees = FinanceFees::model()->DeleteAllByAttributes(array('fee_collection_id' => $collection->id));
                 $transaction = FinanceTransaction::model()->DeleteAllByAttributes(array('collection_id' => $collection->id));
                 $collection->delete();
                 // Fee Collection Deleted
             }
             //Fee Category Deletion
             $categories = FinanceFeeCategories::model()->findAllByAttributes(array('batch_id' => $batch->id));
             foreach ($categories as $category) {
                 // Fee Particular Deletion
                 $particulars = FinanceFeeParticulars::model()->DeleteAllByAttributes(array('finance_fee_category_id' => $category->id));
                 $category->delete();
                 // Fee Category Deleted
             }
             //Timetable Entry Deletion
             $periods = TimetableEntries::model()->DeleteAllByAttributes(array('batch_id' => $batch->id));
             //Class Timings Deletion
             $class_timings = ClassTimings::model()->DeleteAllByAttributes(array('batch_id' => $batch->id));
             //Delete Weekdays
             $weekdays = Weekdays::model()->DeleteAllByAttributes(array('batch_id' => $batch->id));
             $batch->is_active = 0;
             $batch->is_deleted = 1;
             $batch->employee_id = ' ';
             $batch->save();
             // Batch Deleted
         }
         Yii::app()->user->setFlash('success', "Selected course is deleted!");
         $this->redirect(array('managecourse'));
     }
 }
Example #5
0
          <th><?php 
echo Yii::t('students', 'Category Name');
?>
</th>
          <th><?php 
echo Yii::t('students', 'Collection Name');
?>
</th>
           <th><?php 
echo Yii::t('students', 'Amount');
?>
</th>
             
        </tr>
         <?php 
$res = FinanceFees::model()->findAll(array('condition' => 'student_id=:vwid AND is_paid=:vpid', 'params' => array(':vwid' => $_REQUEST['id'], ':vpid' => 1)));
if (count($res) == 0) {
    ?>
    	<tr>
          <td colspan="3"><?php 
    echo Yii::t('students', 'No details of the fees paid available.');
    ?>
</td>             
        </tr>
	<?php 
} else {
    foreach ($res as $res_1) {
        $amount = 0;
        $posts = FinanceFeeCollections::model()->findByAttributes(array('id' => $res_1->fee_collection_id));
        $cat = FinanceFeeCategories::model()->findByAttributes(array('id' => $posts->fee_category_id));
        /*$particular = FinanceFeeParticulars::model()->findAllByAttributes(array('finance_fee_category_id'=>$posts->fee_category_id));
Example #6
0
</th>
        <th style="width:70px; padding-top:10px;"><?php 
    echo Yii::t('unpaid', 'Fees Paid');
    ?>
</th>
        <th style="width:70px; padding-top:10px;"><?php 
    echo Yii::t('unpaid', 'Balance');
    ?>
</th>
    </tr>
<?php 
    $amount = 0;
    //$j=0;
    foreach ($particulars as $particular) {
        $amount = $amount + $particular->amount;
        $list = FinanceFees::model()->findAll("fee_collection_id=:x", array(':x' => $_REQUEST['collection']));
    }
    /*if($j%2==0)
    		$class = 'class="odd"';	
    	else
    		$class = 'class="even"';	*/
    $k = 1;
    foreach ($list as $list_1) {
        $student = Students::model()->findByAttributes(array('id' => $list_1->student_id));
        if ($student == NULL || $list_1->is_paid == 0) {
            continue;
        }
        echo "<tr>";
        echo "<td>" . $k . "</td>";
        echo "<td>" . $student->admission_no . "</td>";
        echo "<td style='padding-left:20px'>" . $student->first_name . ' ' . $student->last_name . "</td>";
Example #7
0
        //$amount = 0;
        $list = FinanceFees::model()->findAll("fee_collection_id=:x", array(':x' => $_REQUEST['collection']));
        $student_arr_2 = array();
        foreach ($list as $item) {
            array_push($student_arr_2, $item->student_id);
            // Push the students present in Finance fees tables
        }
        foreach ($student_arr_2 as $student) {
            if (!in_array($student, $student_arr_1)) {
                $command = Yii::app()->db->createCommand('delete from finance_fees where student_id=:id and fee_collection_id=:coll_id and date is null')->bindValue('id', $student)->bindValue('coll_id', $_REQUEST['collection']);
                $command->execute();
            }
        }
        $missing_students = array_diff($student_arr_1, $student_arr_2);
        foreach ($missing_students as $student) {
            $finance = new FinanceFees();
            $finance->fee_collection_id = $_REQUEST['collection'];
            $finance->student_id = $student;
            $finance->is_paid = 0;
            $finance->save();
        }
        //	var_dump($missing_students);
        //$amount = 0;
        $list = FinanceFees::model()->findAll("fee_collection_id=:x", array(':x' => $_REQUEST['collection']));
        ?>
		<td>
		 </tr>
	</table>
	</div></div>
	
	   <div class="tableinnerlist"> 
 public function actionPayfees()
 {
     $list = FinanceFees::model()->findByAttributes(array('id' => $_REQUEST['id']));
     $list->is_paid = 1;
     $list->save();
     $this->redirect(array('fees', 'id' => $list->student_id));
 }
Example #9
0
</th>
        <th style="width:100px; padding-top:10px;"><?php 
    echo Yii::t('unpaid', 'Fees Paid');
    ?>
</th>
        <th style="width:70px; padding-top:10px;"><?php 
    echo Yii::t('unpaid', 'Balance');
    ?>
</th>
    </tr>
<?php 
    $amount = 0;
    //$j=0;
    foreach ($particulars as $particular) {
        $amount = $amount + $particular->amount;
        $list = FinanceFees::model()->findAll("fee_collection_id=:x and is_paid=:y", array(':x' => $_REQUEST['collection'], ':y' => 0));
    }
    /*if($j%2==0)
    		$class = 'class="odd"';	
    	else
    		$class = 'class="even"';	*/
    $k = 1;
    foreach ($list as $list_1) {
        $student = Students::model()->findByAttributes(array('id' => $list_1->student_id));
        if ($student == NULL || $student->is_active == 0) {
            continue;
        }
        echo "<tr>";
        echo "<td>" . $k . "</td>";
        echo "<td>" . $student->admission_no . "</td>";
        echo "<td style='padding-left:20px'>" . $student->first_name . ' ' . $student->last_name . "</td>";
 public function actionSendsms()
 {
     /*echo 'Batch ID: '.$_REQUEST['batch_id'].'<br/>';
     		echo 'Fee Collection ID: '.$_REQUEST['collection'].'<br/>';
     		echo 'Days in between: '.$_REQUEST['date_status'].'<br/>';
     		echo 'Amount: '.$_REQUEST['amount'].'<br/>';*/
     $sms_settings = SmsSettings::model()->findAll();
     if ($sms_settings[0]->is_enabled == '1' and $sms_settings[7]->is_enabled == '1') {
         // Checking if SMS is enabled.
         $collection = FinanceFeeCollections::model()->findByAttributes(array('id' => $_REQUEST['collection']));
         /*echo 'Fees Name: '.$collection->name.'<br/>';
         		echo 'Due Date: '.$collection->due_date.'<br/>';*/
         $unpaid_students = FinanceFees::model()->findAll("fee_collection_id=:x and is_paid=:y", array(':x' => $_REQUEST['collection'], ':y' => 0));
         //echo 'Total unpaid students: '.count($unpaid_students).'<br/><br/>';
         foreach ($unpaid_students as $unpaid_student) {
             //echo 'Student ID: '.$unpaid_student->student_id.'<br/>';
             $student = Students::model()->findByAttributes(array('id' => $unpaid_student->student_id));
             $guardian = Guardians::model()->findByAttributes(array('ward_id' => $student->id));
             /*echo 'Name: '.$student->first_name.'<br/>';
             		echo 'Phone 1: '.$student->phone1.'<br/>';*/
             $to_parent = '';
             $to_student = '';
             $message = '';
             if (count($guardian) != 0 and $guardian->mobile_phone != NULL) {
                 // If guardian is added
                 $to_parent = $guardian->mobile_phone;
             }
             if ($student->phone1) {
                 // Checking if phone number is provided
                 $to_student = $student->phone1;
             } elseif ($student->phone2) {
                 $to_student = $student->phone2;
             }
             //echo 'Message To: '.$to.'<br/>';
             $college = Configurations::model()->findByPk(1);
             $from = $college->config_value;
             // Checking the days between the current date and due date. And, the customising the message accordingly
             if ($_REQUEST['date_status'] < 1) {
                 $message = 'Last date for the payment of [' . $collection->name . '] fees was ' . $collection->due_date;
             } elseif ($_REQUEST['date_status'] > 1 and $_REQUEST['date_status'] <= 7) {
                 $message = 'Last date for the payment of [' . $collection->name . '] fees is ' . $collection->due_date;
             } elseif ($_REQUEST['date_status'] == 1) {
                 $message = 'Last date for the payment of [' . $collection->name . '] fees is today. i.e.,' . $collection->due_date;
             }
             //echo 'Message: '.$message.'<br/><br/>';
             if ($message != '' && 0) {
                 // Send SMS if message is set
                 if ($to_parent != '') {
                     // If unpaid and parent phone number is provided, send SMS
                     SmsSettings::model()->sendSms($to_parent, $from, $message);
                 }
                 // End check if parent phone number is provided
                 if ($to_student != '') {
                     // If unpaid and student phone number is provided, send SMS
                     SmsSettings::model()->sendSms($to_student, $from, $message);
                 }
                 // End check if student phone number is provided
                 Yii::app()->user->setFlash('notification', 'SMS send Successfully!');
             }
             // End check if message is set
         }
         // End for each student
         //exit;
     }
     // End check whether SMS is enabled
     $this->redirect(array('unpaid', 'batch' => $_REQUEST['batch_id'], 'course' => $_REQUEST['collection']));
 }
 public function actionRemove()
 {
     $val = $_GET['val1'];
     $model = Batches::model()->findByPk($val);
     $model->is_active = 0;
     $model->is_deleted = 1;
     $model->employee_id = ' ';
     if ($model->save()) {
         // Student Deletion
         $students = Students::model()->findAllByAttributes(array('batch_id' => $model->id));
         foreach ($students as $student) {
             //Making student user inactive
             if ($student->uid != NULL and $student->uid != 0) {
                 $student_user = User::model()->findByAttributes(array('id' => $student->uid));
                 if ($student_user != NULL) {
                     $student_user->saveAttributes(array('status' => '0'));
                 }
             }
             //Making parent user inactive
             $parent = Guardians::model()->findByAttributes(array('ward_id' => $student->id));
             if ($parent->uid != NULL and $parent->uid != 0) {
                 $parent_user = User::model()->findByAttributes(array('id' => $parent->uid));
                 if ($parent_user != NULL) {
                     $parent_user->saveAttributes(array('status' => '0'));
                 }
             }
             $student->saveAttributes(array('is_active' => '0', 'is_deleted' => '1'));
             // Student Deleted
         }
         // Subject Association Deletion
         $subjects = Subjects::model()->findAllByAttributes(array('batch_id' => $model->id));
         foreach ($subjects as $subject) {
             EmployeesSubjects::model()->DeleteAllByAttributes(array('subject_id' => $subject->id));
             $subject->delete();
         }
         // Exam Group Deletion
         $examgroups = ExamGroups::model()->findAllByAttributes(array('batch_id' => $model->id));
         foreach ($examgroups as $examgroup) {
             // Exams Deletion
             $exams = Exams::model()->findAllByAttributes(array('exam_group_id' => $examgroup->id));
             foreach ($exams as $exam) {
                 //Exam Score Deletion
                 $examscores = ExamScores::model()->DeleteAllByAttributes(array('exam_id' => $exam->id));
                 $exam->delete();
                 //Exam Deleted
             }
             $examgroup->delete();
             //Exam Group Deleted
         }
         //Fee Collection Deletion
         $collections = FinanceFeeCollections::model()->findAllByAttributes(array('batch_id' => $model->id));
         foreach ($collections as $collection) {
             // Finance Fees Deletion
             $student_fees = FinanceFees::model()->DeleteAllByAttributes(array('fee_collection_id' => $collection->id));
             $collection->delete();
             // Fee Collection Deleted
         }
         //Fee Category Deletion
         $categories = FinanceFeeCategories::model()->findAllByAttributes(array('batch_id' => $model->id));
         foreach ($categories as $category) {
             // Fee Particular Deletion
             $particulars = FinanceFeeParticulars::model()->DeleteAllByAttributes(array('finance_fee_category_id' => $category->id));
             $category->delete();
             // Fee Category Deleted
         }
         //Timetable Entry Deletion
         $periods = TimetableEntries::model()->DeleteAllByAttributes(array('batch_id' => $model->id));
         //Class Timings Deletion
         $class_timings = ClassTimings::model()->DeleteAllByAttributes(array('batch_id' => $model->id));
         //Delete Weekdays
         $weekdays = Weekdays::model()->DeleteAllByAttributes(array('batch_id' => $model->id));
     }
     echo $val;
 }
 public function actionAjax_delete()
 {
     $id = $_POST['id'];
     $deleted = $this->loadModel($id);
     if ($deleted->delete()) {
         FinanceFees::model()->deleteAll('fee_collection_id=:x', array(':x' => $id));
         FinanceTransaction::model()->deleteAll('collection_id=:x', array(':x' => $id));
         echo json_encode(array('success' => true));
         exit;
     } else {
         echo json_encode(array('success' => false));
         exit;
     }
 }
Example #13
0
}
?>
</td>
                <td>
                    <?php 
echo Yii::t('fees', 'Date');
?>
: <?php 
$settings = UserSettings::model()->findByAttributes(array('user_id' => Yii::app()->user->id));
if ($settings != NULL) {
    $date1 = date($settings->displaydate, time());
    echo $date1;
} else {
    echo date('d/m/Y');
}
$finance_fees = FinanceFees::model()->findByAttributes(array('fee_collection_id' => $_REQUEST['collection'], 'student_id' => $_REQUEST['id']));
if ($finance_fees != NULL) {
    if ($settings != NULL) {
        $latestdate = date($settings->displaydate, strtotime($finance_fees->date));
    } else {
        $latestdate = date('d/m/Y', strtotime($finance_fees->date));
    }
} else {
    $latestdate = "-";
}
?>
                </td>
            </tr>
            
            <tr>
                <td style="padding:2px 0px;"><?php 
Example #14
0
</strong></th>
         <th><strong><?php 
    echo Yii::t('fees', 'Paticulars');
    ?>
</strong></th>
          <th><strong><?php 
    echo Yii::t('fees', 'Amount');
    ?>
</strong></th>
        </tr>
        <?php 
    foreach ($list as $list_1) {
        $collection = FinanceFeeCollections::model()->findAllByAttributes(array('batch_id' => $list_1->batch_id));
        for ($i = 0; $i < count($collection); $i++) {
            $particular = FinanceFeeParticulars::model()->findAll("finance_fee_category_id=:x", array(':x' => $collection[$i]->fee_category_id));
            $list = FinanceFees::model()->findAll("fee_collection_id=:x", array(':x' => $collection[$i]->id));
        }
        $k = 1;
        for ($j = 0; $j < count($particular); $j++) {
            $amount = $amount + $particular[$i]->amount;
            $k++;
        }
    }
    ?>
        <tr>
        	<td><?php 
    echo $i;
    ?>
</td>
            <td><?php 
    echo $list_1->first_name;