public function feecategory($data, $row)
 {
     $fees_category = FinanceFeeCategories::model()->findByAttributes(array('id' => $data->fee_category_id, 'is_deleted' => 0));
     if (count($fees_category) > 0) {
         return $fees_category->name;
     } else {
         return '-';
     }
 }
 public function actionAjax_Create()
 {
     if (isset($_POST['FinanceFeeCategories'])) {
         //$model=new FinanceFeeCategories;
         //set the submitted values
         $model->attributes = $_POST['FinanceFeeCategories'];
         $list = $_POST['FinanceFeeCategories'];
         $count = sizeof($list['batch_id']);
         for ($i = 0; $i < $count; $i++) {
             $batch = Batches::model()->findByAttributes(array('id' => $list['batch_id'][$i]));
             $course = Courses::model()->findByAttributes(array('id' => $batch->course_id));
             $model = new FinanceFeeCategories();
             $model->name = $list['name'];
             $model->description = $list['name'] . ' for ' . $batch->name . '( ' . $course->course_name . ') ' . $list['description'];
             $model->batch_id = $list['batch_id'][$i];
             $model->is_deleted = $list['is_deleted'];
             $model->is_master = $list['is_master'];
             $model->created_at = $list['created_at'];
             $model->updated_at = $list['updated_at'];
             $model->save();
         }
         echo json_encode(array('success' => true));
         exit;
     }
 }
Example #3
0
         <?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));
        		if($particular!=NULL)
        		{
        			foreach($particular as $particulars)
        			{
        				$amount = $amount+$particulars->amount;
        			}
        		}*/
        ?>
		  
			<tr>
			  <td><?php 
        if (@$cat) {
            echo $cat->name;
        }
 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
        </table>
    </div>
    <!-- End Header -->
    <br /><br />
    <span align="center"><h4><?php 
    echo Yii::t('fees', 'LIST OF STUDENTS WITH NO FEE DUES');
    ?>
</h4></span>
    <!-- Fees and course details -->
    <div style="border:#CCC 1px; width:700px; padding:10px 10px; background:#E1EAEF;">
        <table style="font-size:14px;">
            <?php 
    $batch = Batches::model()->findByAttributes(array('id' => $_REQUEST['batch']));
    $course_name = Courses::model()->findByAttributes(array('id' => $batch->course_id));
    $collection = FinanceFeeCollections::model()->findByAttributes(array('id' => $_REQUEST['collection']));
    $category = FinanceFeeCategories::model()->findByAttributes(array('id' => $collection->fee_category_id));
    $particulars = FinanceFeeParticulars::model()->findAll("finance_fee_category_id=:x", array(':x' => $collection->fee_category_id));
    $currency = Configurations::model()->findByPk(5);
    if ($currency->config_value == "₹") {
        $currency->config_value = '<img src="images/rupee_symbol.png" width="8">';
    }
    ?>
            <tr>
                <td style="width:100px;"><b><?php 
    echo Yii::t('fees', 'Course');
    ?>
</b></td>
                <td style="width:10px;">:</td>
                <td style="width:250px;"><?php 
    echo $course_name->course_name;
    ?>
