<?php 
include("../connection.php");
include("../user.php");
$user=$_SESSION['user'];
$cur_date=date('Y-m-d H:i:s');
?>
<link rel="stylesheet" href="../css/sweet-alert.css" /> 
<?php
	$cat=$_REQUEST['category'];
	$catdec=$_REQUEST['cat_dec'];
	$brand=$_REQUEST['cat_brand'];
    $measurement =$_REQUEST['measurement_type'];
    $category_id = $_REQUEST['category_id'];
    $availability = $_REQUEST['availability'];
    $price = $_REQUEST['price'];
    $tol_amount = $_REQUEST['tol_amount'];
    $dept = $_REQUEST['dept'];
	$id=$_REQUEST['id'];
	$catg=mysqli_query($con,"UPDATE `category_master` SET `category_id` = '$category_id',`category_type`='$cat',`category_brand`='$brand',`department` = '$dept',`category_description`='$catdec',`measurement`='$measurement',`availability` = '$availability',`amount` = '$price',`total_amount`= '$tol_amount',`status`='0',`modified_on`='$cur_date',`modified_by`='$user' WHERE `id`='$id'");
    if($catg)
{
?>
<script>
    setTimeout(function() {
        swal({
            title: "Successfully",
            text: "Category updated!",
            type: "success"
        }, function() {
      window.location = "category_master.php";
        });
    }, 100);
</script>  
<?php
}	
else
{
?>
<script>
    setTimeout(function() {
        swal({
            title: "Not",
            text: "Category updated!",
            type: "error"
        }, function() {
         window.location = "category_master.php";
        });
    }, 100);
</script> 	  
<?Php
}	
?>
<script src="../js/sweet-alert.js"></script>