<?php
$this->load->view('includes/header.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>');
?>
<script type="text/javascript">
 
 //Date picker
	$(function() {
		 
		$( "#txt_budat" ).datepicker({
			changeMonth: true,
			changeYear: true
		});
		$( "#txt_budat" ).datepicker( "option", "dateFormat", "dd.mm.yy");
		$( "#txt_budat" ).datepicker( "setDate", "<?php echo date('d.m.Y'); ?>" );
		
		
		$( "#txt_bldat" ).datepicker({
			changeMonth: true,
			changeYear: true
		});
		$( "#txt_bldat" ).datepicker( "option", "dateFormat", "dd.mm.yy" );
		$( "#txt_bldat" ).datepicker( "setDate", "<?php echo date('d.m.Y'); ?>" );
		
		
	});

$(document).ready(function(){
$("#button_add").click(function() {
					
$('#add-table').append('<tr><td width="150"><strong><input name="addgl[]" type="text" id="addgl[]"/></strong></td><td width="92" align="center"><strong><input name="addcostctr[]" type="text" id="addcostctr[]" size="10" maxlength="10"/></strong></td><td width="69"><strong><em>Give (-) to assign as credit</em></strong></td><td width="104" align="center"><strong><input name="addamount[]" type="text" id="addamount[]" size="15"/></strong></td><td width="119" align="center"><strong><input name=addassign[]" type="text" id="addassign[]" size="18" maxlength="18"/></strong></td><td width="300"><strong><input name="additemtxt[]" type="text" id="additemtxt[]" size="50" maxlength="50"/></strong></td><td width="195"><strong><a href="#" id="del">Delete item</a></strong></td></tr>');	
});

$('#add-table').delegate('#del', 'click', function(){
            $(this).closest('tr').remove();
})
});
</script>
<form name="form1" method="post" action="<?php echo $form_action ?>">
  <table width="100%" border="0" cellspacing="1" cellpadding="1">
    <tr>
      <td colspan="3"><strong>HEADER DATA</strong></td>
    </tr>
    <tr>
      <td width="14%">Doc. Date</td>
      <td width="1%">:</td>
      <td width="85%"><label for="txt_bldat"></label>
      <input name="txt_bldat" type="text" id="txt_bldat" size="10" maxlength="10" value="<?php echo date('d.m.Y'); ?>"/>
      <input type="hidden" name="txt_nocpvform" id="txt_nocpvform" value="<?php echo $nocpvform; ?>" />
      <input name="totaldata" type="hidden" id="totaldata" value="<?php echo $totaldata; ?>" />
      <input type="hidden" name="txt_idcab" id="txt_idcab" value="<?php echo $idcab; ?>" />
      <input type="hidden" name="txt_totalcpv" id="txt_totalcpv" value="<?php echo $txt_totalcpv; ?>" /></td>
    </tr>
    <tr>
      <td>Posting. Date</td>
      <td>:</td>
      <td><input name="txt_budat" type="text" id="txt_budat" size="10" value="<?php echo date('d.m.Y'); ?>"  maxlength="10" /></td>
    </tr>
    <tr>
      <td>Reference</td>
      <td>:</td>
      <td><label for="txt_msg">
        <input name="txt_xblnr" type="text" id="txt_xblnr" size="16" maxlength="16" value="<?php echo set_value('txt_xblnr', isset($default['txt_xblnr']) ? $default['txt_xblnr'] : ''); ?> " />
      </label></td>
    </tr>
    <tr>
      <td>Short Text</td>
      <td>:</td>
      <td><input name="txt_bktxt" type="text" id="txt_bktxt" size="25" maxlength="25" value="<?php echo set_value('txt_bktxt', isset($default['txt_bktxt']) ? $default['txt_bktxt'] : ''); ?> "  /></td>
    </tr>
  </table>
 

 <table width="100%" border="0" cellspacing="1" cellpadding="1">
   <tr>
     <td colspan="6"><strong>ITEM DATA</strong></td>
   </tr>
   <tr>
     <th width="12%"><strong>G/L Account</strong></th>
     <th width="11%">Cost Center</th>
     <th width="7%"><strong>D/C</strong></th>
     <th width="11%"><strong>Amount</strong></th>
     <th width="14%"><strong>Assigment No.</strong></th>
     <th width="16%"><strong>Item Text</strong></th>
    </tr>
   <?php echo $tables; ?>
   <tr>
     <td colspan="6"><strong>ADD ITEM DATA<br />
       <input type="button" name="button_add" id="button_add" value="Add" class="button" />
       
       <table width="1053" cellpadding="1" cellspacing="1" id="add-table">
         <tr>
           <th height="23"><strong>G/L Account</strong></th>
           <th><strong>Cost Center</strong></th>
           <th><strong>D/C</strong></th>
           <th><strong>Amount</strong></th>
           <th><strong>Assigment No.</strong></th>
           <th><strong>Item Text</strong></th>
           <th>&nbsp;</th>
         </tr>
       </table>
      </td>
    </tr>
   <tr>
     <td>&nbsp;</td>
     <td>&nbsp;</td>
     <td>&nbsp;</td>
     <td>&nbsp;</td>
     <td>&nbsp;</td>
     <td>&nbsp;</td>
   </tr>
   <tr>
     <td><input type="submit" name="button" id="button" value="Submit" class="button" /></td>
     <td>&nbsp;</td>
     <td>&nbsp;</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');
	?>