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

<script>
/* $(function() {

            $('#idtrans').val("");
			$('#nama_trans').val("");
			$('#vnumb').val("");
			var data3 = <?php //$this->fungsi->search_transporter('idtrans'); ?>;
			var data4 = <?php //$this->fungsi->search_transporter('nama_trans'); ?>;
			//txt_cust_nama2
            $("#idtrans").autocomplete({
                //source: "autocomplete3.php?opt=lifnr",
				source: data3,
                minLength: 1,
                select: function(event, ui) {
                    $('#idtrans').val(ui.item.idtrans);
                    $('#nama_trans').val(ui.item.nama_trans);
					$('#vnumb').val(ui.item.vnumb);
                }
            });
			
			//txt_cust2
           $("#nama_trans").autocomplete({
                //source: "autocomplete3.php?opt=name1",
				source:data4,
                minLength: 2,
                select: function(event, ui) {
                    $('#nama_trans').val(ui.item.nama_trans);
                    $('#idtrans').val(ui.item.idtrans);
					$('#vnumb').val(ui.item.vnumb);
                }
            });
		
        });*/
</script>
<script>
 /*$(function() {

            $('#idsupp').val("");
			$('#nama_supp').val("");
			var data1 = <?php // $this->fungsi_sap->fm_search_vendor('lifnr'); ?>;
			var data2 = <?php //$this->fungsi_sap->fm_search_vendor('name1'); ?>;
			//txt_cust_nama2
            $("#idsupp").autocomplete({
                //source: "autocomplete3.php?opt=lifnr",
				source: data1,
                minLength: 2,
                select: function(event, ui) {
                    $('#idsupp').val(ui.item.idsupp);
                    $('#nama_supp').val(ui.item.nama_supp);
                }
            });
			
			//txt_cust2
           $("#nama_supp").autocomplete({
                //source: "autocomplete3.php?opt=name1",
				source:data2,
                minLength: 2,
                select: function(event, ui) {
                    $('#nama_supp').val(ui.item.nama_supp);
                    $('#idsupp').val(ui.item.idsupp);
                }
            });
		
        });*/
</script>

<script type="text/javascript">
			
			// Sample 2
			$(document).ready(function()
			{
				$('#pur').blur(function()
				{
					$('#pur').formatCurrency({ region: 'id-ID' });
				});
				
				$('#pur2').blur(function()
				{
					$('#pur2').formatCurrency({ region: 'id-ID' });
				});
				
			});
		</script>
<script type="text/javascript">

$(function() {
$( "#adddate" ).datepicker({
changeMonth: true, // menampilkan dropdown untuk ganti bulan
changeYear: true // menampilkan dropdown untuk ganti Tahun
});
$( "#adddate" ).datepicker({ altFormat: 'yy-mm-dd' });
$( "#adddate" ).change(function() {
$( "#adddate" ).datepicker( "option", "dateFormat","dd.mm.yy" );
});
});


