<?php include "layouts/menu.php"; ?>
<style>
.count{
    position: relative;
    margin: 0 0 0 10px;
    z-index: 5;
    padding: 0;
    color: white;
    font-weight: 1100;
}
.icon
{
    color: white;

}
</style>
<?php
	$qry=mysqli_query($conn, "select * from customerdetails where mfin='$mfin' && status='Active'");
						$n=mysqli_num_rows($qry);
						$qry343=mysqli_query($conn, "select * from moncust where mfin='$mfin'");
						$n343=mysqli_num_rows($qry343);
							$fqry343=mysqli_query($conn, "select * from fincust where mfin='$mfin'");
						$fn343=mysqli_num_rows($fqry343);
$qry2=mysqli_query($conn, "select * from customer");
$nn=mysqli_num_rows($qry2);
	$qry3=mysqli_query($conn, "select * from customerdetails where mfin='$mfin' && status='Closed'");
						$nq=mysqli_num_rows($qry3);
						$qry3343=mysqli_query($conn, "select * from monnet where mfin='$mfin'");
						$nq343=mysqli_num_rows($qry3343);
						$fqry3343=mysqli_query($conn, "select * from finnet where mfin='$mfin'");
						$fnq343=mysqli_num_rows($fqry3343);
						$ff = $n - $nq;
						$qry4=mysqli_query($conn, "select * from net2 where mfin='$mfin'");
						$nw=mysqli_num_rows($qry4);
						$qry41=mysqli_query($conn, "select * from sizzing where mfin='$mfin'");
						$nww=mysqli_num_rows($qry41);
							$qry5=mysqli_query($conn, "select * from dc where mfin='$mfin'");
						$doc=mysqli_num_rows($qry5);
	$dataPoints = array( 
	array("label"=>"TOTAL LOANS", "y"=>$n),
	array("label"=>"ACTIVE LOANS", "y"=>$ff),
	array("label"=>"CLOSED LOANS", "y"=>$nq),
	array("label"=>"SIZZED LOANS", "y"=>$nww),
	array("label"=>"PENDING DUES", "y"=>0)
	
);

$dataPoints1 = array( 
	array("label" => "RECEIVED PRINCIPLE",  "y" => 95114 ),
	array("label" => "RECEIVED INTEREST", "y" => 50000 ),
	array("label" => "GIVEN LOAN", "isIntermediateSum" => true),
	array("label" => "SALARY", "y" => -2000 ),
	array("label" => "DEBITS",  "y" => -2206 ),
	array("label" => "RECEIVED PENALTY", "y" => 5000 ),
	array("label" => "Operating Income", "isCumulativeSum" => true ),
	array("label" => "Taxes",  "y" => -300 ),
	array("label" => "Net Income",  "isCumulativeSum" => true )
);

 ?>
<script>

window.onload = function() {
 
var chart = new CanvasJS.Chart("chartContainer", {
	theme: "dark2",
	animationEnabled: true,
	title: {
		text: "FINANCE LEDGER DIAGRAM"
	},
	data: [{
		type: "funnel",
		indexLabel: "{label} - {y}",
		yValueFormatString: "#,##0",
		showInLegend: true,
		legendText: "{label}",
		dataPoints: <?php echo json_encode($dataPoints, JSON_NUMERIC_CHECK); ?>
	}]
});
chart.render();
 

 
var chart1 = new CanvasJS.Chart("chartContainer1", {
	animationEnabled: true,
	title: {
		text: "Company Finance"
	},
	axisY: {
		title: "Amount (in INR)",
		prefix: "Rs.",
		suffix: "K",
		gridThickness: 0
	},
	data: [{
		type: "waterfall",
		risingColor: "#428CFF",
		fallingColor: "#FF8C8C",
		indexLabel: "{y}",
		indexLabelFontColor: "#292B2C",
		indexLabelFontWeight: "bolder",
		indexLabelPlacement: "inside",
		yValueFormatString: "$#,##0k",
		dataPoints: <?php echo json_encode($dataPoints1, JSON_NUMERIC_CHECK); ?>
	}]
});
chart1.render();
 
}
</script> <!-- page content -->
        <div class="right_col" role="main">
									<?php $e=0;  $s=0;  $r=0;  $t=0; $d=0; $d1=0; $i=1; $tot11 = 0; $tot22 = 0;
							$sqll = mysqli_query($conn, "select * from abc where mfin='$mfin'");
	$rowww = mysqli_fetch_array($sqll);
	$fdate = "1890-04-31";
										$fdate1 =  $rowww['date1']; 
										$tdate = $rowww['date2'];  

											$fdate1 =  $rowww['date1']; 
										$tdate = $rowww['date2'];
$qry15=mysqli_query($conn, "select sum(hpamount) from customerdetails where mfin='$mfin' && hpdate5 between '$fdate' and '$tdate'");
$row15 = mysqli_fetch_array($qry15);
$qry4415=mysqli_query($conn, "select sum(document) from customerdetails where mfin='$mfin' && hpdate5 between '$fdate' and '$tdate'");
$row4415 = mysqli_fetch_array($qry4415);
$qry45=mysqli_query($conn, "select sum(urname) from user where mfin='$mfin' &&  paydate2 between '$fdate' and '$tdate'");
$row45 = mysqli_fetch_array($qry45);
$qry4501=mysqli_query($conn, "select sum(pass) from user where mfin='$mfin' &&  paydate2 between '$fdate' and '$tdate'");
$row4501 = mysqli_fetch_array($qry4501);
$qry4502=mysqli_query($conn, "select sum(rno) from user where mfin='$mfin' &&  paydate2 between '$fdate' and '$tdate'");
$row4502 = mysqli_fetch_array($qry4502);

$qry445=mysqli_query($conn, "select sum(tot) from net where mfin='$mfin' &&  paydate2 between '$fdate' and '$tdate'");
$row445 = mysqli_fetch_array($qry445);
$qry44501=mysqli_query($conn, "select sum(amt) from net where mfin='$mfin' &&  paydate2 between '$fdate' and '$tdate'");
$row44501 = mysqli_fetch_array($qry445);
$qry44502=mysqli_query($conn, "select sum(rno) from net where mfin='$mfin' &&  paydate2 between '$fdate' and '$tdate'");
$row44502 = mysqli_fetch_array($qry445);

$qry779=mysqli_query($conn, "select sum(actamt) from hloan where mfin='$mfin' && date2 between '$fdate' and '$tdate'");
$row779 = mysqli_fetch_array($qry779);

$qry001=mysqli_query($conn, "select sum(hpamount) from fincust where mfin='$mfin' && hpdate5 between '$fdate' and '$tdate'");
$row001 = mysqli_fetch_array($qry001);
$qry002=mysqli_query($conn, "select sum(urname) from finuser where mfin='$mfin' &&  paydate2 between '$fdate' and '$tdate'");
$row002 = mysqli_fetch_array($qry002);
$qry003=mysqli_query($conn, "select sum(tot) from finnet where mfin='$mfin' &&  paydate2 between '$fdate' and '$tdate'");
$row003 = mysqli_fetch_array($qry003);


$qry145=mysqli_query($conn, "select sum(cr) from voucher where mfin='$mfin' && par='Cash A/c' && date between '$fdate' and '$tdate'");
$row145 = mysqli_fetch_array($qry145);
$qry1455=mysqli_query($conn, "select sum(dr) from voucher where mfin='$mfin' && par='Cash A/c' && date between '$fdate' and '$tdate'");
$row1455 = mysqli_fetch_array($qry1455);						$n=mysqli_num_rows($qry);



$qry0021=mysqli_query($conn, "select sum(pass) from finuser where mfin='$mfin' &&  paydate2 between '$fdate' and '$tdate'");
$row0021 = mysqli_fetch_array($qry0021);
$qry0022=mysqli_query($conn, "select sum(rno) from finuser where mfin='$mfin' &&  paydate2 between '$fdate' and '$tdate'");
$row0022 = mysqli_fetch_array($qry0022);
$qry0031=mysqli_query($conn, "select sum(dueamt) from finnet where mfin='$mfin' &&  paydate2 between '$fdate' and '$tdate'");
$row0031 = mysqli_fetch_array($qry0031);
$qry0032=mysqli_query($conn, "select sum(rno) from finnet where mfin='$mfin' &&  paydate2 between '$fdate' and '$tdate'");
$row0032 = mysqli_fetch_array($qry0032);



//Loan Liablity calc
$pass= $row0021[0] + $row0031[0];	
 $partn = $row001[0] - $pass; 

//Current lia-> Cash in Hand
$userr = $row45[0];	
$vcr = $row145[0]; 
 $vdr = $row1455[0];
 $nett = $row445[0]; 
 $fincustt = $row001[0];	
	
 $hpp = $row15[0]; 
 $finuserr = $row002[0]; 
 $finnett = $row003[0];
$doc = $row4415[0]; 
$hl = $row779[0];
$cre = $vcr+$hpp+$finuserr+$finnett+$hl;
$debb = $userr+$nett+$fincustt+$doc+$vdr;
$tot = abs($cre - $debb);

$pass2= $row4501[0] + $row44501[0];	
 $pass3 = $row15[0] - $pass2; 
 
 
