	<?php ob_start(); ?>
	<!DOCTYPE html>
	<html>
	<?php include "layouts/db_connect.php"; ?>

		<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		
		<!-- Meta, title, CSS, favicons, etc. -->
		<meta charset="utf-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta http-equiv="X-UA-Compatible" content="chrome=1">
		<meta name="viewport" content="width=device-width, initial-scale=1">

		<title>INFOSSEL SOFT SOLUTIONS </title>

		<!-- Bootstrap -->
		<link href="vendors/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">
		<!-- Font Awesome -->
		<link href="vendors/font-awesome/css/font-awesome.min.css" rel="stylesheet">
		<!-- NProgress -->
		<link href="vendors/nprogress/nprogress.css" rel="stylesheet">
		<!-- iCheck -->
		<link href="vendors/iCheck/skins/flat/green.css" rel="stylesheet">
		<link href="vendors/datatables.net-bs/css/dataTables.bootstrap.min.css" rel="stylesheet">
		<link href="vendors/datatables.net-buttons-bs/css/buttons.bootstrap.min.css" rel="stylesheet">
		<link href="vendors/datatables.net-fixedheader-bs/css/fixedHeader.bootstrap.min.css" rel="stylesheet">
		<link href="vendors/datatables.net-responsive-bs/css/responsive.bootstrap.min.css" rel="stylesheet">
		<link href="vendors/datatables.net-scroller-bs/css/scroller.bootstrap.min.css" rel="stylesheet">
		    <link href="vendors/bootstrap-daterangepicker/daterangepicker.css" rel="stylesheet">
    <!-- bootstrap-datetimepicker -->
    <link href="vendors/bootstrap-datetimepicker/build/css/bootstrap-datetimepicker.css" rel="stylesheet">
    <!-- Ion.RangeSlider -->
    <link href="vendors/normalize-css/normalize.css" rel="stylesheet">
    <link href="vendors/ion.rangeSlider/css/ion.rangeSlider.css" rel="stylesheet">
    <link href="vendors/ion.rangeSlider/css/ion.rangeSlider.skinFlat.css" rel="stylesheet">

    <link href="vendors/cropper/dist/cropper.min.css" rel="stylesheet">
		<!-- bootstrap-progressbar -->
		<link href="vendors/bootstrap-progressbar/css/bootstrap-progressbar-3.3.4.min.css" rel="stylesheet">
		<!-- JQVMap -->
		<link href="vendors/jqvmap/dist/jqvmap.min.css" rel="stylesheet"/>
		<!-- bootstrap-daterangepicker -->
		<link href="vendors/bootstrap-daterangepicker/daterangepicker.css" rel="stylesheet">
	  <link rel="stylesheet" href="font.css">
	<link rel="stylesheet" href="bfont/font.css">
        <style type="text/css">
		/* when @font-face is defined(it is in font.css) you can add the font to any rule by using font-family */
		hh1 {
			font-family: 'BAUHS93';
		}
		</style>
		<!-- Custom Theme Style -->
		<link href="build/css/custom.min.css" rel="stylesheet">
		
	<script type="text/javascript"
	  src="http://ajax.googleapis.com/ajax/libs/chrome-frame/1/CFInstall.min.js"></script>
	<script type="text/javascript">
		  $(function() {
	   $("#datepicker").datepicker({ dateFormat: 'dd-mm-yy' });
	  });
	</script>
	<script type="text/javascript">
	function zp(n){
	return n<10?("0"+n):n;
	}
	function insertDate(t,format){
	var now=new Date();
	var DD=zp(now.getDate());
	var MM=zp(now.getMonth()+1);
	var YYYY=now.getFullYear();
	format=format.replace(/DD/,DD);
	format=format.replace(/MM/,MM);
	format=format.replace(/YYYY/,YYYY);
	t.value=format;
	}
	</script>
		<script>
	  $(function() {
	   $("#datepicker1").datepicker({ dateFormat: 'dd-mm-yy' });
	  });
	  </script>
		<script>
	  $(function() {
	   $("#datepicker2").datepicker({ dateFormat: 'dd-mm-yy' });
	  });
	  </script>
		  <script>
	  $(function() {
	   $("#datepicker8").datepicker({ dateFormat: 'dd-mm-yy' });
	  });
	  </script>
		<script>
	  $(function() {
	   $("#datepicker9").datepicker({ dateFormat: 'dd-mm-yy' });
	  });
	  </script>
	  <script type="text/javascript">

		function PrintElem(elem)
		{
			Popup($(elem).html());
		}

		function Popup(data) 
		{
			var mywindow = window.open('', 'my div', 'height=400,width=600');
			mywindow.document.write('<html><head><title>SENTHOOR MOTOR FINANCE</title>');
			/*optional stylesheet*/ //mywindow.document.write('<link rel="stylesheet" href="main.css" type="text/css" />');
			mywindow.document.write('</head><h1 style="color:green;text-align:center;" >SENTHOOR MOTOR FINANCE</h1><body >');
			mywindow.document.write(data);
		   mywindow.document.write('<h3 style="text-align:right;">Signed by</h3><h3 style="color:blue;text-align:right;">For SENTHOOR MOTOR FINANCE</h3></body></html>');

			mywindow.print();
			mywindow.close();

			return true;
		}

	</script>
	  
	  </head>

	  <body class="nav-md">
	   <?php 
		 if(isset($_SESSION['code'])) {
	  $code = $_SESSION['code'];
	  $scode = $_SESSION['code'];
	   $mfin = $_SESSION['mfin'];
		$staff = $_SESSION['name'];
		 $postt = $_SESSION['postt'];
	}
		
		 $qry=mysql_query("select * from customer where code='$code'");
		 $row=mysql_fetch_array($qry);
		 ?>	
		<div class="container body">
		  <div class="main_container">
			<div class="col-md-3 left_col">
			  <div class="left_col scroll-view">
				<div class="navbar nav_title" style="border: 0;">
				  <a href="index.php" class="site_title"> <span><h1><hh1><font color="red" face="Bauhaus 93">INFO</font><font color="#0d0a95" face="Bauhaus 93">SSEL</font></h1></hh1></span></a>
				</div>

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

				<!-- menu profile quick info 
				<div class="profile clearfix">
				  <div class="profile_pic">
					<img src="user/<?php // echo $row['uimg']; ?>" width="75" height="60" alt="..." class="img-circle profile_img">
				  </div>
				  <div class="profile_info">
					<span>Welcome,</span>
					<h2><?php //echo $mfin; ?></h2>
				  </div>
				</div>
				<!-- /menu profile quick info -->


				<!-- sidebar menu -->
				<div id="sidebar-menu" class="main_menu_side hidden-print main_menu">
				  <div class="menu_section">
					<h3></br></h3>
					<ul class="nav side-menu">
					<li> <form name="form1" class="form-horizontal" method="post" action="" enctype="multipart/form-data">
  <div class="input-group">
    <input type="text" class="form-control" name="ss" id="ss"  placeholder="Search" autofocus>
    <div class="input-group-btn">
      <button class="btn btn-info" name="sss" type="submit">
        <i class="glyphicon glyphicon-search"></i>
      </button>
    </div>
  </div>
   <div>
	<?php
							if(isset($_POST['sss']))
							{
								extract($_POST);
									header("location:0fvno2.php?vno=$ss");
							}
?>
	  </div>
