<?php
$this->load->view('includes/header.php');
?>
<script type="text/javascript">
			
			// Sample 2
			$(document).ready(function()
			{
				$('#txt_amount').blur(function()
				{
					$('#txt_amount').formatCurrency({ region: 'id-ID' });
				});
			});
		</script>
<?php
if ( ! empty($prev))
	{
?>

<form action="<?php echo $form_action ?>" method="post">
<?php echo '<font class="title">'.$menu_path.'</font>'; ?>
<table width="100%" border="0" cellspacing="2" cellpadding="2">
  <tr>
    <td>Jenis Pembayaran</td>
    <td>:</td>
    <td><?php echo $top_desc; ?>
      <input name="txt_idtop" type="hidden" id="txt_idtop" value="<?php echo $txt_idtop; ?>" /></td>
  </tr>
  <tr>
    <td>Previous Petty Cash Balance</td>
    <td>:</td>
    <td><?php echo $this->fungsi->format_idr($pcbalance); ?></td>
  </tr>
  <tr>
    <td>Price / Liter</td>
    <td>:</td>
    <td><input name="txt_amount" type="hidden" id="txt_amount" value="<?php echo $txt_amount; ?>" />
      <?php echo $this->fungsi->format_idr($txt_amount); ?></td>
  </tr>
  <tr>
    <td width="14%">Total <input name="txt_liter" type="hidden" id="txt_liter" value="<?php echo $txt_liter; ?>" />Volume</td>
    <td width="1%">:</td>
    <td width="85%"><?php echo number_format($txt_liter); ?></td>
  </tr>
  <tr>
    <td>Total Amount</td>
    <td>:</td>
    <td><?php 
	$total_amount = $txt_amount * $txt_liter;
	echo $this->fungsi->format_idr($total_amount); ?></td>
  </tr>
  
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td><input type="button" name="button3" onclick="goBack()" id="button3" value="Back" class="button" /> 
            <input type="submit" name="button2" id="button2" value="Submit" class="button" /></td>
  </tr>
</table>
</form>
<?php
	}
else
{
echo '<font class="title">'.$menu_path.'</font>';
echo '<br>';
			/* Display system message */
			$this->fungsi->disp_sys_msg();
			echo validation_errors('<p class="field_error">', '</p>');
?>
<form name="form1" method="post" action="<?php echo $form_action ?>">
  <table width="100%" border="0" cellspacing="1" cellpadding="1">
    <tr>
      <td>Jenis Pembayaran</td>
      <td>:</td>
      <td><select name="cb_idtop" id="cb_idtop">
        <option value="0" selected="selected">Cash</option>
        <option value="1">Credit</option>
      </select></td>
    </tr>
    <tr>
      <td>Petty Cash Balance</td>
      <td>:</td>
      <td><?php echo $this->fungsi->format_idr($pcbalance); ?></td>
    </tr>
    <tr>
      <td width="14%">Price / Liter</td>
      <td width="1%">:</td>
      <td width="85%"><label for="txt_ebeln"></label>
      <input name="txt_amount" type="text" id="txt_amount" value="<?php echo set_value('txt_amount', isset($default['txt_amount']) ? $default['txt_amount'] : ''); ?>" /></td>
    </tr>
    <tr>
      <td>Total Volume</td>
      <td>:</td>
      <td><label for="txt_desc">
        <input name="txt_liter" type="text" id="txt_liter" value="<?php echo set_value('txt_liter', isset($default['txt_liter']) ? $default['txt_liter'] : ''); ?>" onblur="this.value=addCommas(this.value)" />
      Liter</label></td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td><input type="submit" name="button" id="button" value="Preview" class="button" /></td>
    </tr>
  </table>
 
</form>

 <?php
}
if ( ! empty($link))
	{
		echo '<p id="bottom_link">';
		foreach($link as $links)
		{
			echo $links . ' ';
		}
		echo '</p>';
	}
$this->load->view('includes/footer.php');
	?>

