<?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']);
$outlet_autoid 	= $conn->real_escape_string($_POST['outlet_autoid']);
$act 		= $_POST['act'];
$autoid 	= $_POST['autoid'];

if($act=="add"){
	$sql = "INSERT INTO warehouse (whs_code,whs_name,whs_desc,outlet_autoid) values ('$whs_code','$whs_name','$whs_desc','$outlet_autoid')";
	$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', outlet_autoid = '$outlet_autoid' 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');
?>