<?php
include("../../validate.php");
$statusID=$_POST['statusID'];

$query="SELECT reference FROM ".$prefix2."order_vat_challan WHERE status='$statusID' ORDER BY id DESC LIMIT 0 , 1";
$patientType=mysqli_query($linkid,$query);
$getid=mysqli_fetch_row($patientType);

$extractData=explode("/",$getid[0]);
$getData=$extractData[1];
$referenceid=$getData+1;
$zerofill = 5;
$dataid= str_pad($referenceid, $zerofill, '0', STR_PAD_LEFT); // 0000000123
echo $dataid;
?>
