コード例 #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.');
コード例 #2
0
 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'));
     }
 }
コード例 #3
0
 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 actionPartialfees()
 {
     if (isset($_POST['FinanceFees']) and isset($_POST['FinanceFees']['fees_paid'])) {
         $model = $this->loadModel($_POST['FinanceFees']['id']);
         $dt = date('Y-m-d');
         $model->saveAttributes(array('date' => $dt));
         $student = Students::model()->findByAttributes(array('id' => $_POST['FinanceFees']['student_id']));
         $collection = FinanceFeeCollections::model()->findByAttributes(array('id' => $_POST['FinanceFees']['fee_collection_id']));
         $check_admission_no = FinanceFeeParticulars::model()->findAllByAttributes(array('finance_fee_category_id' => $collection->fee_category_id, 'admission_no' => $student->admission_no));
         $to_student = "";
         if (count($check_admission_no) > 0) {
             // If any particular is present for this student
             $adm_amount = 0;
             foreach ($check_admission_no as $adm_no) {
                 $adm_amount = $adm_amount + $adm_no->amount;
             }
             $fees = $adm_amount;
         } else {
             // If any particular is present for this student category
             $check_student_category = FinanceFeeParticulars::model()->findAllByAttributes(array('finance_fee_category_id' => $collection->fee_category_id, 'student_category_id' => $student->student_category_id, 'admission_no' => ''));
             if (count($check_student_category) > 0) {
                 $cat_amount = 0;
                 foreach ($check_student_category as $stu_cat) {
                     $cat_amount = $cat_amount + $stu_cat->amount;
                 }
                 $fees = $cat_amount;
             } else {
                 //If no particular is present for this student or student category
                 $check_all = FinanceFeeParticulars::model()->findAllByAttributes(array('finance_fee_category_id' => $collection->fee_category_id, 'student_category_id' => NULL, 'admission_no' => ''));
                 if (count($check_all) > 0) {
                     $all_amount = 0;
                     foreach ($check_all as $all) {
                         $all_amount = $all_amount + $all->amount;
                     }
                     $fees = $all_amount;
                 } else {
                     $fees = 0;
                     // If no particular is found.
                 }
             }
         }
     } elseif (isset($_REQUEST['id'])) {
         $model = $this->loadModel($_REQUEST['id']);
     }
     // Flag to know if we will render the form or try to add
     // new jon.
     $flag = true;
     if (isset($_POST['FinanceFees']) and isset($_POST['FinanceFees']['fees_paid'])) {
         $flag = false;
         $fees_paid = $model->fees_paid + $_POST['FinanceFees']['fees_paid'];
         if ($model->saveAttributes(array('fees_paid' => $fees_paid))) {
             $transaction = new FinanceTransaction();
             $transaction->amount = $_POST['FinanceFees']['fees_paid'];
             $transaction->collection_id = $_POST['FinanceFees']['fee_collection_id'];
             $transaction->student_id = $_POST['FinanceFees']['student_id'];
             $transaction->transaction_date = date('Y-m-d');
             $transaction->save();
             if ($fees == $fees_paid) {
                 $model->saveAttributes(array('is_paid' => 1));
             }
             $sms_settings = SmsSettings::model()->findByAttributes(array('settings_key' => 'FeesEnabled'));
             if ($sms_settings->is_enabled == '1') {
                 // Checking if SMS is enabled.
                 $guardian = Guardians::model()->findByAttributes(array('ward_id' => $_POST['FinanceFees']['student_id']));
                 $student = Students::model()->findByAttributes(array('id' => $_POST['FinanceFees']['student_id']));
                 if (count($guardian) != 0 && $guardian->mobile_phone && $guardian->mobile_phone != "") {
                     $to = $guardian->mobile_phone;
                 } else {
                     if ($student->phone1) {
                         $to = $student->phone1;
                     } else {
                         if ($student->phone2) {
                             $to = $student->phone2;
                         }
                     }
                 }
                 $balance = $fees - $fees_paid > 0 ? $fees - $fees_paid : 0;
                 SmsSettings::model()->sendSmsFees($to, $student->first_name . ' ' . $student->last_name, $fees_paid, $balance);
                 if (defined('EMAIL_ALERT_ADDRESS')) {
                     UserModule::sendMail(constant('EMAIL_ALERT_ADDRESS'), UserModule::t("Student paid fees : {student_name}", array('{student_name}' => $student->first_name . ' ' . $student->last_name)), UserModule::t("Student has paid fees: {student_name} of Rs. {fee_amount}", array('{student_name}' => $old_model->firstname . " " . $old_model->lastname, 'fee_amount' => $fees_paid)));
                 }
             }
             echo CJSON::encode(array('status' => 'success'));
             exit;
         } else {
             echo CJSON::encode(array('status' => 'error'));
             exit;
         }
     }
     if ($flag) {
         Yii::app()->clientScript->scriptMap['jquery.js'] = false;
         $this->renderPartial('partialfees', array('model' => $model), false, true);
     }
 }
コード例 #5
0
 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;
     }
 }
コード例 #6
0
 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;
 }
コード例 #7
0
.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>
コード例 #8
0
 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']));
 }