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

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

if($act=="add"){
	$sql = "INSERT INTO payment (paym_name,paym_status) values ('$paym_name',1)";
	$conn->query($sql) or die($sql);
}

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

header('Location:index');
?>