<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Account Balance</title>
<link rel="stylesheet" type="text/css" href="<?php echo base_url()?>assets/custom/css/print.css">
</head>
<body style="width:auto; margin:auto">
<style type="text/css">
  @media print {
    .noPrint { display: none; }
  }
</style>
<div style="padding:2px">
	<a href="#" class="easyui-linkbutton noPrint" data-options="plain:true,iconCls:'icon-print'" onClick="print_detail()">Print</a>
</div><br />
<div id="list-print-container">
<table width="99%" border="0" cellspacing="0" cellpadding="0" style="margin-left:5px; margin-top:10px;">
    <tr>
		<td colspan="17" class="s0"><?php echo $this->session->userdata('company_name'); ?></td>
    </tr>
    <tr>
		<td height="41" colspan="17" class="s1">Account Balance</td>
    </tr>
	<tr>
		<td height="41" colspan="17" class="s1"></td>
    </tr>
    <tr>
	  <td class="s1"></td>
    </tr>
	<tr>
      <td width="20" class="s4" rowspan="2">No &nbsp;</td>
	  <td width="200" class="s4" rowspan="2">Account Name</td>
		<td width="90" class="s4" rowspan="2">Op. Balance</td>
        <td width="90"  colspan="12" class="s4"><div align="center">Periode</div></td>
   </tr>
   <tr>
		<td width="70" class="s4">Periode 1</td>
		<td width="70" class="s4">Periode 2</td>
		<td width="70" class="s4">Periode 3</td>
		<td width="70" class="s4">Periode 4</td>
		<td width="70" class="s4">Periode 5</td>
		<td width="70" class="s4">Periode 6</td>
		<td width="70" class="s4">Periode 7</td>
		<td width="70" class="s4">Periode 8</td>
		<td width="70" class="s4">Periode 9</td>
		<td width="70" class="s4">Periode 10</td>
		<td width="70" class="s4">Periode 11</td>
		<td width="70" class="s4">Periode 12</td>
    </tr>
  <?php	   
    $list = json_encode($list);
	$balance=json_decode($list);
	$no=0; $total=0;
	foreach($balance as $row){		   
  ?>
	<tr>
	    <td class="s5" rowspan="2"><?php echo ++$no; ?></td>
		
		<td class="s3" rowspan="2"><span class="s5"><?php echo $row->AccountName; ?></span></td>
         <td class="s3" rowspan="2"><span class="s5"><?php echo number_format($row->GLSaldoBalance1,"2",",","."); ?></span></td>
        <td class="s3" colspan="12"><span class="s5"></span></td>
   </tr>
   <tr>
        <td class="s3"><span class="s5"><?php echo number_format($row->GLSaldoBalance1,"2",",","."); ?></span></td>
		<td class="s3"><span class="s5"><?php echo number_format($row->GLSaldoBalance2,"2",",","."); ?></span></td>
        <td class="s3"><span class="s5"><?php echo number_format($row->GLSaldoBalance3,"2",",","."); ?></span></td>
        <td class="s3"><span class="s5"><?php echo number_format($row->GLSaldoBalance4,"2",",","."); ?></span></td>
        <td class="s3"><span class="s5"><?php echo number_format($row->GLSaldoBalance5,"2",",","."); ?></span></td>
        <td class="s3"><span class="s5"><?php echo number_format($row->GLSaldoBalance6,"2",",","."); ?></span></td>
        <td class="s3"><span class="s5"><?php echo number_format($row->GLSaldoBalance7,"2",",","."); ?></span></td>
        <td class="s3"><span class="s5"><?php echo number_format($row->GLSaldoBalance8,"2",",","."); ?></span></td>
        <td class="s3"><span class="s5"><?php echo number_format($row->GLSaldoBalance9,"2",",","."); ?></span></td>
        <td class="s3"><span class="s5"><?php echo number_format($row->GLSaldoBalance10,"2",",","."); ?></span></td>
        <td class="s3"><span class="s5"><?php echo number_format($row->GLSaldoBalance11,"2",",","."); ?></span></td>
        <td class="s3"><span class="s5"><?php echo number_format($row->GLSaldoBalance12,"2",",","."); ?></span></td>
  </tr> 
<?php
}	   
?>
</table>
</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=700');
    var css = '<link rel="stylesheet" href="<?php echo base_url()?>assets/custom/css/print.css" type="text/css" />';
    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;
}
</script>
