<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
    <head>
        <title>Peyment Listing</title>
        <style type="text/css">
            @media print {
                .noPrint { display: none; }
            }
        </style>
        <link rel="stylesheet" type="text/css" href="<?php echo base_url() ?>assets/custom/css/print_new.css">
    </head>
    <body style="width:auto; margin:auto">

        <div class="easyui-layout" data-options="fit:true,border:false">
            <!-- Top view-->
            <div id="form-header" data-options="region:'north',border:false">
                <div id="form-header-wrapper">
                    <table cellpadding="0" cellspacing="0" width="60%">
                        <tr>
                            <td  valign="middle">
                                <a href="#" class="easyui-linkbutton noPrint" data-options="plain:true,iconCls:'icon-print'" onClick="print_detail()">Print</a>
                                <a href="#" class="easyui-linkbutton noPrint" data-options="plain:true,iconCls:'icon-excel'" onClick="modal_open('Import New Account', 'dlg_importfile');" >Export File</a>
                            </td>
                        </tr>
                    </table>  
                </div>      
            </div>

            <div id="limit-container">

            </div>
                <br><br>
            <div id="list-print-container">
                <table class="list-header">
                <tr>
                    <td colspan="9" class="s1">&nbsp;</td>
                </tr>
                <tr>
                    <td colspan="9" class="company-name text-center"><?php echo $this->session->userdata('company_name'); ?></td>
                </tr>
                <tr>
                    <td colspan="9" class="list-title text-center">Peyment Listing</td>
                </tr>
                <tr>
                    <td colspan="9" class="s1">&nbsp;</td>
                </tr>
                <tr class="list-header-top">
                    <td width="20" class="s4">No</td>
                    <td width="43" class="s4">Branch</td>
                    <td width="40" class="s4">Department</td>
                    <td width="50" class="s4">Employee</td>
                    <td width="45" class="s4">Cashbon Date</td>
                    <td width="45" class="s4" align="right">Cashbon</td>
                    <td width="45" class="s4" align="center">Payment Date</td>
                    <td width="45" class="s4" align="right">Payment</td>
                    <td width="45" class="s4" align="right">CRV</td>
                    <td width="45" class="s4" align="right">CPV</td>
                </tr>
                <?php
//                $list_payment=json_decode($list);
                $no = 0;
                $total = 0;
                foreach ($list as $row) {
                    ?>
                <tr valign="top">
                        <td class="s3"><?php echo ++$no; ?></td>
                        <td class="s5"><?php echo $row['BranchName']; ?></td>
                        <td class="s3"><span class="s5"><?php echo $row['DepartmentName']; ?></span></td>
                        <td class="s5"><?php echo $row['EmployeeName']; ?></td>
                        <td class="s5" align="center"><?php echo $row['EBonDate']; ?></td>
                        <td class="s5" align="right"><?php echo number_format($row['EBonAmount'], "0", ",", "."); ?></td>
                        <td class="s5" align="center"><?php echo $row['EPayDate']; ?></td>
                        <td class="s5" align="right"><?php echo number_format($row['ExpenseAmount'], "0", ",", "."); ?></td>
                        <td class="s5" align="right"><?php echo number_format($row['amount_crv'], "0", ",", "."); ?></td>
                        <td class="s5" align="right"><?php echo number_format($row['amount_cpv'], "0", ",", "."); ?></td>
                    </tr> 
                    <?php
                }
                ?>
                <tr>
                    <td class="s5" align="right" colspan="6">&nbsp;</td>
                </tr>
            </table>
        </div>
        </div>
    </body>
</html>

<script type="text/javascript">
    function print_detail() {
        var data_print = $("#list-print-container").html();
        Popup(data_print);
    }

    function Popup(data) {
        var mywindow = window.open('', 'list-print-container', 'height=528,width=500');
        var css = css_print();
        mywindow.document.write('<html><head><title>Print Detail</title>');
        mywindow.document.write(css);
        mywindow.document.write('</head><body >');
        mywindow.document.write(data);
        mywindow.document.write('</body></html>');

        mywindow.document.close(); // necessary for IE >= 10
        mywindow.focus(); // necessary for IE >= 10

        mywindow.print();
        mywindow.close();
        return true;
    }
</script>
