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


$ums_name 	= $conn->real_escape_string($_POST['ums_name']);
$act 		= $_POST['act'];
$autoid 	= $_POST['autoid'];

if($act=="add"){
	$sql = "INSERT INTO mst_unitms (ums_name) VALUES ('$ums_name')";
	$conn->query($sql) or die($sql);
}

if($act=="edit"){
	$sql = "UPDATE  mst_unitms set ums_name = '$ums_name' WHERE ums_name = '$autoid'";
	$conn->query($sql) or die($sql);
	}
	
if($act=="delete"){
	$sql = "DELETE FROM mst_unitms WHERE ums_name = '$autoid'";
	$conn->query($sql) or die($sql);
	}
	

header('Location:index');
?>