GIF89a; CRX
KBHT HEHE
Server IP : 172.26.0.195  /  Your IP : 3.142.124.119
Web Server : Apache
System : Linux 43-205-77-33.cprapid.com 3.10.0-1160.119.1.el7.tuxcare.els2.x86_64 #1 SMP Mon Jul 15 12:09:18 UTC 2024 x86_64
User : jnclnmuac ( 1026)
PHP Version : 8.0.30
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON
Directory (0755) :  /home/jnclnmuac/public_html/web/pdf/../../cas/../cas/application/views/admin/fee/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home/jnclnmuac/public_html/web/pdf/../../cas/../cas/application/views/admin/fee/collectFeeOld.php
<!DOCTYPE HTML>
<html>
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
        <title>Collect Fee (Old) | College Automation System | <?php echo $this->session->userdata("adminData")["branch_short_name"]; ?></title>
        <link rel="stylesheet" href="<?php echo base_url("assets/admin/css/style.css"); ?>">
        <link rel="stylesheet" href="<?php echo base_url("assets/admin/css/bootstrap-select.min.css"); ?>" type='text/css'>
        <link rel="stylesheet" href="<?php echo base_url("assets/admin/css/jquery-ui.css"); ?>">
        <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Nunito:300,400,600,700,800,900&amp;display=swap">
        <link rel="image icon" href="<?php echo base_url("assets/admin/images/logo.png"); ?>">
        <script src="<?php echo base_url("assets/admin/js/jquery-1.10.2.min.js"); ?>"></script>
        <script src="<?php echo base_url("assets/admin/js/jquery-ui.js"); ?>"></script>
        <script src="<?php echo base_url("assets/admin/js/bootstrap.min.js"); ?>"></script>
        <script>
            var csrfHash = '';
        </script>
    </head>
    <body>
        <div class="se-pre-con"></div>
        <section>
            <?php $this->load->view("admin/navAndHeader"); ?>
            <div class="main-content">
                <div class="container-fluid content-top-gap">
                    <nav aria-label="breadcrumb">
                        <ol class="breadcrumb my-breadcrumb">
                            <li class="breadcrumb-item"><a href="<?php echo site_url("admin/Dashboard"); ?>">Home</a></li>
                            <li class="breadcrumb-item" aria-current="page"><a href="<?php echo site_url("admin/Fee/"); ?>">Fee Management</a></li>
                            <li class="breadcrumb-item" aria-current="page"><a href="<?php echo site_url("admin/Fee/collectFeeOld"); ?>">Collect Fee (Old)</a></li>
                        </ol>
                    </nav>
                    <section class="forms">
                        <div class="card card_border py-2 mb-4">
                            <div class="cards__heading">
                                <h3><i class="fa fa-inr"></i>&nbsp;<i class="fa fa-plus"></i> Collect Fee (Old)</h3>
                            </div>
                            <div class="card-body">
                                <?php if (validation_errors() != false) { ?>
                                    <div class="alert alert-danger"> <strong><?php echo validation_errors(); ?></strong> </div>
                                <?php } ?>
                                <?php if ($this->session->flashdata('successMessage')) { ?>
                                    <div class="alert alert-success alert-dismissible fade show"> 
                                        <strong><?php echo $this->session->flashdata('successMessage'); ?></strong> 
                                        <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                                            <span aria-hidden="true">&times;</span>
                                        </button>
                                    </div>
                                <?php } ?>
                                <?php if ($this->session->flashdata('errorMessage')) { ?>
                                    <div class="alert alert-danger alert-dismissible fade show"> 
                                        <strong><?php echo $this->session->flashdata('errorMessage'); ?></strong> 
                                        <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                                            <span aria-hidden="true">&times;</span>
                                        </button>
                                    </div>
                                <?php } ?>
                                <?php echo form_open(site_url('admin/Fee/collectFeeOld'), ['name' => 'feeCollectionOldFrm', 'id' => 'feeCollectionOldFrm']); ?>
                                <div class="form-row">
                                    <div class="form-group col-md-12">
                                        <label for="formEnrlRollNo" class="input__label">Form No./Enrl. No./Roll No. *</label>
                                        <input type="text" class="form-control" id="formEnrlRollNo" name="formEnrlRollNo" value="<?php echo set_value('formEnrlRollNo'); ?>" placeholder="Enter Form No./Enrl. No./Roll No." maxlength="50" autocomplete="off">
                                    </div>
                                </div>
                                <div class="form-row">
                                    <div class="col-md-12">
                                        <label for="fetchStudentInfo" class="input__label"></label>
                                        <span id="spnErr" class="pull-left" style="color:#FF0000;font-weight: bolder;font-size: smaller;"><?php echo $error; ?></span>
                                        <button type="submit" id="fetchStudentInfo" name="fetchStudentInfo" class="btn btn-sm btn-warning pull-right">Fetch Student & Fee Info&nbsp;<i class="fa fa-arrow-left"></i></button>
                                    </div>
                                </div>
                                <?php if (sizeof($studentInfo)) { ?>
                                    <fieldset id="studentDetails">
                                        <legend>Student Info</legend>
                                        <div>
                                            <table border="1" class="table table-warning table-hover table-striped">
                                                <tr>
                                                    <td rowspan="3">
                                                        <a href="<?php echo $studentInfo['stu_photograph']; ?>" target="_blank" title="Click To Open Photograph"><img src="<?php echo $studentInfo['stu_photograph']; ?>" id="photograph" height="78px" alt="Photograph Not Available"/></a><br><br>
                                                        <a href="<?php echo $studentInfo['stu_sign']; ?>" target="_blank" title="Click To Open Signature"><img src="<?php echo $studentInfo['stu_sign']; ?>" id="sign" width="78px" alt="Signature Not Available"/></a>
                                                    </td>
                                                    <th>Form No.</th>
                                                    <td><b><span id="formNo" style="color:#002166;text-decoration: underline;font-size: smaller;"><?php echo $studentInfo['stu_form_no']; ?></span></b></td>
                                                    <th>Enrl. No.</th>
                                                    <td><b><span id="enrollmentNo" style="color:#002166;text-decoration: underline;font-size: smaller;"><?php echo $studentInfo['stu_enrollment_no']; ?></span></b></td>
                                                    <th>Roll No.</th>
                                                    <td><b><span id="rollNo" style="color:#002166;text-decoration: underline;font-size: smaller;"><?php echo $studentInfo['stu_roll_no']; ?></span></b></td>
                                                </tr>
                                                <tr>
                                                    <th>Name</th>
                                                    <td><b><span id="name" style="color:#002166;text-decoration: underline;font-size: smaller;"><?php echo $studentInfo['stu_name']; ?></span></b></td>
                                                    <th>Father's Name</th>
                                                    <td><b><span id="fatherName" style="color:#002166;text-decoration: underline;font-size: smaller;"><?php echo $studentInfo['stu_father_name']; ?></span></b></td>
                                                    <th>D.O.B.</th>
                                                    <td><b><span id="dob" style="color:#002166;text-decoration: underline;font-size: smaller;"><?php echo $studentInfo['stu_dob']; ?></span></b></td>
                                                </tr>
                                                <tr>
                                                    <th>Course</th>
                                                    <td><b><span id="course" style="color:#002166;text-decoration: underline;font-size: smaller;"><?php echo $studentInfo['stu_course'] . " (" . $studentInfo['stu_entry_type'] . ")"; ?></span></b></td>
                                                    <th>Batch</th>
                                                    <td><b><span id="batch" style="color:#002166;text-decoration: underline;font-size: smaller;"><?php echo $studentInfo['stu_batch']; ?></span></b></td>
                                                    <th>Current Semester/Year</th>
                                                    <td><b><span id="semesterOrYear" style="color:#002166;text-decoration: underline;font-size: smaller;"><?php echo $studentInfo['stu_current_semester']; ?></span></b></td>
                                                </tr>
                                                <tr>
                                                    <th colspan="2">Scholarship Eligibility & Applicable Percentage</th>
                                                    <td colspan="1"><b><span style="color:#002166;text-decoration: underline;font-size: smaller;"><?php echo $studentInfo['stu_sch_eligible']; ?></span></b></td>
                                                    <th colspan="1">Gender & Category</th>
                                                    <td colspan="1"><b><span style="color:#002166;text-decoration: underline;font-size: smaller;"><?php echo $studentInfo['stu_gender'] . "/" . $studentInfo['stu_category']; ?></span></b></td>
                                                    <th colspan="2"><a href="<?php echo site_url("admin/FeeConfig/editStudentFee/" . $studentInfo['stu_id'] . "/N"); ?>"><i class="fa fa-hand-o-up"></i> <span id="course" style="color:#002166;text-decoration: underline;font-size: smaller;">Click To Edit Fee Structure Of This Student</span></a></th>
                                                </tr>
                                            </table>
                                        </div>
                                        <input type="hidden" name="tspi_id" value="<?php echo $studentInfo['stu_id']; ?>">
                                    </fieldset>
                                <?php } ?>
                                <?php if (sizeof($feeInfo)) { ?>
                                    <fieldset id="feeToSubmitDetails">
                                        <legend>Following Amount Is Due And Needs To Be Collected</legend>
                                        <div class="form-row">
                                            <?php if (sizeof($feeInfo[0]['counselling_fee_info'])) { ?>
                                                <table style="width:100%" class="table table-danger table-bordered">
                                                    <tr>
                                                        <th>Councelling Fee/Paid To University <i class="fa fa-university"></i></th>
                                                        <th>Amount <i class="fa fa-inr"></i></th>
                                                        <th>Payment Mode <i class="fa fa-credit-card"></i></th>
                                                        <th>Chq/DD/NEFT/UPI/Txn. Id</th>
                                                        <th>Date <i class="fa fa-calendar"></i></th>
                                                    </tr>
                                                    <tr>
                                                        <td><input type="checkbox" id="paidCouncellingFee" name="paidCouncellingFee" value="A" disabled="disabled" checked="checked"><label for="paidCouncellingFee"> Paid.</label></td>
                                                        <td><input type="text" name="councellingFeeAmt" id="councellingFeeAmt"  class="input-sm form-control readonly" placeholder="Enter Submitted Amount" value="<?php echo $feeInfo[0]['counselling_fee_info'][0]->fcnm_amount; ?>"></td>
                                                        <td>
                                                            <select id="councellingFeeMode" name="councellingFeeMode" class="custom-select readonly">
                                                                <option value="">Select Payment Mode</option>
                                                                <?php
                                                                foreach ($feeModes as $mode) {
                                                                    $selected = ($feeInfo[0]['counselling_fee_info'][0]->fcnm_mode == $mode->fmm_id) ? "selected" : "";
                                                                    ?>
                                                                    <option value="<?php echo $mode->fmm_id; ?>" <?php echo $selected; ?>><?php echo stripslashes($mode->fmm_short_name); ?></option>
                                                                <?php }
                                                                ?>
                                                            </select>
                                                        </td>
                                                        <td>
                                                            <input type="text" class="form-control readonly" id="councellingChDDTxnNRFN" name="councellingChDDTxnNRFN" value="<?php echo stripslashes($feeInfo[0]['counselling_fee_info'][0]->fcnm_ref_no); ?>" placeholder="Enter Ref. No." maxlength="200">
                                                        </td>
                                                        <td><input type="text" class="form-control readonly" id="councellingFeePaymentDate" name="councellingFeePaymentDate" value="<?php echo date('d/m/Y', strtotime($feeInfo[0]['counselling_fee_info'][0]->fcnm_date)); ?>" placeholder="Payment Date (DD/MM/YYYY)" autocomplete="off" maxlength="50"></td>
                                                    </tr>
                                                </table>
                                            <?php } else {
                                                ?>
                                                <table style="width:100%" class="table table-default table-bordered">
                                                    <tr>
                                                        <th>Councelling Fee/Paid To University <i class="fa fa-university"></i></th>
                                                        <th>Amount <i class="fa fa-inr"></i></th>
                                                        <th>Payment Mode <i class="fa fa-credit-card"></i></th>
                                                        <th>Chq/DD/NEFT/UPI/Txn. Id</th>
                                                        <th>Date <i class="fa fa-calendar"></i></th>
                                                    </tr>
                                                    <tr>
                                                        <td><input type="checkbox" id="paidCouncellingFee" name="paidCouncellingFee" value="A"><label for="paidCouncellingFee">Select this checkbox if student has already paid some amount in university.</label></td>
                                                        <td><input type="text" name="councellingFeeAmt" id="councellingFeeAmt"  class="input-sm form-control readonly" onkeypress="return isValidAmount(event);" onkeyup="" onfocus="if (parseFloat(this.value) === 0.0) {
                                                                    this.value = '';
                                                                }" placeholder="Enter Submitted Amount" value="0.0" tabindex="-1"></td>
                                                        <td>
                                                            <select id="councellingFeeMode" name="councellingFeeMode" class="custom-select readonly">
                                                                <option value="">Select Payment Mode</option>
                                                                <?php foreach ($feeModes as $mode) { ?>
                                                                    <option value="<?php echo $mode->fmm_id; ?>" <?php echo set_select("councellingFeeMode", $mode->fmm_id); ?>><?php echo stripslashes($mode->fmm_short_name); ?></option>
                                                                <?php }
                                                                ?>
                                                            </select>
                                                        </td>
                                                        <td>
                                                            <input type="text" class="form-control readonly" id="councellingChDDTxnNRFN" name="councellingChDDTxnNRFN" value="" placeholder="Enter Ref. No." maxlength="200" >
                                                        </td>
                                                        <td><input type="text" class="form-control readonly" id="councellingFeePaymentDate" name="councellingFeePaymentDate" value="" placeholder="Payment Date (DD/MM/YYYY)" autocomplete="off" maxlength="50" tabindex="-1"></td>
                                                    </tr>
                                                </table>
                                                <?php
                                            }
                                            ?>
                                        </div>
                                        <div class="form-row">
                                            <table style="width:100%" class="table table-default table-bordered">
                                                <tr>
                                                    <th>Receipt Title <i class="fa fa-file-o"></i></th>
                                                    <th>Fee Head Filter <i class="fa fa-filter"></i></th>
                                                    <th>Semester/Year Filter <i class="fa fa-filter"></i></th>
                                                </tr>
                                                <tr>
                                                    <td>
                                                        <select name="receiptTitle" class="custom-select">
                                                            <option value="Receipt">Receipt</option>
                                                            <option value="Main Receipt">Main Receipt</option>
                                                            <option value="Miscellaneous Receipt">Miscellaneous Receipt</option>
                                                            <option value="Hostel Receipt">Hostel Receipt</option>
                                                            <option value="Transport Receipt">Transport Receipt</option>
                                                        </select>
                                                    </td>
                                                    <td>
                                                        <select id="feeTypeFilter" name="feeTypeFilter" class="custom-select">
                                                            <option value="">All</option>
                                                            <option value="Hostel">Hostel Fee</option>
                                                            <option value="Transport">Transport Fee</option>
                                                        </select>
                                                    </td>
                                                    <td>
                                                        <select id="semOrYearFilter" name="semOrYearFilter" class="custom-select">
                                                            <option value="">All</option>
                                                            <option value="1">1 Sem./Year</option>
                                                            <option value="2">2 Sem./Year</option>
                                                            <option value="3">3 Sem./Year</option>
                                                            <option value="4">4 Sem./Year</option>
                                                            <option value="5">5 Sem./Year</option>
                                                            <option value="6">6 Sem./Year</option>
                                                            <option value="7">7 Sem./Year</option>
                                                            <option value="8">8 Sem./Year</option>
                                                        </select>
                                                    </td>
                                                </tr>
                                            </table>
                                        </div>
                                        <div class="form-row">
                                            <table id="collectionTable"  style="width:100%;" class="table table-active table-bordered">
                                                <tr>
                                                    <th>Select</th>
                                                    <th class="col2">Fee Head</th>
                                                    <th>Applicable Amount</th>
                                                    <th>Paid Amount</th>
                                                    <th style="width:12%">Due Amount</th>
                                                    <th class="col6">Due For</th>
                                                    <th>For Session</th>
                                                    <th style="width:15%">Amount Collected</th>
                                                </tr>
                                                <?php
                                                for ($i = 0; $i < sizeof($feeInfo); $i++) {
                                                    ?>
                                                    <tr <?php
                                                    if (!$feeInfo[$i]['is_field_enabled']) {
                                                        echo "style='background-color:#ffcedc'";
                                                    }
                                                    ?>>
                                                        <th><input type="checkbox" name="selectedFssmIds[]" onClick="validateCheckBox(<?php echo $i; ?>);" value="<?php echo $feeInfo[$i]['fssm_id']; ?>" <?php
                                                            if (!$feeInfo[$i]['is_field_enabled']) {
                                                                echo "checked='checked' disabled='disabled'";
                                                            }
                                                            ?>>
                                                        </th>
                                                        <th class="col2"><label><?php echo $feeInfo[$i]['fhm_name']; ?></label></th>
                                                        <td><label><?php echo $feeInfo[$i]['fssm_amount']; ?></label></td>
                                                        <td><label><?php echo $feeInfo[$i]['fssm_paid_amount']; ?></label></td>
                                                        <td><label><?php echo $feeInfo[$i]['fssm_due_amount']; ?></label><br><span id="cfAdj<?php echo $i; ?>" style="color:#FF0000;font-weight: bolder"></span></td>
                                                        <td class="col6"><label><?php echo $feeInfo[$i]['paying_for_year_sem'] . " " . $feeInfo[$i]['course_time_type']; ?></label></td>
                                                        <td>
                                                            <select name="sessions[<?php echo $feeInfo[$i]['fssm_id']; ?>]" id="forSession<?php echo $i; ?>" class="custom-select readonly">
                                                                <?php foreach ($sessions as $session) { ?>
                                                                    <option <?php ($session->session_status == "C") ? "" : ""; ?> value="<?php echo $session->session_id; ?>"><?php echo stripslashes($session->session_name); ?></option>
                                                                <?php }
                                                                ?>
                                                            </select>
                                                        </td>
                                                        <td><input type="text" name="submittedAmt[<?php echo $i; ?>]" id="submittedAmt<?php echo $i; ?>"  class="form-control input-sm readonly" onkeypress="return isValidAmount(event);" onkeyup="checkAndSetAmount(<?php echo $i ?>, '<?php echo $feeInfo[$i]['fhm_type']; ?>');
                                                                calculateTotalFee();" onfocus="if (parseFloat(this.value) === 0.0) {
                                                                            this.value = '';
                                                                        }" placeholder="Enter Submitted Amount" value="0.0" tabindex="-1" autocomplete="off">
                                                            <input type="hidden" name="<?php echo "fssm" . $feeInfo[$i]['fssm_id']; ?>" value="<?php echo $i; ?>">   
                                                        </td>
                                                    <input type="hidden" name="fhm_type" id="fhm_type<?php echo $i; ?>" value="<?php echo $feeInfo[$i]['fhm_type']; ?>">
                                                    <input type="hidden" name="fhm_calculation" id="fhm_calculation<?php echo $i; ?>" value="<?php echo $feeInfo[$i]['fhm_calculation']; ?>">
                                                    <input type="hidden" name="fssm_due_amounts_for_use[<?php echo $feeInfo[$i]['fssm_id']; ?>]" id="dueAmtForUse<?php echo $i; ?>" value="<?php echo $feeInfo[$i]['fssm_due_amount_hidden']; ?>">
                                                    <input type="hidden" name="fssm_amounts[<?php echo $feeInfo[$i]['fssm_id']; ?>]" value="<?php echo $feeInfo[$i]['fssm_amount_hidden']; ?>">
                                                    <input type="hidden" name="fssm_due_amounts[<?php echo $feeInfo[$i]['fssm_id']; ?>]" id="dueAmt<?php echo $i; ?>" value="<?php echo $feeInfo[$i]['fssm_due_amount_hidden']; ?>">
                                                    <input type="hidden" name="payingForSemOrYear[<?php echo $feeInfo[$i]['fssm_id']; ?>]" value="<?php echo $feeInfo[$i]['paying_for_year_sem']; ?>">
                                                    <input type="hidden" name="isFirstPayment" value="<?php echo $feeInfo[$i]['is_first_payment']; ?>">
                                                    </tr>
                                                <?php } ?>
                                                <tr>
                                                    <td colspan="8">
                                                        Note:
                                                        <ol>
                                                            <li>Please Check The Box Againt The Collected Amount. Filled Amount Will Not Be Saved If The Checkbox Is Not Checked.</li>
                                                            <li>Blank Amount Will Be Treated As INR 0/-.</li>
                                                        </ol>
                                                    </td>
                                                </tr>
                                                <tr style="border-top:4px solid #000;">
                                                    <th colspan="7">Total Fee Collected</th>
                                                    <td colspan="1">
                                                        <input type="text" class="form-control" id="totalFeeCollected" name="totalFeeCollected" value="00.00" placeholder="Total Fee Collected" maxlength="20" readonly="readonly">
                                                    </td>
                                                </tr>
                                            </table>
                                        </div>
                                        <div class="form-row">
                                            <div class="form-group col-md-4">
                                                <label for="feeReceiptNo" class="input__label">Receipt No. *</label>
                                                <input type="text" class="form-control" id="feeReceiptNo" name="feeReceiptNo" value="<?php echo set_value('feeReceiptNo'); ?>" placeholder="Enter Receipt No" autocomplete="off" maxlength="50">
                                            </div>
                                            <div class="form-group col-md-4">
                                                <label for="feeReceiptDate" class="input__label">Receipt Date *</label>
                                                <input type="text" class="form-control" id="feeReceiptDate" name="feeReceiptDate" value="<?php echo set_value('feeReceiptDate'); ?>" placeholder="Enter Receipt Date (DD/MM/YYYY)" autocomplete="off" maxlength="50">
                                            </div>
                                            <div class="form-group col-md-4">
                                                <label for="feeMode" class="input__label">Mode *</label>
                                                <select id="feeMode" name="feeMode" class="custom-select">
                                                    <option value="">Select Payment Mode</option>
                                                    <?php foreach ($feeModes as $mode) { ?>
                                                        <option value="<?php echo $mode->fmm_id; ?>" <?php echo set_select("feeMode", $mode->fmm_id); ?>><?php echo stripslashes($mode->fmm_short_name); ?></option>
                                                    <?php }
                                                    ?>
                                                </select>
                                            </div>
                                        </div>
                                        <div class="form-row">
                                            <div class="form-group col-md-4">
                                                <label for="chDDTxnNRFN" class="input__label">Chq./DD/Txn.Id/NEFT Ref. No. *</label>
                                                <input type="text" class="form-control" id="chDDTxnNRFN" name="chDDTxnNRFN" value="<?php echo set_value("chDDTxnNRFN"); ?>" placeholder="Enter Cheque/DD/Txn.Id/NEFT Ref. No." maxlength="200">
                                            </div>
                                            <div class="form-group col-md-4">
                                                <label for="chDDNEFTDate" class="input__label">Chq./DD/NEFT Date *</label>
                                                <input type="text" class="form-control" id="chDDNEFTDate" name="chDDNEFTDate" value="<?php echo set_value('chDDNEFTDate'); ?>" placeholder="Enter Cheque/DD/NEFT Date (DD/MM/YYYY)" autocomplete="off" maxlength="50">
                                            </div>
                                            <div class="form-group col-md-4">
                                                <label for="bankName" class="input__label">Bank Name *</label>
                                                <input type="text" class="form-control" id="bankName" name="bankName" value="<?php echo set_value('bankName'); ?>" placeholder="Enter Bank Name" autocomplete="off" maxlength="500">
                                            </div>
                                        </div>
                                        <div class="form-row">
                                            <div class="form-group col-md-12">
                                                <label for="bankName" class="input__label">Remarks</label>
                                                <textarea class="form-control" id="remarks" name="remarks" placeholder="Enter Remarks (If Any. Max 500 Chars Allowed)"><?php echo set_value('remarks'); ?></textarea>
                                            </div>
                                        </div>
                                    </fieldset>
                                    <button name="submitFrmBtn" type="button" onClick="submitFee();" class="btn btn-dark btn-block btn-style mt-4"><i class="fa fa-inr"></i>&nbsp;Save And Generate Receipt&nbsp;<i class="fa fa-file-o"></i>&nbsp;<i class="fa fa-arrow-right"></i></button>
                                <?php } echo form_close(); ?>
                            </div>
                        </div>
                    </section>
                </div>
            </div>
        </section>
        <script>
            $(document).ready(function () {
<?php if (sizeof($studentInfo)) { ?>
                    if ('<?php echo $studentInfo['stu_fee_structure_avail']; ?>' !== '1') {
                        $("#stuFeeStructureNotSet").modal('show');
                    }
    <?php
}
?>
                $('#feeTypeFilter').change(function () {
                    $("#collectionTable th.col2:contains('" + $(this).val() + "')").parent().show();
                    $("#collectionTable th.col2:not(:contains('" + $(this).val() + "'))").parent().hide();
                });

                $('#semOrYearFilter').change(function () {
                    $("#collectionTable td.col6:contains('" + $(this).val() + "')").parent().show();
                    $("#collectionTable td.col6:not(:contains('" + $(this).val() + "'))").parent().hide();
                });
            });

            $("#councellingFeePaymentDate").datepicker({
                dateFormat: "dd/mm/yy",
                changeMonth: true,
                changeYear: true,
                maxDate: new Date(),
                numberOfMonths: 1
            });

            $("#chDDNEFTDate").datepicker({
                dateFormat: "dd/mm/yy",
                changeMonth: true,
                changeYear: true,
                maxDate: new Date(),
                numberOfMonths: 1
            });

            $("#feeReceiptDate").datepicker({
                dateFormat: "dd/mm/yy",
                changeMonth: true,
                changeYear: true,
                yearRange: '1980:+0',
                maxDate: 0,
                numberOfMonths: 1
            });

            $("#feeMode").on("change", function () {
                $("#chDDTxnNRFN").val("");
                $("#chDDNEFTDate").val("");
            });

            $("#councellingFeeAmt").on("blur", function () {
                var totalAmounts = <?php echo sizeof($feeInfo); ?>;
                var counsellingFee = $(this).val().trim();
                for (var i = 0; i < totalAmounts; i++) {
                    var fhm_type = "#fhm_type" + i;
                    if ($(fhm_type).val().trim() === "R") {
                        break;
                    }
                }
                if (counsellingFee !== 0 && counsellingFee !== "" && (!isNaN(counsellingFee))) {
                    $("#cfAdj" + i).html("- <i class='fa fa-inr'></i> " + counsellingFee + "/- C.F. Ajd.");
                    $("#dueAmt" + i).val(parseFloat($("#dueAmt" + i).val().trim()) - parseFloat(counsellingFee));
                } else {
                    $("#cfAdj" + i).html("");
                    $("#dueAmt" + i).val($("#dueAmtForUse" + i).val().trim());
                }
            });

            $("#councellingFeeMode").on("change", function () {
                $("#councellingChDDTxnNRFN").val("");
                $("#councellingFeePaymentDate").val("");
            });

            $("#paidCouncellingFee").on("click", function () {
                if ($('input[name="paidCouncellingFee"]:checked').length > 0) {
                    document.getElementById("councellingFeeAmt").classList.remove("readonly");
                    document.getElementById("councellingFeeMode").classList.remove("readonly");
                    document.getElementById("councellingChDDTxnNRFN").classList.remove("readonly");
                    document.getElementById("councellingFeePaymentDate").classList.remove("readonly");
                } else {
                    var totalAmounts = <?php echo sizeof($feeInfo); ?>;
                    $("#councellingFeeAmt").val("0.0");
                    $("#councellingFeeMode").val("");
                    $("#councellingChDDTxnNRFN").val("");
                    $("#councellingFeePaymentDate").val("");
                    document.getElementById("councellingFeeAmt").classList.add("readonly");
                    document.getElementById("councellingFeeMode").classList.add("readonly");
                    document.getElementById("councellingChDDTxnNRFN").classList.add("readonly");
                    document.getElementById("councellingFeePaymentDate").classList.add("readonly");
                    for (var i = 0; i < totalAmounts; i++) {
                        var fhm_type = "#fhm_type" + i;
                        if ($(fhm_type).val().trim() === "Recurring") {
                            break;
                        }
                    }
                    $("#cfAdj" + i).html("");
                    $("#dueAmt" + i).val($("#dueAmtForUse" + i).val().trim());

                }
            });

            function validateCheckBox(index) {
                var feeAmt = "submittedAmt" + index;
                var session = "forSession" + index;
                var selectedFssmIds = document.getElementsByName("selectedFssmIds[]");
                if (selectedFssmIds[index].checked === true) {
                    document.getElementById(feeAmt).classList.remove("readonly");
                    document.getElementById(session).classList.remove("readonly");
                } else {
                    document.getElementById(feeAmt).classList.add("readonly");
                    document.getElementById(session).classList.add("readonly");
                    $("#" + feeAmt).val('0.0');
                }
            }

            function checkAndSetAmount(index, fhm_type) {
                var dueAmt = "#dueAmt" + index;
                var feeAmt = "#submittedAmt" + index;
                var nextFeeAmt = "submittedAmt";
                var nextSession = "forSession";
                var selectedFssmIds = document.getElementsByName("selectedFssmIds[]");
                if (isNaN($(feeAmt).val().trim())) {
                    alert('Only Numbers Are Accepted In Fee Amount Field.');
                    $(feeAmt).val("");
                    $(feeAmt).focus();
                } else if ((parseFloat($(feeAmt).val().trim()) > parseFloat($(dueAmt).val().trim())) && !(fhm_type === 'S' || fhm_type === 'E')) {
                    alert('Collected Amount Can Not Be Greater Than Due Amount : ' + $(dueAmt).val().trim() + '/-');
                    $(feeAmt).val("");
                    $(feeAmt).focus();
                }
                for (var next = (index + 1); next < (selectedFssmIds.length); next++) {
                    selectedFssmIds[next].checked = false;
                    $("#" + nextFeeAmt + next).val('0.0');
                    document.getElementById(nextFeeAmt + next).classList.add("readonly");
                    document.getElementById(nextSession + next).classList.add("readonly");
                    calculateTotalFee();
                }
            }

            function isValidAmount(evt) {
                var charCode = (evt.which) ? evt.which : evt.keyCode;
                if (charCode !== 46 && charCode > 31 && (charCode < 48 || charCode > 57))
                    return false;
                return true;
            }

            function calculateTotalFee() {
                var totalAmounts = <?php echo sizeof($feeInfo); ?>;
                var totalFee = 0.0;
                for (i = 0; i < totalAmounts; i++) {
                    $("input[name='submittedAmt[" + i + "]']").each(function () {
                        var calculation = $("#fhm_calculation" + i).val();
                        if (calculation === '+') {
                            totalFee += ($(this).val().trim() === "") ? 0.0 : parseFloat($(this).val());
                        } else {
                            totalFee -= ($(this).val().trim() === "") ? 0.0 : parseFloat($(this).val());
                        }
                    });
                }
                $("#totalFeeCollected").val(totalFee.toFixed(2));
            }

            function submitFee() {
                if (($('input[name="paidCouncellingFee"]:checked').length > 0) && (isNaN($("#councellingFeeAmt").val().trim()) || (parseFloat($("#councellingFeeAmt").val().trim()) === 0.0))) {
                    $("#councellingFeeAmt").focus();
                    alert("Only Non-Zero Valid Amount Is Accepted In Councelling Fee.");
                } else if (($('input[name="paidCouncellingFee"]:checked').length > 0) && ($("#councellingFeeAmt").val().trim() === "" || isNaN($("#councellingFeeAmt").val().trim()))) {
                    $("#councellingFeeAmt").focus();
                    alert("Please Enter The Councelling Fee That Student Has Submitted In University.");
                } else if (($('input[name="paidCouncellingFee"]:checked').length > 0) && ($("#councellingFeeMode").val().trim() === "")) {
                    $("#councellingFeeMode").focus();
                    alert("Please Select The Payment Mode Of Councelling Fee.");
                } else if (($('input[name="paidCouncellingFee"]:checked').length > 0) && ($("#councellingChDDTxnNRFN").val().trim() === "")) {
                    $("#councellingChDDTxnNRFN").focus();
                    alert("Please Enter Chq./DD/NEFT No/UPI/Txn Ref No & 'NA' In Case Of Cash Payment.");
                } else if (($('input[name="paidCouncellingFee"]:checked').length > 0) && ($("#councellingFeePaymentDate").val().trim() === "")) {
                    $("#councellingFeePaymentDate").focus();
                    alert("Please Enter/Select Coucelling Fee Payment Date.");
                } else if (($("#totalFeeCollected").val().trim() === "00.00") || ($("#totalFeeCollected").val().trim() === "0") || ($("#totalFeeCollected").val().trim() === "0.00") || isNaN($("#totalFeeCollected").val().trim())) {
                    alert("Total Fee Collected Amount Should Not Be 00.00/-. Please Enter Valid Non-Zero Amount.");
                } else if ($("#feeReceiptNo").val().trim() === "") {
                    alert("Please Enter Fee Receipt Number.");
                    $("#feeReceiptNo").focus();
                } else if ($("#feeReceiptDate").val().trim() === "") {
                    alert("Please Enter Fee Receipt Date.");
                    $("#feeReceiptDate").focus();
                } else if ($("#feeMode").val().trim() === "") {
                    alert("Please Select Fee Payment Mode.");
                    $("#feeMode").focus();
                } else if ($("#chDDTxnNRFN").val().trim() === "") {
                    alert("Please Enter Cheque/DD/Txn.Id/NEFT Reference No. & NA In Case Of Cash Mode.");
                    $("#chDDTxnNRFN").focus();
                } else if ($("#chDDNEFTDate").val().trim() === "") {
                    alert("Please Enter Cheque/DD/NEFT Date & Current Date & NA In Case Of Cash Mode.");
                    $("#chDDNEFTDate").focus();
                } else if ($("#bankName").val().trim() === "") {
                    alert("Please Enter Bank Name & NA In Case Of Cash Mode.");
                    $("#bankName").focus();
                } else {
                    $("#feeCollectionOldFrm").attr('action', "<?php echo site_url('admin/Fee/saveFeeAndGenerateReceiptOld') ?>");
                    $("#feeCollectionOldFrm").submit();
                }
            }
        </script>
        <?php $this->load->view("admin/footer"); ?>
        <!-- Student Fee Structure Not Set Modal Starts -->
        <div class="modal fade" id="stuFeeStructureNotSet" role="dialog" data-backdrop="static" data-keyboard="false">
            <div class="modal-dialog modal-dialog-centered">
                <div class="modal-content">
                    <div class="modal-header">
                        <h4 class="modal-title"><b>Setup Fee Structure First</b></h4>
                    </div>
                    <div class="modal-body" style="max-height: calc(100vh - 160px);overflow-y: auto;">
                        <b>Fee can not be collected as fee structure of this student has not been set up.</b><br><br><br>
                        <center><a class="btn btn-danger btn-sm" href="<?php echo site_url("admin/FeeConfig/setupStudentFee/" . $studentInfo['stu_id'] . "/O"); ?>"><i class="fa fa-list-ul"></i> Set Up Fee Structure</a>
                            &nbsp;&nbsp;<a href="<?php echo site_url("admin/Fee/collectFeeOld"); ?>" class="btn btn-info btn-sm"><i class="fa fa-inr"></i> Collect Another Fee</a></center>
                    </div>
                </div>
            </div>
        </div>
        <!-- Student Fee Structure Not Set Modal Starts -->
    </body>
</html>

KBHT - 2023