<?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  alert alert-info">HPL</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">
 
  <input type="button" value="Print" onclick="PrintElem('#mydiv')"  style="margin:20px;">
  <div class="alert alert-info">Get user paid Amount</div><br>
   <form class="form-horizontal" method="post" action="" enctype="multipart/form-data">
    <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="tot" name="uid" value="" placeholder="E.g 1008">
    </div>
  </div>
<div class="form-group">
    <div class="col-sm-offset-2 col-sm-10">
      <button type="submit" class="btn btn-default" name="s10">Get</button>
    </div>
  </div>
   <div id="mydiv">
    <div class="alert alert-success">
	  <b><p style="color:red;margin:10px;"><?php
								if(isset($_POST['s10']))
								{
									extract($_POST);
									
                                    $sql = "select sum(rno) from user where mfin='$mfin' &&  uid='$uid'";
                                    $q = mysqli_query($conn, $sql);
                                    $row = mysqli_fetch_array($q);

                                    echo 'Total Interest: ' . $row[0]; 
									echo "<br>";
                					$sql = "select sum(dueamount) from user where mfin='$mfin' &&  uid='$uid'";
                                    $q = mysqli_query($conn, $sql);
                                    $row1 = mysqli_fetch_array($q);

                                    echo 'Total due Amount with interest: ' . $row1[0];	
									echo "<br>";
                					$sql = "select sum(pass) from user where mfin='$mfin' &&  uid='$uid'";
                                    $q = mysqli_query($conn, $sql);
                                    $row = mysqli_fetch_array($q);

                                    echo 'Total due Amount without interest: ' . $row[0];	
									echo "<br>";
                					$sql = "select sum(fine) from user where mfin='$mfin' &&  uid='$uid'";
                                    $q = mysqli_query($conn, $sql);
                                    $row = mysqli_fetch_array($q);

                                    echo 'Fine: ' . $row[0];	
									echo"<br>";
									$sql = "select * from user where mfin='$mfin' &&  uid='$uid'";
									$q = mysqli_query($conn, $sql);
									$n = mysqli_num_rows($q);
									if($n==0)
									{
									echo"Nothing he has paid";
									}
									else
									{
									echo"Paid Months: $n";
									}
									echo"<br>";
									$result = mysqli_query($conn, "SELECT no FROM user where mfin='$mfin' &&  uid='$uid'"); 

                                    $users_name = mysqli_fetch_row($result); 
                                    $users_name = $users_name[0]; // mysqli_fetch_row returns an array. we only want the Name so we just set it excluseively. 

                                    echo "Total Due Month : $users_name"; 
									echo"<br>";
									$bal = $users_name - $n;
									echo "balance Month: $bal";	
									echo"<br>";
									$result = mysqli_query($conn, "SELECT total FROM customerdetails where mfin='$mfin' &&  hpl='$uid'"); 

                                    $users_name1 = mysqli_fetch_row($result); 
                                    $users_name1 = $users_name1[0]; // mysqli_fetch_row returns an array. we only want the Name so we just set it excluseively. 
									$tot=$users_name1*$users_name;
                                    echo "Amount Have to pay : $tot"; 
									echo"<br>";
								    $balance=$tot-$row1[0]*$n;
									echo "Balance Amount: $balance";
									echo"<br>";							
									$result = mysqli_query($conn, "SELECT hpdate FROM customerdetails where mfin='$mfin' &&  hpl='$uid'"); 

                                    $users_name = mysqli_fetch_row($result); 
                                    $users_name = $users_name[0]; // mysqli_fetch_row returns an array. we only want the Name so we just set it excluseively. 

                                    echo "H.P Date: $users_name"; 
								}
							?></p></b>
			</form>		
</div></div></div></div></div></div>
<?php include "layouts/footer.php"; ?></body></html>