<?php include "layouts/menu.php"; ?> <div class="right_col" role="main">
            <div class="row">
                 <!-- page header -->
                <div class="col-lg-12">
                    <h1 class="page-header">Sub Area Details</h1>
                </div>
                <!--end page header -->
            </div>
            <div class="row">
                <div class="col-lg-12">
                    <!-- Form Elements -->
                    <div class="panel panel-default">
                        <div class="panel-heading">
                            Details
                        </div>    <?php $id=$_REQUEST['id'];?>
                        <div class="panel-body">
                            <div class="row">
   <div class="alert alert-info">Register Sub Area Details</div>
   <?php $qry=mysqli_query($conn, "select * from msarea where id=$id");
   $row = mysqli_fetch_array($qry);
   ?>
   
   <form name="form1" class="form-horizontal" method="post" action="" enctype="multipart/form-data">
   <div class="form-group">
    <label for="inputPassword3" class="col-sm-2 control-label">Sub Area Name</label>
    <div class="col-sm-4">
      <input type="text" class="form-control" id="inputPassword3" name="name" value="<?php echo $row['name']; ?>" placeholder="" required>
      <input type="hidden" class="form-control" id="inputPassword3" name="name55" value="<?php echo $row['name']; ?>" placeholder="" >
   
   </div>
  </div>
   <div class="form-group">
    <label for="inputPassword3" class="col-sm-2 control-label">Under Area</label>
    <div class="col-sm-4">
      <select type="text" class="form-control" id="inputPassword3" name="sname" value="" placeholder="" required>
     <option><?php echo $row['sname']; ?></option>
	<?php 
$qry=mysqli_query($conn, "select * from marea");
	while($row2=mysqli_fetch_array($qry))
						{ ?> <option><?php echo $row2['name'];?></option>
						<?php } ?> </select>
    </div>
  </div>
    <div class="form-group">
    <label for="inputPassword3" class="col-sm-2 control-label">Details</label>
    <div class="col-sm-4">
      <textarea class="form-control" rows="3" name="details" value="" placeholder=""><?php echo $row['details']; ?></textarea>
    </div>
  </div>  
  <div class="form-group">
    <div class="col-sm-offset-2 col-sm-10">
      <button type="submit" class="btn btn-default" name="s1">Update This</button>
    </div>
  </div>
      <div class="alert alert-success">
	 <?php
							if(isset($_POST['s1']))
							{
								extract($_POST);

							$insert224=mysqli_query($conn, "update msarea set name='$name',sname='$sname',details='$details' where id='$id'");		

						if($insert224)
								{
									
									echo "Registered Successfully";
										if($name != $name55) {
	$update=mysqli_query($conn, "update customerdetails set area='$name' where area='$name55'");
	$update2=mysqli_query($conn, "update pending set area='$name' where area='$name55'");	
	}	
	if($update && $update2) {
			echo "Updated Successfully";
	}
								}
								else
								{
									echo "Failure";
								}
							}
?>
	  </div>
</form>
</div></div></div></div></div>
  
 
</div>
</div></div>
</div></div></div> 
        <!-- footer content --> 
        <footer>
          <div class="pull-right">
             <a href="https://infossel.com">Infossel Soft Solution</a>
          </div>
          <div class="clearfix"></div>
        </footer>
        <!-- /footer content -->
      </div>
    </div>

    <!-- jQuery -->
    <script src="vendors/jquery/dist/jquery.min.js"></script>
    <!-- Bootstrap -->
    <script src="vendors/bootstrap/dist/js/bootstrap.min.js"></script>
    <!-- FastClick -->
    <script src="vendors/fastclick/lib/fastclick.js"></script>
    <!-- NProgress -->
    <script src="vendors/nprogress/nprogress.js"></script>
    <!-- iCheck -->
    <script src="vendors/iCheck/icheck.min.js"></script>
    <!-- Datatables -->
    <script src="vendors/datatables.net/js/jquery.dataTables.min.js"></script>
    <script src="vendors/datatables.net-bs/js/dataTables.bootstrap.min.js"></script>
    <script src="vendors/datatables.net-buttons/js/dataTables.buttons.min.js"></script>
    <script src="vendors/datatables.net-buttons-bs/js/buttons.bootstrap.min.js"></script>
    <script src="vendors/datatables.net-buttons/js/buttons.flash.min.js"></script>
    <script src="vendors/datatables.net-buttons/js/buttons.html5.min.js"></script>
    <script src="vendors/datatables.net-buttons/js/buttons.print.min.js"></script>
    <script src="vendors/datatables.net-fixedheader/js/dataTables.fixedHeader.min.js"></script>
    <script src="vendors/datatables.net-keytable/js/dataTables.keyTable.min.js"></script>
    <script src="vendors/datatables.net-responsive/js/dataTables.responsive.min.js"></script>
    <script src="vendors/datatables.net-responsive-bs/js/responsive.bootstrap.js"></script>
    <script src="vendors/datatables.net-scroller/js/dataTables.scroller.min.js"></script>
    <script src="vendors/jszip/dist/jszip.min.js"></script>
    <script src="vendors/pdfmake/build/pdfmake.min.js"></script>
    <script src="vendors/pdfmake/build/vfs_fonts.js"></script>

    <!-- Custom Theme Scripts -->
    <script src="build/js/custom.min.js"></script>

  </body>
</html>