<?php
include('dashboard_bdo.php');
require_once('convert_marathi.php');
require_once('func1.php');
#################################################### Update User Form ######################################################

$num=$_REQUEST['no'];
?><html> 
<head>
<script type="text/javascript" src="js/adduser.js"></script> 				 
<script type="text/javascript" src="jquery-1.8.3.js"></script>
<script type="text/javascript">
			function showUser(para1,para2,para3)
			{
			var s=document.forms["myform"]["usertype"];
				var d=document.forms["myform"]["deptid"];
			var p=document.forms["myform"]["deskid"];
				if (window.XMLHttpRequest)
				{	// code for IE7+, Firefox, Chrome, Opera, Safari
					xmlhttp=new XMLHttpRequest();
				}
				else
				{	// code for IE6, IE5
					xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
				}
				xmlhttp.onreadystatechange=function()
				{
					if (xmlhttp.readyState==4 && xmlhttp.status==200)
					{
						document.getElementById("txtHint").innerHTML=xmlhttp.responseText;
						
					}
				}
				xmlhttp.open("GET","getusername.php?s="+ s.value +"&d="+ d.value +"&p="+ p.value ,true);
				xmlhttp.send(); 
			}
</script>
<script type="text/javascript">
$(document).ready(function() {
	$('#wait_1').hide();
	$('#usertype').change(function(){
	  $('#wait_1').show();
	  $('#result_1').hide();
	   $('#result_2').hide();
      $.get("func1.php", {
		func: "usertype",
		drop_var: $('#usertype').val()
      }, function(response){
        $('#result_1').fadeOut();
        setTimeout("finishAjax('result_1', '"+escape(response)+"')", 800);
      });
    	return false;
	});
});
function finishAjax(id, response) {
  $('#wait_1').hide();
  $('#'+id).html(unescape(response));
  $('#'+id).fadeIn();
}
function finishAjax_tier_three(id, response) {
  $('#wait_2').hide();
  $('#'+id).html(unescape(response));
  $('#'+id).fadeIn();
}
</script>
</head>
<body>
<div class="mainwrapper">
	<div class="rightpanel">
        <ul class="breadcrumbs">
            <li><a href="dashboard_bdo.php"><i class="iconfa-home"></i></a> <span class="separator"></span></li>
            <li>युजर अद्यावत करा </li>
        </ul>
        <div class="pageheader">
            <div class="pageicon"><span class="iconfa-pencil"></span></div>
            <div class="pagetitle">
                <h5></h5>
                <h1>युजर अद्यावत करा </h1>
            </div>
        </div><!--pageheader-->
        <div class="maincontent">
            <div class="maincontentinner">
				<div class="widget">
					<h4 class="widgettitle">युजर अद्यावत करा </h4>
					<div class="widgetcontent">
						<form class="stdform" action="updateuserdetails.php?id=<?php echo $num;?>" method="post" name="myform">
							<?php 	
							convert_marathi();
							$qry1=("select * from login where id='$num'");
							$rs1=mysql_query($qry1) or die("cccccc".mysql_error());
							while($rw1=mysql_fetch_array($rs1))
							{
								?>
								<table width="100%" style="border:1px;">
								<tr>
									
									<td><label class="dec">व्यक्तीची ओळख(User Id) : </label></td>
									<td><input type="text" name="logid" class="input-small" value="<?php echo $rw1['login_id']; ?>" /></td>
									<td><label>व्यक्तीचे नाव: </label></td>
									<td><input type="text" name="usernm" class="input-medium unicode" lang="mr"  value="<?php echo $rw1['user_name']; ?>" /></td>
								</tr>
								<tr>
									<td><label>यूजर प्रकार: </label></td>
									<td><input type="text" name="ustype" class="input-medium unicode" lang="mr" value="<?php echo $rw1['user_type']; ?>" readonly />
									</td>
									<td><label>यूजर प्रकार निवडा : </label></td>   
									<td> 
										<select class="upustype" name="usertype" id="usertype">
										<option value="">यूजर प्रकार निवडा</option>
										<option value="BDO">बी.डी.ओ. अधिकारी</option>
										<option value="Tapal">टपाल अधिकारी</option>
										<option value="Department">विभाग अधिकारी </option>
										<option value="Desk">डेस्क कर्मचारी</option>
										</select>
									</td>
								
								</tr>
									<tr>
							<?php getTierOne(); ?>
							</tr>
								<tr>
									<td><label>विभागाचे नाव : </label></td>
									<td>
										<?php 
										$qry2=("Select dept_nm from department_master,login where department_master.dept_id = login.dept_id AND login.id='$num'");
										$rs2=mysql_query($qry2) or die("dddd".mysql_error());
										while($rw2=mysql_fetch_array($rs2))
										{ 
											$x=$rw2['dept_nm'];}
										?> 
										<input type="text" name="ustype" class="input-medium unicode" lang="mr" value="<?php echo $x; ?>" readonly />
									</td>
									<td><label>डेस्कचे नाव  : </label></td>
									<td> <?php $qry3=("SELECT desk_nm FROM desk_master,login WHERE desk_master.desk_id = login.desk_id AND login.id='$num'");
									$rs3=mysql_query($qry3) or die("ffff".mysql_error());
									while($rw3=mysql_fetch_array($rs3))
									{$y=$rw3['desk_nm'];}?>
									<input type="text" name="ustype" class="input-medium unicode" lang="mr" value="<?php echo $y; ?>" readonly />
									</td>
								</tr>
								
							
							<tr>
									<td colspan="2" style="width:50%;"> 
										<span id="wait_1" style="display: none;"><img alt="Please Wait" src="images/loaders/loader23.gif"/> </span>	
										<span id="result_1" name="result_1" style="display: none;"></span>
									</td>
									<td colspan="2" style="width:50%;"> 
										<span id="wait_2" style="display: none;"><img alt="Please Wait" src="images/loaders/loader23.gif"/></span>
										<span id="result_2" name="result_2" style="display: none;"></span>
									</td>
							</tr>
								<tr>
									<td><label>मोबाईल क्रं. : </label></td>
									<td><input type="text" name="mobno" class="input-medium" placeholder="मोबाईल क्रं" value="<?php echo $rw1['mob_no'];?>" /></td>
									<td><label>ईमेल आय. डी. : </label></td>
									<td><input type="text" name="emailid" class="input-medium" placeholder="ईमेल आय. डी." value="<?php echo $rw1['email_id'];}?>"/></td>
								</tr>
							</table>
							<div>                       
								<p class="stdformbutton">
									<center> <button class="btn btn-primary" name="save" onclick="return validateupdateForm()">अद्यावत करा </button>
									<button type="reset" class="btn">रद्द करा </button></center>
								</p>
							</div>
						</form>
					</div>
				</div>	
                <?php include_once('footer.php');?>
            </div><!--maincontentinner-->
        </div><!--maincontent-->
    </div><!--rightpanel-->
</div><!--mainwrapper-->
</body>
</html>