<?php
include('config.php');

$whs_code 	= $conn->real_escape_string($_POST['whs_code']);
$whs_name 	= $conn->real_escape_string($_POST['whs_name']);
$whs_desc 	= $conn->real_escape_string($_POST['whs_desc']);
$act 		= $_POST['act'];
$autoid 	= $_POST['autoid'];

if($act=="add"){
	$sql = "INSERT INTO warehouse (whs_code,whs_name,whs_desc) values ('$whs_code','$whs_name','$whs_desc')";
	$conn->query($sql) or die($sql);
}

if($act=="edit"){
	$sql = "UPDATE  warehouse set whs_code = '$whs_code',whs_name = '$whs_name', whs_desc = '$whs_desc' WHERE whs_autoid = '$autoid'";
	$conn->query($sql) or die($sql);
	}
	
if($act=="delete"){
	//$sql = "DELETE FROM oc_manufacturer WHERE manufacturer_id = '$autoid'";
	//$conn->query($sql) or die($sql);
	}
	

header('Location:index');
?>