$lia = $pass3;
//Capital Account Part
$sql11=mysqli_query($conn, "select sum(openbal) from ledger where mfin='$mfin' &&  under='Capital Account' && yn='Cr'");
$rrr11 = mysqli_fetch_array($sql11);
$cpp1 = $rrr11[0];

$sql1=mysqli_query($conn, "select sum(openbal) from ledger where mfin='$mfin' &&  under='Capital Account' && yn='Dr'");
$rrr1 = mysqli_fetch_array($sql1);
$cpp2 = $rrr1[0];
$banka = 0;

$sqlu = mysqli_query($conn, "select * from ledger where under='Capital Account' && mfin='$mfin'");  $capvccdr =0; $capvcccr =0;
while($rowu = mysqli_fetch_array($sqlu)){
	$ledgername = $rowu['ledger']; 
$qrya145=mysqli_query($conn, "select sum(dr) from voucher where mfin='$mfin' && vtype='Payment' && par='$ledgername' && date between '$fdate' and '$tdate'");
$rowa145 = mysqli_fetch_array($qrya145);
$qryb145=mysqli_query($conn, "select sum(cr) from voucher where mfin='$mfin' && vtype='Receipt' && par='$ledgername' && date between '$fdate' and '$tdate'");
$rowb145 = mysqli_fetch_array($qryb145);
$ff000 = $rowa145[0];

$capvccdr = $capvccdr + $rowa145[0];
$capvcccr = $capvcccr + $rowb145[0];
}

$cpp = $cpp1 - $cpp2 - $capvccdr + $capvcccr;
////	//Capital Account Part

//Curretn Assets
        $fir = 0;
$sqluu = mysqli_query($conn, "select * from ledgerg where under='Current Assets' && mfin='$mfin'");  
while($rowuu = mysqli_fetch_array($sqluu)){
		$ledg = $rowuu['ledger']; $rrf = 0;
 
$openbal = 0; $qdeb = 0; $qcre = 0;
$sqlu = mysqli_query($conn, "select * from ledger where under='$ledg' && mfin='$mfin'");   $capvccdr =0; $capvcccr =0; $fir++;
while($rowu = mysqli_fetch_array($sqlu)){
	$ledgername = $rowu['ledger'];
$openbal = $rowu['openbal'];	
$yn = $rowu['yn']; 
$ff = NULL; $led = 'Cash A/c';
$sqll = mysqli_query($conn, "select * from ledger where ledger='$led' && mfin='$mfin'");
    $roww = mysqli_fetch_array($sqll);
	$led = $roww['ledger'];
	$opening = $roww['openbal'];
$cdoc2=mysqli_query($conn, "select sum(hpamount) from customerdetails where mfin='$mfin' && pmode='$led' && hpdate5 between '$fdate' and '$tdate'");
$cdoc12 = mysqli_fetch_array($cdoc2);
$cdoc112 = $cdoc12[0];
$cdoc5=mysqli_query($conn, "select sum(chqamt) from customerdetails where mfin='$mfin' && pmode2='$led' && hpdate5 between '$fdate' and '$tdate'");
$cdoc15 = mysqli_fetch_array($cdoc5);
$cdoc115 = $cdoc15[0];
$cdoc28=mysqli_query($conn, "select sum(hpamount) from customerdetails where mfin='$mfin' && pmode!='$led' && pmode!='$ff' && hpdate5 between '$fdate' and '$tdate'");
$cdoc128 = mysqli_fetch_array($cdoc28);
$cdoc1128 = $cdoc128[0];
$pcdoc28=mysqli_query($conn, "select sum(pinter) from customerdetails where mfin='$mfin' && hpdate5 between '$fdate' and '$tdate'");
$pcdoc128 = mysqli_fetch_array($pcdoc28);
$pcdoc1128 = $pcdoc128[0];
$pcdoc282=mysqli_query($conn, "select sum(pcharge) from customerdetails where mfin='$mfin' && hpdate5 between '$fdate' and '$tdate'");
$pcdoc1282 = mysqli_fetch_array($pcdoc282);
$pcdoc11282 = $pcdoc1282[0];
$cdoc58=mysqli_query($conn, "select sum(chqamt) from customerdetails where mfin='$mfin' && pmode2!='$led' && pmode2!='$ff' && hpdate5 between '$fdate' and '$tdate'");
$cdoc158 = mysqli_fetch_array($cdoc58);
$cdoc1158 = $cdoc158[0];
$cdoc56=mysqli_query($conn, "select sum(dealeramt) from customerdetails where mfin='$mfin' && pmode='$led' && hpdate5 between '$fdate' and '$tdate'");
$cdoc156 = mysqli_fetch_array($cdoc56);
$cdoc1156 = $cdoc156[0];
$cdoc11  = $cdoc112 + $cdoc115 - $cdoc1156 - $cdoc1158;
$qry4415=mysqli_query($conn, "select sum(document) from customerdetails where mfin='$mfin' && pmode='$led' && hpdate5 between '$fdate' and '$tdate'");
$row4415 = mysqli_fetch_array($qry4415);
$qry45=mysqli_query($conn, "select sum(urname) from user where mfin='$mfin' && mode='$led' &&  paydate2 between '$fdate' and '$tdate'");
$row45 = mysqli_fetch_array($qry45);
$qry445=mysqli_query($conn, "select sum(tot) from net where mfin='$mfin' && mode='$led' &&  paydate2 between '$fdate' and '$tdate'");
$row445 = mysqli_fetch_array($qry445);
$qry779=mysqli_query($conn, "select sum(actamt2) from hloan where mfin='$mfin' && mode='$led' && date2 between '$fdate' and '$tdate'");
$row779 = mysqli_fetch_array($qry779);
$bqry4415=mysqli_query($conn, "select sum(bcommission) from customerdetails where mfin='$mfin' && hpdate5 between '$fdate' and '$tdate'");
$brow4415 = mysqli_fetch_array($bqry4415);
$qry001=mysqli_query($conn, "select sum(hpamount) from fincust where mfin='$mfin' && pmode='$led' && hpdate5 between '$fdate' and '$tdate'");
$row001 = mysqli_fetch_array($qry001);
$qry002=mysqli_query($conn, "select sum(urname) from finuser where mfin='$mfin' && mode='$led' &&  paydate2 between '$fdate' and '$tdate'");
$row002 = mysqli_fetch_array($qry002);
$qry003=mysqli_query($conn, "select sum(tot) from finnet where mfin='$mfin' && mode='$led' &&  paydate2 between '$fdate' and '$tdate'");
$row003 = mysqli_fetch_array($qry003);

$mqry001=mysqli_query($conn, "select sum(hpamount) from moncust where mfin='$mfin' && pmode='$led' && hpdate5 between '$fdate' and '$tdate'");
$mrow001 = mysqli_fetch_array($mqry001);
$mqry002=mysqli_query($conn, "select sum(urname) from monuser where mfin='$mfin' && mode='$led' &&  paydate2 between '$fdate' and '$tdate'");
$mrow002 = mysqli_fetch_array($mqry002);
$mqry003=mysqli_query($conn, "select sum(tot) from monnet where mfin='$mfin' && mode='$led' &&  paydate2 between '$fdate' and '$tdate'");
$mrow003 = mysqli_fetch_array($mqry003);


$qry145=mysqli_query($conn, "select sum(cr) from voucher where mfin='$mfin' && par='$led' &&  date between '$fdate' and '$tdate'");
$row145 = mysqli_fetch_array($qry145);
$qry1455=mysqli_query($conn, "select sum(dr) from voucher where mfin='$mfin' && par='$led' &&  date between '$fdate' and '$tdate'");
$row1455 = mysqli_fetch_array($qry1455);	
$hbcdoc581=mysqli_query($conn, "select sum(hlamt) from customerdetails where mfin='$mfin' && hpdate5 between '$fdate' and '$tdate'");
$hbcdoc1581 = mysqli_fetch_array($hbcdoc581);
$hbcdoc11581 = $hbcdoc1581[0];	
			
$userr = $row45[0];	
$vcr = $row145[0]; 
 $vdr = $row1455[0];
 $nett = $row445[0]; 
 $fincustt = $row001[0];	
  $moncustt = $mrow001[0];	
	
 $hpp = $cdoc11; 
 $finuserr = $row002[0]; 
 $finnett = $row003[0];
  $monuserr = $mrow002[0]; 
 $monnett = $mrow003[0];
$doc = $row4415[0]; 
$hl = $row779[0];
$bcom = $brow4415[0];

	$cre = $vcr+$hpp+$finuserr+$moncustt+$finnett+$hl+$bcom;
$debb = $userr+$nett+$fincustt+$monuserr+$monnett+$doc+$vdr+$hbcdoc11581+$pcdoc1128+$pcdoc11282 ;  
$qcre =  $cre;
$qdeb =  $debb;
$qdeb = $qdeb + $opening;
$qtot = $qdeb - $qcre;
$captot = $qtot;
$cassin = $qtot;
// End of Cash A/c



///////////////Bank Accounts
if($ledg == 'Bank Accounts') { $opening = 0;
$userr = 0;	$vcr = 0; $vdr = 0; $nett = 0;$qcre = 0; $qdeb = 0; $qtot = 0; $fincustt = 0; $moncustt = 0;$hpp = 0; $finuserr = 0;  $finnett = 0; $monuserr = 0; $monnett = 0; $doc = 0;  $hl = 0; $bcom = 0; $cre = 0; $debb = 0;
	$ff = NULL; $led = $ledgername;
	$sqll = mysqli_query($conn, "select * from ledger where ledger='$led' && mfin='$mfin'");
    while($roww = mysqli_fetch_array($sqll)){
	$led = $roww['ledger'];
	$opening = $roww['openbal']; 
$cdoc2=mysqli_query($conn, "select sum(hpamount) from customerdetails where mfin='$mfin' && pmode='$led' && hpdate5 between '$fdate' and '$tdate'");
$cdoc12 = mysqli_fetch_array($cdoc2);
$cdoc112 = $cdoc12[0];
$cdoc5=mysqli_query($conn, "select sum(chqamt) from customerdetails where mfin='$mfin' && pmode2='$led' && hpdate5 between '$fdate' and '$tdate'");
$cdoc15 = mysqli_fetch_array($cdoc5);
$cdoc115 = $cdoc15[0];
$cdoc28=mysqli_query($conn, "select sum(hpamount) from customerdetails where mfin='$mfin' && pmode!='$led' && pmode!='$ff' && hpdate5 between '$fdate' and '$tdate'");
$cdoc128 = mysqli_fetch_array($cdoc28);
$cdoc1128 = $cdoc128[0];
$cdoc58=mysqli_query($conn, "select sum(chqamt) from customerdetails where mfin='$mfin' && pmode2!='$led' && pmode2!='$ff' && hpdate5 between '$fdate' and '$tdate'");
$cdoc158 = mysqli_fetch_array($cdoc58);
$cdoc1158 = $cdoc158[0];
$cdoc56=mysqli_query($conn, "select sum(dealeramt) from customerdetails where mfin='$mfin' && pmode='$led' && hpdate5 between '$fdate' and '$tdate'");
$cdoc156 = mysqli_fetch_array($cdoc56);
$cdoc1156 = $cdoc156[0];
$cdoc11  = $cdoc112 + $cdoc115 - $cdoc1156 - $cdoc1158;
$qry4415=mysqli_query($conn, "select sum(document) from customerdetails where mfin='$mfin' && pmode='$led' && hpdate5 between '$fdate' and '$tdate'");
$row4415 = mysqli_fetch_array($qry4415);
$qry45=mysqli_query($conn, "select sum(urname) from user where mfin='$mfin' && mode='$led' &&  paydate2 between '$fdate' and '$tdate'");
$row45 = mysqli_fetch_array($qry45);
$qry445=mysqli_query($conn, "select sum(tot) from net where mfin='$mfin' && mode='$led' &&  paydate2 between '$fdate' and '$tdate'");
$row445 = mysqli_fetch_array($qry445);
$qry779=mysqli_query($conn, "select sum(actamt2) from hloan where mfin='$mfin' && mode='$led' && date2 between '$fdate' and '$tdate'");
$row779 = mysqli_fetch_array($qry779);
$bqry4415=mysqli_query($conn, "select sum(bcommission) from customerdetails where mfin='$mfin' && hpdate5 between '$fdate' and '$tdate'");
$brow4415 = mysqli_fetch_array($bqry4415);
$qry001=mysqli_query($conn, "select sum(hpamount) from fincust where mfin='$mfin' && pmode='$led' && hpdate5 between '$fdate' and '$tdate'");
$row001 = mysqli_fetch_array($qry001);
$qry002=mysqli_query($conn, "select sum(urname) from finuser where mfin='$mfin' && mode='$led' &&  paydate2 between '$fdate' and '$tdate'");
$row002 = mysqli_fetch_array($qry002);
$qry003=mysqli_query($conn, "select sum(tot) from finnet where mfin='$mfin' && mode='$led' &&  paydate2 between '$fdate' and '$tdate'");
$row003 = mysqli_fetch_array($qry003);

$mqry001=mysqli_query($conn, "select sum(hpamount) from moncust where mfin='$mfin' && pmode='$led' && hpdate5 between '$fdate' and '$tdate'");
$mrow001 = mysqli_fetch_array($mqry001);
$mqry002=mysqli_query($conn, "select sum(urname) from monuser where mfin='$mfin' && mode='$led' &&  paydate2 between '$fdate' and '$tdate'");
$mrow002 = mysqli_fetch_array($mqry002);
$mqry003=mysqli_query($conn, "select sum(tot) from monnet where mfin='$mfin' && mode='$led' &&  paydate2 between '$fdate' and '$tdate'");
$mrow003 = mysqli_fetch_array($mqry003);


$qry145=mysqli_query($conn, "select sum(cr) from voucher where mfin='$mfin' && par='$led' &&  date between '$fdate' and '$tdate'");
$row145 = mysqli_fetch_array($qry145);
$qry1455=mysqli_query($conn, "select sum(dr) from voucher where mfin='$mfin' && par='$led' &&  date between '$fdate' and '$tdate'");
$row1455 = mysqli_fetch_array($qry1455);	
$hbcdoc581=mysqli_query($conn, "select sum(hlamt) from customerdetails where mfin='$mfin' && pmode2!='Cash A/c' && hpdate5 between '$fdate' and '$tdate'");
$hbcdoc1581 = mysqli_fetch_array($hbcdoc581);
$hbcdoc11581 = $hbcdoc1581[0];	
			
$userr = $row45[0];	
$vcr = $row145[0]; 
 $vdr = $row1455[0];
 $nett = $row445[0]; 
 $fincustt = $row001[0];	
  $moncustt = $mrow001[0];	
	
 $hpp = $cdoc11; 
 $finuserr = $row002[0]; 
 $finnett = $row003[0];
  $monuserr = $mrow002[0]; 
 $monnett = $mrow003[0];
$doc = $row4415[0]; 
$hl = $row779[0];
$bcom = $brow4415[0];

	$cre = $vcr+$hpp+$finuserr+$moncustt+$finnett+$hl;
	$debb = $userr+$nett+$fincustt+$monuserr+$monnett+$vdr;

	$qcre = $qcre + $cre;
$qdeb = $qdeb + $debb  + $opening;
}
$qtot = $qdeb - $qcre;
$captot = $qtot;
$banka = $qtot;
}
else {	
$qrya145=mysqli_query($conn, "select sum(dr) from voucher where mfin='$mfin' && vtype='Payment' && par='$ledgername' && date between '$fdate' and '$tdate'");
$rowa145 = mysqli_fetch_array($qrya145);
$qryb145=mysqli_query($conn, "select sum(cr) from voucher where mfin='$mfin' && vtype='Receipt' && par='$ledgername' && date between '$fdate' and '$tdate'");
$rowb145 = mysqli_fetch_array($qryb145);

$capvccdr = $rowa145[0];
$capvcccr = $rowb145[0];
$captot = $openbal - $capvccdr + $capvcccr;

if($rrf == 0) {
	$curasname = $ledg;
	$captot11 = $captot;
 }
}
 } }

