<?php 
     require_once('db.php');
	 require_once('../convert_marathi.php');
	 if (isset($_POST['save']))
	 {			###########################// Add New Stamp Type ###################################
										
				
       $stampnm=$_POST['stampnm'];
	   //$dptnm=$_POST['dptnm']
       //sql query
	 
       $qry=("insert into stamp_master(stamp_nm) values('$stampnm')");
    
		 if(mysql_query($qry))
		{   
			echo "<script type='text/javascript'>alert('Inserted Successfully!')</script>";
			echo '<script language="JavaScript"> window.location.href ="../addstamp.php?no=1" </script>';	
		}
		else
		{   
			echo "<script type='text/javascript'>alert('Problem to insert!')</script>";
			echo '<script language="JavaScript"> window.location.href ="../addstamp.php?no=1" </script>';
		}
		//header("Location:addstamp.php?no=1");
     }
	
			##########################//End OF Add New Stamp Type ######################################
	else if(isset($_POST['saveup'])) 
	 {	
				############################// Update Stamp Type ###################################
										
				
		 $stampnm=$_POST['stampnm'];
		 $stampid=$_POST['stampid'];
      $qry1=("update stamp_master set stamp_nm = '$stampnm' WHERE stamp_id='$stampid'");
       
		if(mysql_query($qry1))
		{
			echo "<script type='text/javascript'>alert('Updated Successfully!')</script>";
			echo '<script language="JavaScript"> window.location.href ="../addstamp.php?no=2" </script>';
   exit;
		}
		else
		{
			echo "<script type='text/javascript'>alert('Problem to Update!')</script>";
			echo '<script language="JavaScript"> window.location.href ="../addstamp.php?no=2" </script>';
			
		}
		header("Location: addstamp.php");
     }
			###########################//End OF Update Stamp Type ###################################
?>