<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="#">Receipt Details</a></li>
                    <li class="breadcrumb-item active">Individual Receipt</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">
                        Individual Receipt 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">

            <div class="container-fluid">

              <table class="table table-bordered">
                <thead>
                  <tr>
                    <th class="text-center" colspan="16">
                      <h4><B>YM76 - TRICHY DISTRICT AGRICULTURAL DEPARTMENT OFFICERS CO-OPERATIVE THRIFT & CREDIT SOCIETY LIMITED</B></h4>
                    </th>
                  </tr>
                  <tr>
                    <th class="text-center" colspan="16" style="margin-top:0px">
                      <h4><B>MANNARPURAM, TRICHY - 20 Ph. 0431 - 2420 540</B></h4>
                    </th>
                  <TR>
                    <th class="text-center" colspan="16">
                      <h4><B>INDIVIDUAL LEDGER (<?php echo $years[0] . " - " . $years[1]; ?>)</B></h4>
                    </th>
                  </TR>
                  </tr>
                </thead>
                <tbody>
                  <tr>
                    <td colspan="7" align="center"><b>Member Details</b></td>
                    <td colspan="8" align="center"><b>Surety Details</b></td>

                  </tr>

                  <tr>
                    <td colspan="4" rowspan="3" align="center"><b>Photo</b></td>
                    <td colspan="3" rowspan="3"><?php if ($member->mem_image != "") { ?><img src="../files/Member/mem_image/<?php echo $member->mem_image; ?>" height="100px" width="90px"> <?php } ?></td>
                    <td colspan="4" rowspan="3" align="center"><b>Photo</b></td>
                    <td colspan="4" rowspan="3"><?php if ($smember->mem_image != "") { ?><img src="../files/Member/mem_image/<?php echo $smember->mem_image; ?>" height="100px" width="90px"><?php } ?></td>

                  </tr>

                  <tr>
                  </tr>
                  <tr>
                  </tr>

                  <tr>
                    <td colspan="4"><b>M.No.</b></td>
                    <td colspan="3"><b><?php echo $member['me_no']; ?></b></td>
                    <td colspan="4"><b>M.No.</b></td>
                    <td colspan="4"><b><?php if (isset($smember->me_no)) {
                                          echo $smember->me_no;
                                        } ?></b></td>
                  </tr>
                  <tr>
                    <td colspan="4"><b>M.Name</b></td>
                    <td colspan="3"><b><?php echo $member['mem_name']; ?></b></td>
                    <td colspan="4"><b>M.Name</b></td>
                    <td colspan="4"><b><?php if (isset($smember->mem_no)) {
                                          echo $smember->mem_name;
                                        } ?></b></td>
                  </tr>
                  <tr>
                    <td colspan="4"><b>Loan Amount & ROI (%) </b></td>
                    <td colspan="3"><b><?php echo $loan['loan_amount']; ?> - <?php echo $loan['loan_int_rate']; ?>%</b></td>
                    <td colspan="4"><b></b></td>
                    <td colspan="4"><b></b></td>
                  </tr>

                  <tr align="center">
                    <td><b>S.No</b></td>
                    <td><b>Date</b></td>
                    <td><b>Rec. No.</b></td>
                    <td><b>Share</b></td>
                    <td><b>Books & Forms</b></td>
                    <td><b>E.Fees</b></td>
                    <td><b>Thrift</b></td>
                    <td><b>Pri.</b></td>
                    <td><b>Int.</b></td>
                    <td><b>P.Int</b></td>
                    <td><b>Insurance</b></td>
                    <td><b>Others</b></td>
                    <td><b>Due By</b></td>
                    <!-- <td><b>Due To</b></td> -->
                    <td><b>Total</b></td>
                  </tr>
                  <!-- <tr align="right">
                    <td></td>
                    <td><b>01-04-<?php echo $years[0]; ?></b></td>
                    <td><b>-</b></td>
                    <td><b><?php echo $shareamt['tot_share'] ?></b></td>
                    <td><b>-</b></td>
                    <td><b><?php echo $thriftamt['tot_thrift']; ?></b></td>
                    <td><b>-</b></td>
                    <td><b><?php echo $demand['d_loan_os']; ?></b></td>
                    <td><b>-</b></td>
                    <td><b>-</b></td>
                    <td><b>-</b></td>
                    <td><b>-</b></td>
                  </tr> -->
                  <?php $sno = 1;
                  $tot = 0;
                  $tot_share = 0;
                  $tot_ef = 0;
                  $tot_thrift = 0;
                  $tot_pri = 0;
                  $tot_int = 0;
                  $tot_fpri = 0;
                  $tot_fint = 0;
                  $tot_ins = 0;
                  $tot_others = 0;
                  // print_r($pays);die;z

                  foreach ($payment as $pay) {
                    if ($pay['tot_pay'] > 0) {
                  ?>
                      <tr align="right">
                        <td><?php echo $sno; ?></td>
                        <td><?php echo date('d-m-Y', strtotime($pay['paid_on'])); ?></td>
                        <td><?php echo $pay['rec_no']; ?></td>
                        <td><?php echo $pay['share_amt']; ?></td>
                        <td><?php echo $pay['books']; ?></td>

                        <td><?php echo $pay['ent_fees']; ?></td>
                        <td><?php echo $pay['thrift_amt'] + $pay['old_thrift'] ;?></td>
                        <td><?php echo $pay['loan_pri_amt'] + $pay['last_principal'] + $pay['ex_os'] + $pay['os_pay']; ?></td>
                        <td><?php echo $pay['loan_int_amt'] + $pay['last_int']; ?></td>
                        <td><?php echo $pay['old_p_int'] + $pay['p_int']; ?></td>

                        <td><?php echo $pay['insurance'] + $pay['old_ins']; ?></td>
                        <td><?php echo $pay['others']; ?></td>
                        <td><?php echo $pay['due_by']; ?></td>
                        <!-- <td></td> -->
                        <td><?php echo $pay['tot_pay']; ?></td>

                      </tr>
                  <?php $sno++;
                      $tot += $pay['tot_pay'];
                      $tot_share += $pay['share_amt'];
                      $tot_books += $pay['books'];
                      $tot_ef += $pay['ent_fees'];
                      $tot_thrift += $pay['thrift_amt'] + $pay['old_thrift'] ;
                      $tot_pri += $pay['loan_pri_amt'] + $pay['last_principal'] + $pay['ex_os'] + $pay['os_pay'];
                      $tot_int += $pay['loan_int_amt'] + $pay['last_int'];
                      $tot_p_int += $pay['old_p_int'] + $pay['p_int'];

                      $tot_fpri += $pay['f_pri'] + $pay['f_old_pri'] + $pay['f_ex_os'] + $pay['f_os_pay'];
                      $tot_fint += $pay['f_int'] + $pay['f_p_int'] + $pay['f_old_int'];
                      $tot_ins += $pay['insurance'] + $pay['old_ins'];
                      $tot_others += $pay['others'];
                      $tot_due_by += $pay['due_by'];

                    }
                  } ?>

                  <tr align="right">
                    <td colspan="3"><b>Total</b></td>
                    <td><b><?php echo $tot_share; ?></b></td>
                    <td><b><?php echo $tot_ef; ?></b></td>
                    <td><b><?php echo $tot_books; ?></b></td>
                    <td><b><?php echo $tot_thrift; ?></b></td>
                    <td><b><?php echo $tot_pri; ?></b></td>
                    <td><b><?php echo $tot_int; ?></b></td>
                    <td><b><?php echo $tot_p_int; ?></b></td>
                    <td><b><?php echo $tot_ins; ?></b></td>
                    <td><b><?php echo $tot_others; ?></b></td>
                    <td><b><?php echo $tot_due_by; ?></b></td>
                    <!-- <td><b></b></td> -->
                    <td><b><?php echo $tot; ?></b></td>
                  </tr>
                  <tr style="color:blue;">
                    <td colspan="4"><b>ML OS </b></td>
                    <td colspan="3"><b><?php echo $loan['loan_os_amt']; ?> </b></td>
                    <td colspan="4"><b>L. No. & L. Date</b></td>
                    <td colspan="5"><b><?php echo $loan['loan_no']; ?></b></td>
                  </tr>
                </tbody>

              </table>
              <br><br><br><br>
              <b>Secretary/President</b>
            </div>

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