$sqlu = mysqli_query($conn, "select * from ledger where under='Current Assets' && mfin='$mfin'");   $capvccdr =0; $capvcccr =0; $fir++;
while($rowu = mysqli_fetch_array($sqlu)){
	$ledgername = $rowu['ledger'];
$openbal = $rowu['openbal'];	
$yn = $rowu['yn'];
	
$qrya145=mysqli_query($conn, "select sum(dr) from voucher where mfin='$mfin' && vtype='Payment' && par='$ledgername' && date between '$fdate' and '$tdate'");
$rowa145 = mysqli_fetch_array($qrya145);
$qryb145=mysqli_query($conn, "select sum(cr) from voucher where mfin='$mfin' && vtype='Receipt' && par='$ledgername' && date between '$fdate' and '$tdate'");
$rowb145 = mysqli_fetch_array($qryb145);

$capvccdr = $rowa145[0];
$capvcccr = $rowb145[0];
$captot = $openbal - $capvccdr + $capvcccr;

if($rrf == 0) {
	$curasname = $ledg;
	$captot11 = $captot;
 } 
 
} 	
//Hp Party(s)
$tdyy = date('Y-m-d');
$sdcdocd=mysqli_query($conn, "select sum(hpamount) from customerdetails where mfin='$mfin' && hpdate5='$tdyy'");
$sdcdoc1d = mysqli_fetch_array($sdcdocd);
$sdcdoc11d = $sdcdoc1d[0];
$hpparty1 = 0 + $sdcdoc11d;

$sdcdoc=mysqli_query($conn, "select sum(hpamount) from customerdetails where mfin='$mfin' && hpdate5 between '$fdate' and '$tdate'");
$sdcdoc1 = mysqli_fetch_array($sdcdoc);
$sdcdoc11 = $sdcdoc1[0];
$dsdcdoc=mysqli_query($conn, "select sum(dealeramt) from customerdetails where mfin='$mfin' && hpdate5 between '$fdate' and '$tdate'");
$dsdcdoc1 = mysqli_fetch_array($dsdcdoc);
$dsdcdoc11 = $dsdcdoc1[0];
$hppass=mysqli_query($conn, "select sum(pass) from user where mfin='$mfin' && paydate2 between '$fdate' and '$tdate'");
$hppass1 = mysqli_fetch_array($hppass);
$hppass111 = $hppass1[0];
$hppass2=mysqli_query($conn, "select sum(dueamt) from net where mfin='$mfin' && paydate2 between '$fdate' and '$tdate'");
$hppass22 = mysqli_fetch_array($hppass2);
$hppass222 = $hppass22[0];

