<?php include "layouts/menu.php"; ?> <div class="right_col" role="main">
          
            <div class="row">
                <div class="col-lg-12">
                    <!-- Form Elements -->
                    <div class="panel panel-default">
                        <div class="panel-heading">
                            Packet Transfer - Customer
                        </div>
                        <div class="panel-body">
                            <div class="row">

   <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">Loan No</label>
    <div class="col-sm-4">
      <input type="text" class="form-control" id="inputPassword3" name="hpl" value="" placeholder="" required>
    </div>
  </div>
  <div class="form-group">
    <label for="inputPassword3" class="col-sm-2 control-label">To Locker</label>
    <div class="col-sm-4">
         <select type="text" class="form-control" id="inputPassword3" name="name" value="" placeholder="" required>
             <?php
             $sql = mysqli_query($conn, "select * from godown"); 
             while($row = mysqli_fetch_array($sql)){ ?>
             <option><?php echo $row['name'] ;?></option>
             <?php } ?> </select>
    </div>
  </div>

    <div class="form-group">
    <label for="inputPassword3" class="col-sm-2 control-label">Transfer Date</label>
    <div class="col-sm-4">
         <input type="date" class="form-control" id="inputPassword3" name="date" value="<?php echo date('Y-m-d'); ?>" placeholder="" required>
    </div>
  </div>

  <div class="form-group">
    <div class="col-sm-offset-2 col-sm-10">
      <button type="submit" class="btn btn-default" name="s1">Save This</button>
    </div>
  </div>
      <div class="alert alert-success">
	<?php
							if(isset($_POST['s1']))
							{
								extract($_POST);
	$insert2=mysqli_query($conn, "update customerdetails set locker='$name' where hpl='$hpl' && mfin='$mfin'");

								$insert=mysqli_query($conn, "insert into tranp(mfin,scode,date,hpl,name)
											 values('$mfin','$scode','$date','$hpl','$name')");
								
								if($insert)
								{
									
									echo "Registered Successfully";
									
								}
								else
								{
									echo "Failure";
								}
							}
?>
	  </div>
</form>
</div>

				  <?php
					
						$qry=mysqli_query($conn, "select * from tranp where mfin='$mfin'");
						$n=mysqli_num_rows($qry);
						if($n==0)
						{
							echo "Nothing To Display";
						}
						else
						
					{ 
						?>
                <!-- Main content -->
                <section class="content">
                    <div class="row">
                        <div class="col-xs-12"> 
                            <div class="box">
                               <!-- /.box-header -->
                                <div class="box-body table-responsive">
                                    <table id="table2" class="table table-bordered table-striped">
                                        <thead>
                                            <tr>
							<th>Loan No</th>
							
							<th>Locker NAme</th>
							<th>Date</th>
						
	
                                            </tr>
                                        </thead>
										<?php 
					while($row2=mysqli_fetch_array($qry))
						{
					?>
                                        <tbody>
                                           <tr>
                         <td><?php echo $row2['hpl'];?></td>						
           						
                         <td><?php echo $row2['name'];?></td>						
						<td><?php echo $row2['date']; ?></td>
					
						
                                            </tr>
                                          </tbody>
                                        <?php
						}
					}
				
					?>
					                    
                                    </table>		
                                </div><!-- /.box-body -->
                            </div><!-- /.box -->
 
</div>
</div></div>
</div></div></div> <?php include "layouts/footer.php"; ?> </body></html>