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

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

if($act=="add"){
	$sql = "INSERT INTO mst_parttype (pt_code,pt_name) values ('$pt_code','$pt_name')";
	$conn->query($sql) or die($sql);
}

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

header('Location:index');
?>