<?php 
     require_once('db.php');
	 require_once('../convert_marathi.php');
	#########################################//Code To Add New User###############################################
if(isset($_POST['save']))	
{     //fetching data
	  
      $loginid=strtoupper($_POST['logid']);
	  $password=$_POST['password'];
	  $username=$_POST['usernm'];
	   $deptno=$_POST['deptid'];
	   //echo $deptno;
	  $deskid=$_POST['deskid'];
	 // echo $deskid;
	  $secque=$_POST['secque'];
	  $secans=$_POST['secans'];
	  $mobno=$_POST['mobno'];
	  $emailid=$_POST['emailid'];
	  //$mobno=$_POST['deptid'];
	  $emailid=$_POST['emailid'];
	  $ustype=$_POST['usertype'];
	  
	  convert_marathi();
	  
	  
	 //query
       $qry=("INSERT INTO login(login_id, password, user_name,user_type, dept_id, desk_id, security_ques, sec_ans, mob_no, email_id) VALUES('$loginid','$password','$username','$ustype','$deptno','$deskid','$secque','$secans','$mobno','$emailid')");
    
		if(mysql_query($qry)) 
			 
		{   
			
			echo "<script type='text/javascript'>alert('Inserted Successfully!')</script>";
			echo '<script language="JavaScript"> window.location.href ="../adduser.php" </script>';			
		}
		else
		{   
			echo "<script type='text/javascript'>alert('Problem to insert!')</script>";
			echo '<script language="JavaScript"> window.location.href ="../adduser.php" </script>';
		}
}
	########################################//End OF Code To Add New User##########################################
 ?>
