<?php
$this->load->view('includes/header.php');
	echo '<font class="title">'.$menu_path.'</font>';
	echo '<br>';
	$this->fungsi->disp_sys_msg();
	echo validation_errors('<p class="field_error">', '</p>');
?>
<script type="text/javascript">
/*function toggleChecked(status) {
$(".checkbox").each( function() {
$(this).attr("checked",status);
})
}
*/
</script>
<script type="text/javascript">
function toggleChecked(status) {
$(".checkbox").each( function() {
$(this).attr("checked",status);
$(this).closest('tr').toggleClass("highlight", this.checked);
})
}

$(function() {
    $('td:first-child input').change(function() {
        $(this).closest('tr').toggleClass("highlight", this.checked);
    });
});
</script>
<style type="text/css">
.highlight {
      background-color:yellow;
}
</style>
<?php if($prev == 0)
{
?>
<form action="<?php echo $form_action ?>" method="post">
<div id="checkboxes">
<?php
	echo ! empty($message) ? $message : '';
	echo ! empty($table) ? $table : '';
	echo ! empty($pagination) ? '<p id="pagination">' . $pagination . '</p>' : '';
	if ( ! empty($link))
	{
		echo '<p id="bottom_link">';
		foreach($link as $links)
		{
			echo $links . ' ';
		}
		echo '</p>';
	}
	
?>
</div>
<input name="Preview" type="submit" value="Preview" class="button" />
</form>	
<?php } 
else if($prev == 1)
{
?>
<form id="form1" name="form1" method="post" action="<?php echo $form_action ?>">
  <table width="990" border="0" cellpadding="2" cellspacing="2">
    <tr>
      <th width="175">NO. PO</th>
      <th width="261">SUPPLIER</th>
      <th width="263">TOTAL AMOUNT</th>
      <th width="263">OPTIONS</th>
    </tr>
    <?php echo $tables; ?>
    <tr>
      <td colspan="2" bgcolor="#FFFF66"><strong>TERBILANG : # <?php echo $this->fungsi->terbilang($total); ?> Rupiah #</strong></td>
      <td align="right" bgcolor="#FFFF66"><strong>
        <input type="hidden" name="total" id="total" value="<?php echo $total; ?>"  />
      <?php echo $this->fungsi->format_idr($total); ?></strong></td>
      <td bgcolor="#FFFF66">&nbsp;</td>
    </tr>
  </table>
  <input type="button" name="button3" onclick="goBack()" id="button3" value="Back" class="button" />
  <?php echo $submit; ?>
<br />
</form>
<?php }
$this->load->view('includes/footer.php');
 ?>