$hpparty = $sdcdoc11 - $hppass111 - $hppass222;

$msdcdoc=mysqli_query($conn, "select sum(hpamount) from moncust where mfin='$mfin' && hpdate5 between '$fdate' and '$tdate'");
$msdcdoc1 = mysqli_fetch_array($msdcdoc);
$msdcdoc11 = $msdcdoc1[0];
$mdsdcdoc=mysqli_query($conn, "select sum(dealeramt) from moncust where mfin='$mfin' && hpdate5 between '$fdate' and '$tdate'");
$mdsdcdoc1 = mysqli_fetch_array($mdsdcdoc);
$mdsdcdoc11 = $mdsdcdoc1[0];
$mhppass=mysqli_query($conn, "select sum(pass) from monuser where mfin='$mfin' && paydate2 between '$fdate' and '$tdate'");
$mhppass1 = mysqli_fetch_array($mhppass);
$mhppass111 = $mhppass1[0];
$mhppass2=mysqli_query($conn, "select sum(dueamt) from monnet where mfin='$mfin' && paydate2 between '$fdate' and '$tdate'");
$mhppass22 = mysqli_fetch_array($mhppass2);
$mhppass222 = $mhppass22[0];

$mhpparty = $msdcdoc11 - $mhppass111 - $mhppass222;

if($rrf == 0) {
	$curasname = $ledg;
	$captot11 = $captot;
 }
//Sundry Deptor
$ssdcdoc=mysqli_query($conn, "select sum(hloan) from user where mfin='$mfin' && paydate2 between '$fdate' and '$tdate'");
$ssdcdoc1 = mysqli_fetch_array($ssdcdoc);
$ssdcdoc11 = $ssdcdoc1[0];
$cssdcdoc=mysqli_query($conn, "select sum(hlamt) from customerdetails where mfin='$mfin' && hpdate5 between '$fdate' and '$tdate'");
$cssdcdoc1 = mysqli_fetch_array($cssdcdoc);
$cssdcdoc11 = $cssdcdoc1[0];
$saddd=mysqli_query($conn, "select sum(hloan) from net where mfin='$mfin' && paydate2 between '$fdate' and '$tdate'");
$saddd1 = mysqli_fetch_array($saddd);
$saddd11 = $saddd1[0];
$hsaddd=mysqli_query($conn, "select sum(actamt2) from hloan where mfin='$mfin' && date2 between '$fdate' and '$tdate'");
$hsaddd1 = mysqli_fetch_array($hsaddd);
$hsaddd11 = $hsaddd1[0]; //fin loan int
$fissdcdoc=mysqli_query($conn, "select sum(rno) from finuser where mfin='$mfin' && paydate2 between '$fdate' and '$tdate'");
$fissdcdoc1 = mysqli_fetch_array($fissdcdoc);
$fissdcdoc11 = $fissdcdoc1[0];
$fisaddd=mysqli_query($conn, "select sum(amt) from finnet where mfin='$mfin' && paydate2 between '$fdate' and '$tdate'");
$fisaddd1 = mysqli_fetch_array($fisaddd);
$fisaddd11 = $fisaddd1[0];

$mfissdcdoc=mysqli_query($conn, "select sum(rno) from monuser where mfin='$mfin' && paydate2 between '$fdate' and '$tdate'");
$mfissdcdoc1 = mysqli_fetch_array($mfissdcdoc);
$mfissdcdoc11 = $mfissdcdoc1[0];
$mfisaddd=mysqli_query($conn, "select sum(amt) from monnet where mfin='$mfin' && paydate2 between '$fdate' and '$tdate'");
$mfisaddd1 = mysqli_fetch_array($mfisaddd);
$mfisaddd11 = $mfisaddd1[0];


$sdept = $hsaddd11 - $ssdcdoc11 - $saddd11 - $cssdcdoc11;
//echo $hsaddd11; echo "<>";   echo $ssdcdoc11; echo "<>";  echo $saddd11; echo "<>";   echo $fissdcdoc11; echo "<>";   echo $fisaddd11; echo "<>"; 

//total Current Asset
$curass = 	$cassin + $banka + $hpparty + $sdept;	


// Current Liablities // Sundery Creditors
//////////////////////////////////////////////////////////// Broker 
$bdealc = 0; $bdeald = 0; $bdealo = 0;
$sqlu = mysqli_query($conn, "select * from ledger where under='Broker' && mfin='$mfin'");   $capvccdr =0; $capvcccr =0; $fir++;
while($rowu = mysqli_fetch_array($sqlu)){
	$ledgername = $rowu['ledger'];
$openbal = $rowu['openbal'];	
$yn = $rowu['yn'];
$cass11=mysqli_query($conn, "select sum(dr) from voucher where mfin='$mfin' && par='$ledgername' && date between '$fdate' and '$tdate'");
$cass1 = mysqli_fetch_array($cass11); $casss2 = 0;
$cass22=mysqli_query($conn, "select sum(cr) from voucher where mfin='$mfin' &&  par='$ledgername' && date between '$fdate' and '$tdate'");
$cass23 = mysqli_fetch_array($cass22);

$crasdr = $cass1[0];
$crascr = $cass23[0];
$bdealo = $bdealo + $openbal;
$bdeald = $bdeald + $crasdr;
$bdealc = $bdealc + $crascr;
}
$clsdcdoc=mysqli_query($conn, "select sum(bcommission) from customerdetails where mfin='$mfin' && dealeramt<='0' && hpdate5 between '$fdate' and '$tdate'");
$clsdcdoc1 = mysqli_fetch_array($clsdcdoc);
$bclsdcdoc11 = $clsdcdoc1[0];
$brkbb = $bdealo  + $bdeald - $bdealc - $bclsdcdoc11; 
//////////////////////////////////////////////////////////// Broker 





//////////////////////////////////////////////////////////// Dealer 
$dealc = 0; $deald = 0; $dealo = 0;
$sqlu = mysqli_query($conn, "select * from ledger where under='Dealer' && mfin='$mfin'");   $capvccdr =0; $capvcccr =0; $fir++;
while($rowu = mysqli_fetch_array($sqlu)){
	$ledgername = $rowu['ledger'];
$openbal = $rowu['openbal'];	
$yn = $rowu['yn'];
$cass11=mysqli_query($conn, "select sum(dr) from voucher where mfin='$mfin' && par='$ledgername' && date between '$fdate' and '$tdate'");
$cass1 = mysqli_fetch_array($cass11); $casss2 = 0;
$cass22=mysqli_query($conn, "select sum(cr) from voucher where mfin='$mfin' &&  par='$ledgername' && date between '$fdate' and '$tdate'");
$cass23 = mysqli_fetch_array($cass22);

$crasdr = $cass1[0];
$crascr = $cass23[0];
$dealo = $dealo + $openbal;
$deald = $deald + $crasdr;
$dealc = $dealc + $crascr;
}
$clsdcdoc22=mysqli_query($conn, "select sum(dealeramt) from customerdetails where mfin='$mfin' && hpdate5 between '$fdate' and '$tdate'");
$clsdcdoc122 = mysqli_fetch_array($clsdcdoc22);
$clsdcdoc1122 = $clsdcdoc122[0]; 

$ddclsdcdoc=mysqli_query($conn, "select sum(bcommission) from customerdetails where mfin='$mfin' && dealeramt>'0' && hpdate5 between '$fdate' and '$tdate'");
$ddclsdcdoc1 = mysqli_fetch_array($ddclsdcdoc);
$ddbclsdcdoc11 = $ddclsdcdoc1[0];

$dealera = $dealo  + $deald - $dealc - $clsdcdoc1122 - $ddbclsdcdoc11; 
//////////////////////////////////////////////////////////// Dealer 



//////////////////////////////////////////////////////////// Coolection Agent 
$coldealc = 0; $coldeald = 0; $coldealo = 0; $hlcolag = 0;
$sqlu = mysqli_query($conn, "select * from ledger where under='Collection Agent' && mfin='$mfin'");   $capvccdr =0; $capvcccr =0; $fir++;
while($rowu = mysqli_fetch_array($sqlu)){
	$ledgername = $rowu['ledger'];
	if($ledgername != 'DIRECT COLLECTION') {
$openbal = $rowu['openbal'];	
$yn = $rowu['yn'];
$cass11=mysqli_query($conn, "select sum(dr) from voucher where mfin='$mfin' && par='$ledgername' && date between '$fdate' and '$tdate'");
$cass1 = mysqli_fetch_array($cass11); $casss2 = 0;
$cass22=mysqli_query($conn, "select sum(cr) from voucher where mfin='$mfin' &&  par='$ledgername' && date between '$fdate' and '$tdate'");
$cass23 = mysqli_fetch_array($cass22);


$clsdcdoc22=mysqli_query($conn, "select sum(actamt2) from hloan where mfin='$mfin' && agent='$ledgername' && mode='$ledgername' && date2 between '$fdate' and '$tdate'");
$clsdcdoc122 = mysqli_fetch_array($clsdcdoc22);
$hlcolag = $hlcolag + $clsdcdoc122[0]; 


$crasdr = $cass1[0];
$crascr = $cass23[0];
$coldealo = $dealo + $coldealo;
$coldeald = $coldeald + $crasdr;
$coldealc = $coldealc + $crascr;
	}
}

