<link rel="stylesheet" href="../css/sweet-alert.css" /> 


<?php 
include("../connection.php");
include("../user.php");
$user=$_SESSION['user'];
?>

<?php
    $id=$_REQUEST['id'];
		$ven_code=$_REQUEST['vendor_code'];
		$department=$_REQUEST['department'];
	$ven_name=$_REQUEST['vendor_name'];
	$ven_addr=$_REQUEST['vendor_addr'];
	$phone=$_REQUEST['phone'];
	$mail=$_REQUEST['email'];
	$cnct=$_REQUEST['contact'];
	$gst_number=$_REQUEST['gst_number'];
	$vendor_master=mysqli_query($con,"UPDATE `vendor_master` SET `department`='$department',`vendor_code`='$ven_code',`vendor_name`='$ven_name',`vendor_address`='$ven_addr',`phone`='$phone',`email`='$mail',`contact_person`='$cnct',`gst_number`='$gst_number',`modified_by`='$user' WHERE `id`='$id'");
			//$vendor_master=mysqli_query($con,"call vendor('$ven_code','$ven_name','$ven_addr','$phone','$mail','$cnct','0','','$user','$id')");
	//echo "call vendor('$ven_code','$ven_name','$ven_addr','0','','$user','$id')";
	
	
	
if($vendor_master)
	{
	?>
	<script>
	
	
    setTimeout(function() {
        swal({
            title: "Successfully",
            text: "Vendor Updated!",
            type: "success"
        }, function() {
         window.location = "vendor_master.php";
        });
    }, 100);
</script>  
    <?php
	}	
	else
	{
	?>
	<script>
    setTimeout(function() {
        swal({
            title: "Not",
            text: "Vendor is not Updated!",
            type: "error"
        }, function() {
        window.location = "vendor_master.php";
        });
    }, 100);
</script> 	  
	<?Php
	}	
?>

  <script src="../js/sweet-alert.js"></script>

