<?php include "layouts/menu.php"; ?>
<script>
	function autocomplet() {
	var min_length = 0; // min caracters to display the autocomplete
	var keyword = $('#did').val();
	if (keyword.length >= min_length) {
		$.ajax({
			url: 'ajax_refresh.php',
			type: 'POST',
			data: {keyword:keyword},
			success:function(data){
				$('#country_list_id').show();
				$('#country_list_id').html(data);
			}
		});
	} else {
		$('#country_list_id').hide();
	}
}
function set_item(item) {
	// change input value
	$('#did').val(item);
	// hide proposition list
	$('#country_list_id').hide();
}
	</script>
	 <script>
	function autocomp() {
	var min_length = 0; // min caracters to display the autocomplete
	var keyword = $('#didn').val();
	if (keyword.length >= min_length) {
		$.ajax({
			url: 'ajax_sname.php',
			type: 'POST',
			data: {keyword:keyword},
			success:function(data){
				$('#dname').show();
				$('#dname').html(data);
			}
		});
	} else {
		$('#dname').hide();
	}
}

// set_item : this function will be executed when we select an item
function set_itemm(item) {
	// change input value
	$('#didn').val(item);
	// hide proposition list
	$('#dname').hide();
}
	</script>
 <script>
	function autocomplett() {
	var min_length = 0; // min caracters to display the autocomplete
	var keyword = $('#zxcvb').val();
	if (keyword.length >= min_length) {
		$.ajax({
			url: 'ajax_refreshq.php',
			type: 'POST',
			data: {keyword:keyword},
			success:function(data){
				$('#qwertyu').show();
				$('#qwertyu').html(data);
			}
		});
	} else {
		$('#qwertyu').hide();
	}
}
// set_item : this function will be executed when we select an item
function set_itemmm(item) {
	// change input value
	$('#zxcvb').val(item);
	// hide proposition list
	$('#qwertyu').hide();
}
	</script>
  <!--  page-wrapper -->
           <div class="right_col" role="main">
         


            <div class="clearfix"></div>

            <div class="clearfix"></div>

            <div class="row">
			
           <div class="col-md-12 col-sm-12 col-xs-12">
                <div class="x_panel">
                  <div class="x_title" >
                    <h2>Customer Details <small></small></h2>
                    <ul class="nav navbar-right panel_toolbox">
                      <li><a class="collapse-link"><i class="fa fa-chevron-up"></i></a>
                      </li>
                      <li class="dropdown">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"><i class="fa fa-wrench"></i></a>
                        <ul class="dropdown-menu" role="menu">
                          <li><a href="#">Settings 1</a>
                          </li>
                          <li><a href="#">Settings 2</a>
                          </li>
                        </ul>
                      </li>
                      <li><a class="close-link"><i class="fa fa-close"></i></a>
                      </li>
                    </ul>
                    <div class="clearfix"></div>
                  </div>
                  <div class="x_content">
                    <div class="row">
                      <div class="col-sm-12">
                        <div class="card-box table-responsive">			
  <table id="datatable-buttons" id="datatable-buttons" class="table table-striped table-bordered">  
					<thead>
					<tr><th>S.No</th>
						<th>Hpl</th>
						<th>Party Address</th><th>Office Address</th>
		                <th>Gurn Address</th>
		                  <th>Gurn Work Address</th>
							<th>Due Details</th>
							
	
					
					</tr></thead>
					<tbody><?php $ii = 0; $due=$_REQUEST['due']; $due2=$_REQUEST['due2'];
					$area=$_REQUEST['area'];
$qry=mysqli_query($conn, "select * from pending where mfin='$mfin' && area='$area' && pendmnt between $due and $due2");
				$n=mysqli_num_rows($qry);
				while($row=mysqli_fetch_array($qry))
  { $ii++;
$x = $row['hpl'];
$qry2=mysqli_query($conn, "select * from customerdetails where mfin='$mfin' && hpl='$x'");
$row2=mysqli_fetch_array($qry2);
				
?>				<tr>
				<td><b><b><?php echo $ii;?></b></td>
						<td><b><a href="udelete10.php?hpl=<?php echo $row['hpl']; ?>&mfin=<?php echo $mfin; ?>" target="_blank"><?php echo $row['hpl'];?> <?php echo $row['star'];?></br>
						<?php echo $row['vno'];?></a></br>
						H.P Date : <?php echo $row['hpdate'];?></br>
						H.P Amt : <?php echo $row2['hpamount'];?></br>
				L.D. Date : <?php echo $row['lddate'];?></b>
				
				</a></b></td>
						
						<td><b><?php	$sql22 = mysqli_query($conn, "select * from addr where hpl='$x' && mfin='$mfin' order by id asc");
$row3 = mysqli_fetch_array($sql22);
$nn = mysqli_num_rows($sql22);
$iddf = $row3['id'];

if($nn>0) {

$iddf = $row3['id'];
for($i=1;$i<=7;$i++){
	
$sql223 = mysqli_query($conn, "select * from addr where id='$iddf'");
$row33 = mysqli_fetch_array($sql223); $iddf++;
?>
<?php echo $row33['addr']; ?></br>
<?php } } ?></b></td>
<td><b><?php	$sql22 = mysqli_query($conn, "select * from addr where hpl='$x' && mfin='$mfin' order by id asc");
$row3 = mysqli_fetch_array($sql22);
$nn = mysqli_num_rows($sql22);
$iddf = $row3['id'];

if($nn>0) {

$iddf = $row3['id'];
for($i=1;$i<=7;$i++){
	
$sql223 = mysqli_query($conn, "select * from addr where id='$iddf'");
$row33 = mysqli_fetch_array($sql223); $iddf++;
?>
<?php echo $row33['oadd']; ?></br>
<?php } } ?></b></td>
<td><b><?php	$sql22 = mysqli_query($conn, "select * from addr where hpl='$x' && mfin='$mfin' order by id asc");
$row3 = mysqli_fetch_array($sql22);
$nn = mysqli_num_rows($sql22);
$iddf = $row3['id'];

if($nn>0) {

$iddf = $row3['id'];
for($i=1;$i<=7;$i++){
	
$sql223 = mysqli_query($conn, "select * from addr where id='$iddf'");
$row33 = mysqli_fetch_array($sql223); $iddf++;
?>
<?php echo $row33['co']; ?></br>
<?php } } ?></b></td>
<td><b><?php	$sql22 = mysqli_query($conn, "select * from addr where hpl='$x' && mfin='$mfin' order by id asc");
$row3 = mysqli_fetch_array($sql22);
$nn = mysqli_num_rows($sql22);
$iddf = $row3['id'];

if($nn>0) {

$iddf = $row3['id'];
for($i=1;$i<=7;$i++){
	
$sql223 = mysqli_query($conn, "select * from addr where id='$iddf'");
$row33 = mysqli_fetch_array($sql223); $iddf++;
?>
<?php echo $row33['co2']; ?></br>
<?php } } ?></b></td>
				<td><b>Total Due : <?php echo $row['duemnt'];?></br>
				Paid Due : <?php echo $row['paymnt'];?></br>
				Pend Due : <?php echo $row['pendmnt'];?></br>
				Pend Amt : <?php echo round($row['penamt'],0);?></br>
				HL : <?php echo round($row['hlbal'],0);?></br>
				Def : <?php echo round($row['defamt'],0);?></b></td>
			
		
				
						
					</tr>
					<?php
						$x++;  }

					?>  </tbody>
					</table>
					
</div>
</div></div></div></div>
</div></div></div>     <!-- /page content -->

        <!-- 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>