$colagent = $coldealo  + $coldeald - $coldealc - $hlcolag; 
//////////////////////////////////////////////////////////// Coolection Agent  



/////////////////////////////////////////////////////////// Direct Collection
$clsdcdoc22=mysqli_query($conn, "select sum(actamt2) from hloan where mfin='$mfin' && agent='DIRECT COLLECTION' && mode='DIRECT COLLECTION' && date2 between '$fdate' and '$tdate'");
$clsdcdoc122 = mysqli_fetch_array($clsdcdoc22);
$ddcol1 = $clsdcdoc122[0];  $ddcol2 = 0;
$ddcol = $ddcol2 - $ddcol1;
/////////////////////////////////////////////////////////// Direct Collection
$suncrec = 0; $suncred = 0;
	
	if($dealera > 0) { $suncred = $suncred + $dealera;  
 } else { $suncrec = $suncrec + abs($dealera); 
 } 
 if($brkbb > 0) { $suncred = $suncred + $brkbb;  
 } else { $suncrec = $suncrec + abs($brkbb); 
 } 
 if($colagent > 0) { $suncred = $suncred + $colagent;  
 } else { $suncrec = $suncrec + abs($colagent); 
} 
 if($ddcol > 0) { $suncred = $suncred + $ddcol;  
 } else { $suncrec = $suncrec + abs($ddcol);  } 
$curlia = abs($suncred) - abs($suncrec);
?>
						
				
						<?php 
//			 Duties & Taxes		
$tddd=mysqli_query($conn, "select sum(tds) from finuser where mfin='$mfin' && paydate2 between '$fdate' and '$tdate'");
$tdsss = mysqli_fetch_array($tddd);
$tds1 = $tdsss[0];
$tddd1=mysqli_query($conn, "select sum(tds) from finnet where mfin='$mfin' && paydate2 between '$fdate' and '$tdate'");
$tdsss1 = mysqli_fetch_array($tddd1);
$tds2 = $tdsss1[0];
$tds = $tds1 + $tds2;  $frfrfr = $curlia - $tds;
		$dincome2 = 0; $dexp2 = 0; $inexp = 0; $ddexp = 0; $ddincome = 0; $inincome = 0;

$sqlu = mysqli_query($conn, "select * from ledger where under='Direct Incomes' && mfin='$mfin'");   
$capvccdr =0; $capvcccr =0; $fir++;
while($rowu = mysqli_fetch_array($sqlu)){
$ledgername = $rowu['ledger'];
$openbal = $rowu['openbal'];	
$yn = $rowu['yn'];

$cass11=mysqli_query($conn, "select sum(dr) from voucher where mfin='$mfin' && vtype='Payment' && par='$ledgername' && date between '$fdate' and '$tdate'");
$cass1 = mysqli_fetch_array($cass11); $casss2 = 0;
$cass22=mysqli_query($conn, "select sum(cr) from voucher where mfin='$mfin' && vtype='Receipt' && par='$ledgername' && date between '$fdate' and '$tdate'");
$cass23 = mysqli_fetch_array($cass22);

$crascr = $cass1[0];
$crasdr = $cass23[0];
$ddincome = $ddincome + $openbal + $crasdr - $crascr;
$dincome2 = $dincome2 + $openbal + $crasdr - $crascr;
}
$sqlu = mysqli_query($conn, "select * from ledger where under='Indirect Incomes' && mfin='$mfin'");  
while($rowu = mysqli_fetch_array($sqlu)){
$ledgername = $rowu['ledger'];
$openbal = $rowu['openbal'];	
$yn = $rowu['yn'];

$cass11=mysqli_query($conn, "select sum(dr) from voucher where mfin='$mfin' && vtype='Payment' && par='$ledgername' && date between '$fdate' and '$tdate'");
$cass1 = mysqli_fetch_array($cass11); 
$casss2 = 0;
$cass22=mysqli_query($conn, "select sum(cr) from voucher where mfin='$mfin' && vtype='Receipt' && par='$ledgername' && date between '$fdate' and '$tdate'");
$cass23 = mysqli_fetch_array($cass22);

$crascr = $cass1[0];
$crasdr = $cass23[0];
$inincome = $inincome + $openbal + $crasdr - $crascr;
$dincome2 = $dincome2 + $openbal + $crasdr - $crascr;
}
$sdcdoc=mysqli_query($conn, "select sum(document) from customerdetails where mfin='$mfin' && hpdate5 between '$fdate' and '$tdate'");
$sdcdoc1 = mysqli_fetch_array($sdcdoc);
$sdcdoc11 = $sdcdoc1[0];
$hppass=mysqli_query($conn, "select sum(rno) from user where mfin='$mfin' && paydate2 between '$fdate' and '$tdate'");
$hppass1 = mysqli_fetch_array($hppass);
$hppass111 = $hppass1[0];
$hppass3=mysqli_query($conn, "select sum(fine) from user where mfin='$mfin' && paydate2 between '$fdate' and '$tdate'");
$hppass13 = mysqli_fetch_array($hppass3);
$hppass1113 = $hppass13[0];
$hppass2=mysqli_query($conn, "select sum(amt) from net where mfin='$mfin' && paydate2 between '$fdate' and '$tdate'");
$hppass22 = mysqli_fetch_array($hppass2);
$hppass222 = $hppass22[0];
$hppass23=mysqli_query($conn, "select sum(fine) from net where mfin='$mfin' && paydate2 between '$fdate' and '$tdate'");
$hppass223 = mysqli_fetch_array($hppass23);
$hppass2223 = $hppass223[0];

//$mpbchhqry002=mysqli_query($conn, "select sum(rno) from monuser where mfin='$mfin' &&  paydate2 between '$fdate' and '$tdate'");
//$mpbchhrow002 = mysqli_fetch_array($mpbchhqry002);
//$mpbchpartuser = $mpbchhrow002[0];
//$mpbchhqry003=mysqli_query($conn, "select sum(amt) from monnet where mfin='$mfin' &&  paydate2 between '$fdate' and '$tdate'");
//$mpbchhrow003 = mysqli_fetch_array($mpbchhqry003);
//$mpbchpartner = $mpbchhqry003[0];
///////////////////////////////////////////////////////////
//$pbchhqry001=mysqli_query($conn, "select sum(hpamount) from fincust where mfin='$mfin' && hpdate5 between '$fdate' and '$tdate'");
//$pbchhrow001 = mysqli_fetch_array($pbchhqry001);
//$pbchhpart = $pbchhrow001[0]; 
$ffine = $hppass1113 + + $hppass2223;
$intrcpt = $hppass111 + $mpbchpartuser  + $mpbchpartner + $hppass222;
$ddincome = $ddincome  + $intrcpt + $ffine;
$dincome = $dincome2 + $intrcpt + $ffine; 
 //echo $sdcdoc11;
 //// Document Charge Add OR Not $ddincome = $ddincome + $sdcdoc11 + $intrcpt + $ffine;
////////////////////////$dincome = $dincome2 + $sdcdoc11 + $intrcpt + $ffine;
//Direct Expence
$sqlu = mysqli_query($conn, "select * from ledger where under='Direct Expenses' && mfin='$mfin'");   $capvccdr =0; $capvcccr =0; $fir++;
while($rowu = mysqli_fetch_array($sqlu)){
$ledgername = $rowu['ledger'];
$openbal = $rowu['openbal'];	
$yn = $rowu['yn'];
$cass11=mysqli_query($conn, "select sum(dr) from voucher where mfin='$mfin' && vtype='Payment' && par='$ledgername' && date between '$fdate' and '$tdate'");
$cass1 = mysqli_fetch_array($cass11); $casss2 = 0;
$cass22=mysqli_query($conn, "select sum(cr) from voucher where mfin='$mfin' && vtype='Receipt' && par='$ledgername' && date between '$fdate' and '$tdate'");
$cass23 = mysqli_fetch_array($cass22);

$crascr = $cass1[0];
$crasdr = $cass23[0];
$ddexp = $ddexp + $openbal - $crasdr + $crascr;
$dexp2 = $dexp2 + $openbal - $crasdr + $crascr;
}
$sqlu = mysqli_query($conn, "select * from ledger where under='Indirect Expenses' && mfin='$mfin'");   
while($rowu = mysqli_fetch_array($sqlu)){
$ledgername = $rowu['ledger'];
$openbal = $rowu['openbal'];	
$yn = $rowu['yn'];
$cass11=mysqli_query($conn, "select sum(dr) from voucher where mfin='$mfin' && vtype='Payment' && par='$ledgername' && date between '$fdate' and '$tdate'");
$cass1 = mysqli_fetch_array($cass11); $casss2 = 0;
$cass22=mysqli_query($conn, "select sum(cr) from voucher where mfin='$mfin' && vtype='Receipt' && par='$ledgername' && date between '$fdate' and '$tdate'");
$cass23 = mysqli_fetch_array($cass22);

$crascr = $cass1[0];
$crasdr = $cass23[0];
$inexp = $inexp + $openbal - $crasdr + $crascr;
$dexp2 = $dexp2 + $openbal - $crasdr + $crascr; 
} 
$sdcdoc=mysqli_query($conn, "select sum(bcommission) from customerdetails where mfin='$mfin' && hpdate5 between '$fdate' and '$tdate'");
$sdcdoc1 = mysqli_fetch_array($sdcdoc);
$sdcdoc11 = $sdcdoc1[0];
$addd=mysqli_query($conn, "select sum(addless) from net where mfin='$mfin' && paydate2 between '$fdate' and '$tdate'");
$addd1 = mysqli_fetch_array($addd);
$addd11 = $addd1[0];
$lesss=mysqli_query($conn, "select sum(addless) from user where mfin='$mfin' && paydate2 between '$fdate' and '$tdate'");
$lesss1 = mysqli_fetch_array($lesss);
$lesss11 = $lesss1[0];