</form></li>
					  <li><a href="index2.php"  data-toggle="tooltip" title="Home Page"><i class="fa fa-home"></i> Dashboard </a>
					  </li>
					  
					   <li>
							<a href="all.php" data-toggle="tooltip" title="All Finance View"><i class="fa fa-dashboard fa-fw"></i>Customer Details F2</a>
						</li>
						 <li>
							<a href="allmfin.php"  data-toggle="tooltip" title="Selected Finance View"><i class="fa fa-dashboard fa-fw"></i>Customer Details</a>
						</li>
			 <?php if($postt == 'MD')   { ?>      <li><a><i class="fa fa-book"></i> Entry <span class="fa fa-chevron-down"></span></a>
						<ul class="nav child_menu">
						
						<li class="blue">
									<a>HP Ledger New<span class="fa fa-chevron-down"></span></a>
									 <ul class="nav child_menu">
                            <li><a href="register11.php">Create</a>
                            </li>
                           
                            <li><a href="lview.php">View</a>
                            </li>
                          </ul>
								</li>
								 <li class="blue">
									<a href="umap.php" >Google Locator</a>
								</li>
						    <li class="blue">
									<a href="rprint.php">Re-Print</a>
								</li>
								 <li class="blue">
									<a href="reloan.php">HP Re-Loan</a>
								</li>
								<li class="blue">
									<a>HP Receipt<span class="fa fa-chevron-down"></span></a>
									 <ul class="nav child_menu">
                           
                            <li><a href="search55.php">Create</a>
                            </li>
                            <li><a href="getuserdue.php">View</a>
                            </li>
                          </ul>
								</li>
								
								<li class="blue">
									<a>HP Settle<span class="fa fa-chevron-down"></span></a>
									 <ul class="nav child_menu">
                           
                            <li><a href="fullsettle.php">Create</a>
                            </li>
                            <li><a href="closedacc.php">View</a>
                            </li>
                          </ul>
								</li>
				<li class="blue">
									<a>HL Payment<span class="fa fa-chevron-down"></span></a>
									 <ul class="nav child_menu">
                           <li><a href="bill/add_sales2.php?mfin=<?php echo $mfin; ?>&scode=<?php echo $scode; ?>" target="_blank">Create</a>
                            </li>
                            <li><a href="bill/add_sales222.php?mfin=<?php echo $mfin; ?>&scode=<?php echo $scode; ?>" target="_blank">Collection HL</a>
                            </li>
                            <li><a href="vhloan.php">View</a>
                            </li>
                          </ul>
								</li>
								<li class="blue">
									<a>Other Entries<span class="fa fa-chevron-down"></span></a>
									 <ul class="nav child_menu">
                            <li><a href="bill/add_sales1.php?mfin=<?php echo $mfin; ?>&scode=<?php echo $scode; ?>" target="_blank">Create</a>
                            </li>
                            <li><a href="oentry.php">Create1</a>
                            </li>
                            <li><a href="voentry.php">View</a>
                            </li>
                          </ul>
								</li>
								<li class="blue">
									<a>Godown Sale<span class="fa fa-chevron-down"></span></a>
									 <ul class="nav child_menu">
                           
                            <li><a href="gsale.php">Create</a>
                            </li>
                            <li><a href="vgsale.php">View</a>
                            </li>
                          </ul>
								</li>
								<li class="blue">
									<a>Voucher<span class="fa fa-chevron-down"></span></a>
									 <ul class="nav child_menu">
                           
                         <li><a href="voucher.php" >Create</a>
                            </li>
                            <li><a href="vvoucher.php">View</a>
                            </li>
                          </ul>
								</li>
								<li class="blue">
									<a href="docs.php">Documents<span class="fa fa-chevron-down"></span></a>
								</li>
								<li class="blue">
									<a href="govt.php">Goverment Id <span class="fa fa-chevron-down"></span></a>
								</li>
							</ul>
							<!-- second-level-items -->
						</li>
							 <li><a ><i class="fa fa-group"></i> Group <span class="fa fa-chevron-down"></span></a>
						<ul class="nav child_menu">
						
						<li class="blue">
						<a>HP Ledger<span class="fa fa-chevron-down"></span></a>
									 <ul class="nav child_menu">
                           
                            <li><a href="gglview.php">View</a>
                            </li>
                          </ul>
								</li>
								<li class="blue">
									<a>HP Receipt<span class="fa fa-chevron-down"></span></a>
									 <ul class="nav child_menu">
                 
                            <li><a href="ggbillrep.php">View</a>
                            </li>
                          </ul>
								</li>
								
								<li class="blue">
									<a>HP Settle<span class="fa fa-chevron-down"></span></a>
									 <ul class="nav child_menu">
                                  <li><a href="ggclosedacc.php">View</a>
                            </li>
                          </ul>
								</li>
								<li class="blue">
									<a>HL Payment<span class="fa fa-chevron-down"></span></a>
									 <ul class="nav child_menu">
                                     <li><a href="ggvhloan.php">View</a>
                            </li>
                          </ul>
								</li>
								<li class="blue">
									<a>Other Entries<span class="fa fa-chevron-down"></span></a>
									 <ul class="nav child_menu">
                            <li><a href="ggvoentry.php">View</a>
                            </li>
                          </ul>
								</li>
							
								
							</ul>
							<!-- second-level-items -->
						</li>		

		   <li><a><i class="fa fa-leaf"></i> Master <span class="fa fa-chevron-down"></span></a>
						<ul class="nav child_menu">
	 <li class="blue">
									<a href="mfin.php">Company Master</a>
								</li>     
									  
							 <li class="blue">
									<a href="mveh.php">Vehicle</a>
								</li>
								<li class="blue">
									<a href="mcolor.php">Colour</a>
								</li>
								 <li class="blue">
									<a href="marea.php">Area</a>
								</li>
								 <li class="blue">
									<a href="msarea.php">Sub Area</a>
								</li>
									 <li class="blue">
									<a href="00area.php">Area Sync</a>
								</li>
								<li class="blue">
									<a href="godown.php">Gowdown</a>
								</li>
								<li class="blue">
									<a href="dchart.php">Def Chart</a>
								</li>
								<li class="blue">
									<a href="mbroker.php">Broker</a>
								</li>
								<li class="blue">
									<a href="mfoff.php">Field Officer</a>
								</li>
								<li class="blue">
									<a href="magent.php">Agent</a>
								</li>
								<li class="blue">
									<a href="mhloan.php">Hand Loan</a>
								</li>
								<li class="blue">
									<a href="mdealer.php">Dealer</a>
								</li>
								<li class="blue">
									<a href="minscom.php">Insurance Company</a>
								</li>
								<li class="blue">
									<a href="mgovt.php">Goverment ID</a>
								</li>
								<li class="blue">
									<a href="ledger.php">Ledger</a>
								</li>
								<li class="blue">
									<a href="ledgergrp.php">Ledger Group</a>
								</li>
							</ul>
						   
						</li>
						
						 
						 <!-- second-level-items 
						<li>
							<a href="#"><i class="fa fa-files-o fa-fw"></i>Settle Amount<span class="fa arrow"></span></a>
							<ul class="nav nav-second-level">
							   <li class="blue">
									<a href="fullsettle.php">Due Settle</a>
								</li>
							   <li class="blue">
									<a href="closedacc.php">View Settle</a>
								</li>
							</ul></li>-->
												 <li><a><i class="fa fa-motorcycle"></i>Seizing Vehicle<span class="fa fa-chevron-down"></span></a>
						<ul class="nav child_menu">
							   <li class="blue">
									<a href="sizzing.php">Seizing</a>
								</li>
							   <li class="blue">
									<a href="sizzingcls.php">View Seizing</a>
								</li>
							</ul></li>
						  <li><a><i class="fa fa-question-circle"></i> Pending List <span class="fa fa-chevron-down"></span></a>
						<ul class="nav child_menu">
							
								<li class="blue">
									<a href="pending55.php">Pending List</a>
								</li>
								<li class="blue">
									<a href="pendcat.php">Cat Wise</a>
								</li>
								
								<li class="blue">
									<a href="lview2.php">Photo Pend</a>
								</li>
								<li class="blue">
									<a href="hpbal.php">HP Balance</a>
								</li>
								 <li class="blue">
									<a href="pendingc.php">Doc Pending</a>
								</li>
								 <li class="blue">
									<a href="pendingt.php">Termination A/C</a>
								</li>
								 <li class="blue">
									<a href="pendings.php">Seized Vehicle</a>
								</li>
								<li class="blue">
									<a href="gpend.php">Godown Vehicles</a>
								</li>
								</ul>
						</li> 
						
						<li><a><i class="fa fa-tasks"></i> Other Entries <span class="fa fa-chevron-down"></span></a>
						<ul class="nav child_menu">
						 <li class="blue">
									<a href="memo.php">Memo</a>
								</li>
								<li class="blue">
									<a href="investment.php">Investment</a>
								</li>
								<li class="blue">
									<a href="bank.php">Bank Details</a>
								</li>
								<li class="blue">
									<a href="debit.php">Debit</a>
								</li>
							   <li class="blue">
									<a href="salary.php">Salary</a>
								</li>
								<li class="blue">
									<a href="insurance.php">Insurance</a>
								</li>
								<li class="blue">
							<a href="doc.php">Documentation</a>
						</li>
							</ul>
							<!-- second-level-items -->
						</li>
					   
						<li><a><i class="fa fa-tasks"></i> Notice <span class="fa fa-chevron-down"></span></a>
						<ul class="nav child_menu">
						 <li class="blue">
									<a href="notice.php">Reference for Arbitration</a>
								</li>
								<li class="blue">
									<a href="notice5.php">கடனை திருப்பி செலுத்த வேண்டி அறிவிப்பு -CUSTOMER</a>
								</li>
								<li class="blue">
									<a href="notice1.php">கடனை திருப்பி செலுத்த வேண்டி அறிவிப்பு- CO-OBLIGANT</a>
								</li>
								<li class="blue">
									<a href="notice2.php">LOAN DEFAULT NOTICE-CUSTOMER</a>
								</li>
								<li class="blue">
									<a href="notice3.php">LOAN DEFAULT NOTICE-CO-OBLIGANT</a>
								</li>
							   <li class="blue">
									<a href="notice4.php">கடன் பாக்கி அறிவிப்பு</a>
								</li>
								

							</ul>
							<!-- second-level-items -->
						</li>
						
						
					  <li><a><i class="fa fa-support"></i> Reports <span class="fa fa-chevron-down"></span></a>
						<ul class="nav child_menu">
								<li class="blue">
									<a href="billrep.php">Bill Report</a>
								</li>
								
							   <li class="blue">
									<a href="getuserdue.php">Party Summary</a>
								</li>
								<li class="blue">
									<a href="allcus.php">HP LIST</a>
								</li>
								<li class="blue">
									<a href="notice6.php">Ledger Report</a>
								</li>
								 <li class="blue">
									<a href="allcus.php">Customer Details</a>
								</li>
								<li class="blue">
									<a href="brep.php">Business Report 2017</a>
								</li>
								<li class="blue">
									<a href="brep2.php">Business Report 2018</a>
								</li>
								<li class="blue">
									<a href="brep3.php">Business Report 2019</a>
								</li>
								<li class="blue">
									<a href="brep4.php">Business Report 2020</a>
								</li>
								<li class="blue">
									<a href="demand.php">Demand Statement</a>
								</li>
							  <li class="blue">
									<a href="billrepcpy.php">View Dues DateWise</a>
								</li>
								<li class="blue">
									<a href="viewduesc.php">View Paid Dues</a>
								</li>
							</ul>
							<!-- second-level-items -->
						</li>
						  <li><a><i class="fa fa-bar-chart"></i> Accounts <span class="fa fa-chevron-down"></span></a>
						<ul class="nav child_menu">

							  . <li class="blue">
									<a href="state.php">Statement</a>
								</li>
								<li class="blue">
									<a href="day.php">Day Book</a>
								</li>
									<li class="blue">
									<a href="bals.php">Balance Sheet</a>
								</li>

							  <li class="blue">
									<a href="tbal.php">Trial Balance</a>
								</li>
								
								
							   <li class="blue">
									<a href="tbal.php">Profit & Loss</a>
								</li>
								
							</ul>
							<!-- second-level-items -->
					</li> 
					 <li><a><i class="fa fa-archive"></i> Options <span class="fa fa-chevron-down"></span></a>
						<ul class="nav child_menu">

							  . <li class="blue">
									<a href="backup.php">Backup</a>
								</li>
								<li class="blue">
									<a href="pros.php">Schedule SMS</a>
								</li>

							  <li class="blue">
									<a href="pros2.php">Day Closing</a>
								</li>
								
								
							</ul>
							<!-- second-level-items -->
					</li> 
					
						 <li>
							<a href="backup.php"><i class="fa fa-wrench fa-fw"></i>Backup</a>
							<!-- second-level-items -->
						</li>
			 
			 <?php } elseif($postt == 'Office') { ?>
			 <<li><a><i class="fa fa-book"></i> Entry <span class="fa fa-chevron-down"></span></a>
						<ul class="nav child_menu">
						
						<li class="blue">
									<a>HP Ledger New<span class="fa fa-chevron-down"></span></a>
									 <ul class="nav child_menu">
                            <li><a href="register11.php">Create</a>
                            </li>
                           
                            <li><a href="lview.php">View</a>
                            </li>
                          </ul>
								</li>
								 <li class="blue">
									<a href="umap.php" >Google Locator</a>
								</li>
						    <li class="blue">
									<a href="rprint.php">Re-Print</a>
								</li>
								 <li class="blue">
									<a href="reloan.php">HP Re-Loan</a>
								</li>
								<li class="blue">
									<a>HP Receipt<span class="fa fa-chevron-down"></span></a>
									 <ul class="nav child_menu">
                           
                            <li><a href="search55.php">Create</a>
                            </li>
                            <li><a href="getuserdue.php">View</a>
                            </li>
                          </ul>
								</li>
								
								<li class="blue">
									<a>HP Settle<span class="fa fa-chevron-down"></span></a>
									 <ul class="nav child_menu">
                           
                            <li><a href="fullsettle.php">Create</a>
                            </li>
                            <li><a href="closedacc.php">View</a>
                            </li>
                          </ul>
								</li>
				<li class="blue">
									<a>HL Payment<span class="fa fa-chevron-down"></span></a>
									 <ul class="nav child_menu">
                           <li><a href="bill/add_sales2.php?mfin=<?php echo $mfin; ?>&scode=<?php echo $scode; ?>" target="_blank">Create</a>
                            </li>
                            <li><a href="bill/add_sales222.php?mfin=<?php echo $mfin; ?>&scode=<?php echo $scode; ?>" target="_blank">Collection HL</a>
                            </li>
                            <li><a href="vhloan.php">View</a>
                            </li>
                          </ul>
								</li>
								<li class="blue">
									<a>Other Entries<span class="fa fa-chevron-down"></span></a>
									 <ul class="nav child_menu">
                            <li><a href="bill/add_sales1.php?mfin=<?php echo $mfin; ?>&scode=<?php echo $scode; ?>" target="_blank">Create</a>
                            </li>
                            <li><a href="oentry.php">Create1</a>
                            </li>
                            <li><a href="voentry.php">View</a>
                            </li>
                          </ul>
								</li>
								<li class="blue">
									<a>Godown Sale<span class="fa fa-chevron-down"></span></a>
									 <ul class="nav child_menu">
                           
                            <li><a href="gsale.php">Create</a>
                            </li>
                            <li><a href="vgsale.php">View</a>
                            </li>
                          </ul>
								</li>
								<li class="blue">
									<a>Voucher<span class="fa fa-chevron-down"></span></a>
									 <ul class="nav child_menu">
                           
                        <li><a href="voucher.php" >Create</a>
                            </li>
                            <li><a href="vvoucher.php">View</a>
                            </li>
                          </ul>
								</li>
								<li class="blue">
									<a href="docs.php">Documents<span class="fa fa-chevron-down"></span></a>
								</li>
								<li class="blue">
									<a href="govt.php">Goverment Id <span class="fa fa-chevron-down"></span></a>
								</li>
							</ul>
							<!-- second-level-items -->
						</li>
							 <li><a ><i class="fa fa-group"></i> Group <span class="fa fa-chevron-down"></span></a>
						<ul class="nav child_menu">
						
						<li class="blue">
						<a>HP Ledger<span class="fa fa-chevron-down"></span></a>
									 <ul class="nav child_menu">
                           
                            <li><a href="gglview.php">View</a>
                            </li>
                          </ul>
								</li>
								<li class="blue">
									<a>HP Receipt<span class="fa fa-chevron-down"></span></a>
									 <ul class="nav child_menu">
                 
                            <li><a href="ggbillrep.php">View</a>
                            </li>
                          </ul>
								</li>
								
								<li class="blue">
									<a>HP Settle<span class="fa fa-chevron-down"></span></a>
									 <ul class="nav child_menu">
                                  <li><a href="ggclosedacc.php">View</a>
                            </li>
                          </ul>
								</li>
								<li class="blue">
									<a>HL Payment<span class="fa fa-chevron-down"></span></a>
									 <ul class="nav child_menu">
                                     <li><a href="ggvhloan.php">View</a>
                            </li>
                          </ul>
								</li>
								<li class="blue">
									<a>Other Entries<span class="fa fa-chevron-down"></span></a>
									 <ul class="nav child_menu">
                            <li><a href="ggvoentry.php">View</a>
                            </li>
                          </ul>
								</li>
							
								
							</ul>
							<!-- second-level-items -->
						</li>		

		   <li><a><i class="fa fa-leaf"></i> Master <span class="fa fa-chevron-down"></span></a>
						<ul class="nav child_menu">
	 <li class="blue">
									<a href="mfin.php">Company Master</a>
								</li>     
									  
							 <li class="blue">
									<a href="mveh.php">Vehicle</a>
								</li>
								<li class="blue">
									<a href="mcolor.php">Colour</a>
								</li>
								 <li class="blue">
									<a href="marea.php">Area</a>
								</li>
								 <li class="blue">
									<a href="msarea.php">Sub Area</a>
								</li>
								 <li class="blue">
									<a href="00area.php">Area Sync</a>
								</li>
								<li class="blue">
									<a href="godown.php">Gowdown</a>
								</li>
								<li class="blue">
									<a href="dchart.php">Def Chart</a>
								</li>
								<li class="blue">
									<a href="mbroker.php">Broker</a>
								</li>
								<li class="blue">
									<a href="mfoff.php">Field Officer</a>
								</li>
								<li class="blue">
									<a href="magent.php">Agent</a>
								</li>
								<li class="blue">
									<a href="mhloan.php">Hand Loan</a>
								</li>
								<li class="blue">
									<a href="mdealer.php">Dealer</a>
								</li>
								<li class="blue">
									<a href="minscom.php">Insurance Company</a>
								</li>
								<li class="blue">
									<a href="mgovt.php">Goverment ID</a>
								</li>
								<li class="blue">
									<a href="ledger.php">Ledger</a>
								</li>
								<li class="blue">
									<a href="ledgergrp.php">Ledger Group</a>
								</li>
							</ul>
						   
						</li>
						
						 
						 <!-- second-level-items 
						<li>
							<a href="#"><i class="fa fa-files-o fa-fw"></i>Settle Amount<span class="fa arrow"></span></a>
							<ul class="nav nav-second-level">
							   <li class="blue">
									<a href="fullsettle.php">Due Settle</a>
								</li>
							   <li class="blue">
									<a href="closedacc.php">View Settle</a>
								</li>
							</ul></li>-->
												 <li><a><i class="fa fa-motorcycle"></i>Seizing Vehicle<span class="fa fa-chevron-down"></span></a>
						<ul class="nav child_menu">
							   <li class="blue">
									<a href="sizzing.php">Seizing</a>
								</li>
							   <li class="blue">
									<a href="sizzingcls.php">View Seizing</a>
								</li>
							</ul></li>
						  <li><a><i class="fa fa-question-circle"></i> Pending List <span class="fa fa-chevron-down"></span></a>
						<ul class="nav child_menu">
							
								<li class="blue">
									<a href="pending55.php">Pending List</a>
								</li>
								<li class="blue">
									<a href="pendcat.php">Cat Wise</a>
								</li>
						
								<li class="blue">
									<a href="lview2.php">Photo Pend</a>
								</li>
								<li class="blue">
									<a href="hpbal.php">HP Balance</a>
								</li>
								 <li class="blue">
									<a href="pendingc.php">Doc Pending</a>
								</li>
								 <li class="blue">
									<a href="pendingt.php">Termination A/C</a>
								</li>
								 <li class="blue">
									<a href="pendings.php">Seized Vehicle</a>
								</li>
								<li class="blue">
									<a href="gpend.php">Godown Vehicles</a>
								</li>
								</ul>
						</li> 
						
						<li><a><i class="fa fa-tasks"></i> Other Entries <span class="fa fa-chevron-down"></span></a>
						<ul class="nav child_menu">
						 <li class="blue">
									<a href="memo.php">Memo</a>
								</li>
								<li class="blue">
									<a href="investment.php">Investment</a>
								</li>
								<li class="blue">
									<a href="bank.php">Bank Details</a>
								</li>
								<li class="blue">
									<a href="debit.php">Debit</a>
								</li>
							   <li class="blue">
									<a href="salary.php">Salary</a>
								</li>
								<li class="blue">
									<a href="insurance.php">Insurance</a>
								</li>
								<li class="blue">
							<a href="doc.php">Documentation</a>
						</li>
							</ul>
							<!-- second-level-items -->
						</li>
					   
						<li><a><i class="fa fa-tasks"></i> Notice <span class="fa fa-chevron-down"></span></a>
						<ul class="nav child_menu">
						 <li class="blue">
									<a href="notice.php">Reference for Arbitration</a>
								</li>
								<li class="blue">
									<a href="notice5.php">கடனை திருப்பி செலுத்த வேண்டி அறிவிப்பு -CUSTOMER</a>
								</li>
								<li class="blue">
									<a href="notice1.php">கடனை திருப்பி செலுத்த வேண்டி அறிவிப்பு- CO-OBLIGANT</a>
								</li>
								<li class="blue">
									<a href="notice2.php">LOAN DEFAULT NOTICE-CUSTOMER</a>
								</li>
								<li class="blue">
									<a href="notice3.php">LOAN DEFAULT NOTICE-CO-OBLIGANT</a>
								</li>
							   <li class="blue">
									<a href="notice4.php">கடன் பாக்கி அறிவிப்பு</a>
								</li>
								

							</ul>
							<!-- second-level-items -->
						</li>
						
						
					  <li><a><i class="fa fa-support"></i> Reports <span class="fa fa-chevron-down"></span></a>
						<ul class="nav child_menu">
								<li class="blue">
									<a href="billrep.php">Bill Report</a>
								</li>
								
							   <li class="blue">
									<a href="getuserdue.php">Party Summary</a>
								</li>
								<li class="blue">
									<a href="allcus.php">HP LIST</a>
								</li>
								<li class="blue">
									<a href="notice6.php">Ledger Report</a>
								</li>
								 <li class="blue">
									<a href="allcus.php">Customer Details</a>
								</li>
							
							  <li class="blue">
									<a href="billrepcpy.php">View Dues DateWise</a>
								</li>
								<li class="blue">
									<a href="viewduesc.php">View Paid Dues</a>
								</li>
							</ul>
							<!-- second-level-items -->
						</li>
				
					 <li><a><i class="fa fa-archive"></i> Options <span class="fa fa-chevron-down"></span></a>
						<ul class="nav child_menu">

							  . <li class="blue">
									<a href="backup.php">Backup</a>
								</li>
								<li class="blue">
									<a href="pros.php">Schedule SMS</a>
								</li>

							  <li class="blue">
									<a href="pros2.php">Day Closing</a>
								</li>
								
								
							</ul>
							<!-- second-level-items -->
					</li> 
						
		<?php	 }  else { ?>
		 <li><a><i class="fa fa-book"></i> Entry <span class="fa fa-chevron-down"></span></a>
						<ul class="nav child_menu">
						
						<li class="blue">
									<a>HP Ledger New<span class="fa fa-chevron-down"></span></a>
									 <ul class="nav child_menu">
                            <li><a href="register11.php">Create</a>
                            </li>
                           
                            <li><a href="lview.php">View</a>
                            </li>
                          </ul>
								</li>
								 <li class="blue">
									<a href="umap.php" >Google Locator</a>
								</li>
						    <li class="blue">
									<a href="rprint.php">Re-Print</a>
								</li>
								 <li class="blue">
									<a href="reloan.php">HP Re-Loan</a>
								</li>
								<li class="blue">
									<a>HP Receipt<span class="fa fa-chevron-down"></span></a>
									 <ul class="nav child_menu">
                           
                            <li><a href="search55.php">Create</a>
                            </li>
                            <li><a href="getuserdue.php">View</a>
                            </li>
                          </ul>
								</li>
								
								<li class="blue">
									<a>HP Settle<span class="fa fa-chevron-down"></span></a>
									 <ul class="nav child_menu">
                           
                            <li><a href="fullsettle.php">Create</a>
                            </li>
                            <li><a href="closedacc.php">View</a>
                            </li>
                          </ul>
								</li>
				<li class="blue">
									<a>HL Payment<span class="fa fa-chevron-down"></span></a>
									 <ul class="nav child_menu">
                           <li><a href="bill/add_sales2.php?mfin=<?php echo $mfin; ?>&scode=<?php echo $scode; ?>" target="_blank">Create</a>
                            </li>
                            <li><a href="bill/add_sales222.php?mfin=<?php echo $mfin; ?>&scode=<?php echo $scode; ?>" target="_blank">Collection HL</a>
                            </li>
                            <li><a href="vhloan.php">View</a>
                            </li>
                          </ul>
								</li>
								<li class="blue">
									<a>Other Entries<span class="fa fa-chevron-down"></span></a>
									 <ul class="nav child_menu">
                            <li><a href="bill/add_sales1.php?mfin=<?php echo $mfin; ?>&scode=<?php echo $scode; ?>" target="_blank">Create</a>
                            </li>
                            <li><a href="oentry.php">Create1</a>
                            </li>
                            <li><a href="voentry.php">View</a>
                            </li>
                          </ul>
								</li>
								<li class="blue">
									<a>Godown Sale<span class="fa fa-chevron-down"></span></a>
									 <ul class="nav child_menu">
                           
                            <li><a href="gsale.php">Create</a>
                            </li>
                            <li><a href="vgsale.php">View</a>
                            </li>
                          </ul>
								</li>
								<li class="blue">
									<a>Voucher<span class="fa fa-chevron-down"></span></a>
									 <ul class="nav child_menu">
                           
                         <li><a href="bill/voucher.php" target="_blank">Create</a>
                            </li>
                            <li><a href="vvoucher.php">View</a>
                            </li>
                          </ul>
								</li>
								<li class="blue">
									<a href="docs.php">Documents<span class="fa fa-chevron-down"></span></a>
								</li>
								<li class="blue">
									<a href="govt.php">Goverment Id <span class="fa fa-chevron-down"></span></a>
								</li>
							</ul>
							<!-- second-level-items -->
						</li>
							 <li><a ><i class="fa fa-group"></i> Group <span class="fa fa-chevron-down"></span></a>
						<ul class="nav child_menu">
						
						<li class="blue">
						<a>HP Ledger<span class="fa fa-chevron-down"></span></a>
									 <ul class="nav child_menu">
                           
                            <li><a href="gglview.php">View</a>
                            </li>
                          </ul>
								</li>
								<li class="blue">
									<a>HP Receipt<span class="fa fa-chevron-down"></span></a>
									 <ul class="nav child_menu">
                 
                            <li><a href="ggbillrep.php">View</a>
                            </li>
                          </ul>
								</li>
								
								<li class="blue">
									<a>HP Settle<span class="fa fa-chevron-down"></span></a>
									 <ul class="nav child_menu">
                                  <li><a href="ggclosedacc.php">View</a>
                            </li>
                          </ul>
								</li>
								<li class="blue">
									<a>HL Payment<span class="fa fa-chevron-down"></span></a>
									 <ul class="nav child_menu">
                                     <li><a href="ggvhloan.php">View</a>
                            </li>
                          </ul>
								</li>
								<li class="blue">
									<a>Other Entries<span class="fa fa-chevron-down"></span></a>
									 <ul class="nav child_menu">
                            <li><a href="ggvoentry.php">View</a>
                            </li>
                          </ul>
								</li>
							
								
							</ul>
							<!-- second-level-items -->
						</li>		

		   <li><a><i class="fa fa-leaf"></i> Master <span class="fa fa-chevron-down"></span></a>
						<ul class="nav child_menu">
	 <li class="blue">
									<a href="mfin.php">Company Master</a>
								</li>     
									  
							 <li class="blue">
									<a href="mveh.php">Vehicle</a>
								</li>
								<li class="blue">
									<a href="mcolor.php">Colour</a>
								</li>
								 <li class="blue">
									<a href="marea.php">Area</a>
								</li>
								 <li class="blue">
									<a href="msarea.php">Sub Area</a>
								</li>
								 <li class="blue">
									<a href="00area.php">Area Sync</a>
								</li>
								<li class="blue">
									<a href="godown.php">Gowdown</a>
								</li>
								<li class="blue">
									<a href="dchart.php">Def Chart</a>
								</li>
								<li class="blue">
									<a href="mbroker.php">Broker</a>
								</li>
								<li class="blue">
									<a href="mfoff.php">Field Officer</a>
								</li>
								<li class="blue">
									<a href="magent.php">Agent</a>
								</li>
								<li class="blue">
									<a href="mhloan.php">Hand Loan</a>
								</li>
								<li class="blue">
									<a href="mdealer.php">Dealer</a>
								</li>
								<li class="blue">
									<a href="minscom.php">Insurance Company</a>
								</li>
								<li class="blue">
									<a href="mgovt.php">Goverment ID</a>
								</li>
								<li class="blue">
									<a href="ledger.php">Ledger</a>
								</li>
								<li class="blue">
									<a href="ledgergrp.php">Ledger Group</a>
								</li>
							</ul>
						   
						</li>
						
						 
						 <!-- second-level-items 
						<li>
							<a href="#"><i class="fa fa-files-o fa-fw"></i>Settle Amount<span class="fa arrow"></span></a>
							<ul class="nav nav-second-level">
							   <li class="blue">
									<a href="fullsettle.php">Due Settle</a>
								</li>
							   <li class="blue">
									<a href="closedacc.php">View Settle</a>
								</li>
							</ul></li>-->
												 <li><a><i class="fa fa-motorcycle"></i>Seizing Vehicle<span class="fa fa-chevron-down"></span></a>
						<ul class="nav child_menu">
							   <li class="blue">
									<a href="sizzing.php">Seizing</a>
								</li>
							   <li class="blue">
									<a href="sizzingcls.php">View Seizing</a>
								</li>
							</ul></li>
						  <li><a><i class="fa fa-question-circle"></i> Pending List <span class="fa fa-chevron-down"></span></a>
						<ul class="nav child_menu">
							
								<li class="blue">
									<a href="pending55.php">Pending List</a>
								</li>
								<li class="blue">
									<a href="pendcat.php">Cat Wise</a>
								</li>
							
								<li class="blue">
									<a href="lview2.php">Photo Pend</a>
								</li>
							
								 <li class="blue">
									<a href="pendingc.php">Doc Pending</a>
								</li>
								 <li class="blue">
									<a href="pendingt.php">Termination A/C</a>
								</li>
								 <li class="blue">
									<a href="pendings.php">Seized Vehicle</a>
								</li>
								<li class="blue">
									<a href="gpend.php">Godown Vehicles</a>
								</li>
								</ul>
						</li> 
						
						
					   
						<li><a><i class="fa fa-tasks"></i> Notice <span class="fa fa-chevron-down"></span></a>
						<ul class="nav child_menu">
						 <li class="blue">
									<a href="notice.php">Reference for Arbitration</a>
								</li>
								<li class="blue">
									<a href="notice5.php">கடனை திருப்பி செலுத்த வேண்டி அறிவிப்பு -CUSTOMER</a>
								</li>
								<li class="blue">
									<a href="notice1.php">கடனை திருப்பி செலுத்த வேண்டி அறிவிப்பு- CO-OBLIGANT</a>
								</li>
								<li class="blue">
									<a href="notice2.php">LOAN DEFAULT NOTICE-CUSTOMER</a>
								</li>
								<li class="blue">
									<a href="notice3.php">LOAN DEFAULT NOTICE-CO-OBLIGANT</a>
								</li>
							   <li class="blue">
									<a href="notice4.php">கடன் பாக்கி அறிவிப்பு</a>
								</li>
								

							</ul>
							<!-- second-level-items -->
						</li>
						
						
					  <li><a><i class="fa fa-support"></i> Reports <span class="fa fa-chevron-down"></span></a>
						<ul class="nav child_menu">
								<li class="blue">
									<a href="billrep.php">Bill Report</a>
								</li>
								
							   <li class="blue">
									<a href="getuserdue.php">Party Summary</a>
								</li>
								<li class="blue">
									<a href="allcus.php">HP LIST</a>
								</li>
								<li class="blue">
									<a href="notice6.php">Ledger Report</a>
								</li>
								 <li class="blue">
									<a href="allcus.php">Customer Details</a>
								</li>
							
								<li class="blue">
									<a href="demand.php">Demand Statement</a>
								</li>
							  <li class="blue">
									<a href="billrepcpy.php">View Dues DateWise</a>
								</li>
								<li class="blue">
									<a href="viewduesc.php">View Paid Dues</a>
								</li>
							</ul>
							<!-- second-level-items -->
						</li>
					
					 <li><a><i class="fa fa-archive"></i> Options <span class="fa fa-chevron-down"></span></a>
						<ul class="nav child_menu">

							  . <li class="blue">
									<a href="backup.php">Backup</a>
								</li>
								<li class="blue">
									<a href="pros.php">Schedule SMS</a>
								</li>

							  <li class="blue">
									<a href="pros2.php">Day Closing</a>
								</li>
								
								
							</ul>
							<!-- second-level-items -->
					</li> 
					  
					
		<?php } ?>
	
						   
					 
					</ul>
				  </div>
		   

				</div>
				<!-- /sidebar menu -->

				<!-- /menu footer buttons -->
				<div class="sidebar-footer hidden-small">
				  <a data-toggle="tooltip" data-placement="top" title="Settings">
					<span class="glyphicon glyphicon-cog" aria-hidden="true"></span>
				  </a>
				  <a data-toggle="tooltip" data-placement="top" title="FullScreen">
					<span class="glyphicon glyphicon-fullscreen" aria-hidden="true"></span>
				  </a>
				  <a data-toggle="tooltip" data-placement="top" title="Lock">
					<span class="glyphicon glyphicon-eye-close" aria-hidden="true"></span>
				  </a>
				  <a data-toggle="tooltip" data-placement="top" title="Logout" href="login.html">
					<span class="glyphicon glyphicon-off" aria-hidden="true"></span>
				  </a>
				</div>
				<!-- /menu footer buttons -->
			  </div>
			</div>

			<!-- top navigation -->
			<div class="top_nav">
			  <div class="nav_menu">
				<nav>
				  <div class="nav toggle">
					<a id="menu_toggle"><i class="fa fa-bars"></i></a>
				  </div>

				  <ul class="nav navbar-nav navbar-right">
					<li class="">
					  <a href="javascript:;" class="user-profile dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
						<img src="user/<?php echo $row['uimg']; ?>" alt=""><?php echo $row['name']; ?>
						<span class=" fa fa-angle-down"></span>
					  </a>
					  <ul class="dropdown-menu dropdown-usermenu pull-right">
						<li><a href="changepwd.php"> Change Password</a></li>
						<li>
						  <a href="javascript:;">
							<span class="badge bg-red pull-right">50%</span>
							<span>Settings</span>
						  </a>
						</li>
						<li><a href="javascript:;">Help</a></li>
						<li><a href="index.php"><i class="fa fa-sign-out pull-right"></i> Log Out</a></li>
					  </ul>
					</li>


		

				
					<li role="presentation" class="dropdown">
					  <a href="javascript:;"  title="Empployee Management" class="dropdown-toggle info-number" data-toggle="dropdown" aria-expanded="false">
						<i class="fa fa-group"></i>
						<span class="badge bg-orange">*</span>
					  </a>
					  <ul id="menu1" class="dropdown-menu list-unstyled msg_list" role="menu">
					   <li>
												<a href="eatt.php">
													<i class="fa fa-users success"></i> EMP ATT
												</a>
											</li>
											<li>
												<a href="lapply.php">
													<i class="fa fa-users success"></i> Leave Apply
												</a>
											</li>
										   <li>
												<a href="salary.php">
													<i class="fa fa-inr success"></i> SALARY
												</a>
											</li>
											 <li>
												<a href="empreport.php">
													<i class="fa fa-edit success"></i> Report
												</a>
											</li>
											 <li>
												<a href="newemp.php">
													<i class="fa fa-male warning"></i> New EMPLOYEE
												</a>
											</li>
					  </ul>
					</li>
				<li role="presentation" class="dropdown">
					  <a href="javascript:;"  title="Veicle Management" class="dropdown-toggle info-number" data-toggle="dropdown" aria-expanded="false">
						<i class="fa fa-car"></i>
						<span class="badge bg-green">*</span>
					  </a>
					  <ul id="menu1" class="dropdown-menu list-unstyled msg_list" role="menu">
					  
					   <li> <a href="vehicle1.php">
													<i class="fa fa-truck success"></i> Log Entry
												</a>
											</li>
										   <li>
												<a href="vehreport.php">
													<i class="fa fa-truck success"></i> Car REPORT
												</a>
											</li>
											 <li>
												<a href="vehreport2.php">
													<i class="fa fa-truck success"></i> Log REPORT
												</a>
											</li>
											 <li>
												<a href="vdebit.php">
													<i class="fa fa-truck success"></i> Car DEBIT
												</a>
											</li>
											 <li>
												<a href="vehicle.php">
													<i class="fa fa-truck warning"></i> New Vehicle Entry
												</a>
											</li> 
					   
				   
					  </ul>
					</li>
						<li role="presentation" class="dropdown">
					  <a href="javascript:;"  title="Task Management" class="dropdown-toggle info-number" data-toggle="dropdown" aria-expanded="false">
						<i class="fa fa-bell"></i>
						<span class="badge bg-blue">*</span>
					  </a>
					  <ul id="menu1" class="dropdown-menu list-unstyled msg_list" role="menu">
					  
					   <li> <a href="task.php">
													<i class="fa fa-bell success"></i> Create Task
												</a>
											</li>
										   <li>
												 <a href="mytask.php">
													<i class="fa fa-bell success"></i> My Task
												</a>
											</li>
											 <li>
												 <a href="stask.php">
													<i class="fa fa-bell success"></i> Staff Wise Task
												</a>
											</li>
											 <li>
												 <a href="ctask.php">
													<i class="fa fa-bell success"></i> Comp Wise Task
												</a>
											</li>
											 <li>
											 <a href="mytask.php">
													<i class="fa fa-bell success"></i> Todays Tasks
												</a>
											</li>
											 <li>
												 <a href="memo.php">
													<i class="fa fa-clock-o warning"></i> Memo
												</a>
											</li> 
					   
				   
					  </ul>
					</li>
				   
					</li><center><h1><font color="blue" font="Arial Black"> <b><?PHP echo $mfin; ?></font></h1></b></center>
				  </ul>
				
				</nav>
			  </div>
			</div>
			<!-- /top navigation -->

