<html>
<head>
  <title><?php echo $menu_label ?></title>
  <link rel="stylesheet" type="text/css" href="<?php echo base_url()?>assets/custom/css/print_new.css">
</head>
<style type="text/css">
  @media print {
    .noPrint { display: none; }
  }
</style>
<body>
  <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="100%">
              <tr>
                  <td  valign="middle">
                      <a href="#" class="easyui-linkbutton noPrint" data-options="plain:true,iconCls:'icon-print'" onClick="print_detail()" <?= in_array($list_transaksi->TransStatus,array(1,2,3,9))? "":"disabled" ?>>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>
	                  <input type="checkbox" name="c_lpdate" id="lp_date" value="lp_date" onclick="ShowHide(this.value)" checked="true">Loan Payment Date
	                  <input type="checkbox" name="c_nolp" id="no_lp" value="no_lp" onclick="ShowHide(this.value)" checked="true">Loan Payment No
	                    <!-- <input type="checkbox" name="c_invno" id="inv_no" value="inv_no" onclick="ShowHide(this.value)" checked="true">PInv No <input type="checkbox" name="c_invdate" id="inv_date" value="inv_date" onclick="ShowHide(this.value)" checked="true">PInv Date -->
	               </td>
              </tr>
              </table>  
          </div>      
      </div>
      <br><br>
      <!-- Header -->
      <div id="print-container">
     
	      <table class="header">
	        <tr>
	             <td colspan="2"class="bdr-left bdr-right bdr-top bdr-bottom head-left" rowspan="2">	             	
                        <span class="normal_bold span_block" ><?php echo $this->session->userdata('company_name'); ?> - <?php echo $list_transaksi->BranchName;?> </span>
                        <span class="small_bold span_block"><?php echo $list_transaksi->BranchAddress;?></span>		             	
	            </td>
	            <td colspan="2" class="bdr-right bdr-top bdr-bottom head-right">
	              <h2 id="title-form">LOAN PAYMENT</h2>
	            </td>
	        </tr>
	        <tr>
	        	<td class="bdr-right bdr-bottom head-right-bottom text-top">
	              <p><label class="lbl-a" >LPay. No</label> <label class="lbl-b">:</label><label class="lbl-c"><?php echo $list_transaksi->LPNumber;?></label></p>
	              <p><label class="lbl-a" >LFun. No</label> <label class="lbl-b">:</label><label class="lbl-c txt_payment_for"><?php echo $list_transaksi->LFNumber;?></label></p>
	            </td>
	            <td class="bdr-right bdr-bottom head-right-bottom text-top">
	              <p><label class="lbl-aright" >LPay. Date</label> <label class="lbl-b">:</label><label class="lbl-cright"><?php echo date('d-m-Y',strtotime($list_transaksi->LPDate));?></label></p>
	              <p><label class="lbl-aright" >Crcy Code</label> <label class="lbl-b">:</label><label class="lbl-cright"><?php echo  $list_transaksi->CurrencyCode; ?></label></p>
	              <p><label class="lbl-aright" >Crcy Rate</label> <label class="lbl-b">:</label><label class="lbl-cright"><?php echo number_format($list_transaksi->CurrencyRate,"2",",","."); ?></label></p>
	            </td>
	        </tr>
	      </table>
	      <!-- Detail Item -->
	      <table class="content">
	      		<tr class="content-top">
	      			  <th class="bdr-left bdr-right bdr-top bdr-bottom th-name"><span class="normal_bold span_block">Loan Account</span></th>
			          <th class="bdr-right bdr-top bdr-bottom th-name"><span class="normal_bold span_block">Bank Account </span></th>
			           <th class="bdr-right bdr-top bdr-bottom th-desc"><span class="normal_bold span_block">Desc</span></th>
			          <th class="bdr-right bdr-top bdr-bottom th-amount" ><span class="normal_bold span_block">Payment</span></th>
	      		</tr>
	      		<tr class="content-middle">
	      			<td class="bdr-left"><span class="normal_bold span_block" ><?php echo  $list_transaksi->Loan_Account; ?></span></td>
	      			<td class=""><span class="normal_bold span_block" ><?php echo  $list_transaksi->Bank_Account; ?></span></td>
	      			<td class=""><span class="normal_bold span_block"><?php echo  substr($list_transaksi->LPDesc,0,50); ?></span></td>
	      			<td class="bdr-right text-right"><span class="normal_bold span_block" ><?php echo number_format($list_transaksi->LPAmount,"2",",","."); ?></span></td>
	      		</tr>
	      		<?php for($x=0;$x<10;$x++):?>
	      		<tr class="content-middle no-item">
	      			<td  class="bdr-left" ><span class="small_bold">&nbsp;</span></td> 
		            <td  class=" " ><span class="small_bold">&nbsp;</span></td>
		            <td  class=" " ><span class="small_bold">&nbsp;</span></td>
		            <td  class="bdr-right" ><span class="small_bold">&nbsp;</span></td>
		           <!--  <td  class=" bdr-left bdr-right" ><span class="small_bold">&nbsp;</span></td> -->
	      		</tr>
	      		<?php endfor;?>
	        	<tr>
        	   		<td  class=" bdr-left bdr-right bdr-bottom bdr-top content-bottom-desc" rowspan="8" colspan="4">
        	   			<span class="normal_bold span_block">Description :</span>
        	   			<span class="normal_bold span_block"><?php echo substr($list_transaksi->LPDesc,0,225);?></span>
        	   		</td>
        		</tr>
	      </table>
	      <!-- Footer Form -->
              
            <div class="footer">
                <div class="footer-top">
                    <div class="footer-paraf-div">
                        <div class="footer-paraf-by normal_bold">Elektronik Prepared By</div>
                        <?php if($list_transaksi->nm_prepared !=""):?>
                        <span class="text-underline text-center footer-paraf-name"><?php echo $list_transaksi->nm_prepared;?></span>
                            <?php else:?>
                        <span class="normal_bold span_block footer-paraf-name">____________</span>
                        <?php endif;?>
                    </div>       
                    
                    <div class="footer-paraf-div">
                        <div class="footer-paraf-by normal_bold">Elektronik Approved By</div>
                        <?php if($list_transaksi->nm_direktur  !=""):?>
                        <span class="text-underline text-center footer-paraf-name"><?php echo $list_transaksi->nm_direktur;?></span>
                            <?php else:?>
                        <span class="normal_bold span_block footer-paraf-name">____________</span>
                        <?php endif;?>
                    </div>      
                    <?php if(($list_transaksi->TransStatus == 3) or ($list_transaksi->TransStatus == 9)){?>
                        <div class="footer-status"><h4 id="title-form" class="suspended">DOKUMEN TIDAK BERLAKU</h4></div>     
                    <?php }?>
                    <div class='clear-float'></div>
                </div>
                
                <div class="footer-bottom">
                    <div class="footer-bottom-company">
                        <div class="footer-bottom-page">Page : 1 Of 1</div>
                    </div>
                    <div class='clear-float'></div>
                </div>
            </div>
              
	    </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('', 'print-container', 'height=528,width=700');
    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;
}

$('.txt_payment_for').on('click',function(){
  var ADebtNumber = $(this).html();
  ADebtNumber   = ADebtNumber.trim();
  ADebtNumber   = ADebtNumber.replace('&nbsp;','');
  parent.tab_edit('Edit Loan Funding', 'list/loan_funding', 'icon-edit', 'edit', ADebtNumber);
}).on('mouseover',function(){
  $(this).css({"color":"blue","text-decoration":"underline","cursor":"pointer"});
}).on('mouseout',function(){
  $(this).css({"color":"#000000","text-decoration":"none"});
});

</script>