$maddd=mysqli_query($conn, "select sum(addless) from monnet where mfin='$mfin' && paydate2 between '$fdate' and '$tdate'");
$maddd1 = mysqli_fetch_array($maddd);
$maddd11 = $maddd1[0];
$mlesss=mysqli_query($conn, "select sum(addless) from monuser where mfin='$mfin' && paydate2 between '$fdate' and '$tdate'");
$mlesss1 = mysqli_fetch_array($mlesss);
$mlesss11 = $mlesss1[0];

$faddd=mysqli_query($conn, "select sum(addless) from finnet where mfin='$mfin' && paydate2 between '$fdate' and '$tdate'");
$faddd1 = mysqli_fetch_array($faddd);
$faddd11 = $faddd1[0];
$flesss=mysqli_query($conn, "select sum(addless) from finuser where mfin='$mfin' && paydate2 between '$fdate' and '$tdate'");
$flesss1 = mysqli_fetch_array($flesss);
$flesss11 = $flesss1[0];
$pbchhqry002=mysqli_query($conn, "select sum(rno) from finuser where mfin='$mfin' &&  paydate2 between '$fdate' and '$tdate'");
$pbchhrow002 = mysqli_fetch_array($pbchhqry002);
$pbchpartuser = $pbchhrow002[0];
$pbchhqry003=mysqli_query($conn, "select sum(amt) from finnet where mfin='$mfin' &&  paydate2 between '$fdate' and '$tdate'");
$pbchhrow003 = mysqli_fetch_array($pbchhqry003);
$pbchpartnet = $pbchhrow003[0]; //echo $pbchhpart; echo "asas"; echo $pbchpartuser; echo "asas"; echo $pbchpartnet;
$addles =  $faddd11 + $flesss11 - $addd11 - $lesss11 - $maddd11 - $mlesss11;
$intpaid = $pbchpartuser + $pbchpartnet;
$dexp = $dexp2  + $addles+ $intpaid;
$ddexp = $ddexp + $addles + $intpaid; 

$pcdoc28=mysqli_query($conn, "select sum(pinter) from customerdetails where mfin='$mfin' && hpdate5 between '$fdate' and '$tdate'");
$pcdoc128 = mysqli_fetch_array($pcdoc28);
$pcdoc1128 = $pcdoc128[0];
$pcdoc282=mysqli_query($conn, "select sum(pcharge) from customerdetails where mfin='$mfin' && hpdate5 between '$fdate' and '$tdate'");
$pcdoc1282 = mysqli_fetch_array($pcdoc282);
$pcdoc11282 = $pcdoc1282[0];
$dtot = $dincome - $dexp + $pcdoc1128 + $pcdoc11282;   
$ttdate = date("Y-m-d");
$qwcdoc2=mysqli_query($conn, "select sum(tot) from net where mfin='$mfin' && paydate2='$ttdate'");
$qwcdoc12 = mysqli_fetch_array($qwcdoc2);
$qwcdoc112 = $qwcdoc12[0];

$qwcdoc21=mysqli_query($conn, "select sum(amt) from net where mfin='$mfin' && paydate='$tdate'");
$qwcdoc121 = mysqli_fetch_array($qwcdoc21);
$qwcdoc1121 = $qwcdoc121[0];
$qwcdoc213=mysqli_query($conn, "select sum(pinter) from customerdetails where mfin='$mfin' && hpdate='$tdate'");
$qwcdoc1213 = mysqli_fetch_array($qwcdoc213);
$qwcdoc11213 = $qwcdoc1213[0];
$qwcdoc212=mysqli_query($conn, "select sum(rno) from user where mfin='$mfin' && paydate='$tdate'");
$qwcdoc1212 = mysqli_fetch_array($qwcdoc212);
$qwcdoc11212 = $qwcdoc1212[0];
$ftyut = $qwcdoc11212 + $qwcdoc1121 + $qwcdoc11213; 
$van11=mysqli_query($conn, "select * from abcd where mfin='$mfin'");
$van = mysqli_fetch_array($van11);
//echo $dincome; echo "<>"; echo $dexp; ?>
  <div class="row top_tiles">
  <div class="">
            <div class="row top_tiles">
              <a href="allcusa.php"> <div class="animated flipInY col-lg-3 col-md-3 col-sm-6 col-xs-12">
                <div style="background: <?php echo $van['d1']; ?>" class="tile-stats">
                  <div class="icon"><i class="fa fa-check-square-o" ></i></div>
                  <div class="count"><?php echo $n; ?></div>
                  <h3><font color="white"><b>Active Pledges</b></font></h3>
                  <p>Total</p>
                </div>
              </div></a>
                         <a href="allcusc.php">   <div class="animated flipInY col-lg-3 col-md-3 col-sm-6 col-xs-12">
                <div style="background: <?php echo $van['d3']; ?>" class="tile-stats">
                  <div class="icon"><i class="fa fa-close"></i></div>
                  <div class="count"><?php echo $nq; ?></div>
                  <h3><font color="white"><b>Closed Pledges</b></font></h3>
                  <p>Total</p>
                </div>
              </div></a>
                        <a href="allcusca.php">    <div class="animated flipInY col-lg-3 col-md-3 col-sm-6 col-xs-12">
                <div style="background: <?php echo $van['d5']; ?>" class="tile-stats">
                  <div class="icon"><i class="fa fa-sort-amount-desc"></i></div>
                  <div class="count"><?php echo $nww; ?></div>
                  <h3><font color="white"><b>Auctioned Pledges</b></font></h3>
                  <p>Total</p>
                </div>
              </div></a>
                       <a href="hpbalp.php">     <div class="animated flipInY col-lg-3 col-md-3 col-sm-6 col-xs-12">
                <div style="background: <?php echo $van['d7']; ?>" class="tile-stats">
                  <div class="icon"><i class="fa fa-hand-o-left "></"></i></div>
                  <div class="count"><?php echo $hpparty; ?></div>
                  <h3><font color="white"><b>Principal Balance</b></font></h3>
                  <p>Total</p>
                </div>
              </div></a>
         
		           <a href="bals.php">    <div class="animated flipInY col-lg-3 col-md-3 col-sm-6 col-xs-12">
                <div style="background: <?php echo $van['d9']; ?>" class="tile-stats">
                  <div class="icon"><i class="fa fa-inr"></i></div>
                  <div class="count"><?php echo $cassin; ?></div>
                  <h3><font color="white"><b>Cash in Hand</b></font></h3>
                  <p>Current</p>
                </div>
              </div> </a>
            <a href="finlview.php">   <div class="animated flipInY col-lg-3 col-md-3 col-sm-6 col-xs-12">
                <div style="background: <?php echo $van['d11']; ?>" class="tile-stats">
                  <div class="icon"><i class="fa fa-university"></i></div>
                  <div class="count"><?php echo $fn343; ?></div>
                  <h3><font color="white"><b>Re-Pledge Loans</b></font></h3>
                  <p>Total-Active</p>
                </div>
              </div> </a>
			             <a href="finlview.php">    <div class="animated flipInY col-lg-3 col-md-3 col-sm-6 col-xs-12">
                <div style="background: <?php echo $van['d13']; ?>" class="tile-stats">
                  <div class="icon"><i class="fa fa-stack-exchange"></i></div>
                  <div class="count"><?php echo $fnq343; ?></div>
                  <h3><font color="white"><b>Closed Re-Pledge</b></font></h3>
                  <p>Total-Active</p>
                </div>
              </div> </a>
			            <a href="lview.php">     <div class="animated flipInY col-lg-3 col-md-3 col-sm-6 col-xs-12">
                <div style="background: <?php echo $van['d15']; ?>" class="tile-stats">
                  <div class="icon"><i class="fa fa-check-square-o"></i></div>
                  <div class="count"><?php echo $hpparty1; ?></div>
                  <h3><font color="white"><b>Pledge Amount</b></font></h3>
                  <p>Today</p>
                </div>
              </div> </a>

		   </div>
		<?php
						 $e=0;  $s=0;  $r=0;  $t=0; $d=0; $d1=0; $i=1;
							$sqll = mysqli_query($conn, "select * from abc where mfin='$mfin'");
	$rowww = mysqli_fetch_array($sqll);
											$fdate1 =  $rowww['date1']; 
										$tdate1 =  $rowww['date2']; 
											$fdate =  date("Y-m-d", strtotime("$fdate1")); 
										$tdate =  date("Y-m-t", strtotime("$fdate"));
										$obal = 0;
	$qcre =  0;
$qdeb =  0;
				
