<?php
if($xls == 1 ) {
header("Content-Disposition: attachment; filename=\"op_periode.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 width="1663" border="1" cellpadding="1" cellspacing="1" bordercolor="#000000">
  <tr>
   <th width="145">Posting Date</th>
    <th width="134" height="41">OP Number</th>
    <th width="137">PP Number</th>
    <th width="137">PO Number</th>
     <th width="129">STB Number</th>  
    <th width="145">Name</th>
    <th width="145">Type</th>
    <th width="145">Manifest</th>  
    <th width="136">Purchase Price</th>
    <th width="124">Fee Price</th>
    <th width="137">Vol</th>
    <th width="278">Information</th>
  </tr>
<?php 
$total = 0;
foreach ($op as $ops)
{ 

if($bg==0)
											   {
											   echo '<tr style=background-color:#eeeeee;>';
											   $bg++;
											   }
											else
												{
												echo '<tr style=background-color:#;>';
												$bg--;
												}		


?>  <td align="center"><?php echo  date("d.m.Y", strtotime($ops->postdate)) ; ?></td>
    <td align="center"><?php echo $ops->opnumb; ?></td>
    <td align="center"><?php echo $ops->prnumb; ?></td>
    <td align="center"><?php echo $ops->ebeln; ?></td>
    <td align="center"><?php echo $ops->idstb; ?></td>
    <td align="center"><?php echo $ops->suppname; ?></td>
    <td align="center"><?php echo $ops->type; ?></td>
    <td align="center"><?php echo $ops->mnfst; ?></td>
    <td align="right"><?php echo $ops->pur; ?></td>
    <td align="right"><?php echo $ops->fee; ?></td>
   <?php /*?> <?php print_r($ops->fee); ?><?php */?>
    <td align="right"><?php echo $ops->vol; ?></td>
    <td align="center"><?php echo $ops->inf; ?></td>
    
   
  </tr>
<?php 
$total = $ops->vol + $total;
}
?>
<tr>
    <td bgcolor="#FFFF00">&nbsp;</td>
    <td bgcolor="#FFFF00">&nbsp;</td>
    <td bgcolor="#FFFF00">&nbsp;</td>
    <td bgcolor="#FFFF00">&nbsp;</td>
     <td bgcolor="#FFFF00">&nbsp;</td>
 <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">&nbsp;</td>
    <td align="right" bgcolor="#FFFF00"><strong>
      <?php
	if($this->session->userdata('uid')=='sugeng')
	{
		echo number_format($total);
	}
	else
	{
	 echo $this->fungsi->format_idr($total);
	}
	 ?>
    </strong></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');
	?>
