<?php
if($xls == 1 ) {
header("Content-Disposition: attachment; filename=\"pc_op.xls\"");
header("Content-Type: application/vnd.ms-excel");	
}
$this->load->view('includes/header.php');
echo '<font class="title">'.$menu_path.'</font>';
echo '<br>';
echo '<br>';
			/* Display system message */
			$this->fungsi->disp_sys_msg();
			echo validation_errors('<p class="field_error">', '</p>');
			
			//foreach ($cpv_pus  as $cpv_puss)
?>

<style type="text/css" media="print">
.no-print		{ display:none; }
</style>
<script language="Javascript1.2">
  <!--
  function printpage() {
  window.print();
  }
  //-->
</script>
<?php
if($xls == 0 ) {
	?>
<input type="button" class="no-print" value="Print this Page" onclick="window.print();">
<form name="form1" method="post" action="<?php echo $form_action ?>">
  <input type="submit" name="button" class="no-print" id="button" value="Export To Excel" />
</form>
<?php } ?>
<br />
<table border="1" cellpadding="1" cellspacing="1" bordercolor="#000000">
  <tr>
    <th width="97">NO. BPKK</th>
    <th width="38">NO.</th>
    <th width="293">URAIAN</th>
    <th width="50">GL. ACC.</th>
    <th width="50">GL. ACC. DESC.</th>
    <th width="103">TOTAL</th>
    <th width="87" height="41">POST DATE</th>
    <th width="87" height="41">ENTRY DATE</th>
    <th width="67">POST BY</th>
  </tr>
  <?php 
$total = 0;
$total_amt = 0;
$bg = 0;
foreach ($bpkk as $bpkks)
{ 
											if($bg==0)
											   {
											   echo '<tr style=background-color:#eeeeee;>';
											   $bg++;
											   }
											else
												{
												echo '<tr style=background-color:#;>';
												$bg--;
												}		
?>
       
        
           
<?php if($xls == 0 ) { ?>
 <td><?php echo $bpkks->nobpkkform; ?></td>
            <td align="center"><?php echo $bpkks->itemno; ?></td>
        <td><?php echo $bpkks->uraian; ?></td>
        <td align="center"><?php echo $bpkks->glacc; ?></td>
        <td><?php echo $bpkks->desc; ?></td>
      <td align="right"><?php echo $this->fungsi->format_idr($bpkks->total_item); ?></td>
      <td align="center"><?php echo  date("d.m.Y", strtotime($bpkks->postdate)) ; ?></td>
      <td align="center"><?php echo  date("d.m.Y", strtotime($bpkks->adddate)) ; ?></td>
    <td align="center"><?php echo $bpkks->addby; ?></td>
    <?php }
else
{
 ?>
 <td width="17" ><?php echo $bpkks->nobpkkform; ?></td>
            <td width="106" ><?php echo $bpkks->itemno; ?></td>
        <td width="106" ><?php echo $bpkks->uraian; ?></td>
        <td><?php echo $bpkks->uraian; ?></td>
        <td align="center"><?php echo $bpkks->glacc; ?></td>
      <td width="106"  align="right"><?php echo $bpkks->total_item; ?></td>
      <td width="106" ><?php echo  date("d.m.Y", strtotime($bpkks->postdate)) ; ?></td>
       <td align="center"><?php echo  date("d.m.Y", strtotime($bpkks->adddate)) ; ?></td>
    <td width="106" ><?php echo $bpkks->addby; ?></td>
<?php } ?>
  </tr>
  <?php 
$total_amt = $total_amt + $bpkks->total_item;
}
?>
  <tr>
    <td bgcolor="#FFFF00">&nbsp;</td>
    <td bgcolor="#FFFF00">&nbsp;</td>
    <td bgcolor="#FFFF00">&nbsp;</td>
    <td bgcolor="#FFFF00">&nbsp;</td>
    <td align="right" bgcolor="#FFFF00"><strong>Total</strong></td>
  <td align="right" bgcolor="#FFFF00"><strong><?php if($xls == 0) { echo $this->fungsi->format_idr($total_amt); } else {  echo $total_amt;} ?></strong></td>
  <td bgcolor="#FFFF00">&nbsp;</td>
    <td bgcolor="#FFFF00">&nbsp;</td>
    <td bgcolor="#FFFF00">&nbsp;</td>
  </tr>
  
</table>
<?php
if ( ! empty($link))
	{
		echo '<p id="bottom_link" class="no-print">';
		foreach($link as $links)
		{
			echo $links . ' ';
		}
		echo '</p>';
	}
$this->load->view('includes/footer.php');
	?>
