<?php
include('connection.php');
$b=$_GET['srno'];
	$my="SELECT * FROM `administrate1` where srno='$b'";
		
//echo $my;
$n=mysqli_query($GLOBALS["___mysqli_ston"], $my) or die ("Query Fail:".mysqli_error($GLOBALS["___mysqli_ston"]));
if(mysqli_num_rows($n)>0)
{
while($rw=mysqli_fetch_assoc($n)) 
{
		$srno=$rw['srno'];
						$srno1=$rw['srno_marathi'];
$office=$rw['office_name'];
//echo $office;
$office1=$rw['office_name_marathi'];
$officer=$rw['officer_name'];
$officer1=$rw['officer_name_marathi'];
$phone=$rw['phoneno'];
$phone1=$rw['phone_marathi'];
$no=$rw['mobileno'];
$no1=$rw['mobile_no_marathi'];

	$date=$rw['date'];
	
		}
}
?>
<!DOCTYPE html>
<html lang="en">

<head>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="samarth10" >

    <title>SB Admin 2 - Bootstrap Admin Theme</title>
 
    <!-- Bootstrap Core CSS -->
            
    <link href="bower_components/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">
    
    <!-- MetisMenu CSS -->
    <link href="bower_components/metisMenu/dist/metisMenu.min.css" rel="stylesheet">
 
    <!-- Custom CSS -->
     <link href="dist/css/sb-admin-2.css" rel="stylesheet">
 
    <!-- Custom Fonts -->
    <link href="bower_components/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css"> 
   
 
 <link rel="stylesheet" href="http://code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
 
<script src="dist/js/jquery-1.7.1.min.js"></script>
 
<script src="http://code.jquery.com/jquery-1.10.2.js"></script>
<script src="http://code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
<link rel="stylesheet" href="/resources/demos/style.css">
<link rel="stylesheet" href="dist/css/bootstrap-datepicker.css">

<link rel="stylesheet" href="tinybox/style_tiny.css" />
<script type="text/javascript" src="tinybox/tinybox.js"></script>

<script src="dist/js/bootstrap-datepicker.js"></script>
<script src="dist/js/bootstrap-datepicker.min.js"></script>

        <script type="text/javascript" >

$(function()
{
$('#date').datepicker();	
	
	});
</script>
</head>

<body>
<script type="text/javascript" >
function update()
{
//	alert('dgdf');
var srno=document.getElementById('srno').value;	
var srno_mar=document.getElementById('srno_mar').value;		
//alert(srno);	
var office=document.getElementById('office').value;		
//alert(office);
var offr_mar=document.getElementById('offr_mar').value;	
//alert(offr_mar);	
var off_mar=document.getElementById('off_mar').value;		
//alert(off_mar);

var officer=document.getElementById('officer').value;		
var phone=document.getElementById('phone').value;		
var phone_mar=document.getElementById('phone_mar').value;		
var no_mar=document.getElementById('no_mar').value;		
var no=document.getElementById('no').value;		
    var date=document.getElementById('date').value;


if(office==''||officer==''||phone==''||no==''||date==''||off_mar==''||offr_mar=='')
{
alert('Please enter all details..?');
	}
	else
	{  	
  	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) 
	{
   //  alert(xmlhttp.responseText);
      if(xmlhttp.responseText==1)	   {

	   alert("Updated successfully");
       window.location.reload();
		
  }
  	  
  }
  }
			var que ="?&office="+office+"&srno="+srno+"&officer="+officer+"&phone="+phone+"&no="+no+"&date="+date+"&offr_mar="+offr_mar+"&off_mar="+off_mar+"&phone_mar="+phone_mar+"&no_mar="+no_mar+"&srno_mar="+srno_mar;
 //alert(que);
  xmlhttp.open("GET","adminupdt.php" + que, true);
  xmlhttp.send(null);
}
}



function update_company(i)
		{
	//		alert(i)
			var Sr=i;
	//		alert(Sr);
														//	var xr=document.getElementById('x'+i).value;
															//alert(xr);
		TINY.box.show({iframe:"adminupdate.php?srno="+i,boxid:'frameless',width:660,height:800,fixed:false,maskid:'bluemask',maskopacity:40,closejs:function(){closeJS()}});	
		
	
		
			}

