<?php 
     require_once('db.php');
	  require_once('../convert_marathi.php');
	
	 if (isset($_POST['save']))
	 {			###########################// Add New Sandharbha Type #################################
										
				
       $sandharbhnm=$_POST['sandharbhnm'];
	   //$dptnm=$_POST['dptnm']
       //sql query
	     convert_marathi();
       $qry=("insert into sandharbh_master(sandharbh_nm) values('$sandharbhnm')");
    
		  if(mysql_query($qry))
		{  
			echo "<script type='text/javascript'>alert('Inserted Successfully!')</script>";
			 echo '<script language="JavaScript"> window.location.href ="../addsandhrbha.php?no=1" </script>';
			
		}
		else
		{   
			echo "<script type='text/javascript'>alert('Problem to insert!')</script>";
			echo '<script language="JavaScript"> window.location.href ="../addsandhrbha.php?no=1" </script>';
			
		}
     }
	############################// End Of Add New Sandharbha Type ###############################
	
	else if(isset($_POST['saveup'])) 
	 {    #########################	// Update Sandharbha Type #################################
									
				
		 $sandharbhnm=$_POST['sandharbh_nm'];
		 $sandharbhid=$_POST['sandharbh_id'];
		 convert_marathi();
      $qry1=("update sandharbh_master set sandharbh_nm = '$sandharbhnm' WHERE sandhrbh_id='$sandharbhid'");
        if(mysql_query($qry1))
		{   
			echo "<script type='text/javascript'>alert('Updated Successfully!')</script>";
			echo '<script language="JavaScript"> window.location.href ="../addsandhrbha.php?no=2" </script>';
			
		}
		else
		{  
			echo "<script type='text/javascript'>alert('Problem to Update!')</script>";
			 echo '<script language="JavaScript"> window.location.href ="../addsandhrbha.php?no=2" </script>';
			
		}
     }
			#################### End OF Update Sandharbha Type ###########################
	 
?>
