<div class="content-header">
    <div class="container-fluid">
        <div class="row mb-2">
            <div class="col-sm-6">
                <!-- <h1 class="m-0">Deactive Member </h1> -->
            </div>
            <div class="col-sm-6">
                <ol class="breadcrumb float-sm-right">
                    <li class="breadcrumb-item"><a href="#">Check List</a></li>
                    <li class="breadcrumb-item active">OD Member </li>
                </ol>
            </div>
        </div>
    </div>
</div>




<section class="content">
    <div class="container-fluid">




        <div class="row">

            <section class="col-lg-12 connectedSortable">

                <div class="card">
                    <div class="card-header " style="background-color:#31708e;color:white">
                        <h3 class="card-title">
                        OD Member Details
                        </h3>
                        <div class="card-tools">
                            <ul class="nav nav-pills ml-auto">
                            </ul>
                        </div>
                    </div>
                    <div class="card-body">
                        <div class="tab-content p-0">


                            <?php if (isset($_SESSION['mem_add']) && $_SESSION['mem_add'] != "") { ?>
                                <div class="alert alert-success">
                                    <strong><?php echo $_SESSION['mem_add']; ?></strong>
                                </div>
                            <?php $_SESSION['mem_add'] = "";
                            } ?>

                        </div>
                        <form method="post" action="<?php echo base_url(); ?>index.php/Demand/od_member" id="member_add_" enctype='multipart/form-data'>
                            <div class="row">
                                <div class="col-sm-3">
                                    <div>Division</div>
                                    <select name="division" id="division_id" class="form-control">
                                        <option value="">All</option>
                                        <?php foreach ($divisions as $div) { ?>
                                            <option value="<?php echo $div['division']; ?>"><?php echo $div['division']; ?></option>
                                        <?php } ?>
                                    </select>
                                </div>
                                <div class="col-sm-3">
                                    <div>Section</div>
                                    <select name="section" id="section_id" class="form-control">
                                        <option value="">All</option>
                                        <?php foreach ($sections as $sec) { ?>
                                            <option value="<?php echo $sec['section']; ?>"><?php echo $sec['section']; ?></option>
                                        <?php } ?>
                                    </select>
                                </div>
                                <div class="col-sm-2">
                                    <div>Month</div>
                                    <?php $m = date('F'); ?>
                                    <select name="month" class="form-control">
                                        <option value="">Select Month</option>
                                        <option <?php if ($m == "January") {
                                                    echo "";
                                                } ?> value="January">January</option>
                                        <option <?php if ($m == "February") {
                                                    echo "";
                                                } ?> value="February">February</option>
                                        <option <?php if ($m == "March") {
                                                    echo "";
                                                } ?> value="March">March</option>
                                        <option <?php if ($m == "April") {
                                                    echo "";
                                                } ?> value="April">April</option>
                                        <option <?php if ($m == "May") {
                                                    echo "";
                                                } ?> value="May">May</option>
                                        <option <?php if ($m == "June") {
                                                    echo "";
                                                } ?> value="June">June</option>
                                        <option <?php if ($m == "July") {
                                                    echo "";
                                                } ?> value="July">July</option>
                                        <option <?php if ($m == "August") {
                                                    echo "";
                                                } ?> value="August">August</option>
                                        <option <?php if ($m == "September") {
                                                    echo "";
                                                } ?> value="September">September</option>
                                        <option <?php if ($m == "October") {
                                                    echo "";
                                                } ?> value="October">October</option>
                                        <option <?php if ($m == "November") {
                                                    echo "";
                                                } ?> value="November">November</option>
                                        <option <?php if ($m == "December") {
                                                    echo "";
                                                } ?> value="December">December</option>
                                    </select>
                                </div>
                                <div class="col-sm-2">Year
                                    <?php $y = date('Y'); ?>
                                    <select name="year" class="form-control">
                                        <option value="">Select Year</option>
                                        <?php for ($j = $y; $j >= 2019; $j--) { ?>
                                            <option <?php if ($j == $y) {
                                                        echo "";
                                                    } ?> value="<?php echo $j; ?>"><?php echo $j; ?></option>
                                        <?php } ?>
                                    </select>
                                </div>
                                <div class="col-sm-2 mt-4"><button type="submit" class="btn btn-primary" >Submit</button></div>
                        </form>
                    </div>
                    <?php $member_ft = 0;
                    $tot_os = 0;
                    $tot_pri = 0;
                    $tot_int = 0;
                    $tot_fpri = 0;
                    $tot_fint = 0;
                    $tot_fos = 0;
                    $tot_td = 0;
                    $tot_others = 0;
                    $tot_ins = 0;
                    $tot_recover = 0; ?>
                    <?php if (isset($members) && count($members) > 0) { ?><br><br>
                            <div class="row">
                                <div class="col-sm-12">
                                    <div class="tile">
                                        <div class="tile-body">
                                            <table id="table_id" class="table table-bordered " style="width:100%;">
                                                <thead>
                                                    <tr>
                                                        <th class="text-center">S.No.</th>
                                                        <th class="text-center">M. No.</th>
                                                        <th class="text-center">Name</th>
                                                        <!-- <th class="text-center">Desig</th> -->
                                                        <th class="text-center">Tot Thrift</th>
                                                        <?php if ($display_demand_type != "wothrift") { ?>

                                                        <?php } ?>
                                                        <?php if ($display_demand_type != "thrift") { ?>
                                                            <th class="text-center">Loan Os</th>
                                                            <th class="text-center">Pri.</th>
                                                            <th class="text-center">Int. Rate</th>
                                                            <th class="text-center">Int.</th>
                                                            <th class="text-center">P.I. Rate</th>
                                                            <th class="text-center">Thrift</th>
                                                            <th class="text-center">Insurance</th>
                                                            <th class="text-center">Others</th>
                                                        <?php } ?>
                                                        <th class="text-center">Total</th>
                                                        <th class="text-center">Recovered</th>
                                                    </tr>
                                                </thead>
                                                <!-- Here's where we iterate through our $articles query object, printing out article info -->
                                                <tbody>
                                                    <?php
                                                    $pre_section = "";
                                                    if ($division != "") {
                                                        foreach ($members as $key => $member) {
                                                            $member = (object) $member;

                                                            if ($member->d_last_thrift > 0 || $member->d_last_principal > 0 || $member->p_int + $member->d_last_int > 0 || $member->f_old_pri > 0 || $member->f_old_int + $member->f_p_int > 0 || $member->old_thrift > 0 || $member->old_ins > 0) {

                                                                if ($pre_section != $member->section) {
                                                    ?>
                                                                    <tr>
                                                                        <td></td>
                                                                        <td style="color:blue;" colspan="2"><b><strong><?php echo $member->section; ?></strong< /b>
                                                                        <td></td>
                                                                        <?php if ($display_demand_type != "wothrift") { ?>
                                                                            <td></td>
                                                                        <?php } ?>
                                                                        <?php if ($display_demand_type != "thrift") { ?>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                        <?php } ?>
                                                                    </tr>
                                                                <?php
                                                                }
                                                                $pre_section = $member->section;
                                                                $sno = $sno + 1; ?>

                                                                <tr style="height:30px;">
                                                                    <td class="text-center" style="padding:5px; margin:0px;">
                                                                        <?= $sno; ?>
                                                                    </td>
                                                                    <td class="text-center" style="padding:5px; margin:0px;">
                                                                        <?= $member->me_no ?>

                                                                    </td>
                                                                    <td style="padding:5px; margin:0px;">
                                                                        <?= $member->mem_name ?>
                                                                    </td>
                                                                    <!-- <td style="padding:5px; margin:0px;">
                                                                        <?= $member->mem_desig ?>
                                                                    </td> -->
                                                                    <td style="padding:5px; margin:0px;text-align:right;" id="loan_os_amt">
                                                                        <?php if ($member->tot_thrift != "") { ?>
                                                                            <?= $member->tot_thrift ?>
                                                                        <?php } ?>
                                                                    </td>
                                                                    <?php if ($display_demand_type != "wothrift") { ?>
                                                                        <td style="padding:5px; margin:0px;text-align:right;">
                                                                            <?php if ($member->d_loan_os > 0) { ?>
                                                                                <?= $member->d_loan_os ?>
                                                                            <?php } ?>

                                                                        </td>
                                                                        <td style="padding:5px; margin:0px;text-align:right;">
                                                                            <?php if ($member->d_principal > 0) { ?>
                                                                                <?php echo $member->d_principal; ?>
                                                                            <?php } ?>
                                                                        </td>
                                                                        <td style="padding:5px; margin:0px;text-align:right;">
                                                                            <?php if ($member->d_int_rate > 0) { ?>
                                                                                <?php echo $member->d_int_rate; ?>
                                                                            <?php } ?>
                                                                        </td>
                                                                        <td style="padding:5px; margin:0px;text-align:right;">
                                                                            <?php if ($member->d_int > 0) { ?>
                                                                                <?php echo $member->d_int; ?>
                                                                            <?php } ?>
                                                                        </td>
                                                                        <td style="padding:5px; margin:0px;text-align:right;">


                                                                        </td>
                                                                        <td style="padding:5px; margin:0px;text-align:right;">
                                                                            <?php if ($member->d_thrift != "") { ?>
                                                                                <?= $member->d_thrift ?>
                                                                            <?php } ?>
                                                                        </td>
                                                                        <td style="padding:5px; margin:0px;text-align:right;">
                                                                            <?php if ($member->d_insurance > 0) { ?>
                                                                                <?php echo $member->d_insurance; ?>
                                                                            <?php } ?>

                                                                        </td>
                                                                        <td width="50px" s style="padding:5px; margin:0px;text-align:right;">
                                                                            <?php if ($member->d_others > 0) { ?>
                                                                                <?php echo $member->d_others; ?>
                                                                            <?php } ?>
                                                                        </td>
                                                                    <?php } ?>
                                                                    <?php if ($display_demand_type == "all") { ?>
                                                                        <td style="padding:5px; margin:0px;text-align:right;">
                                                                            <?php if ($member->d_total > 0) { ?>
                                                                                <?php echo $member->d_total; ?>
                                                                            <?php } ?>
                                                                        </td>
                                                                    <?php } else if ($display_demand_type == "thrift") { ?>
                                                                        <td style="padding:5px; margin:0px;text-align:right;">
                                                                            <?php if ($member->d_thrift > 0) { ?>
                                                                                <?php echo $member->d_thrift; ?>
                                                                            <?php } ?>
                                                                        </td>
                                                                    <?php } else { ?>
                                                                        <td style="padding:5px; margin:0px;text-align:right;">
                                                                            <?php if ($member->d_total  > 0) { ?>
                                                                                <?php echo $member->d_total; ?>
                                                                            <?php } ?>
                                                                        </td>
                                                                    <?php } ?>
                                                                    <td></td>
                                                                </tr>
                                                                <?php
                                                                if ($member->d_last_thrift > 0 || $member->d_last_principal > 0 || $member->p_int + $member->d_last_int > 0 || $member->f_old_pri > 0 || $member->f_old_int + $member->f_p_int > 0 || $member->old_thrift > 0 || $member->old_ins > 0) {
                                                                ?>
                                                                    <tr style="height:30px;color:red;">
                                                                        <td></td>
                                                                        <td></td>
                                                                        <td style="padding:5px; margin:0px;text-align:right;"></td>

                                                                        <td></td>
                                                                        <td></td>
                                                                        <td style="padding:5px; margin:0px;text-align:right;">
                                                                            <?php if ($member->d_last_principal > 0) { ?>
                                                                                <b> <?php echo $member->d_last_principal; ?></b>
                                                                            <?php } ?>
                                                                        </td>
                                                                        <td style="padding:5px; margin:0px;text-align:right;">

                                                                            <b> 3%</b>
                                                                        </td>
                                                                        <td style="padding:5px; margin:0px;text-align:right;">
                                                                            <?php if ($member->d_last_int > 0) { ?>
                                                                                <b> <?php echo $member->d_last_int; ?></b>
                                                                            <?php } ?>
                                                                        </td>
                                                                        <td style="padding:5px; margin:0px;text-align:right;">
                                                                            <?php if ($member->p_int > 0) { ?>
                                                                                <b> <?php echo $member->p_int; ?></b>
                                                                            <?php } ?>
                                                                        </td>
                                                                        <td style="padding:5px; margin:0px;text-align:right;">
                                                                            <?php if ($member->d_last_thrift > 0) { ?>
                                                                                <b> <?php echo $member->d_last_thrift; ?></b>
                                                                            <?php } ?>
                                                                        </td>
                                                                        <td style="padding:5px; margin:0px;text-align:right;">
                                                                            <?php if ($member->old_ins > 0) { ?>
                                                                                <b><?php echo $member->old_ins; ?></b>
                                                                            <?php } ?>
                                                                        </td>
                                                                        <td>
                                                                            <?php if ($member->old_others > 0) { ?>
                                                                                <b> <?php echo $member->old_others; ?></b>
                                                                            <?php } ?>
                                                                        </td>
                                                                        <td>

                                                                        </td>
                                                                        <td></td>
                                                                    </tr>
                                                                <?php } ?>
                                                                <?php $member_ft += $member->d_total;
                                                                $tot_thrift += $member->tot_thrift;

                                                                $tot_loan_amount += $member->d_loan_amount;
                                                                $tot_os += $member->d_loan_os;
                                                                $tot_pri += $member->d_principal + $member->d_last_principal;
                                                                $tot_int += $member->d_int + $member->d_last_int;
                                                                $tot_p_int += $member->p_int;
                                                                $tot_fpri += $member->f_pri + $member->f_old_pri;
                                                                $tot_fint += $member->f_int + $member->f_old_int + $member->f_p_int;
                                                                $tot_fos += $member->f_os;
                                                                $tot_td += $member->d_thrift + $member->d_last_thrift;
                                                                $tot_ins += $member->d_insurance + $member->old_ins;
                                                                $tot_others += $member->d_others + $member->old_others; ?>

                                                                        <?php } ?>
                                                                    <?php } ?>
                                                                <?php } else { ?>

                                                                    <?php foreach ($members as $key => $member) {
                                                                        $member = (object) $member;

                                                                        if ($member->d_last_thrift > 0 || $member->d_last_principal > 0 || $member->p_int + $member->d_last_int > 0 || $member->f_old_pri > 0 || $member->f_old_int + $member->f_p_int > 0 || $member->old_thrift > 0 || $member->old_ins > 0) {


                                                                    ?>

                                                                <?php

                                                                $pre_section = $member->section;
                                                                $sno = $sno + 1; ?>

                                                                <tr style="height:30px;">
                                                                    <td class="text-center" style="padding:5px; margin:0px;">
                                                                        <?= $sno; ?>
                                                                    </td>
                                                                    <td class="text-center" style="padding:5px; margin:0px;">
                                                                        <?= $member->me_no ?>

                                                                    </td>
                                                                    <td style="padding:5px; margin:0px;">
                                                                        <?= $member->mem_name ?>
                                                                    </td>
                                                                    <!-- <td style="padding:5px; margin:0px;">
                                                                    <?= $member->mem_desig ?>
                                                                </td> -->
                                                                    <td style="padding:5px; margin:0px;text-align:right;" id="loan_os_amt">
                                                                        <?php if ($member->tot_thrift != "") { ?>
                                                                            <?= $member->tot_thrift ?>
                                                                        <?php } ?>
                                                                    </td>
                                                                    <?php if ($display_demand_type != "wothrift") { ?>
                                                                        <td style="padding:5px; margin:0px;text-align:right;">
                                                                            <?php if ($member->d_loan_os > 0) { ?>
                                                                                <?= $member->d_loan_os ?>
                                                                            <?php } ?>

                                                                        </td>
                                                                        <td style="padding:5px; margin:0px;text-align:right;">
                                                                            <?php if ($member->d_principal > 0) { ?>
                                                                                <?php echo $member->d_principal; ?>
                                                                            <?php } ?>
                                                                        </td>
                                                                        <td style="padding:5px; margin:0px;text-align:right;">
                                                                            <?php if ($member->d_int_rate > 0) { ?>
                                                                                <?php echo $member->d_int_rate; ?>
                                                                            <?php } ?>
                                                                        </td>
                                                                        <td style="padding:5px; margin:0px;text-align:right;">
                                                                            <?php if ($member->d_int > 0) { ?>
                                                                                <?php echo $member->d_int; ?>
                                                                            <?php } ?>
                                                                        </td>
                                                                        <td style="padding:5px; margin:0px;text-align:right;">


                                                                        </td>
                                                                        <td style="padding:5px; margin:0px;text-align:right;">
                                                                            <?php if ($member->d_thrift != "") { ?>
                                                                                <?= $member->d_thrift ?>
                                                                            <?php } ?>
                                                                        </td>
                                                                        <td style="padding:5px; margin:0px;text-align:right;">
                                                                            <?php if ($member->d_insurance > 0) { ?>
                                                                                <?php echo $member->d_insurance; ?>
                                                                            <?php } ?>

                                                                        </td>
                                                                        <td width="50px" s style="padding:5px; margin:0px;text-align:right;">
                                                                            <?php if ($member->d_others > 0) { ?>
                                                                                <?php echo $member->d_others; ?>
                                                                            <?php } ?>
                                                                        </td>
                                                                    <?php } ?>
                                                                    <?php if ($display_demand_type == "all") { ?>
                                                                        <td style="padding:5px; margin:0px;text-align:right;">
                                                                            <?php if ($member->d_total > 0) { ?>
                                                                                <?php echo $member->d_total; ?>
                                                                            <?php } ?>
                                                                        </td>
                                                                    <?php } else if ($display_demand_type == "thrift") { ?>
                                                                        <td style="padding:5px; margin:0px;text-align:right;">
                                                                            <?php if ($member->d_thrift > 0) { ?>
                                                                                <?php echo $member->d_thrift; ?>
                                                                            <?php } ?>
                                                                        </td>
                                                                    <?php } else { ?>
                                                                        <td style="padding:5px; margin:0px;text-align:right;">
                                                                            <?php if ($member->d_total  > 0) { ?>
                                                                                <?php echo $member->d_total; ?>
                                                                            <?php } ?>
                                                                        </td>
                                                                    <?php } ?>
                                                                    <td></td>
                                                                </tr>
                                                                <?php
                                                                if ($member->d_last_thrift > 0 || $member->d_last_principal > 0 || $member->p_int + $member->d_last_int > 0 || $member->f_old_pri > 0 || $member->f_old_int + $member->f_p_int > 0 || $member->old_thrift > 0 || $member->old_ins > 0) {
                                                                ?>
                                                                    <tr style="height:30px;color:red;">
                                                                        <td></td>
                                                                        <td></td>
                                                                        <td style="padding:5px; margin:0px;text-align:right;"></td>

                                                                        <td></td>
                                                                        <td></td>
                                                                        <td style="padding:5px; margin:0px;text-align:right;">
                                                                            <?php if ($member->d_last_principal > 0) { ?>
                                                                                <b> <?php echo $member->d_last_principal; ?></b>
                                                                            <?php } ?>
                                                                        </td>
                                                                        <td style="padding:5px; margin:0px;text-align:right;">

                                                                            <b> 3%</b>
                                                                        </td>
                                                                        <td style="padding:5px; margin:0px;text-align:right;">
                                                                            <?php if ($member->d_last_int > 0) { ?>
                                                                                <b> <?php echo $member->d_last_int; ?></b>
                                                                            <?php } ?>
                                                                        </td>
                                                                        <td style="padding:5px; margin:0px;text-align:right;">
                                                                            <?php if ($member->p_int > 0) { ?>
                                                                                <b> <?php echo $member->p_int; ?></b>
                                                                            <?php } ?>
                                                                        </td>
                                                                        <td style="padding:5px; margin:0px;text-align:right;">
                                                                            <?php if ($member->d_last_thrift > 0) { ?>
                                                                                <b> <?php echo $member->d_last_thrift; ?></b>
                                                                            <?php } ?>
                                                                        </td>
                                                                        <td style="padding:5px; margin:0px;text-align:right;">
                                                                            <?php if ($member->old_ins > 0) { ?>
                                                                                <b><?php echo $member->old_ins; ?></b>
                                                                            <?php } ?>
                                                                        </td>
                                                                        <td>
                                                                            <?php if ($member->old_others > 0) { ?>
                                                                                <b> <?php echo $member->old_others; ?></b>
                                                                            <?php } ?>
                                                                        </td>
                                                                        <td>

                                                                        </td>
                                                                        <td></td>
                                                                    </tr>
                                                                <?php } ?>
                                                                <?php $member_ft += $member->d_total;
                                                                $tot_thrift += $member->tot_thrift;

                                                                $tot_loan_amount += $member->d_loan_amount;
                                                                $tot_os += $member->d_loan_os;
                                                                $tot_pri += $member->d_principal + $member->d_last_principal;
                                                                $tot_int += $member->d_int + $member->d_last_int;
                                                                $tot_p_int += $member->p_int;
                                                                $tot_fpri += $member->f_pri + $member->f_old_pri;
                                                                $tot_fint += $member->f_int + $member->f_old_int + $member->f_p_int;
                                                                $tot_fos += $member->f_os;
                                                                $tot_td += $member->d_thrift + $member->d_last_thrift;
                                                                $tot_ins += $member->d_insurance + $member->old_ins;
                                                                $tot_others += $member->d_others + $member->old_others; ?>

                                                            <?php } ?>
                                                        <?php } ?>
                                                    <?php } ?>
                                                    <tr style="height:30px;">
                                                        <td>

                                                        </td>
                                                        <td class="text-center">

                                                        </td>
                                                        <td>

                                                        </td>
                                                        <td style="padding:5px; margin:0px;text-align:right;">
                                                            <b> <?php echo $tot_thrift; ?></b>
                                                        </td>
                                                        <?php if ($display_demand_type != "wothrift") { ?>
                                                        <?php } ?>
                                                        <?php if ($display_demand_type != "thrift") { ?>
                                                            <td style="padding:5px; margin:0px;text-align:right;">
                                                                <b> <?php echo $tot_os; ?></b>
                                                            </td>
                                                            <td style="padding:5px; margin:0px;text-align:right;">
                                                                <b> <?php echo $tot_pri; ?></b>
                                                            </td>
                                                            <td></td>
                                                            <td style="padding:5px; margin:0px;text-align:right;">
                                                                <b> <?php echo $tot_int; ?></b>
                                                            </td>
                                                            <td style="padding:5px; margin:0px;text-align:right;">
                                                                <b> <?php echo $tot_p_int; ?></b>
                                                            </td>
                                                            <td style="padding:5px; margin:0px;text-align:right;">
                                                                <b> <?php echo $tot_td; ?></b>
                                                            </td>
                                                            <td style="padding:5px; margin:0px;text-align:right;">
                                                                <b> <?php echo $tot_ins; ?></b>
                                                            </td>
                                                            <td style="padding:5px; margin:0px;text-align:right;">
                                                                <b> <?php echo $tot_others; ?></b>
                                                            </td>
                                                        <?php } ?>
                                                        <?php if ($display_demand_type == "all") { ?>
                                                            <td style="padding:5px; margin:0px;text-align:right;">
                                                                <b> <?php echo $member_ft; ?></b>
                                                            </td>
                                                        <?php } else if ($display_demand_type == "thrift") { ?>
                                                            <td style="padding:5px; margin:0px;text-align:right;">
                                                                <b> <?php echo $tot_td; ?></b>
                                                            </td>
                                                        <?php } else { ?>
                                                            <td style="padding:5px; margin:0px;text-align:right;">
                                                                <b> <?php echo $member_ft; ?></b>
                                                            </td>
                                                        <?php } ?>
                                                        <td></td>
                                                    </tr>
                                                </tbody>
                                            </table>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        <?php } ?>
               



 </div>
                    </div>
                </div>
        </div>
