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

	$description=$_REQUEST['description'];
	$outgoingto=$_REQUEST['outgoingto'];
	$location=$_REQUEST['location'];
	$make=$_REQUEST['make'];
	$serialno=$_REQUEST['serialno'];
	$model=$_REQUEST['model'];
	$capacity=$_REQUEST['capacity'];
	$equipment_id=$_REQUEST['equipment_id'];
	$maintenance=$_REQUEST['maintenance'];
	$value=$_REQUEST['asset_value'];
	$user_master=mysqli_query($con,"INSERT INTO `asset_master`(`description`, `outgoingto`, `location`, `make`, `model`, `capacity`, `equipment_id`,`serialno`, `maintenance`,`value`,`status`) 
    VALUES('$description','$outgoingto','$location','$make','$model','$capacity','$equipment_id','$serialno','$maintenance','$value','0')");

	if($user_master)
	{
	?>
	<script>
	
	
    setTimeout(function() {
        swal({
            title: "Successfully",
            text: "Asset Created!",
            type: "success"
        }, function() {
        window.location = "asset_master.php";
        });
    }, 100);
</script>  
    <?php
	}	
	else
	{
	?>
	<script>
    setTimeout(function() {
        swal({
            title: "Not",
            text: "Asset is not Created!",
            type: "error"
        }, function() {
        window.location = "asset_master.php";
        });
    }, 100);
</script> 	  
	<?php
	}
	?>

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