$quser = 0;
$qnett = 0; $iii = 0;
$qdeff = 0;
$qhpp =0;
$qtot = 0;			//	   $fdate = $fdate;  $tdate = $tdate; 
								while(strtotime($fdate)<=strtotime($tdate1)) { $iii++;
					$monthh = date('F, Y', strtotime($fdate));

$qry15=mysqli_query($conn, "select sum(hpamount) from customerdetails where mfin='$mfin'  && hpdate5 between '$fdate' and '$tdate'");
$row15 = mysqli_fetch_array($qry15);
$qry4415=mysqli_query($conn, "select sum(document) from customerdetails where mfin='$mfin'  && hpdate5 between '$fdate' and '$tdate'");
$row4415 = mysqli_fetch_array($qry4415);
$qry45=mysqli_query($conn, "select sum(pass) from user where mfin='$mfin'  &&  paydate2 between '$fdate' and '$tdate'");
$row45 = mysqli_fetch_array($qry45);
$qry452=mysqli_query($conn, "select sum(rno) from user where mfin='$mfin'  &&  paydate2 between '$fdate' and '$tdate'");
$row452 = mysqli_fetch_array($qry452);
$qry445=mysqli_query($conn, "select sum(dueamt) from net where mfin='$mfin'  &&  paydate2 between '$fdate' and '$tdate'");
$row445 = mysqli_fetch_array($qry445);
$qry4451=mysqli_query($conn, "select sum(amt) from net where mfin='$mfin'  &&  paydate2 between '$fdate' and '$tdate'");
$row4451 = mysqli_fetch_array($qry4451);

$qry009=mysqli_query($conn, "select sum(fine) from net where mfin='$mfin'  &&  paydate2 between '$fdate' and '$tdate'");
$row009 = mysqli_fetch_array($qry009);
$qry0099=mysqli_query($conn, "select sum(fine) from user where mfin='$mfin'  &&  paydate2 between '$fdate' and '$tdate'");
$row0099 = mysqli_fetch_array($qry0099);

$qry779=mysqli_query($conn, "select sum(actamt) from hloan where mfin='$mfin' && date2 between '$fdate' and '$tdate'");
$row779 = mysqli_fetch_array($qry779);

$qry001=mysqli_query($conn, "select sum(hpamount) from fincust where mfin='$mfin' && hpdate5 between '$fdate' and '$tdate'");
$row001 = mysqli_fetch_array($qry001);
$qry002=mysqli_query($conn, "select sum(urname) from finuser where mfin='$mfin' &&  paydate2 between '$fdate' and '$tdate'");
$row002 = mysqli_fetch_array($qry002);
$qry003=mysqli_query($conn, "select sum(tot) from finnet where mfin='$mfin' &&  paydate2 between '$fdate' and '$tdate'");
$row003 = mysqli_fetch_array($qry003);



$userr = $row45[0] + $row445[0];	
 $nett = $row452[0] + $row4451[0]; 
  $deff = $row009[0] + $row0099[0]; 
 $hpp = $row15[0]; 
 $tot = $userr + $nett + $deff;

$quser = $quser + $userr;
$qnett = $qnett + $nett;
$qdeff = $qdeff + $deff;
$qhpp = $qhpp + $hpp;
$qtot = $qtot + $tot; 
						$totqaa[$iii] = $hpp;
						$totq[$iii] = $userr;
						$totqq[$iii] = $nett;
						$totqa[$iii] = $deff;
						
						$tott[$iii] = $monthh;
						
						$fdate =  date("Y-m-d", strtotime("$fdate + " . 1 . " month"));

						$tdate = date("Y-m-t", strtotime("$fdate"));

						}
						?>
            <div class="row">
              <div class="col-md-12">
                <div class="x_panel">
                  <div class="x_title">
                    <h2>Transaction Summary <small>Weekly progress</small></h2>
                    <div class="filter">
                      <div id="reportrange" class="pull-right" style="background: #fff; cursor: pointer; padding: 5px 10px; border: 1px solid #ccc">
                        <i class="glyphicon glyphicon-calendar fa fa-calendar"></i>
                        <span>December 30, 2014 - January 28, 2015</span> <b class="caret"></b>
                      </div>
                    </div>
                    <div class="clearfix"></div>
                  </div>
                  <div class="x_content">
                    <div class="col-md-9 col-sm-12 col-xs-12">
                     <?php

	$dataPoints1 = array(
	array("label"=>$tott[1], "y"=>$totq[1]),
	array("label"=>$tott[2], "y"=>$totq[2]),
	array("label"=>$tott[3], "y"=>$totq[3]),
	array("label"=>$tott[4], "y"=>$totq[4]),
	array("label"=>$tott[5], "y"=>$totq[5]),
	array("label"=>$tott[6], "y"=>$totq[6]),
	array("label"=>$tott[7], "y"=>$totq[7]),
	array("label"=>$tott[8], "y"=>$totq[8]),
	array("label"=>$tott[9], "y"=>$totq[9]),
	array("label"=>$tott[10], "y"=>$totq[10]),
	array("label"=>$tott[11], "y"=>$totq[11]),
	array("label"=>$tott[12], "y"=>$totq[12])
	
);

	$dataPoints2 = array(
	array("label"=>$tott[1], "y"=>$totqq[1]),
	array("label"=>$tott[2], "y"=>$totqq[2]),
	array("label"=>$tott[3], "y"=>$totqq[3]),
	array("label"=>$tott[4], "y"=>$totqq[4]),
	array("label"=>$tott[5], "y"=>$totqq[5]),
	array("label"=>$tott[6], "y"=>$totqq[6]),
	array("label"=>$tott[7], "y"=>$totqq[7]),
	array("label"=>$tott[8], "y"=>$totqq[8]),
	array("label"=>$tott[9], "y"=>$totqq[9]),
	array("label"=>$tott[10], "y"=>$totqq[10]),
	array("label"=>$tott[11], "y"=>$totqq[11]),
	array("label"=>$tott[12], "y"=>$totqq[12])
	
);

	$dataPoints3 = array(
	array("label"=>$tott[1], "y"=>$totqa[1]),
	array("label"=>$tott[2], "y"=>$totqa[2]),
	array("label"=>$tott[3], "y"=>$totqa[3]),
	array("label"=>$tott[4], "y"=>$totqa[4]),
	array("label"=>$tott[5], "y"=>$totqa[5]),
	array("label"=>$tott[6], "y"=>$totqa[6]),
	array("label"=>$tott[7], "y"=>$totqa[7]),
	array("label"=>$tott[8], "y"=>$totqa[8]),
	array("label"=>$tott[9], "y"=>$totqa[9]),
	array("label"=>$tott[10], "y"=>$totqa[10]),
	array("label"=>$tott[11], "y"=>$totqa[11]),
	array("label"=>$tott[12], "y"=>$totqa[12])
	
);
$dataPoints4 = array(
	array("label"=>$tott[1], "y"=>$totqaa[1]),
	array("label"=>$tott[2], "y"=>$totqaa[2]),
	array("label"=>$tott[3], "y"=>$totqaa[3]),
	array("label"=>$tott[4], "y"=>$totqaa[4]),
	array("label"=>$tott[5], "y"=>$totqaa[5]),
	array("label"=>$tott[6], "y"=>$totqaa[6]),
	array("label"=>$tott[7], "y"=>$totqaa[7]),
	array("label"=>$tott[8], "y"=>$totqaa[8]),
	array("label"=>$tott[9], "y"=>$totqaa[9]),
	array("label"=>$tott[10], "y"=>$totqaa[10]),
	array("label"=>$tott[11], "y"=>$totqaa[11]),
	array("label"=>$tott[12], "y"=>$totqaa[12])
	
);


 ?>
<script>
window.onload = function () {
 
var chart = new CanvasJS.Chart("chartContainer", {
	title: {
		text: "Pledge & COLLECTION REPORT"
	},
	theme: "light2",
	animationEnabled: true,
	toolTip:{
		shared: true,
		reversed: true
	},
	axisY: {
		title: "Amount In",
		suffix: " Rs"
	},
	legend: {
		cursor: "pointer",
		itemclick: toggleDataSeries
	},
	data: [
		{
			type: "stackedColumn",
			name: "Principle Received",
			showInLegend: true,
			yValueFormatString: "#,##0 Rs",
			dataPoints: <?php echo json_encode($dataPoints1, JSON_NUMERIC_CHECK); ?>
		},{
			type: "stackedColumn",
			name: "Interest Received",
			showInLegend: true,
			yValueFormatString: "#,##0 Rs",
			dataPoints: <?php echo json_encode($dataPoints2, JSON_NUMERIC_CHECK); ?>
		},{
			type: "stackedColumn",
			name: "Default Received",
			showInLegend: true,
			yValueFormatString: "#,##0 Rs",
			dataPoints: <?php echo json_encode($dataPoints3, JSON_NUMERIC_CHECK); ?>
		},{
			type: "stackedColumn",
			name: "Pledge AMOUNT GIVEN",
			showInLegend: true,
			yValueFormatString: "#,##0 Rs",
			dataPoints: <?php echo json_encode($dataPoints4, JSON_NUMERIC_CHECK); ?>
		}
	]
});
 
chart.render();
 
function toggleDataSeries(e) {
	if (typeof (e.dataSeries.visible) === "undefined" || e.dataSeries.visible) {
		e.dataSeries.visible = false;
	} else {
		e.dataSeries.visible = true;
	}
	e.chart.render();
}
 
}
</script>