</script>
    <div id="wrapper">

        <!-- Navigation -->
        <nav class="navbar navbar-default navbar-static-top" role="navigation" style="margin-bottom: 0">
            
            <!-- /.navbar-header -->

            <!-- /.navbar-top-links -->

            <!-- /.navbar-static-side -->
        </nav>

        <!-- Page Content -->
       <!--  <div id="page-wrapper">
            <div class="container-fluid">
                <div class="row">
                    <div class="col-lg-12"> -->
                       
                        <div id="page-wrapper">
            <div class="row">
                <div class="col-lg-12">
                    <h1 class="page-header"></h1>
                </div>
                <!-- /.col-lg-12 -->
            </div>
            <!-- /.row -->
            <div class="row">
                <div class="col-lg-12">
                    <div class="panel panel-default">
                        <div class="panel-heading">
                            Important Phone No
                        </div>
                        <div class="panel-body">
                            <div class="row">
                                <div class="col-lg-6">
                                    <form role="form">
                                    
                                    <div class="form-group">
                                            <label>Sr.No.</label>
                                            <input class="form-control" placeholder="Enter Number" id="srno" name="name" value="<?php echo $srno;?>" / readonly>
                                            </div>
                                            <div class="form-group">
                                            <label>Sr.no Marathi</label>
                                            <input class="form-control" id="srno_mar" name="srno_mar" value="<?php echo $srno1;?>" >

                                        </div>
                                        
                                         <div class="form-group">
                                             <label>Date</label>
                                            <input class="form-control" placeholder="date" id="date" name="date" value="<?php echo $date;?>"  >
                                        </div>
                                       
                                         <div class="form-group">
                                            <label>Office Name</label>
                                            <input class="form-control" id="office" name="office" value="<?php echo $office?>">

                                        </div>
                                        
                                          <div class="form-group">
                                            <label>Office Name in Marathi</label>
                                            <input class="form-control" id="off_mar" name="off_mar" value="<?php echo $office1?>" >

                                        </div>
                                        <div class="form-group">
                                            <label>Officer Name</label>
                                            <input class="form-control" id="officer" name="officer" value="<?php echo $officer?>">

                                        </div>
                                        <div class="form-group">
                                            <label>Officer Name in Marathi</label>
                                            <input class="form-control" id="offr_mar" name="offr_mar" value="<?php echo $officer1?>" >
                                        </div>
                                        <div class="form-group">
                                            <label>Phone No</label>
                                            <input class="form-control" id="phone" name="phone" value="<?php echo $phone?>">

                                        </div>
                                        <div class="form-group">
                                            <label>Phoneno in Marathi</label>
                                            <input class="form-control" id="phone_mar" name="phone_mar" value="<?php echo $phone1;?>" >
                                        </div>
                                        
                                        <div class="form-group">
                                            <label>Mobile No</label>
                                            <input class="form-control" id="no" name="no" value="<?php echo $no?>">

                                        </div>
                                        <div class="form-group">
                                            <label>Mobile No in Marathi</label>
                                            <input class="form-control" id="no_mar" name="no_mar" value="<?php echo $no1;?>" >
                                        </div>
                                        
                                       
                                        
                                       
                                       
                                        
<!--                                         <button type="button" onclick="view();" class="submit">Submit Button</button> -->
                                        <button type="button" onclick="update();" class="submit">Update</button>
        <div id="search_res" style="width:100%;" >
                                               
<!--                                          <button type="reset" class="btn btn-default">Reset Button</button>  -->
                                    </form>
                                </div>
                                <!-- /.col-lg-6 (nested) -->
                                
                                <!-- /.col-lg-6 (nested) -->
                            </div>
                            <!-- /.row (nested) -->
                        </div>
                        <!-- /.panel-body -->
                    </div>
                    <!-- /.panel -->
                </div>
                <!-- /.col-lg-12 -->
            </div>
            <!-- /.row -->
        
                       
                       
                   
                       
                       </div>
                       
                    </div>
                    <!-- /.col-lg-12 -->
                
                <!-- /.row -->
            
            <!-- /.container-fluid -->
        


        <!-- /#page-wrapper -->

   
    <!-- /#wrapper -->

    <!-- jQuery -->
    <script src="../bower_components/jquery/dist/jquery.min.js"></script>

    <!-- Bootstrap Core JavaScript -->
    <script src="../bower_components/bootstrap/dist/js/bootstrap.min.js"></script>

    <!-- Metis Menu Plugin JavaScript -->
    <script src="../bower_components/metisMenu/dist/metisMenu.min.js"></script>

    <!-- Custom Theme JavaScript -->
    <script src="../dist/js/sb-admin-2.js"></script>

</body>

</html>
