<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
    <head>
        <title>Customers</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 style="padding:2px">
                    <a href="#" class="easyui-linkbutton" data-options="plain:true,iconCls:'icon-print'" onClick="link_print('list/customers/to_pdf')">Print</a>
                </div><br />-->
        <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" data-options="plain:true,iconCls:'icon-print'" onClick="link_print('list/customers/to_pdf')">Print</a>-->
                                <a href="#" class="easyui-linkbutton noPrint" data-options="plain:true,iconCls:'icon-print'" onClick="print_detail()">Print</a>
                            </td>
                        </tr>
                    </table>  
                </div>      
            </div>

            <div id="limit-container">

            </div>
            <br><br>

            <div id="print-container">
                <table class="list-header">
            <!--<table width="80%" border="0" cellspacing="0" cellpadding="0" style="margin-left:9%; margin-top:10px;">-->
                <tr>
                    <td colspan="6" class="company-name text-center">PT. Indopenta Sakti Teguh</td>
                </tr>
                <tr>
                    <td colspan="6" class="list-title text-center">List Customer</td>
                </tr>
                <tr>
                    <td colspan="6" class="list-title text-center"><br></td>
                </tr>
                <tr class="list-header-top">
                    <td width="" class="s4">Customer No</td>
                    <td width="" class="s4">Customer Name</td>
                    <td width="" class="s4">Phone</td>
                    <td width="" class="s4">Contact</td>
                    <td width="" class="s4">Balance Prime</td>
                    <td width="" class="s4">Currency</td>
                </tr>
                <?php foreach ($list as $row): ?>
                    <tr class="row-preview-list" >
                        <td class="text-top s5"><?php echo $row->CustomerCode; ?></td>
                        <td class="text-top s5"><span class="s5"><?php echo $row->CustomerName; ?></span></td>
                        <td class="text-top s5"><?php echo $row->PhoneNumber; ?></td>
                        <td class="text-top s5"><?php echo $row->ContactPerson; ?></td>
                        <td class="text-top s5"><?php echo $row->SalesLimit; ?></td>
                        <td class="text-top s5"><?php echo $row->CurrencyName; ?></td>
                    </tr> 
                <?php endforeach; ?>
                <tr>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                    <td>&nbsp;</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 = $("#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>