<!DOCTYPE html>
<html>

<head>

    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>

    </title>

    <style type="text/css">
        table {
            page-break-inside: auto
        }

        tr {
            page-break-inside: avoid;
            page-break-after: auto
        }

        thead {
            display: table-header-group
        }

        tfoot {
            display: table-footer-group
        }
    </style>
</head>

<body class="app sidebar-mini rtl">

    <?php
    function getIndianCurrency(float $number)
    {
        $decimal = round($number - ($no = floor($number)), 2) * 100;
        $hundred = null;
        $digits_length = strlen($no);
        $i = 0;
        $str = array();
        $words = array(
            0 => '', 1 => 'one', 2 => 'two',
            3 => 'three', 4 => 'four', 5 => 'five', 6 => 'six',
            7 => 'seven', 8 => 'eight', 9 => 'nine',
            10 => 'ten', 11 => 'eleven', 12 => 'twelve',
            13 => 'thirteen', 14 => 'fourteen', 15 => 'fifteen',
            16 => 'sixteen', 17 => 'seventeen', 18 => 'eighteen',
            19 => 'nineteen', 20 => 'twenty', 30 => 'thirty',
            40 => 'forty', 50 => 'fifty', 60 => 'sixty',
            70 => 'seventy', 80 => 'eighty', 90 => 'ninety'
        );
        $digits = array('', 'hundred', 'thousand', 'lakh', 'crore');
        while ($i < $digits_length) {
            $divider = ($i == 2) ? 10 : 100;
            $number = floor($no % $divider);
            $no = floor($no / $divider);
            $i += $divider == 10 ? 1 : 2;
            if ($number) {
                $plural = (($counter = count($str)) && $number > 9) ? 's' : null;
                $hundred = ($counter == 1 && $str[0]) ? ' and ' : null;
                $str[] = ($number < 21) ? $words[$number] . ' ' . $digits[$counter] . $plural . ' ' . $hundred : $words[floor($number / 10) * 10] . ' ' . $words[$number % 10] . ' ' . $digits[$counter] . $plural . ' ' . $hundred;
            } else $str[] = null;
        }
        $Rupees = implode('', array_reverse($str));
        $paise = ($decimal) ? "." . ($words[$decimal / 10] . " " . $words[$decimal % 10]) . ' Paise' : '';
        return ($Rupees ? $Rupees . 'Rupees ' : '') . $paise;
    }

    ?>

    <?php $total_amt = $member->tot_pay; ?>

    <?php
    $member_pri = $member->loan_pri_amt + $member->last_principal + $member->ex_os;

    if ($total_amt == "") {
        $total_amt = 0;
    }
    ?>
    <div class="app-title mt-5">
        <table width="560px" bordercolor="green" border="1" style="float:left;margin-right:5px;">
            <tr>
                <th colspan="4" style="height:40px;">TRICHY DISTRICT AGRICULTURAL DEPARTMENT OFFICERS CO-OPERATIVE THRIFT & CREDIT SOCIETY LIMITED,R693.</th>
            </tr>
            <tr>
                <th colspan="4" style="height:25px;">TRICHY &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Ph. 0431 - 2422 230</th>
            </tr>

            <tr>
                <th colspan="4" style="height:30px;">ADJUSTMENT RECEIPT</th>
            </tr>

            <tr>
                <td width="69" style="height:30px; padding-left:6px;">Recpt.</td>
                <td width="208" style="padding-left:6px;"><label><b><?php echo $member->rec_no; ?></b></label></td>
                <td width="128" style="padding-left:6px;">Date</td>
                <td width="127"><b><?php //echo date("d-m-Y", strtotime($paidon)); ?></b></td>
            </tr>
            <!-- <td width="69" style="height:30px;padding-left:6px;">Mem No.</td>
            <td width="208" style="padding-left:6px;"><strong><label><?php echo $member->me_no; ?></label></strong></td>
            <td width="128" style="padding-left:6px;" colspan="2">Name :<b> <label><?php echo $member->mem_name; ?></label></b></td> -->

            <tr>
                <td colspan="2" style="height:30px;padding-left:6px;">Office Address.</td>
                <td colspan="2" style="padding-left:6px;"><b><label><?php echo $division . " - " . $section; ?></label></b></td>
            </tr>
            <tr>
                <td align="center" style="height:30px;padding-left:6px;"><b>S.No.</b></td>
                <td align="center"><b>Particulars</b></td>
                <td align="center"><b>Credit (Rs.)</b></td>
                <td align="center"><b>Debit (Rs.)</b></td>
            </tr>
            <tr>
                <td align="center" style="height:25px;">1.</td>
                <td style="padding-left:6px;">Share Amount</td>
                <td align="right"><b><label>0<?php //echo $share_amt; ?></label></b></td>
                <td align="right"></td>
            </tr>
            <tr>
                <td align="center" style="height:25px;">2.</td>
                <td style="padding-left:6px;">Thrift Deposit</td>
                <td align="right" style="padding-right:6"><b><label>0<?php //echo $thrift_amt; ?></label></b></td>
                <td align="right"></td>
            </tr>
            <tr>
                <td align="center" style="height:25px;">3.</td>
                <td style="padding-left:6px;">Principal-Loan No:<b><?php echo $member->loan_no; ?></b></td>
                <td align="right" style="padding-right:6"><b><label>0<?php //echo $loan_pri_amt; ?></label></b></td>
                <td align="right"></td>
            </tr>
            <tr>
                <td align="center" style="height:25px;">4.</td>
                <td style="padding-left:6px;">Interest</td>
                <td align="right" style="padding-right:6"><b><label>0<?php //echo $loan_int_amt; ?></label></b></td>
                <td align="right"></td>
            </tr>
            <tr>
                <td align="center" style="height:25px;">5.</td>
                <td style="padding-left:6px;">FL Principal</td>
                <td align="right"><b><label>0<?php //echo $member->f_pri + $member->f_old_pri + $member->f_ex_os + $member->f_os_pay; ?></label></b></td>
                <td align="right"></td>
            </tr>
            <tr>
                <td align="center" style="height:25px;">6.</td>
                <td style="padding-left:6px;">FL Interest</td>
                <td align="right"><b><label>0<?php //echo $member->f_int + $member->f_p_int + $member->f_old_int; ?></label></b></td>
                <td align="right"></td>
            </tr>
            <tr>
                <td align="center" style="height:25px;">7.</td>
                <td style="padding-left:6px;">Books & Forms</td>
                <td align="right"><b><label><?php //echo $books; ?>0</label></b></td>
                <td align="right"></td>
            </tr>
            <tr>
                <td align="center" style="height:25px;">8.</td>
                <td style="padding-left:6px;">Entrance Fees</td>
                <td align="right"><b><label><?php //echo $ent_fees; ?>0</label></b></td>
                <td align="right"></td>
            </tr>
            <tr>
                <td align="center" style="height:25px;">9.</td>
                <td style="padding-left:6px;">Extra Interest</td>
                <td align="right"><b><label><?php //echo $others; ?>0</label></b></td>
                <td align="right"></td>
            </tr>
            <tr>
                <td align="center" style="height:25px;">10.</td>
                <td style="padding-left:6px;">Insurance</td>
                <td align="right"> <b><label><?php //echo $member->insurance; ?>0</label></b></td>
                <td align="right"></td>
            </tr>
            <tr>
                <td align="center" style="height:25px;">11.</td>
                <td style="padding-left:6px;">Due by</td>
                <td align="right"><b><label><?php echo $total; ?></label></b> </td>
                <td align="right" style="padding-right:6"></td>
            </tr>
            <tr>
                <td align="center" style="height:25px;"></td>
                <td align="right" style="padding-right:6px;"><b>Total Rs.</b></td>
                <td align="right" style="padding-right:6"><b><label><?php echo $total; ?></label></b></td>
                <td align="right" style="padding-right:6"><b><label><?php echo $member->tot_pay; ?></label></b></td>
            </tr>
            <tr>
                <td colspan="4" align="center" style="height:30px;"><label><b>Rupees <?php echo getIndianCurrency($total); ?></label></b></td>
            </tr>
            <tr>
                <td colspan="4" style="height:80px; padding-right:10px;" align="left" valign="bottom"><b>* This is Computer Generated Bill Signature is Not required</b></td>
            </tr>
        </table>

    </div>

</body>

</html>
</body>

</html>