
<?php 
/*if($_SESSION["login"]!="True")
{
	header('Location:./index.php');
}*/




/*if($_SESSION["login"]!="True")
{
	header('Location:./index.php');
}*/

	

						 
	require_once("config.inc.php");
	require_once("DBConnector.php");
						
	$sql = "delete FROM TMP_EDU_FILTER";
	$db = new DBConnector();
	$result =$db->RunQuery($sql);
						
	$sql = "delete FROM	TMP_QUALI_FILTER";
	$db = new DBConnector();
	$result =$db->RunQuery($sql);
?>	


<link rel="stylesheet" href="css/table_min.css" type="text/css"/>	
<link rel="stylesheet" type="text/css" media="all" href="css/jsDatePick_ltr.min.css" />
<script type="text/javascript" src="js/jsDatePick.min.1.3.js"></script>

<script type="text/javascript" language="javascript" src="js/get_cat_description.js"></script>
<script type="text/javascript" language="javascript" src="js/datepickr.js"></script>


<script language="javascript" type="text/javascript">
<!--
/****************************************************
     Author: Eric King
     Url: http://redrival.com/eak/index.shtml
     This script is free to use as long as this info is left in
     Featured on Dynamic Drive script library (http://www.dynamicdrive.com)
****************************************************/
var win=null;
function NewWindow(mypage,myname,w,h,scroll,pos){
if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}
else if((pos!="center" && pos!="random") || pos==null){LeftPosition=0;TopPosition=20}
settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';
win=window.open(mypage,myname,settings);}
// -->
</script>

<script type="text/javascript">
function openWin()
{
myWindow=window.open('serach_inv.php','','width=200,height=100');
myWindow.focus();

}
</script>

<script type="text/javascript">
	window.onload = function(){
		new JsDatePick({
			useMode:2,
			target:"dte_shedule",
			dateFormat:"%Y-%m-%d"
			/*selectedDate:{				This is an example of what the full configuration offers.
				day:5,						For full documentation about these settings please see the full version of the code.
				month:9,
				year:2006
			},
			yearsRange:[1978,2020],
			limitToToday:false,
			cellColorScheme:"beige",
			dateFormat:"%m-%d-%Y",
			imgPath:"img/",
			weekStartDay:1*/
		});
	};
</script>

</label>
          
<fieldset>
                                                	<legend>
  <div class="text_forheader">ARN Details</div>
                                               	 </legend>             

