<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
    <head>
        <title>Deposit</title>
        <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="100%">
                        <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="5" class="company-name text-center "><span class="normal_bold span_block " ><?= $company->CompanyName; ?></span></td>
                    </tr>
                    <tr>
                        <td colspan="5" class="branch-name text-center"><span class="normal_bold span_block " ><?= $company->BranchName; ?></span></td>
                    </tr>
                    <tr>
                        <td colspan="5" class="list-title text-center"><span class="normal_bold span_block " >Sweep Bank</span></td>
                    </tr>
                    <tr>
                        <td colspan="5" class="s1">&nbsp;</td>
                    </tr>
                    <tr class="list-header-top">
                        <td width="" class=" text-left"><span class="small_bold" >No</span></td>
                        <td width="" class=" text-center"><span class="small_bold" >Sweep Bank No.</span></td>
                        <td width="" class=" text-left"><span class="small_bold" >Date</span></td>
                        <td width="" class=" text-left"><span class="small_bold" >Description</span></td>
                        <td width="" class=" text-right" align="right"><span class="small_bold" >Amount</span></td>
                    </tr>
                    <?php
                    $no = 0;
                    $total = 0;
                    foreach ($list as $row) {
                        $total += doubleval($row->BSweepAmount);
                        ?>
                        <tr class="list-header-middle row-preview-list" ondblclick="clickRows('<?php echo $row->BSweepNumber; ?>')" valign="top">
                            <td class=""><?php echo ++$no; ?></td>
                            <td class=""><?php echo $row->BSweepNumber; ?></td>
                            <td class=""><span class=""><?php echo convert_to_textual($row->BSweepDate); ?></span></td>
                            <td class=""><?php echo $row->BSweepDesc; ?></td>
                            <td class=" text-right"><span class=""><?php echo number_format($row->BSweepAmount, "2", ",", "."); ?></span></td>
                        </tr> 
                        <?php
                    }
                    ?>
                    <tr>
                        <td colspan="5">&nbsp;</td>
                    </tr>
                    <tr class="list-header-bottom">
                        <td class=" text-left" colspan="3"><span class="small_bold" >&nbsp;</span></td>
                        <td class=" text-left"><span class="small_bold" >Total &nbsp;</span></td>
                        <td class=" text-right text-underline"><span class="small_bold" ><?php echo number_format($total, "2", ",", "."); ?></span></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;
    }
    function clickRows(idNumber){
        parent.tab_edit('Edit <?php echo $menu_label;?>' , '<?php echo $menu_link;?>', 'icon-edit', 'edit', idNumber);
    }
</script>