<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
    <head><title>Regions</title>
        
    <style type="text/css">
        @media print {
            .noPrint { display: none; }
        }
    </style>
    </head>

    <body style="width:auto; margin:auto">

        <div style="padding:2px" class="noPrint">
<!--            <a href="#" class="easyui-linkbutton" data-options="plain:true,iconCls:'icon-print'" onClick="link_print('list/departement/to_pdf')">Print</a>-->
            <a href="#" class="easyui-linkbutton" data-options="plain:true,iconCls:'icon-print'" onClick="print_detail()">Print</a>
        </div><br />

        <div style="overflow: auto; height:700px;" id="print-container">
            <table width="80%" border="0" cellspacing="0" cellpadding="0" style="margin-left:9%; margin-top:10px;">
            <tr>
                <td colspan="3" align="center" class="s0">PT. Indopenta Sakti Teguh</td>
            </tr>
            <tr>
                <td colspan="3" align="center" class="s1">Region List</td>
            </tr>
            <tr>
                <td width="" class="s4">Region Code</td>
                <td width="" class="s4">Region Name</td>
                <td width="" class="s4">Description</td>
            </tr>
            <?php foreach ($list as $row): ?>
                <tr ondblclick="clickRows('<?php echo $row->RegionCode; ?>')" class="row-preview-list">
                    <td class="s5"><?php echo $row->RegionCode; ?></td>
                    <td class="s3"><?php echo $row->RegionName; ?></td>
                    <td class="s5"><?php echo $row->RegionDesc; ?></td>
                </tr>
            <?php endforeach; ?>
            <tr>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
            </tr>
        </table>
        </div>
    </body>
</html>
<script>
    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('', 'print-container', 'height=528,width=700');
        var css = '<link rel="stylesheet" href="<?php echo base_url() ?>assets/custom/css/table.css" type="text/css" />';
//        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>

