<?php
include('db_connection.php');
$Mainclass=new DB_Controller();
//$Mainclass->Check_Login();

$sql="select max(SLN) as SLN from gold_indent_master";
	$result= mysqli_query($Mainclass->dbh,$sql);
	$row=mysqli_fetch_array($result);
	if($row['SLN']==0)
	{	
		$Order_No="INO/00001";
	}
	else
	{
		$NewSLN=$row['SLN']+1;
		
		$NewCode=sprintf("%05d", $NewSLN);
		
		 
		$Order_No="INO/".$NewCode;
	}
	
	 $InnserIndentMast="insert into gold_indent_master(Order_No,Indent_No,Dealer_Code,Indent_Date,Created_By,Status,Consignment_Stn)values('".$Order_No."','".$_REQUEST['Indent_No']."', '".$_REQUEST['dealer']."','".date('Y-m-d')."','".$_COOKIE['User_Name']."','Processing','".$_REQUEST['Consignment_Stn']."')";
	 mysqli_query($Mainclass->dbh,$InnserIndentMast);	
	 
echo $Order_No;
?>