<?php 
include '../Admin_config/connection.php';

if (isset($_POST["query"])) 
{

	$sql= "SELECT `sr_id` AS `max_rc` FROM `sc_receipt` WHERE `rc_type`='GST'  ORDER BY `sr_id` DESC LIMIT 1";
	$result=mysqli_query($conn,$sql);
	$row = mysqli_fetch_assoc($result);
// 	$temp = explode('/', $row['max_rc']);
// 	$getId = end($temp);
	$newId = $row['max_rc'] + 1;

// 	if ($incId < 100000) {
// 		$newId = "RC-GST/00000".$incId;
// 	}else{
// 		$newId = "RC-GST/".$incId;
// 	}

	echo ($newId);
}

?>