<div id="chartContainer" style="height: 370px; width: 100%;"></div>
<script src="https://canvasjs.com/assets/script/canvasjs.min.js"></script>
                    <!--  <div class="tiles">
                        <div class="col-md-4 tile">
                          <span>Total Interest Income</span>
                          <h2>Rs.231,809</h2>
                          <span class="sparkline11 graph" style="height: 160px;">
                               <canvas width="200" height="60" style="display: inline-block; vertical-align: top; width: 94px; height: 30px;"></canvas>
                          </span>
                        </div>
                        <div class="col-md-4 tile">
                          <span>Total Pledege Given</span>
                          <h2>Rs.231,809</h2>
                          <span class="sparkline22 graph" style="height: 160px;">
                                <canvas width="200" height="60" style="display: inline-block; vertical-align: top; width: 94px; height: 30px;"></canvas>
                          </span>
                        </div>
                        <div class="col-md-4 tile">
                          <span>Total Pledege Release</span>
                          <h2>Rs.231,809</h2>
                          <span class="sparkline11 graph" style="height: 160px;">
                                 <canvas width="200" height="60" style="display: inline-block; vertical-align: top; width: 94px; height: 30px;"></canvas>
                          </span>
                        </div>
                      </div> -->

                    </div>

                    <div class="col-md-3 col-sm-12 col-xs-12">
                    

	   
                     
                         <a href="lview.php">     <div style="background: <?php echo $van['d17']; ?>" class="tile-stats">
                  <div class="icon"><i class="fa fa-stack-overflow"></i></div>
                  <div class="count"><?php echo $qwcdoc112; ?></div>
                  <h3><font color="white"><b>Release Amount </b></font></h3>
                  <p>Today</p>
                </div></a>
              
			 
                         <a href="billrep.php">     <div style="background: <?php echo $van['d19']; ?>" class="tile-stats">
                  <div class="icon"><i class="fa fa-check-square-o"></i></div>
                  <div class="count"><?php echo $ftyut; ?></div>
                  <h3><font color="white"><b>Interest Income</b></font></h3>
                  <p>Today</p>
                </div></a>
           
                         <a href="pnl.php">     <div style="background: <?php echo $van['d21']; ?>" class="tile-stats">
                  <div class="icon"><i class="fa fa-exclamation-triangle"></i></div>
                  <div class="count"><?php echo $dtot; ?></div>
                  <h3><font color="white"><b>Profit & Loss</b></font></h3>
                  <p>Total</p>
                </div></a>
					  
                    </div>

                  </div>
                </div>
              </div>
            </div>





       <!--     <div class="row">
              <div class="col-md-4">
                <div class="x_panel">
                  <div class="x_title">
                    <h2>Top Profiles <small>Sessions</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>
                   <ul class="list-unstyled top_profiles scroll-view">
                          <li class="media event">
                            <a class="pull-left border-aero profile_thumb">
                              <i class="fa fa-user aero"></i>
                            </a>
                            <div class="media-body">
                              <a class="title" href="#">Ms. Mary Jane</a>
                              <p><strong>$2300. </strong> Agent Avarage Sales </p>
                              <p> <small>12 Sales Today</small>
                              </p>
                            </div>
                          </li>
                          <li class="media event">
                            <a class="pull-left border-green profile_thumb">
                              <i class="fa fa-user green"></i>
                            </a>
                            <div class="media-body">
                              <a class="title" href="#">Ms. Mary Jane</a>
                              <p><strong>$2300. </strong> Agent Avarage Sales </p>
                              <p> <small>12 Sales Today</small>
                              </p>
                            </div>
                          </li>
                          <li class="media event">
                            <a class="pull-left border-blue profile_thumb">
                              <i class="fa fa-user blue"></i>
                            </a>
                            <div class="media-body">
                              <a class="title" href="#">Ms. Mary Jane</a>
                              <p><strong>$2300. </strong> Agent Avarage Sales </p>
                              <p> <small>12 Sales Today</small>
                              </p>
                            </div>
                          </li>
                          <li class="media event">
                            <a class="pull-left border-aero profile_thumb">
                              <i class="fa fa-user aero"></i>
                            </a>
                            <div class="media-body">
                              <a class="title" href="#">Ms. Mary Jane</a>
                              <p><strong>$2300. </strong> Agent Avarage Sales </p>
                              <p> <small>12 Sales Today</small>
                              </p>
                            </div>
                          </li>
                          <li class="media event">
                            <a class="pull-left border-green profile_thumb">
                              <i class="fa fa-user green"></i>
                            </a>
                            <div class="media-body">
                              <a class="title" href="#">Ms. Mary Jane</a>
                              <p><strong>$2300. </strong> Agent Avarage Sales </p>
                              <p> <small>12 Sales Today</small>
                              </p>
                            </div>
                          </li>
                        </ul>
                </div>
              </div>

              <div class="col-md-4">
                <div class="x_panel">
                  <div class="x_title">
                    <h2>Top Profiles <small>Sessions</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">
                    <article class="media event">
                      <a class="pull-left date">
                        <p class="month">April</p>
                        <p class="day">23</p>
                      </a>
                      <div class="media-body">
                        <a class="title" href="#">Item One Title</a>
                        <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
                      </div>
                    </article>
                    <article class="media event">
                      <a class="pull-left date">
                        <p class="month">April</p>
                        <p class="day">23</p>
                      </a>
                      <div class="media-body">
                        <a class="title" href="#">Item Two Title</a>
                        <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
                      </div>
                    </article>
                    <article class="media event">
                      <a class="pull-left date">
                        <p class="month">April</p>
                        <p class="day">23</p>
                      </a>
                      <div class="media-body">
                        <a class="title" href="#">Item Two Title</a>
                        <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
                      </div>
                    </article>
                    <article class="media event">
                      <a class="pull-left date">
                        <p class="month">April</p>
                        <p class="day">23</p>
                      </a>
                      <div class="media-body">
                        <a class="title" href="#">Item Two Title</a>
                        <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
                      </div>
                    </article>
                    <article class="media event">
                      <a class="pull-left date">
                        <p class="month">April</p>
                        <p class="day">23</p>
                      </a>
                      <div class="media-body">
                        <a class="title" href="#">Item Three Title</a>
                        <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
                      </div>
                    </article>
                  </div>
                </div>
              </div>

              <div class="col-md-4">
                <div class="x_panel">
                  <div class="x_title">
                    <h2>Top Profiles <small>Sessions</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">
                    <article class="media event">
                      <a class="pull-left date">
                        <p class="month">April</p>
                        <p class="day">23</p>
                      </a>
                      <div class="media-body">
                        <a class="title" href="#">Item One Title</a>
                        <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
                      </div>
                    </article>
                    <article class="media event">
                      <a class="pull-left date">
                        <p class="month">April</p>
                        <p class="day">23</p>
                      </a>
                      <div class="media-body">
                        <a class="title" href="#">Item Two Title</a>
                        <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
                      </div>
                    </article>
                    <article class="media event">
                      <a class="pull-left date">
                        <p class="month">April</p>
                        <p class="day">23</p>
                      </a>
                      <div class="media-body">
                        <a class="title" href="#">Item Two Title</a>
                        <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
                      </div>
                    </article>
                    <article class="media event">
                      <a class="pull-left date">
                        <p class="month">April</p>
                        <p class="day">23</p>
                      </a>
                      <div class="media-body">
                        <a class="title" href="#">Item Two Title</a>
                        <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
                      </div>
                    </article>
                    <article class="media event">
                      <a class="pull-left date">
                        <p class="month">April</p>
                        <p class="day">23</p>
                      </a>
                      <div class="media-body">
                        <a class="title" href="#">Item Three Title</a>
                        <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
                      </div>
                    </article>
                  </div>
                </div>
              </div>
            </div>
          </div> 
 -->
		
           

                          </div>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </div>
		
            </div>     </div>
                <!-- end of weather widget -->
              </div>
            </div>
          </div>
        </div>
        <!-- /page content -->

        <!-- footer content -->
   
  <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>
    <!-- Chart.js -->
    <script src="vendors/Chart.js/dist/Chart.min.js"></script>
    <!-- jQuery Sparklines -->
    <script src="vendors/jquery-sparkline/dist/jquery.sparkline.min.js"></script>
    <!-- Flot -->
    <script src="vendors/Flot/jquery.flot.js"></script>
    <script src="vendors/Flot/jquery.flot.pie.js"></script>
    <script src="vendors/Flot/jquery.flot.time.js"></script>
    <script src="vendors/Flot/jquery.flot.stack.js"></script>
    <script src="vendors/Flot/jquery.flot.resize.js"></script>
    <!-- Flot plugins -->
    <script src="vendors/flot.orderbars/js/jquery.flot.orderBars.js"></script>
    <script src="vendors/flot-spline/js/jquery.flot.spline.min.js"></script>
    <script src="vendors/flot.curvedlines/curvedLines.js"></script>
    <!-- DateJS -->
    <script src="vendors/DateJS/build/date.js"></script>
    <!-- bootstrap-daterangepicker -->
    <script src="vendors/moment/min/moment.min.js"></script>
    <script src="vendors/bootstrap-daterangepicker/daterangepicker.js"></script>
    
    <!-- Custom Theme Scripts -->
    <script src="build/js/custom.min.js"></script>
  </body>
</html>
