<?php
$this->load->view('includes/header.php');

?>

<?php if($prev == 1) { 

?>
<script>
function validateForm()
{
var x=document.forms["form1"]["txt_descan"].value;
if (x==null || x=="")
  {
  alert("Reason For Cancel Cannot Be Empty!");
  return false;
  }
}
</script>
<?php echo '<font class="title">'.$menu_path.'</font>';
echo '<br>';
/* Display system message */
$this->fungsi->disp_sys_msg(); ?>
<form action="<?php echo $form_action ?>" method="post" name="form1" onsubmit="return validateForm()">
  <table width="100%" border="0" cellspacing="2" cellpadding="2">
    <tr>
      <td width="12%">Transfer To</td>
      <td width="1%">:</td>
      <td width="26%"><?php echo $cabname; ?></td>
      <td width="10%">Created By</td>
      <td width="1%">:</td>
      <td width="50%"><?php echo $addby; ?></td>
    </tr>
  <tr>
    <td>Petty Cash Type</td>
    <td>:</td>
    <td><?php echo $desc2; ?></td>
    <td width="10%">Created Date</td>
    <td width="1%">:</td>
    <td width="50%"><?php echo $adddate; ?></td>
    </tr>
  <tr>
    <td>Transaction type</td>
    <td>:</td>
    <td><?php echo $desc3; ?></td>
    <td>Edit By</td>
    <td>:</td>
    <td><?php echo $chby; ?></td>
    </tr>
  <tr>
    <td>Amount Requested</td>
    <td>:</td>
    <td><?php echo $amount_req; ?></td>
    <td>Edit Date</td>
    <td>:</td>
    <td><?php echo $chdate; ?></td>
    </tr>
  <tr>
    <td>Amount Transfer</td>
    <td>:</td>
    <td><?php echo $amount_trf; ?></td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>Description</td>
    <td>:</td>
    <td><?php echo $desc; ?></td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td><input name="txt_desc2" type="hidden" id="txt_desc" value="<?php echo $desc; ?>" />
      <input name="txt_amount_trf2" type="hidden" id="txt_amount_trf2" value="<?php echo  $amount_trf2; ?>" /></td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>Approval Status</td>
    <td>:</td><input name="txt_nocpvform" type="hidden" value="<?php echo $nocpvform; ?>" />
    <input name="txt_idcab" type="hidden" value="<?php echo $idcab; ?>" />
      <input name="txt_amount_trf" type="hidden" value="<?php echo $amount_trf; ?>" />
       <input name="txt_desc" type="hidden" value="<?php echo $desc; ?>" />
        <input name="txt_pctrans" type="hidden" value="<?php echo $pctrans; ?>" />
    <td><input name="txt_app" type="hidden" value="<?php echo $rg_app; ?>" /><?php if($rg_app == 1)
	{
		echo '<font color="#00CC00"><font size="+3"><b>APPROVE</b></font>';
	}
	else
	{
		echo '<font color="##FF0000"><font size="+3"><b>CANCEL</b></font>';
		
	}
	?>
     </td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
<?php if($rg_app == 2) { ?>
  <tr>
    <td>Reason For Cancel</td>
    <td>:</td>
    <td><label for="txt_descan"></label>
      <textarea name="txt_descan" id="txt_descan" cols="45" rows="5"><?php echo set_value('txt_descan', isset($default['txt_descan']) ? $default['txt_descan'] : ''); ?></textarea></td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
<?php } ?>
  <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>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
</table>
</form>
<?php }
else
{ ?>
<?php 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 action="<?php echo $form_action ?>" method="post">
  <table width="100%" border="0" cellspacing="2" cellpadding="2">
    <tr>
      <td width="12%">Transfer To</td>
      <td width="1%">:</td>
      <td width="26%"><?php echo $cabname; ?></td>
      <td width="10%">Created By</td>
      <td width="1%">:</td>
      <td width="50%"><?php echo $addby; ?></td>
    </tr>
  <tr>
    <td>Petty Cash Type</td>
    <td>:</td>
    <td><?php echo $desc2; ?></td>
    <td width="10%">Created Date</td>
    <td width="1%">:</td>
    <td width="50%"><?php echo $adddate; ?></td>
    </tr>
  <tr>
    <td>Transaction type</td>
    <td>:</td>
    <td><?php echo $desc3; ?></td>
    <td>Edit By</td>
    <td>:</td>
    <td><?php echo $chby; ?></td>
    </tr>
  <tr>
    <td>Amount Requested</td>
    <td>:</td>
    <td><?php echo $amount_req; ?></td>
    <td>Edit Date</td>
    <td>:</td>
    <td><?php echo $chdate; ?></td>
    </tr>
  <tr>
    <td>Amount Transfer</td>
    <td>:</td>
    <td><?php echo $amount_trf; ?></td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>Description</td>
    <td>:</td>
    <td><?php echo $desc; ?></td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>Approval Status</td>
    <td>:</td>
    <td>
        <label>
          <input type="radio" name="rg_app" value="1" id="rg_app_0" <?php echo set_radio('rg_app', '1', isset($default['rg_app']) && $default['rg_app']=='1'  ? TRUE : FALSE ); ?>  />
          Approve</label>
        <label>
          <input type="radio" name="rg_app" value="2" id="rg_app_1" <?php echo set_radio('rg_app', '2', isset($default['rg_app']) && $default['rg_app']=='2'  ? TRUE : FALSE ); ?>  />
          Cancel</label>
      </td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td><input type="submit" name="button2" id="button2" value="Preview" class="button" /></td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</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');
	?>

