<?php

//require "config/configDB.php"; 

$sqlVehicleQuery = mysqli_query($conn,"SELECT id, vehicleno  FROM vehicle_master WHERE isdelete=1");

$sqlVehicleNo = '';
//$prow = mysqli_fetch_array($sqlBrandQuery,MYSQLI_NUM))
while($prow = mysqli_fetch_array($sqlVehicleQuery)){

    $sqlVehicleNo =$sqlVehicleNo."<option value='".$prow['id']."'>".$prow['vehicleno']."</option>";

}

$sqlVehicleQuerya = mysqli_query($conn,"SELECT id, ename  FROM employee_master WHERE isdelete=1");

$sqldrivername = '';
//$prow = mysqli_fetch_array($sqlBrandQuery,MYSQLI_NUM))
while($prowa = mysqli_fetch_array($sqlVehicleQuerya)){

    $sqldrivername =$sqldrivername."<option value='".$prowa['id']."'>".$prowa['ename']."</option>";

}


$sqlinchargeQuerya = mysqli_query($conn,"SELECT id, ename  FROM employee_master WHERE isdelete=1");

$sqlinchargename = '';
//$prow = mysqli_fetch_array($sqlBrandQuery,MYSQLI_NUM))
while($prows = mysqli_fetch_array($sqlinchargeQuerya)){

    $sqlinchargename =$sqlinchargename."<option value='".$prows['id']."'>".$prows['ename']."</option>";

}


$sqlAStockQuery = mysqli_query($conn,"SELECT sum(litres) as astock   FROM purchase_dieselinvoice WHERE isdelete=1 and status='' ");
$AStockrow = mysqli_fetch_array($sqlAStockQuery,MYSQLI_ASSOC);

$sqlinternalstockQuery = mysqli_query($conn,"SELECT sum(litres) as iastock   FROM internalpro_diesel WHERE isdelete=1 ");
$internalstockrow = mysqli_fetch_array($sqlinternalstockQuery,MYSQLI_ASSOC);


$sqlinternalunfillstockQuery = mysqli_query($conn,"SELECT sum(litres) as iaunfillstock   FROM internalunfillpro_diesel WHERE isdelete=1 ");
$internalunfillstockrow = mysqli_fetch_array($sqlinternalunfillstockQuery,MYSQLI_ASSOC);

$stk=$internalstockrow['iastock']+$internalunfillstockrow['iaunfillstock'];

$AStock =($AStockrow['astock']-$stk);


$accountyear        = $financialYearStart."-".$financialYearEnd;
$sql_InvoiceQuery   = mysqli_query($conn,"SELECT count(*) as invoice FROM internalpro_diesel ");
$rowInvoiceCount    = mysqli_fetch_array($sql_InvoiceQuery,MYSQLI_ASSOC);
$invoice_count      = $rowInvoiceCount['invoice']+1;


?>