
<?php 
session_start();
###############################// Add Department Database File#########################################
	require_once('db.php');
	 require_once('../convert_marathi.php');								
	 ###############################	// Add Department Database Code###################################
								

	 if (isset($_POST['save']))
	 {
       	$sub=$_POST['sub'];
	   date_default_timezone_set('Asia/Kolkata');
         $dt   = date("Y-m-d");
	    mysql_query('SET character_set_results=utf8');
		mysql_query('SET names=utf8');
		mysql_query('SET character_set_client=utf8');
		mysql_query('SET character_set_connection=utf8');
		mysql_query('SET character_set_results=utf8');
		mysql_query('SET collation_connection=utf8_general_ci');
		
		$checkbox1=$_POST['chk'];  
		$chk="";  
		foreach($checkbox1 as $chk)  
		   {  
			 $qry= mysql_query("insert into sms_vibhag(suchna,dpt_id,sms_dt) values('$sub','$chk','$dt')");
			// echo $chk."</br>";  
		   }
   
           

		if($qry)
		{ 
			echo "<script type='text/javascript'>alert('Inserted Successfully!')</script>";
			echo '<script language="JavaScript"> window.location.href ="../sms_vibhag.php" </script>';
				
		}
		else
		{   
			echo "<script type='text/javascript'>alert('Problem to insert!')</script>";
			echo '<script language="JavaScript"> window.location.href ="../sms_vibhag.php" </script>';
			
		}
	 }
	 	 ################################	End OF Add Department Database Code############################
		 
		 
	 #################################	Update Department Code   ######################################
									
	
	
?>

