<?php 
include("header.php");
//session_start();
//error_reporting(0);

include "checksession.php";



include "include/db-connect.php";

	$order_id=$_REQUEST['order_id'];
	
	
	$setqqqqoooo=mysql_query("select * from invoice_no order by id desc");
  	$fetqqqqoooo=mysql_fetch_array($setqqqqoooo);
  	$id=$fetqqqqoooo['id'];
	$iddd=$id+1;
	
	$invc="INV00".$iddd;
	
	$date=date("d-m-Y");
	
	
	$insert=mysql_query("insert into invoice_no(invno,order_id,date) values('$invc','$order_id','$date')");
		
			
	 header("Location:invoice_gen.php?oid=$order_id");
 ?>
<script>
window.location='invoice_gen.php?oid=<?php echo $order_id;?>';
</script>