Example #6
0
                                                                                                 $.js_afterValidateAttribute(form, attribute, data, hasError);
                                                                                                                            }')));
    ?>
    <?php 
    echo $form->errorSummary($model, '
    <div style="font-weight:bold">' . Yii::t('fees', 'Please correct these errors:') . '</div>
    ', NULL, array('class' => 'errorsum notification errorshow png_bg'));
    ?>
    <p class="note">Fields with <span class="required">*</span> are required.</p>
		
          <div class="row">
            <?php 
    echo $form->labelEx($model, 'fee_category_id', array('style' => 'color:#222222'));
    ?>
             <?php 
    $models = FinanceFeeCategories::model()->findAll("is_master=:x", array(':x' => 1));
    $data = array();
    foreach ($models as $model_1) {
        $posts = Batches::model()->findByPk($model_1->batch_id);
        $data[$model_1->id] = @$model_1->name . '-' . @$posts->name . '(' . @$model_1->description . ')';
    }
    ?>
            
            <?php 
    echo $form->dropDownList($model, 'fee_category_id', $data, array('empty' => 'Select Fee Category'));
    ?>
        <span style="margin-top:0px; position: relative; right:83px; top:6px;" id="success-FinanceFeeCollections_fee_category_id"
              class="hid input-notification-success  success png_bg right"></span>
        <div>
            <small></small>
        </div>
Example #7
0
Yii::app()->clientScript->registerScript('ajax-link-handler2-user', "\n\$('#userloaddrop_link a').live('click', function(event){\n\t   \$.ajax({\n                'type':'get',\n                'url':\$(this).attr('href'),\n                'dataType': 'html',\n                'success':function(data){\n                        \$('#user_panel_handler').html(data);\n\t\t\t\t\t\t\n                }\n        });\n        event.preventDefault();\n});\n");
Yii::app()->clientScript->registerScript('ajax-link-handler1', "\n\$('#student_div a').live('click', function(event){\n\t\$.ajax({\n                'type':'get',\n                'url':\$(this).attr('href'),\n                'dataType': 'html',\n                'success':function(data){\n\t\t\t\t\tvar label = data.split('@#\$`')[0];\n\t\t\t\t\tvar id = data.split('@#\$`')[1];\n\t\t\t\t\t\n                        \$('#name_widget').val(label);\n\t\t\t\t\t\t\$('#id_widget').val(id);\n\t\t\t\t\t\t\$('#explorer_handler').html('');\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n                }\n        });\n        event.preventDefault();\n});\n");
Yii::app()->clientScript->registerScript('ajax-link-handler1-user', "\n\$('#user_div a').live('click', function(event){\n\t\$.ajax({\n                'type':'get',\n                'url':\$(this).attr('href'),\n                'dataType': 'html',\n                'success':function(data){\n\t\t\t\t\tvar label = data.split('@#\$`')[0];\n\t\t\t\t\tvar id = data.split('@#\$`')[1];\n\t\t\t\t\t\n                        \$('#name_widget').val(label);\n\t\t\t\t\t\t\$('#id_widget').val(id);\n\t\t\t\t\t\t\$('#explorer_handler').html('');\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n                }\n        });\n        event.preventDefault();\n});\n");
$setup_stu = false;
$setup_emp = false;
$setup_cou = false;
$setup_fee = false;
$setup_tim = false;
$setup_lib = false;
$setup_hos = false;
$setup_tra = false;
$setups = 0;
$exp_stu = Students::model()->findAll();
$exp_emp = Employees::model()->findAll();
$exp_cou = Courses::model()->findAll();
$exp_fee = FinanceFeeCategories::model()->findAll();
$exp_tim = TimetableEntries::model()->findAll();
Yii::app()->getModule('library');
$exp_lib = Book::model()->findAll();
Yii::app()->getModule('hostel');
$exp_hos = Hosteldetails::model()->findAll();
Yii::app()->getModule('transport');
$exp_tra = RouteDetails::model()->findAll();
if (count($exp_stu)) {
    $setup_stu = true;
    $setups++;
}
if (count($exp_emp)) {
    $setup_emp = true;
    $setups++;
}
<?php 
$this->renderPartial('//assesments/left_side');
?>
    
    </td>
    <td valign="top">
    <div class="cont_right formWrapper">
    
    <h1>Create Additional View</h1>
    
    <div class="formCon" style="width:60%">

    <div class="formConInner">
    <?php 
if (isset($_REQUEST['id'])) {
    $posts_1 = FinanceFeeCategories::model()->findByAttributes(array('id' => $_REQUEST['id']));
    $posts = FinanceFeeCollections::model()->findByAttributes(array('fee_category_id' => $posts_1->id));
    ?>
	<table width="50%">
    <tr>
     <td>Category Name</td>
     <td></td>
     <td><?php 
    echo $posts_1->name;
    ?>
</td>
    </tr>
    <tr>
     <td>Description</td>
     <td></td>
     <td><?php 
Example #9
0
    $val = $_REQUEST['id'];
} else {
    $val = '';
}
echo CHtml::dropDownList('batch', '', $data, array('onchange' => 'batch()', 'id' => 'batchdrop', 'empty' => 'Select Batch', 'options' => array($val => array('selected' => true))));
if (isset($_REQUEST['id'])) {
    $criteria = new CDbCriteria();
    $criteria->compare('is_deleted', 0);
    // normal DB field
    $criteria->compare('batch_id', $_REQUEST['id']);
    $total = FinanceFeeCategories::model()->count($criteria);
    $pages = new CPagination($total);
    $pages->setPageSize(Yii::app()->params['listPerPage']);
    $pages->applyLimit($criteria);
    // the trick is here!
    $posts = FinanceFeeCategories::model()->findAll($criteria);
    ?>
 <div class="tablebx">  
 	  <table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr class="tablebx_topbg">
        <td>Sl. No.</td>	
        <td>Fees Name</td>
        <td>Batch Name</td>
        <td>Created Date </td>
        <td>Select </td>
        <!--<td style="border-right:none;">Task</td>-->
      </tr>
      
	<?php 
    $i = 1;
    foreach ($posts as $posts_1) {
 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_Create()
 {
     if (isset($_POST['FinanceFeeCollections'])) {
         $list = $_POST['FinanceFeeCollections'];
         $model = new FinanceFeeCollections();
         $model->attributes = $_POST['FinanceFeeCollections'];
         if ($model->start_date) {
             $model->start_date = date('Y-m-d', strtotime($model->start_date));
         }
         if ($model->end_date) {
             $model->end_date = date('Y-m-d', strtotime($model->end_date));
         }
         if ($model->due_date) {
             $model->due_date = date('Y-m-d', strtotime($model->due_date));
         }
         $cat = FinanceFeeCategories::model()->findByAttributes(array('id' => $list['fee_category_id']));
         $model->batch_id = $cat->batch_id;
         //return the JSON result to provide feedback.
         $student = Students::model()->findAll("batch_id=:x and is_active=:y and is_deleted=:z", array(':x' => $cat->batch_id, ':y' => 1, ':z' => 0));
         if ($model->save(false)) {
             foreach ($student as $students) {
                 $finance = new FinanceFees();
                 $finance->fee_collection_id = $model->id;
                 $finance->student_id = $students->id;
                 $finance->is_paid = 0;
                 $finance->save();
             }
             echo json_encode(array('success' => true, 'id' => $model->primaryKey));
             exit;
         } else {
             echo json_encode(array('success' => false));
             exit;
         }
     }
 }
Example #12
0
echo Yii::t('fees', 'Amount');
?>
</td>
    <td><?php 
echo $model->amount;
?>
</td>
  </tr>
  <tr>
    <td><?php 
echo Yii::t('fees', 'Finance Fee Category');
?>
</td>
    <td>
	<?php 
$category = FinanceFeeCategories::model()->findByAttributes(array('id' => $model->finance_fee_category_id));
echo $category->name;
?>
</td>
  </tr>
  <tr>
    <td><?php 
echo Yii::t('fees', 'Student Category');
?>
</td>
    <td>
	<?php 
$student_category = StudentCategories::model()->findByAttributes(array('id' => $model->student_category_id));
if ($student_category) {
    echo $student_category->name;
} else {