<?php 
include("../connection.php");
include("../user.php");
$user=$_SESSION['user'];
?>
<link rel="stylesheet" href="../css/sweet-alert.css" /> 
<?php

    $id=$_REQUEST['id'];
    $unit=$_REQUEST['unit'];
	$mesurement_master=mysqli_query($con,"UPDATE `measurement_master` SET `name`='$unit',`status`='0' WHERE `id`='$id'");
    if($mesurement_master)
	{
	?>
    	<script>
            setTimeout(function() {
                swal({
                    title: "Successfully",
                    text: "Measurement Updated!",
                    type: "success"
                }, function() {
                 window.location = "measurement_master.php";
                });
            }, 100);
        </script>  
    <?php
	}	
	else
	{
	?>
    	<script>
            setTimeout(function() {
                swal({
                    title: "Not",
                    text: "Measurement is not Updated!",
                    type: "error"
                }, function() {
                window.location = "measurement_master.php";
                });
            }, 100);
        </script> 	  
	<?Php
	}	
?>
  <script src="../js/sweet-alert.js"></script>