<form name="form1" id="form1">            
  <table width="100%" border="0"  class=\"form-matrix-table\">
  <tr>
    <td width="14%"><input type="text"  class="label_purchase" value="ARN No" disabled/></td>
    <td width="15%"><input type="text" name="invno" id="invno" value="" class="text_purchase3" onkeypress="keyset('searchcust',event);"  />
      <!--<a href="serach_arn.php" onClick="NewWindow(this.href,'mywin','800','700','yes','center');return false" onFocus="this.blur()">-->
          <a href="" onClick="NewWindow('serach_arn.php?stname=new_arn','mywin','800','700','yes','center');return false" onFocus="this.blur()">
        <input type="button" name="searchinv" id="searchinv" value="..." class="btn_purchase1" >
      </a></td>
    <td width="14%">&nbsp;</td>
    <td width="14%">&nbsp;</td>
    <td width="24%"><input type="text"  class="label_purchase" value="Date" disabled="disabled"/></td>
    <td width="14%"><input type="text"  name="invdate" id="invdate" value="<?php echo date("Y-m-d"); ?>"   class="text_purchase3"/></td>
    <td width="2%">&nbsp;</td>
    <td width="3%">&nbsp;</td>
    <td width="0%">&nbsp;</td>
  </tr>
  <tr>
    <td><input type="text"  class="label_purchase" value="Invoice No " disabled="disabled"/></td>
    <td><input id="lc_no" type="text" class="text_purchase3" /></td>
    <td><input type="text"  class="label_purchase" value="Po No " disabled="disabled"/></td>
    <td><input id="pi_no" name="pi_no" type="text" class="text_purchase3" /></td>
    <td><input type="text"  class="label_purchase" value="Department" disabled="disabled"/></td>
    <td><select name="department" id="department" onkeypress="keyset('brand',event);" class="text_purchase3">
      <option value=""> --Select-- </option>
      <?php
																	$sql="select * from s_stomas order by DESCRIPTION";
																	$result =$db->RunQuery($sql);
																	while($row = mysql_fetch_array($result)){
																		if ($row["CODE"]=="1"){
                        													echo "<option selected value='".$row["CODE"]."'>".$row["DESCRIPTION"]."</option>";
																		}	else {
																			echo "<option value='".$row["CODE"]."'>".$row["DESCRIPTION"]."</option>";
																		}
                       												}
																?>
    </select></td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td><input type="text"  class="label_purchase" value="Purchase Invoice Date" disabled="disabled"/></td>
    <td><input id="dte_dor" name="dte_dor" type="text"  value="" class="text_purchase3" /></td>
    <td><input type="text"  class="label_purchase" value="Brand " disabled="disabled"/></td>
    <td><input id="brand" name="brand" type="text" onkeypress="keyset('department',event);" class="text_purchase3" /></td>
    <td><input type="text"  class="label_purchase" value="Order No" disabled="disabled"/></td>
    <td width="14%"><input type="text" name="orderno1" id="orderno1" value="" onkeypress="keyset('orderdate',event);" class="text_purchase3"/>
     <a href="search_purord.php?stname=arn" onClick="NewWindow(this.href,'mywin','800','700','yes','center');return false" onFocus="this.blur()"><input type="button" name="searchord" id="searchord" value="..." class="btn_purchase1" ></a></td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td><input type="text"  class="label_purchase" value="Supplier" disabled/></td>
    <td><input type="text" class="text_purchase3" name="supplier_code" id="supplier_code" onblur="suppno_ind('arn');" onkeypress="keyset('purtype',event);"/>
      <a href="" onClick="NewWindow('serach_supplier.php?stname=arn_new','mywin','800','700','yes','center');return false" onFocus="this.blur()">
        <input type="button" name="searchcust2" id="searchcust2" value="..."  class="btn_purchase1">
      </a></td>
    <td><input type="text"  class="label_purchase" value="Vat No" disabled="disabled"/></td>
     <td><input type="text" size="15" name="vatno1" id="vatno1" value=""  class="text_purchase3"/></td>
    <td><input type="text"  class="label_purchase" value="Country" disabled="disabled"/></td>
    <td><input type="text" size="15" name="country" id="country" value="" onkeypress="keyset('creditlimit',event);" class="text_purchase3"/></td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td colspan="4"><input type="text"  class="text_purchase3" size="65" id="supplier_name" name="supplier_name" /></td>
    <td><input type="text"  class="label_purchase" value="Marketing Executive" disabled="disabled"/></td>
    <td><select name="salesrep" id="salesrep" onkeypress="keyset('dte_dor',event);" class="text_purchase3">
      <?php
																	$sql="select * from s_salrep where cancel='1' order by REPCODE";
																	$result =$db->RunQuery($sql);
																	while($row = mysql_fetch_array($result)){
                        												echo "<option value='".$row["REPCODE"]."'>".$row["REPCODE"]." ".$row["Name"]."</option>";
                       												}
																?>
    </select></td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
      <td><input type="text"  class="label_purchase" value="Purchase Type" disabled="disabled"/></td>
    <td>
      <select name="purtype" id="purtype" onkeypress="keyset('vatgroup_0',event);" class="text_purchase3" onchange="assignbrand();" disabled="disabled">
        <option value='Import'>Local</option>
        <option value='Local'>Import</option>
      </select>
    <input type="text" hidden="" name="count" id="count"></td> 
    <td><input type="text"  class="label_purchase" value="Cost Centre" disabled="disabled"/></td>
    <td><select name="costcenter" id="costcenter" onkeypress="keyset('vatgroup_0',event);" class="text_purchase3" onchange="assignbrand();">
      <option> --Select-- </option>
      <option value='1'>1</option>
      <option value='2'>2</option>
      <option value='3'>3</option>
      <option value='4'>4</option>
      <option value='5'>5</option>
      <option value='6'>6</option>
      <option value='7'>7</option>
      <option value='8'>8</option>
      <option value='9'>9</option>
      <option value='10'>10</option>
    </select></td>
    <td><input type="text"  class="label_purchase" value="Stocks Received" disabled="disabled"/></td>
    <td>
	<select name="arpend" id="arpend" class="text_purchase3">
	<option value='0'>Received</option>	
	<option value='1'>Pending</option>
	
	</select>
	</td>
    <td><a class='btn_purchase1' onClick="update_arstat();">Update</a></td>
  </tr>
  <tr>
    <td><input type="text"  class="label_purchase" value="Special Instruction" disabled="disabled"/></td>
    
    <td colspan="3"><textarea name="textarea" id="textarea" cols="45" rows="2" class="text_purchase5"></textarea></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>
  </table>

  
  <br/>   
