<?php
include("../include/db.php");
if(($_POST['action']=="ADD")) 
{
 $fabric_type=$_POST['fabric_type'];
 $contract_rate=$_POST['contract_rate'];
 $description=$_POST['description'];
$Insql=mysql_query("insert into fabric_type_creation(fabric_type,contract_rate,description)values('$fabric_type','$contract_rate','$description')");
echo "Added Successfully!!";
}


if(($_POST['action']=="EDIT"))
{
$edit_id = $_POST['edit_id']; 
 $fabric_type=$_POST['fabric_type'];
 $contract_rate=$_POST['contract_rate'];
 $description=$_POST['description'];
$Insql=mysql_query("update fabric_type_creation set fabric_type='$fabric_type',contract_rate='$contract_rate',description='$description'  where  id='$_POST[edit_id]'");
echo "Updated Successfully!!";
}


if($_POST['action']=="delete")
{ 		 
		$delete2="delete from fabric_type_creation where id='$_POST[id]'";
		mysql_query($delete2);
		echo "<script>alert('Deleted Succesfully')</script>";
		include("fabric_type_creation_list.php");
}


?>