<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
    <head>
        <title>Payment Karyawan Journal</title>
        <link rel="stylesheet" type="text/css" href="<?php echo base_url() ?>assets/custom/css/print_new.css">
        <style type="text/css">
            @media print {
                .noPrint { display: none; }
            }
        </style>
    </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="7" class="company-name text-center "><span class="normal_bold span_block " ><?= $company->CompanyName; ?></span></td>
                    </tr>
                    <tr>
                        <td colspan="7" class="branch-name text-center"><span class="normal_bold span_block " ><?= $company->BranchName; ?></span></td>
                    </tr>
                    <tr>
                        <td colspan="7" class="list-title text-center"><span class="normal_bold span_block " >List Payment Karyawan Journal</span></td>
                    </tr>
                    <tr>
                        <td colspan="7" class="s1">&nbsp;</td>
                    </tr>
                    <tr class="list-header-top">
                        <td width="" class="">No</td>
                        <td width="" class="">No payment</td>
                        <td width="" class="">Date</td>
                        <td width="" class="">From</td>
                        <td width="" class="">To</td>
                        <td width="" class="">Description</td>
                        <td width="" class="text-right">Amount</td>
                    </tr>
                    <?php
                    $no = 0;
                    $list = json_encode($list);
                    $total = 0;
                    $payment_karyawan = json_decode($list);
                    foreach ($payment_karyawan as $row) {
                        ?>
                        <tr class="row-preview-list" ondblclick="clickRows('<?php echo $row->EInjNumber; ?>')">
                            <td class="text-top s5"><?php echo ++$no; ?></td>
                            <td class="text-top s5"><?php echo $row->EInjNumber; ?></td>
                            <td class="text-top s5"><span class=""><?php echo convert_to_dmy($row->EInjDate); ?></span></td>
                            <td class="text-top s5"><?php echo $row->EmployeeName; ?></td>
                            <td class="text-top s5"><span class=""><?php echo $row->CompanyName; ?></span></td>
                            <td class="text-top s5"><span class=""><?php echo $row->EInjDesc; ?></span></td>
                            <td class="text-right text-top s5"><span class=""><?php echo number_format($row->EInjAmount, "0", ",", "."); ?><?php $total += $row->EInjAmount; ?></span></td>
                        </tr> 
                        <?php
                    }
                    ?>
                    <tr>
                        <td class="" align="right" colspan="7">&nbsp;</td>
                    </tr>
                    <tr class="list-header-bottom">
                        <td colspan="5"><span class="normal_bold" >&nbsp;</span></td>
                        <td class="text-left"><span class="normal_bold" >Total</span></td>
                        <td class="text-right text-underline"><span class="normal_bold" ><?php echo number_format($total, "2", ",", "."); ?></span></td>
                    </tr>
                </table>
            </div>
        </div>
    </body>
</html>
<script type="text/javascript">
    function print_detail() {
        //var opt_print   = $("input[type='radio'][name='opt_print']:checked").val();
        var data_print = $("#list-print-container").html();
        Popup(data_print);

    }

    function Popup(data) {
        var mywindow = window.open('', 'list-print-container', 'height=528,width=600');
        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 >= 6
        mywindow.focus(); // necessary for IE >= 6

        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>