</section>
</div>
</div>
</section>



        <script>
            function cheque_trans_id_div_fun() {
                var cash_type_id = $('#cash_type_id').val();
                if (cash_type_id != "" && cash_type_id != "Cash") {
                    $("#cheque_trans_id_div").show();
                } else {
                    $("#cheque_trans_id_div").hide();
                }
            }

            function check_validation() {
                var added_on_id = $('#added_on_id').val();
                var cash_type_id = $('#cash_type_id').val();
                var cheque_trans_id = $('#cheque_trans_id').val();
                if (added_on_id == "") {

                    alert("Must Fill Recover Date");
                    $('#added_on_id').focus();
                    return false;

                }
                if (cash_type_id == "") {

                    alert("Must Fill Cash Type");
                    $('#cash_type_id').focus();
                    return false;

                }
                if (cash_type_id != "" && cash_type_id != "Cash" && cheque_trans_id == "") {
                    alert("Must Fill Cheque no or transaction id");
                    $('#cheque_trans_id').focus();
                    return false;
                }

                $('#rec_form').submit();

            }
            $('#division_id').on('change', function() {
                var division = this.value;
                var section = $('#section_id').val();
                $.ajax({
                    type: 'POST',
                    url: "<?php echo base_url() ?>index.php/Member/member_search",
                    data: {
                        division: division,
                        section: section
                    },
                    dataType: 'html',
                    success: function(data) {
                        $('#filter_id').html(data);
                        var table = $('#table_id1').DataTable({
                            "processing": true,
                            "dom": 'lBfrtip',
                            "lengthMenu": [
                                [10, 25, 50, -1],
                                [10, 25, 50, "All"]
                            ],
                            "buttons": [
                                'copyHtml5',
                                'excelHtml5',
                                'csvHtml5',
                                'pdfHtml5'
                            ]
                        });
                        $(".buttons-html5").addClass("btn btn-primary");
                        $('.dt-buttons').addClass("pt-3 pb-0");
                    }
                });

                $.ajax({
                    type: 'POST',
                    url: "<?php echo base_url() ?>index.php/Member/getsection",
                    data: {
                        division: division
                    },
                    dataType: 'html',
                    success: function(data) {

                        $('#section_id').html(data);
                    }
                });

            });

            $(document).ready(function() {
                $('.alert').fadeOut(3000);
                $(".recover_amt").keyup(function() {
                    var tot_m = $('#final_tot').attr("data-id");
                    var tot_others = 0;
                    for (j = 1; j <= tot_m; j++) {
                        var others_ = $('#recover_' + j).val() == "" ? 0 : $('#recover_' + j).val();
                        tot_others += parseInt(others_);
                    }
                    $('#final_tot').val(tot_others);

                });
            });
        </script>