</script>
<?php
if ( ! empty($prev))
	{
?>


<?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>');
			echo '<br>';
?>
<fieldset>
<legend>OIL PURCHASE CREDIT</legend>
<form name="form1" method="post" action="<?php echo $form_action ?>" id="form1">
  <table width="100%" border="0" cellspacing="1" cellpadding="1">
    <tr>
      <td width="16%"><strong>Purchase Requisition No.</strong></td>
      <td width="1%">:</td>
      <td width="36%"><span class="primary">
      <input type="text" name="prnumb" id="prnumb" value="<?php ?>" size="20" readonly="readonly"/>
      </span>
      <input type="button" name="button3" id="button3" value="..." class="button" onclick="window.open('<?php echo base_url();?>index.php/popup/popup_pr_credit/','popuppage','width=900,height=600,scrollbar=yes,scrollbars=yes,top=100,left=100');" /></td>
      <td><strong>Total PR</strong></td>
      <td>:</td>
      <td><input type="text" name="total" id="total" value="<?php echo set_value('total', isset($default['total']) ? $default['total'] : ''); ?>" size="10" readonly="readonly" />
        (Rp)</td>
    </tr>
    <tr>
      <td><strong>Receive Goods No.</strong></td>
      <td>:</td>
      <td><span class="primary">
        <input type="text" name="idstb" id="idstb" value="<?php ?>" size="20" readonly="readonly"/>
        </span>
        <input type="button" name="button3" id="button3" value="..." class="button" onclick="window.open('<?php echo base_url();?>index.php/popup/popup_stb_qa_credit/','popuppage','width=900,height=600,scrollbar=yes,scrollbars=yes,top=100,left=100');" /></td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>Type</td>
      <td>:</td>
      <td><input name="type" type="text" id="type" size="20" maxlength="50" readonly="readonly" value="<?php echo set_value('type', isset($default['type']) ? $default['type'] : ''); ?>"  /></td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>DO No.</td>
      <td>:</td>
      <td><input name="donumb" type="text" id="donumb" size="20" maxlength="50" readonly="readonly" value="<?php echo set_value('donumb', isset($default['donumb']) ? $default['donumb'] : ''); ?>"  /></td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>Posting Date</td>
      <td>:</td>
      <td><input type="text" name="adddate" id="adddate" size="20" value="<?php echo date('d.m.Y'); ?>" /></td>
      <td><strong>Price</strong></td>
      <td>:</td>
      <td><input type="text" name="c_amt_bapi" id="c_amt_bapi" value="<?php ?>" size="10" readonly="readonly"/>
        (Rp)</td>
    </tr>
    <tr>
      <td>Manifest No.</td>
      <td>:</td>
      <td><label for="mnfst">
        <input name="mnfst" type="text" id="mnfst" size="20" maxlength="20" readonly="readonly" value="<?php echo set_value('mnfst', isset($default['mnfst']) ? $default['mnfst'] : ''); ?>"  />
      </label></td>
      <td><strong>Quantity</strong></td>
      <td>:</td>
      <td><input type="text" name="quantity" id="quantity" value="<?php echo set_value('quantity', isset($default['quantity']) ? $default['quantity'] : ''); ?>" size="10" readonly="readonly" />
        (L)</td>
    </tr>
   

<tr>
  <td>Vehicle No.</td>
  <td>:</td>
  <td><input name="vnumb" type="text" id="vnumb"  value="<?php echo set_value('vnumb', isset($default['vnumb']) ? $default['vnumb'] : ''); ?>" size="8" maxlength="8" readonly="readonly"  />
    <font class="required">*</font></td>
  <td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>

    <tr>
      <td>Supplier</td>
      <td>:</td>
      <td><span class="primary"><em>
        <input name="idsupp" type="text" id="idsupp" size="4" maxlength="4" readonly="readonly" value="<?php echo set_value('idsupp', isset($default['idsupp']) ? $default['idsupp'] : ''); ?>"  />
/  
<input name="nama_supp" type="text" id="nama_supp" size="40" maxlength="100" readonly="readonly" value="<?php echo set_value('nama_supp', isset($default['nama_supp']) ? $default['nama_supp'] : ''); ?>"  />
  </em></span></td>
      <td><strong>Available Quantity</strong></td>
      <td>:</td>
      <td><input name="available" type="text" id="available" size="10" maxlength="50" value="<?php echo set_value('$available', isset($default['$available']) ? $default['available'] : ''); ?>" readonly="readonly" />
        (L)</td>
    </tr>
    <tr>
      <td>Transporter</td>
      <td>:</td>
      <td><span class="primary">
        <input name="idtrans" type="text" id="idtrans" size="4" maxlength="10" readonly="readonly" />
        /
        <input name="nama_trans" type="text" id="nama_trans" size="40" maxlength="100" readonly="readonly" />
  <em><br />
  Search  ID Or Name</em></span></td>
      <!--<td><strong>Available Balance</strong></td>
      <td>&nbsp;</td>
      <td><input name="avail" type="text" id="avail" size="10" maxlength="50" value="<?php echo $this->fungsi->format_idr($this->fungsi->get_pc_bal($this->session->userdata('idcab'))); ?>" readonly="readonly" />
        (Rp)</td>-->
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>Invoice No.</td>
      <td>:</td>
      <td><input name="invoice" type="text" id="invoice" size="20" maxlength="50" value="<?php echo set_value('invoice', isset($default['invoice']) ? $default['invoice'] : ''); ?>"  /><font class="required">*</font></td>
      <td><div align="center"><strong>COST PAYMENT</strong></div></td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>Total Purchase  (<em>Before <strong><font color="#FF0000">PPN</font></strong></em>)</td>
      <td>:</td>
      <td><input name="pur" type="text" id="pur" size="10" maxlength="50" value="<?php echo set_value('pur', isset($default['pur']) ? $default['pur'] : ''); ?>"  />
        (Rp)<font class="required">*</font></td>
    </tr>
    <tr>
      <td>Using <strong><font color="#FF0000">PPN</font></strong></td>
      <td>:</td>
      <td><select name="cb_tax" id="cb_tax">
<option value="0">NO</option>
<option value="1" selected="selected">YES</option>
      </select></td>
      <td>Volume</td>
      <td>:</td>
      <td><input name="vol" type="text" id="vol" size="10" maxlength="50" readonly="readonly" value="<?php echo set_value('vol', isset($default['vol']) ? $default['vol'] : ''); ?>"  onblur="this.value=addCommas(this.value)" />
        (L)<font class="required">*</font></td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td><div align="center"><strong>OTHER PAYMENT</strong></div></td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>Other Payment (Transport, etc)</td>
      <td>:</td>
      <td><input name="pur2" type="text" id="pur2" size="10" maxlength="50" value="<?php echo set_value('pur2', isset($default['pur2']) ? $default['pur2'] : ''); ?>"  />
(Rp)<font class="required">*</font></td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>Other Payment Information</td>
      <td>:</td>
      <td><textarea name="inf2" cols="30" rows="5"><?php echo set_value('inf', isset($default['inf']) ? $default['inf'] : ''); ?></textarea>
      <font class="required">*</font></td>
    </tr>
    <tr>
      <td>Information</td>
      <td>:</td>
      <td colspan="4"><textarea name="inf" cols="50" rows="5"><?php echo set_value('inf', isset($default['inf']) ? $default['inf'] : ''); ?></textarea>
      <em>Fill No. Faktur Pajak (If using<strong><font color="#FF0000"> PPN</font></strong>) &amp; Purchase Info</em></td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td width="22%">&nbsp;</td>
      <td width="1%">&nbsp;</td>
      <td width="24%">&nbsp;</td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td><input type="submit" name="button" id="button" value="Submit" class="button" onclick="return confirmSubmit('Apakah Data Yang Anda Isi Sudah Benar ?')"  /></td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
  </table>
</form>
 <br>
 <?php
}
if ( ! empty($link))
	{
		echo '<p id="bottom_link">';
		foreach($link as $links)
		{
			echo $links . ' ';
		}
		echo '</p>';
	}
$this->load->view('includes/footer.php');
	?>

