<?php 
 // echo @$_GET['msg'];
 //  session_start();
 //  if(isset($_SESSION['userId'])){ 
  	// If Debit Amount
if(isset($_POST['dated'])){
extract($_POST);

require 'connection.php';

  $qry = "SELECT max(vno) as vno FROM voucher where dated = '$dated'";
   $run = mysqli_query($connect, $qry) or die(mysqli_error($connect));
   $row = mysqli_fetch_array($run);
	echo $row['vno']+1;

}
// }

// else
// {
// header('location: index.php');
// }
 ?>
