<?php
$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>
<style type="text/css">
.tooltip{
   			display: inline;
    		position: relative;
		}
		
		.tooltip:hover:after{
    		background: #333;
    		background: rgba(0,0,0,.8);
    		border-radius: 5px;
    		bottom: 26px;
    		color: #fff;
    		content: attr(title);
    		left: 20%;
    		padding: 5px 15px;
    		position: absolute;
    		z-index: 98;
    		width: 220px;
		}
		
		.tooltip:hover:before{
    		border: solid;
    		border-color: #333 transparent;
    		border-width: 6px 6px 0 6px;
    		bottom: 20px;
    		content: "";
    		left: 50%;
    		position: absolute;
    		z-index: 99;
		}
</style>
<script language="Javascript1.2">
  <!--
  function printpage() {
  window.print();
  }
  //-->
</script>

<input type="button" class="no-print" value="Print this Page" onclick="window.print();">
<br />
<?php 
/*
$total = 0;
$count = 0;
foreach ($balance as $balances)
{
$count = $count + 1;
switch ($count)
{
case 1:
  $sum_1 = $balances->total;
  break;
case 2:
 $sum_2 = $balances->total;
  break;
case 3:
  $sum_3 = $balances->total;
  break;
case 4:
  $sum_4 = $balances->total;
  break;
case 5:
  $sum_5 = $balances->total;
  break;
case 6:
  $sum_6 = $balances->total;
  break;
case 7:
  $sum_7 = $balances->total;
break;
case 8:
  $sum_8 = $balances->total;
break;
case 9:
  $sum_9 = $balances->total;
break;
}
$total = $balances->total + $total;
}
*/
?>
<table width="486" border="1" cellpadding="1" cellspacing="1" bordercolor="#000000">
  <tr>
    <th width="281" height="41">TRANSACTION</th>
    <th width="192">AMOUNT</th>
  </tr>
  <tr>
    <td>1. BANK BALANCE <a href="#" title="Saldo Bank BCA WGI" class="tooltip">[ ? ]</a></td>
    <td align="right"><?php if($this->session->userdata('uid')=='sugeng')
	{
		echo number_format($sum_6);
	}
	else
	{
		echo $this->fungsi->format_idr($sum_6);
	} ?></td>
  </tr>
  <tr>
    <td>2. PC UO BALANCE <a href="#" title="Saldo petty cash used oil" class="tooltip">[ ? ]</a></td>
    <td align="right"><?php if($this->session->userdata('uid')=='sugeng')
	{
		echo number_format($sum_7);
	}
	else
	{
		echo $this->fungsi->format_idr($sum_7);
	} ?></td>
  </tr>
  <tr>
    <td>3. PC OP BALANCE <a href="#" title="Saldo petty cash operational" class="tooltip">[ ? ]</a></td>
    <td align="right"><?php if($this->session->userdata('uid')=='sugeng')
	{
		echo number_format($sum_8);
	}
	else
	{
		echo $this->fungsi->format_idr($sum_8);
	} ?></td>
  </tr>
  <tr>
    <td>4. OIL PURCH PENDING <a href="#" title="Total pembelian oli (OP) yang belum di closed menjadi PO" class="tooltip">[ ? ]</a></td>
    <td align="right"><?php if($this->session->userdata('uid')=='sugeng')
	{
		echo number_format($sum_5);
	}
	else
	{
		echo $this->fungsi->format_idr($sum_5);
	} ?></td>
  </tr>
  <tr>
    <td>5. BPKK PENDING <a href="#" title="Total transaksi petty cash operational yang belum di rembuirse ke pusat" class="tooltip">[ ? ]</a></td>
    <td align="right"><?php if($this->session->userdata('uid')=='sugeng')
	{
		echo number_format($sum_10);
	}
	else
	{
		echo $this->fungsi->format_idr($sum_10);
	} ?></td>
  </tr>
  <tr>
    <td>6. REMBUIRSEMENT PENDING <a href="#" title="Total transaksi petty cash operational yang sudah di rembuirse ke pusat tetapi belum di proses oleh pusat" class="tooltip">[ ? ]</a></td>
    <td align="right"><?php if($this->session->userdata('uid')=='sugeng')
	{
		echo number_format($sum_9);
	}
	else
	{
		echo $this->fungsi->format_idr($sum_9);
	} ?></td>
  </tr>
  <tr>
      <td>7. CPV PENDING <a href="#" title="Total transaksi petty cash used oil (PO) yang sudah di rembuirse ke pusat tetapi belum di proses oleh pusat" class="tooltip">[ ? ]</a></td>
      <td align="right"><?php
	  if($this->session->userdata('uid')=='sugeng')
	{
		echo number_format($sum_1 + $sum_12);
	}
	else
	{
		echo $this->fungsi->format_idr($sum_1 + $sum_12);
	}
	    ?></td>
    </tr>
    <tr>
      <td>8. CPV PENDING APPROVAL <a href="#" title="Total transaksi rembuirsement yang sudah di verifikasi oleh finance tetapi belum di lakukan approval"class="tooltip">[ ? ]</a></td>
      <td align="right"><?php  if($this->session->userdata('uid')=='sugeng')
	{
		echo number_format($sum_11);
	}
	else
	{
		echo $this->fungsi->format_idr($sum_11);
	}?></td>
    </tr>
    <tr>
      <td>9. CPDU PENDING <a href="#" title="Proses verifikasi dan approval dokumen rembuirse sudah OK tetapi belum di input no. CPDU oleh finance" class="tooltip">[ ? ]</a></td>
      <td align="right"><?php  if($this->session->userdata('uid')=='sugeng')
	{
		echo number_format($sum_3);
	}
	else
	{
		echo $this->fungsi->format_idr($sum_3);
	} ?></td>
    </tr>
    <tr>
      <td>10. POST G/L OP PENDING <a href="#" title="Rembuirsement belum di lakukan jurnal oleh accounting" class="tooltip">[ ? ]</a></td>
      <td align="right"><?php  if($this->session->userdata('uid')=='sugeng')
	{
		echo number_format($sum_4);
	}
	else
	{
		echo $this->fungsi->format_idr($sum_4);
	}?></td>
    </tr>
  <tr>
    <td align="right" bgcolor="#FFFF00"><strong>Total :</strong></td>
    <td align="right" bgcolor="#FFFF00"><strong>
      <?php 
	$total = $sum_1 + $sum_3 + $sum_4 + $sum_5 + $sum_6 + $sum_7 + $sum_8 + $sum_9 + $sum_10 + $sum_11 + $sum_12;
	if($this->session->userdata('uid')=='sugeng')
	{
		echo number_format($total);
	}
	else
	{
		echo $this->fungsi->format_idr($total);
	}
			 ?>
    </strong></td>
  </tr>
  <tr>
    <td align="right" bgcolor="#FFFF00"><strong>Limit Petty Cash :</strong></td>
    <td align="right" bgcolor="#FFFF00"><strong><?php if($this->session->userdata('uid')=='sugeng')
	{
		echo number_format($sal_tot_cab);
	}
	else
	{
		echo $this->fungsi->format_idr($sal_tot_cab);
	}
	?></strong></td>
  </tr>
  <tr>
    <td align="right" bgcolor="#FFFF00"><strong>Differences :</strong></td>
    <td align="right" bgcolor="#FFFF00"><strong><?php if($this->session->userdata('uid')=='sugeng')
	{
		echo number_format(round($total) - $sal_tot_cab);
	}
	else
	{
		echo $this->fungsi->format_idr(round($total) - $sal_tot_cab);
	}
	?></strong></td>
  </tr>
  <tr>
    <td align="right" bgcolor="#FFFF00"><strong>Status :</strong></td>
    <td align="center" bgcolor="#FFFF00"><strong><?php if(round($total) - $sal_tot_cab == 0) { echo '<font color="#009900">BALANCE</font>'; }else { echo '<font color="#FF0000">NOT BALANCE!</font>'; } ?></strong></td>
  </tr>
</table>
<br />
<br />
<?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');
	?>