<fieldset>               
            
   	<legend><div class="text_forheader">Item Details</div></legend>            
            
  <table width="84%" border="0">
    
  
  <tr>
      
      
      <td><span class="style1">
      <input type="text"  class="label_purchase" value="Code" disabled="disabled"/>
    </span></td>
    
    <td ><span class="">
      <input type="text"  class="label_purchase" value="Description" disabled="disabled"/>
    </span></td>
    
    <td><span class="style1">
      <input type="text"  class="label_purchase" value="QTY" disabled="disabled"/>
    </span></td>
    <td>
      <input type="text"  class="label_purchase" value="Cost" disabled="disabled"/>    </td>
    <td>
        <input type="text"  class="" value="Net" disabled="disabled" style="background-color: #2b3e5c;color: white"/>    </td>
    <td>
      <input type="text"  class="label_purchase" value="Vat" disabled="disabled"/>    </td>
    <td>
      <input type="text"  class="label_purchase" value="Gross" disabled="disabled"/>    </td>
    
    
    <td>&nbsp;</td>
    </tr>
    <tr>
        <td width="14%"><font color="#FFFFFF"><font color="#FFFFFF"><a href="search_item_arn.php" onclick="NewWindow(this.href,'mywin','800','700','yes','center');return false" onfocus="this.blur()">
      <input type="text"  class="text_purchase3" name="item_code"  id="item_code" size="10"     />
    </font></font></td>
<!--    <td  width="3%"><a href="serach_item.php?stname=grn_item" onclick="NewWindow(this.href,'mywin','800','700','yes','center');return false" onfocus="this.blur()">
      <input type="button" name="searchitem" id="searchitem" value="..." class="btn_purchase" disabled="disabled" />
    </a></td>-->
    <td  width="40%"><font color="#FFFFFF">
      <input type="text"  class="text_purchase3" id="itemdescript" name="itemdescript" disabled="disabled"  />
    </font></td>
    <td  width="14%"><font color="#FFFFFF">
      <input type="text" size="15" name="qty1" id="qty1"   class="text_purchase3" />
    </font></td>
    <td  width="44%"><font color="#FFFFFF">
      <input type="text" size="15" name="cost1" id="cost1"  class="text_purchase3"  />
    </font></td>
    <td  width="14%"><font color="#FFFFFF">
      <input type="text" size="15" name="net" id="net" disabled="disabled" value="0" class="text_purchase3"/>
      <input type="hidden" size="15" name="discount_amt" id="discount_amt" value="0" class=""/>
    </font></td>
    <td  width="40%"><font color="#FFFFFF">
      <input type="text" size="15" name="vat" id="vat" disabled="disabled" />
    </font></td>
    <td  width="40%"><font color="#FFFFFF">
      <input type="text" size="15" name="Gross" id="Gross"  onkeyup="cal11()" />
    </font></td>
    <td  width="20%"><input type="button" name="additem_tmp" id="additem_tmp" value="Add" onclick="add_tmp12();" class="btn_purchase1" /></td>
    </tr>
	<td width="30%" colspan="9">
    <div class="CSSTableGenerator" id="itemdetails" >
<table>
                                                        			<tr>
                              											<td width="70"  background="images/headingbg.gif" ><font color="#FFFFFF">Code</font></td>
                              											<td width="300"  background="images/headingbg.gif"><font color="#FFFFFF">Description</font></td>
                                                                        <td width="100"  background="images/headingbg.gif"><font color="#FFFFFF">Qty</font></td>
                                                                        <td width="100"  background="images/headingbg.gif"><font color="#FFFFFF">Cost</font></td>
                                                                        <td width="100"  background="images/headingbg.gif"><font color="#FFFFFF">Net</font></td>
                                                                        <td width="100"  background="images/headingbg.gif"><font color="#FFFFFF">Vat</font></td>
                                                                        <td width="100"  background="images/headingbg.gif"><font color="#FFFFFF">Gross</font></td>
                           											</tr>
                   												</table>   </div>                                                 		</td>
                                                		</tr>
  
  <tr>
    <td width="10%">&nbsp;</td>
    <td width="20%">&nbsp;</td>
    <td width="10%">&nbsp;</td>
    <td width="10%"><input type="text"  class="label_purchase" value="Total Value" disabled="disabled"/></td>
    <td width="10%"><font color="#FFFFFF">
      <input type="text" size="20" name="total_value" id="total_value" value="" onblur="calc1();" class="text_purchase3" disabled="disabled" onkeypress="keyset('discount',event);"/>
    </font></td>
    
    <td width="10%"><input type="text"  class="label_purchase" value="Total Vat" disabled="disabled"/></td>
    <td width="10%"><font color="#FFFFFF">
      <input type="text" size="20" name="total_vat" id="total_vat" value="" class="text_purchase3" />
    </font></td>
    
    </tr>
</table>
          

</form>        

</fieldset>    
            
            <table width="765" border="0" cellpadding="0">
<tr>
                	<th height="189" colspan="5" align="left" nowrap="nowrap">
              			<div align="left">