<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
    <head>
        <title><?php echo $menu_label; ?></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">
            <div style="padding:2px" class="noPrint">
                <!--<a href="#" class="easyui-linkbutton" data-options="plain:true,iconCls:'icon-print'" onClick="link_print('<?php echo $menu_link; ?>/to_print')">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;">-->
            <div id="print-container">
                <table class="list-header">
                    <tr>
                        <td height="40" colspan="10" class="company-name text-center "><?php echo $this->load->model('file/m_new_company')->get_company_name($this->session->userdata('company')); ?></td>
                    </tr>
                    <tr>
                        <td colspan="10" class="list-title text-center">List <?php echo $menu_label; ?></td>
                    </tr>
                    <tr>
                        <td colspan="10" class="s5"><br></td>
                    </tr>
                    <tr class="list-header-top">
                        <td width="30" class="s4">Name</td>
                        <td width="75" class="s4">Depreciate Method</td>
                        <td width="75" class="s4">Estimated Life (Month)</td>
                        <td width="65" class="s4">Depriciate Rate (%)</td>
                        <td width="150" class="s4">Description</td>
                        <td width="20" class="s4">Status</td>
                    </tr>
                    <?php
                    foreach ($list as $row) {
                        $DepMethodID = get_depreciate_method($row->DepMethodID);
                        ?>
                        <tr ondblclick="clickRows('<?php echo $row->FixedAssetTypeID; ?>')" class="row-preview-list">
                            <td class="text-top s5"><?php echo $row->FixedAssetType; ?></td>
                            <td class="text-top s5"><?php echo $DepMethodID; ?></td>
                            <td class="text-top s5"><?php echo $row->EstimatedLife; ?></td>
                            <td class="text-top s5"><?php echo $row->DepriciateRate; ?></td>
                            <td class="text-top s5"><?php echo $row->FixedAssetDesc; ?></td>
                            <td class="text-top s5"><?php echo $row->Status; ?></td>
                        </tr> 
                        <?php
                    }
                    ?>
                </table>
            </div>
        </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>
