Example #1
0
 
</div>






<?php 
}
?>

<?php 
if (isset($_REQUEST['transaction_id'])) {
    //$amount = 0;
    $list = FinanceTransaction::model()->findAll("id=:x", array(':x' => $_REQUEST['transaction_id']));
    // print_r($list);
    ?>

   <div class="tableinnerlist"> 
   <?php 
    echo Yii::t('fees', 'Transaction Details');
    ?>
    <table width="80%" cellspacing="0" cellpadding="0">
        <tr>
         <th><strong><?php 
    echo Yii::t('fees', 'ID.');
    ?>
</strong></th>
         <th><strong><?php 
    echo Yii::t('fees', 'Admission No.');
 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'));
     }
 }
 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 actionPartialreceipt()
 {
     $list = FinanceTransaction::model()->findByAttributes(array('id' => $_REQUEST['id']));
     $collection_id = $list->collection_id;
     $student_id = $list->student_id;
     $collection = FinanceFeeCollections::model()->findByAttributes(array('id' => $collection_id));
     $student = Students::model()->findByAttributes(array('id' => $student_id));
     $student = $student->first_name . ' ' . $student->last_name . ' Fees Receipt.pdf';
     $batch_id = $collection->batch_id;
     //saving receipt details
     $receipt = FeeReceipt::model()->findByAttributes(array('student' => $student_id, 'batch' => $batch_id, 'collection' => $collection_id));
     if ($receipt == NULL) {
         $newReceipt = new FeeReceipt();
         $newReceipt->student = $student_id;
         $newReceipt->batch = $batch_id;
         $newReceipt->collection = $collection_id;
         if ($newReceipt->validate()) {
             $newReceipt->save();
             $receipt_no = $newReceipt->id;
         }
     } else {
         $receipt_no = $receipt->id;
     }
     # HTML2PDF has very similar syntax
     $html2pdf = Yii::app()->ePdf->HTML2PDF();
     $receipt_type = "student_copy";
     $html2pdf->WriteHTML($this->renderPartial('partialreceipt', array('transaction_id' => $_REQUEST['id'], 'batch_id' => $batch_id, 'collection_id' => $collection_id, 'student_id' => $student_id, 'receipt_no' => $receipt_no, 'receipt_type' => $receipt_type), true));
     $html2pdf->WriteHTML("<br/><br/><br/><br/><br/>");
     $receipt_type = "office_copy";
     $html2pdf->WriteHTML($this->renderPartial('partialreceipt', array('transaction_id' => $_REQUEST['id'], 'batch_id' => $batch_id, 'collection_id' => $collection_id, 'student_id' => $student_id, 'receipt_no' => $receipt_no, 'receipt_type' => $receipt_type), true));
     $html2pdf->Output($student);
     //$this->render('printreceipt');
 }
 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;
     }
 }
 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));
             $transaction = FinanceTransaction::model()->DeleteAllByAttributes(array('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;
 }
.tableinnerlist th{
      border-right:1px #b9c7d0 solid;
      border-bottom:1px #b9c7d0 solid;
     padding:4px 10px;
     font-size:10px;
     font-weight:bold;
     text-align:center;
     
    
}
</style>
<?php 
$student = Students::model()->findByAttributes(array('id' => $student_id));
$collection = FinanceFeeCollections::model()->findByAttributes(array('id' => $collection_id));
$category = FinanceFeeCategories::model()->findByAttributes(array('id' => $collection->fee_category_id));
$list = FinanceTransaction::model()->findByAttributes(array('id' => $transaction_id));
$guard = Guardians::model()->findByAttributes(array('id' => $student->parent_id));
//$particulars = FinanceFeeParticulars::model()->findAll("finance_fee_category_id=:x", array(':x'=>$collection->fee_category_id));
$batch = Batches::model()->findByAttributes(array('id' => $batch_id));
$currency = Configurations::model()->findByPk(5);
if ($currency->config_value == "₹") {
    $currency->config_value = '<img src="images/rupee_symbol.png" width="8">';
}
?>

<table width="680" border="1" bgcolor="#f9feff">
  <tr>
    <td>
        <div style="padding:10px 20px;">
            <table width="650" border="0" cellspacing="0" cellpadding="0">
              <tr>
 public function actionDeletes()
 {
     $model = Students::model()->findByAttributes(array('id' => $_REQUEST['sid']));
     $model->saveAttributes(array('is_deleted' => '1'));
     //Adding activity to feed via saveFeed($initiator_id,$activity_type,$goal_id,$goal_name,$field_name,$initial_field_value,$new_field_value)
     ActivityFeed::model()->saveFeed(Yii::app()->user->Id, '7', $model->id, ucfirst($model->first_name) . ' ' . ucfirst($model->middle_name) . ' ' . ucfirst($model->last_name), NULL, NULL, NULL);
     if ($model->uid and $model->uid != NULL and $model->uid != 0) {
         $user = User::model()->findByPk($model->uid);
         if ($user) {
             $profile = Profile::model()->findByPk($user->id);
             if ($profile) {
                 $profile->delete();
             }
             $user->delete();
         }
     }
     $guardian = Guardians::model()->findByAttributes(array('ward_id' => $_REQUEST['sid']));
     if ($guardian->uid and $guardian->uid != NULL and $guardian->uid != 0) {
         $parent_user = User::model()->findByPk($guardian->uid);
         if ($parent_user) {
             $profile = Profile::model()->findByPk($parent_user->id);
             if ($profile) {
                 $profile->delete();
             }
             $parent_user->delete();
         }
     }
     $examscores = ExamScores::model()->DeleteAllByAttributes(array('student_id' => $_REQUEST['sid']));
     $transactions = FinanceTransaction::model()->deleteAll('collection_id=:x', array(':x' => $_REQUEST['sid']));
     $this->redirect(array('/courses/batches/batchstudents', 'id' => $_REQUEST['id']));
 }