<? include("header.php");
//error_reporting(0);
//include "checksession.php";
//include ("include/db-connect.php");
 if(isset($_REQUEST['submit']))
	{ 
  $product_id= $_REQUEST['product_id'];
  $query = mysql_query("SELECT * FROM ".$SUPPLIER." where product_id='$product_id'");
 ?>
  <script>window.location='add_old_pur.php?pid=<? echo $product_id ?>';</script>
<? } ?>
      
      
  <link rel="stylesheet" type="text/css" media="all" href="Auto_complete/ad_comple.css">
  <script type="text/javascript" src="Auto_complete/jquery-1.9.1.min.js"></script>
  <script type="text/javascript" src="Auto_complete/jquery.autocomplete.min.js"></script>  
  <script type="text/javascript">
  $noaudooo=$.noConflict();
  $noaudooo(function(){ var currencies = [
 <?php $qur="SELECT distinct `name` FROM `products`"; 
		$result = mysql_query($qur);
		while ($row_section = mysql_fetch_array($result)) {?>	  
    { value:'<?php echo $row_section['name']; ?>' },<?php } ?> ];
  $noaudooo('#autocomplete').autocomplete({lookup: currencies,}); });
</script>

<div id="content">
  <div class="breadcrumb">
      </div>
              <div class="box">
    <div class="heading">
      <h1><img src="view/image/home.png" alt="" />Add purchase</h1>
    </div>
    <div class="content">
      <div class="overview" style="width:50%; margin-left:300px;">
        <div class="dashboard-heading"> Add purchase</div>
        <div class="dashboard-content">
 <?php if($_REQUEST['ed']=='su'){ echo "<div class='alert_succes'>Contact Edited Successfully</div>"; } else { echo "";}?>
 <form method="post" id="client" enctype="multipart/form-data">
  <br />
<div class="mainrow" style="margin-left:200px;">
                <div class="maintext">Product Name<font color="#FF0000"><b> *</b></font> </div>
                <div class="maintextbox"><input type="text" name="product_id" size="55" required="required" id="autocomplete" autofocus="autofocus" style="width:200px;"></div>
                </div> <br />
<div class="mainrow" style="margin-left:200px;">
    <div class="maintext"><font color="#FF0000"><b></b></font> </div>
                <div class="maintextbox"><input type="submit" name="submit" value="Submit" ></div></div>
   </form>
        </div>
      </div>
    </div>
  </div>
</div>
</div>
<?  include("footer.php"); ?>