<?php include "layouts/menu.php"; ?> 
    <?php $hpl=$_REQUEST['hpl'];?>
  <?php $vno=$_REQUEST['vno'];?>
  <!--  page-wrapper -->
         <div class="right_col" role="main">
            <div class="row">
                 <!-- page header -->
                <div class="col-lg-12">
                    <h1 class="page-header  alert alert-info">Updates</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>
                        <div class="panel-body">
                            <div class="row">
   <div class="alert alert-info">Welcome Update User Details Here</div>
   <form name="form1" class="form-horizontal" method="post" action="" enctype="multipart/form-data">
   <?php
				$qry=mysqli_query($conn, "select * from customerdetails where mfin='$mfin' &&  hpl='$hpl'");
				$row=mysqli_fetch_array($qry);
				$qry1=mysqli_query($conn, "select * from response where mfin='$mfin' &&  hpl='$hpl'");
				$row1=mysqli_fetch_array($qry1);
				$n=mysqli_num_rows($qry1);
						if($n==0)
						{?>
							<img style="margin-left:150px;margin-bottom:20px;"" src="user/<?php echo $row['uimg'];?>" height="100" width="100"/>
   <div class="form-group">
    <label for="inputPassword3" class="col-sm-2 control-label">HPL</label>
    <div class="col-sm-4">
      <input type="text" class="form-control" id="inputPassword3" name="hpl" value="<?php echo $row['hpl'];?>" placeholder="E.g 1008" required>
    </div>
  </div> 
  <div class="form-group">
    <label for="inputPassword3" class="col-sm-2 control-label">Response Date</label>
    <div class="col-sm-4">
      <input type="text" class="form-control" id="datepicker" name="rdate" value="<?php echo $row1['rdate'];?>" placeholder="H.P Date">
    </div>
    </div>
  <div class="form-group">
    <div class="col-sm-offset-2 col-sm-10">
      <button type="submit" class="btn btn-default" name="s2">Register</button>
    </div>
  </div>
      <div class="alert alert-success">
	  <?php include "programs/response1.php"; ?>
	  </div>
				<?php		}
						else
					{ 
	?>
	<img style="margin-left:150px;margin-bottom:20px;"" src="user/<?php echo $row['uimg'];?>" height="100" width="100"/>
   <div class="form-group">
    <label for="inputPassword3" class="col-sm-2 control-label">HPL</label>
    <div class="col-sm-4">
      <input type="text" class="form-control" id="inputPassword3" name="hpl" value="<?php echo $row['hpl'];?>" placeholder="E.g 1008" required>
    </div>
  </div> 
  <div class="form-group">
    <label for="inputPassword3" class="col-sm-2 control-label">Response Date</label>
    <div class="col-sm-4">
      <input type="text" class="form-control" id="datepicker" name="rdate" value="<?php echo $row1['rdate'];?>" placeholder="H.P Date">
    </div>
    </div>
  <div class="form-group">
    <div class="col-sm-offset-2 col-sm-10">
      <button type="submit" class="btn btn-default" name="s2">Register</button>
    </div>
  </div>
      <div class="alert alert-success">
	 <?php
							if(isset($_POST['s2']))
							{
								extract($_POST);
								$update=mysqli_query($conn, "update response set rdate='$rdate' where hpl='$hpl'");
								if($update)
								{									
								echo "Updated successfully";
								}
									
								else
								{
								echo "Failure";
								}
							}
?>
	  </div>
</form><?php } ?>
 </div>
</div></div>
</div></div></div> <?php include "layouts/footer.php"; ?></body></html>