<div class="right_col" role="main">
            <div class="row">
                 <!-- page header -->
                <div class="col-lg-12">
                    <h1 class="page-header">Schedule SMS</h1>
                </div>
                <!--end page header -->
            </div>
            <div class="row">
                <div class="col-lg-12">
                    <!-- Form Elements -->
					 <!-- Form Elements -->
                    <div class="panel panel-default">
                        <div class="panel-heading">
                            Vehicle Loan
                        </div>
                        <div class="panel-body">
                            <div class="row">
  
 
    <?php
												   $sts2 ="Active";
					 $ii = date('D');
  $stime=$stime;
					  $iii=23000;
					  $mfin="SENTHOOR MOTOR FINANCE";
  $qry2 = "SELECT * FROM customerdetails where mfin='$mfin' && dd=$ii && status='Active' order by id desc";
	  $rs = mysql_query($qry2);
	  // Loop the recordset $rs
	// Each row will be made into an array ($row) using mysql_fetch_array
while($row = mysql_fetch_array($rs)) {
	$x = $row['hpl'];
	
	$tottt = 0; $caa = 0; $fine55 = 0; $hlbal = 0;
	$spdd= 0; $spdue = 0; $spff = 0; $spfine = 0;
	$sppp = 0; $less = 0; $sppdue = 0;
	$spfine = 0; $spddd = 0;
$spdd = 0; $spdue = 0;
$spff = 0;
$sphl = 0;
		
		$hpl = $row['hpl'];
		$hpdate = $row['hpdate'];
			$vno = $row['vno'];
			$dd = $row['dd'];
			$pno = $row['pno'];
			$vname = $row['vname'];
			$model = $row['model'];
			$area = $row['area'];
			$name = $row['name'];
			
  $rrno2 = 0;
  $mfin = $mfin;
  $aaa = mysql_query("select * from bad where hpl='$hpl' && mfin='$mfin'");
  $an = mysql_num_rows($aaa);
  $aaa1 = mysql_query("select * from sizzing where hpl='$hpl' && mfin='$mfin'");
  $an1 = mysql_num_rows($aaa1);
  if(($an==0)&&($an1==0)) {
$rrow44=0;$rrow45=0;
										
									$sql = "SELECT SUM(hpamount) FROM customerdetails where mfin='$mfin' &&  hpl='$hpl'";
                                    $q = mysql_query($sql);
                                    $row52 = mysql_fetch_array($q);	
                                    $rrow44 = $row52[0] + $rrow44;								
									
									$sql = "SELECT SUM(pass) FROM user where mfin='$mfin' &&  hpl='$hpl'";
                                    $q = mysql_query($sql);
                                    $row53 = mysql_fetch_array($q);	
                                    $rrow45 = $row53[0] + $rrow45;																			
									
									
									 $rrow445= $rrow44 - $rrow45;  $rrno2 = 0;
$qry5=mysql_query("select * from user ORDER BY id DESC");
$n5=mysql_num_rows($qry5);
$row5=mysql_fetch_array($qry5);
											
$qry=mysql_query("select * from user where mfin='$mfin' && hpl='$hpl' ORDER BY fid DESC");
						$n=mysql_num_rows($qry);
						
						if($n==0)
						{
							$sss = 0;
						}
						else
					    {
						$row=mysql_fetch_array($qry);
						$lddate = $row['paydate'];
						$sss = $row['bal'];
						$newsss = $row['bal'];
						
						}
$sql1 = "select sum(paymnt) from user where mfin='$mfin' &&  hpl='$hpl'";
$qt = mysql_query($sql1);
$row1 = mysql_fetch_array($qt);
$sql5=$row1[0];
$sql6=$sql5 + 1;
$nuserpay = $sql5;
$hlbal20 = 0;
$sql155 = "select sum(actamt2) from hloan where mfin='$mfin' && type!='COLLECTION' && hpl='$hpl'";
$qt55 = mysql_query($sql155);
$row155 = mysql_fetch_array($qt55); 
	$hlbal20= $row155[0]; 
$sql155 = "select sum(postamt2) from otherentry where mfin='$mfin' &&  hpl='$hpl'";
$qt55 = mysql_query($sql155);
$row155 = mysql_fetch_array($qt55);
$hlbal2=$row155[0];

$sql1551 = "select sum(hlamt) from customerdetails where mfin='$mfin' &&  hpl='$hpl'";
$qt551 = mysql_query($sql1551);
$row1551 = mysql_fetch_array($qt551);
$hlbal1=$row1551[0];

$sql1552 = "select sum(hloan) from user where mfin='$mfin' &&  hpl='$hpl'";
$qt552 = mysql_query($sql1552);
$row1552 = mysql_fetch_array($qt552);
$hlbal3=$row1552[0];
$hlbal = $hlbal20 + $hlbal2 - $hlbal1 - $hlbal3;

 $noo = 0; $less = 0; $spdue= 0 ; $spfine = 0; $spdd = 0;
			$ttp = 0;	$tti = 0; $ttdue = 0;	$ttdd = 0;	$ttfine = 0;	$ttpf = 0;	$tthl = 0;	
				$tttot = 0;	
				$qdue = 0; $qdue25 = 0;
			$ttp = 0;	$tti  = 0; $ttdue = 0;	$ttdd = 0;	$ttfine = 0;	$ttpf = 0;	$tthl = 0;	
				$tttot = 0;	$dmm = 0; $sts = 0;
						$qry=mysql_query("select * from customerdetails where mfin='$mfin' &&  hpl='$hpl'");			
$row = mysql_fetch_array($qry);
	   $duedat = str_replace('/', '-', $row['hpdate']);
						$pp = $row['duemnt'];
						$addr = $row['address'];
			$damt = $row['total'];		
$intt = $row['inter'];
$intt2 = $row['interest'];
$prin = $row['dueamt'];			
$pno = $row['pno'];	
$cobpno = $row['cobpno'];	
	$defamt2 = $row['defamt'];	
	$defamt = (($damt*$defamt2)/100)/30;	
  $d1 = strtotime($duedat);
$d2 = strtotime("today");
$min_date = min($d1, $d2);
$max_date = max($d1, $d2);

if($iii>$pp)
{ $iii=$pp; }
$rc = $iii - $sql5 ;
$sql9 = $sql5 + $rc ; $vv = 1; $ii = 0;
 
$qry5=mysql_query("select * from user where mfin='$mfin' && hpl='$hpl' order by paydate2 asc");			
while($row5 = mysql_fetch_array($qry5)) { $rr = 0;
$duemnt = $row5['paymnt'];
$rcptno = $row5['roll'];
$fidd = $row5['fid'];
$gi = 0;
$rno1 = $row5['rno'];
$rno = $rno1/$duemnt;
$pass1 = $row5['pass'];
$pday = $row5['paydate'];
$pass = $pass1/$duemnt;
$urname1 = $row5['urname'];
$hloan = $row5['hloan'];
$fine1 = $row5['fine'];
$urname = ($urname1 - $hloan - $fine1) /$duemnt;
$dmm = $urname1 - $hloan - $fine1;
$ff55 = 0;
while($dmm>0) { $gi++; $rr++;
if($ff55 == 0){
	$fine18 = $fine1;
	$hloan8 = $hloan;
}
else {
	$fine18 = 0;
	$hloan8 = 0;
}
$ff55++;
if($sts==0) {
if($dmm>$damt){
	$sts = 1; $less = 0;
	$pamt = $damt;
	$noo++;
}
elseif($dmm==$damt){
	$sts = 0; $less = 0;
	$pamt = $damt;
	$noo++;
}
else{
	$sts = 2;
	$pamt = $dmm;
	$less = $damt - $dmm;
}
$ii++;
$selected_date=$duedat;
		  	$selected_date=strtotime( $selected_date );
			$mysqldate = date( 'd-m-Y', $selected_date );
			$month = date( 'm', $selected_date );
			$day = date( 'd', $selected_date );
			$yyyy = date( 'Y', $selected_date );
if((($day==30)&&($month==01)) || (($day==29)&&($month==01)) || (($day==31)&&($month==01)))	
{
$duedat = "28-02-".$yyyy;
}
else {	
$duedat = date("d-m-Y", strtotime("$duedat + " . 1 . " month"));
}
$pday = $row5['paydate'];


  $d11 = strtotime($duedat);
$d22 = strtotime($pday);
$min_date1 = min($d11, $d22);
$max_date1 = max($d11, $d22);
$i6 = 0;
if($d11<=$d22) {
while (($min_date1 = strtotime("+1 DAY", $min_date1)) <= $max_date1) {
    $i6++;
}
}
if($i6 <= 3){
    
$fine2 = 0;
} else {
$fine2 = (($defamt/$damt)*($i6 * $pamt)); }
if($fine2 < 0) {
	$fine2 = 0;
}
 $dmm = $dmm - $pamt;
$spfine = $spfine + $fine2;
$spdd = $spdd + $i6; $spdue = $spdue + $pamt;
$spff = $spff + $fine18;
$sphl = $sphl + $hloan8;
 } 

elseif($sts == 1) {
	if($dmm>$damt){
	$sts = 1; $less = 0;
	$pamt = $damt;
	$noo++;
}
elseif($dmm==$damt){
	$sts = 0; $less = 0;
	$pamt = $damt;
	$noo++;
}
else{
	$sts = 2;
	$pamt = $dmm;
	$less = $damt - $dmm;
} $ii++; 
$selected_date=$duedat;
		  	$selected_date=strtotime( $selected_date );
			$mysqldate = date( 'd-m-Y', $selected_date );
			$month = date( 'm', $selected_date );
			$day = date( 'd', $selected_date );
			$yyyy = date( 'Y', $selected_date );
if((($day==30)&&($month==01)) || (($day==29)&&($month==01)) || (($day==31)&&($month==01)))	
{
$duedat = "28-02-".$yyyy;
}
else {	
$duedat = date("d-m-Y", strtotime("$duedat + " . 1 . " month"));
}



  $d11 = strtotime($duedat);
$d22 = strtotime($pday);
$min_date1 = min($d11, $d22);
$max_date1 = max($d11, $d22);
$i6 = 0;
if($d11<=$d22) {
while (($min_date1 = strtotime("+1 DAY", $min_date1)) <= $max_date1) {
    $i6++;
}
}
if($i6 <= 3){
    
$fine2 = 0;
} else {
$fine2 = (($defamt/$damt)*($i6 * $pamt)); }
if($fine2 < 0) {
	$fine2 = 0;
}  $dmm = $dmm - $pamt;
$spfine = $spfine + $fine2;
$spdd = $spdd + $i6; $spdue = $spdue + $pamt;
$spff = $spff + $fine18;
$sphl = $sphl + $hloan8;
 } 
else { 
  $d11 = strtotime($duedat);
$d22 = strtotime($pday);
$min_date1 = min($d11, $d22);
$max_date1 = max($d11, $d22);
$i6 = 0;
if($d11<=$d22) {
while (($min_date1 = strtotime("+1 DAY", $min_date1)) <= $max_date1) {
    $i6++;
}
}
if($i6 < 3){
    
$fine2 = 0;
} else {
$fine2 = (($defamt/$damt)*($i6 * $less));
 }
if($fine2 < 0) {
	$fine2 = 0;
}
if($less>$dmm){
$dmm2 = $less - $dmm; $noo++;
$less2 = $less  - $dmm2; 
$spdue = $spdue + $less;
$dmm = 0;
if($dmm>$damt){
	$sts = 1;
	$less = 0;
	$pamt = $damt;
	$noo++;
}
elseif($dmm==$damt){
	$sts = 0; $less = 0;
	$pamt = $damt;
	$noo++;
}
else{
	
	$sts = 2;
	$pamt = $less2;
	$less = $dmm2;
}
$pamt = $less2;	
}
else{
$dmm = $dmm - $less; $noo++;
$spdue = $spdue + $less;
if($dmm>$damt){
	$sts = 1;
	$less = 0;
	$pamt = $damt;
	$noo++;
}
elseif($dmm==$damt){
	$sts = 0; $less = 0;
	$pamt = $damt;
	$noo++;
}
else{
	
	$sts = 0;
	$pamt = $dmm;
	$less = 0;
}
$pamt = $dmm; }
 $dmm = $dmm;
$spfine = $spfine + $fine2;
$spdd = $spdd + $i6; $spff = $spff + $fine18;  
$sphl = $sphl + $hloan8;
 }  
$ttp = $ttp + $pass; $tti = $tti + $rno; $ttdue = $ttdue + $urname;	$ttdd = $ttdd + $i6;	
$ttfine = $ttfine + $fine2;	
$ttpf = $fine1 + $ttpf;	$tthl = $tthl + $hloan;	$tttot = $tttot + $urname1;
				
} } 

$qry51=mysql_query("select * from net where mfin='$mfin' &&  hpl='$hpl'");
					$n51=mysql_num_rows($qry51);
					$row51 = mysql_fetch_array($qry51);
					if($n51>0){  $ttt = $row51['tot'];  $spdue = $spdue + $ttt;	}
else { 
if($less > 0){
	$tday = date('d-m-Y');
  $d11 = strtotime($duedat);
  $duedatles = $duedat;
$d22 = strtotime($tday);
$min_date1 = min($d11, $d22);
$max_date1 = max($d11, $d22);
$i6 = 0;
if($d11<=$d22) {
while (($min_date1 = strtotime("+1 DAY", $min_date1)) <= $max_date1) {
    $i6++;
}
}
if($i6 < 3){
    
$fine2 = 0;
} else {
$fine2 = (($defamt/$damt)*($i6 * $less));
 }
if($fine2 < 0) {
	$fine2 = 0;
}

$dmm = 0;	
$spfine = $spfine + $fine2;
$spdd = $spdd + $i6;
$sppp = $sppp + $less;
}
$iiii = $ii;
$ii++; $ni = 0;
while($ii<=$pp) {
	 $duedat = date("d-m-Y", strtotime("$duedat + " . 1 . " month")); 
  $d11 = strtotime($duedat);
$d22 = strtotime("today");
$min_date1 = min($d11, $d22);
$max_date1 = max($d11, $d22);
$i6 = 0;
if($d11<=$d22) {
while (($min_date1 = strtotime("+1 DAY", $min_date1)) <= $max_date1) {
    $i6++;
} }

if($i6 <= 3){
    
$fine2 = 0;
} else {
$fine2 = $defamt * $i6; }
if($fine2 < 0) {
	$fine2 = 0;
} $ii++; 
$ttdd = $ttdd + $i6;	
$ttfine = $ttfine + $fine2;	
$spfine = $spfine + $fine2;
$spdd = $spdd + $i6;
if($i6>0){
	$ni++;
	$sppdue = $sppdue + $damt;
}
} }
$fine55 = $spfine - $spff;
  $d119 = strtotime($duedatles);
$d229 = strtotime("today");
if($d119>=$d229){
	$spddd = $sppdue;
}
else {
$spddd = $less + $sppdue;
if($less>0){
$iiii = $iiii - 1;
$ni = $ni + 1;
    
}
}
	 $tottt = 0;
 $caa = round($fine55,0); 
 $tottt = ($spddd *1) + ($caa * 1) + ($hlbal * 1); 
  $d111 = strtotime($duedat);
$d222 = strtotime("today");
if($d111<=$d222){
	$star = "*";
}
else{
	$star = NULL;
}
 if($tottt>0){
     $sql44 = mysql_query("select * from pending where hpl='$hpl' && mfin='$mfin'");
     $n447 = mysql_num_rows($sql44);
     $row44 = mysql_fetch_array($sql44);
     if($n447>0){
         $delete2=mysql_query("delete from pending where mfin='$mfin' && hpl='$hpl'");
         	$insert=mysql_query("insert into pending(mfin,hpl,vno,vname,model,lddate,hpdate,duemnt,paymnt,dueamt,hlbal,penamt,pendmnt,hloan,fname,area,defamt,pno,cobpno,dd,star)
											 values('$mfin','$hpl','$vno','$vname','$model','$lddate','$hpdate','$duemnt','$iiii','$damt','$hlbal','$tottt','$ni','$hlbal','$name','$area','$fine55','$pno','$cobpno','$dd','$star')");
								
         
     }
     else{
         $insert=mysql_query("insert into pending(mfin,hpl,vno,vname,model,lddate,hpdate,duemnt,paymnt,dueamt,hlbal,penamt,pendmnt,hloan,fname,area,defamt,pno,cobpno,dd,star)
values('$mfin','$hpl','$vno','$vname','$model','$lddate','$hpdate','$duemnt','$iiii','$damt','$hlbal','$tottt','$ni','$hlbal','$name','$area','$fine55','$pno','$cobpno','$dd','$star')");
	 }
 ?>
	
								<?php } }  }
							

 ?>
			
				</tbody></table>
 </div></div>
 
 
</div>
</div></div>
</div><?php include "layouts/footer.php"; ?></body></html>