<? include("header.php");
//session_start();
//error_reporting(0);
include "checksession.php";
include ("include/db-connect.php");


 $id1=$_REQUEST['id'];

	if(isset($_REQUEST['submit']))
	{
	$supplier_name= $_REQUEST['supplier_name'];
	$supplier_address= $_REQUEST['supplier_address'];
	$contact_no= $_REQUEST['contact_no'];
	$email_id= $_REQUEST['email_id'];
	

	 $update = mysql_query("update ".$SUPPLIER." set supplier_name='$supplier_name',supplier_address='$supplier_address',contact_no='$contact_no',email_id='$email_id' where id='$id1'");

					?>
                    <script>window.location='view_supplier.php?add=success';</script>
                    <? } ?>		 
		
<script type="text/javascript">
function showstate(str)
{
if (str=="")
{
document.getElementById("txtHint").innerHTML="";
return;
}
if (window.XMLHttpRequest)
{
xmlhttp=new XMLHttpRequest();
}
else
{
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
document.getElementById("txtHintstate").innerHTML=xmlhttp.responseText;
}
}
xmlhttp.open("GET","loadData1.php?q="+str,true);
xmlhttp.send();
}
function showcity(str)
{
if (str=="")
{
document.getElementById("txtHint").innerHTML="";
return;
}
if (window.XMLHttpRequest)
{
xmlhttp=new XMLHttpRequest();
}
else
{
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
document.getElementById("txtHintcity").innerHTML=xmlhttp.responseText;
}
}
xmlhttp.open("GET","city_ajax.php?q="+str,true);
xmlhttp.send();
}
</script>

<div id="content">
  <div class="breadcrumb">
       <!-- <a href="http://amarasudhan.com/admin/index.php?route=common/home&amp;token=b735cc089ec2d51abb9a8e1901f501fb">Home</a>-->
      </div>
              <div class="box">
    <div class="heading">
      <h1><img src="view/image/home.png" alt="" />EDI SUPPLIER</h1>
    </div>
    <div class="content">
      <div class="overview" style="width:50%; margin-left:300px;">
        <div class="dashboard-heading"> EDI SUPPLIER</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">
  <!--<script type="text/javascript" src="../prototype.js"></script> 
  <script type="text/javascript" src="../validation.js"></script>-->
  <?php
  
 $id1=$_REQUEST['id'];
  
 $qur="SELECT * FROM ".$SUPPLIER." WHERE id='$id1'"; 

  $result = mysql_query($qur);
  while ($row_section = mysql_fetch_array($result))
  { 
  $id1=$row_section['id'];
  $sname=$row_section['supplier_name'];
  $supplier_address=$row_section['supplier_address'];
  $contact_no=$row_section['contact_no'];
  $email_id=$row_section['email_id'];
  
     ?>                         
        
                
        <div class="mainrow" style="margin-left:100px;">
          <div class="maintext">Supplier Name<font color="#FF0000"><b> *</b></font> </div>
                <div class="maintextbox"><input type="text"  name="supplier_name" size="55" class="required" value="<?php echo $sname; ?>"></div>
        </div>               
                <br />
                <div class="mainrow" style="margin-left:100px;">
                <div class="maintext">Contact no<font color="#FF0000"><b> *</b></font> </div>
                <div class="maintextbox"><input type="text"  name="contact_no" size="55" class="required" value="<?php echo $contact_no; ?>"></div>
                </div>
                
                
                <br />
                <div class="mainrow" style="margin-left:100px;">
                <div class="maintext">Email ID<font color="#FF0000"><b> *</b></font> </div>
                <div class="maintextbox"><input type="text"  name="email_id" size="55" class="required" value="<?php echo $email_id; ?>"></div>
                </div>
                
                <br />
                
        <div class="mainrow" style="margin-left:100px;">
                <div class="maintext">Supplier Address<font color="#FF0000"><b> *</b></font> </div>
                <div class="maintextbox"><input type="text"  name="supplier_address" size="55" class="required" value="<?php echo $supplier_address; ?>"></div>
                </div>
                <br />
                 <?php } ?>
        <div class="mainrow" style="margin-left:100px;">
          <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>
<!--[if IE]>
<script type="text/javascript" src="view/javascript/jquery/flot/excanvas.js"></script>
<![endif]--> 
<script type="text/javascript" src="view/javascript/jquery/flot/jquery.flot.js"></script> 
<script type="text/javascript"><!--
function getSalesChart(range) {
	$.ajax({
		type: 'get',
		url: 'index.php?route=common/home/chart&token=b735cc089ec2d51abb9a8e1901f501fb&range=' + range,
		dataType: 'json',
		async: false,
		success: function(json) {
			var option = {	
				shadowSize: 0,
				lines: { 
					show: true,
					fill: true,
					lineWidth: 1
				},
				grid: {
					backgroundColor: '#FFFFFF'
				},	
				xaxis: {
            		ticks: json.xaxis
				}
			}

			$.plot($('#report'), [json.order, json.customer], option);
		}
	});
}

getSalesChart($('#range').val());
//--></script> 
</div>
<div id="footer">Copyright &copy; 2014 | Powered by <a href="http://linikantech.com/" target="_blank">Linikantech</a><!--<a href="http://www.opencart.com">OpenCart</a> &copy; 2009-2016 All Rights Reserved.<br />Version 1.5.6.4--></div>
</body></html>