<?php
require_once("../include/config.php");
require_once("../include/startup.php");
	$invoice_obj					=	new Invoice_frquotation();
if($G_memberid > 0)
{
	
		$memberid = $G_memberid;
		 $sql_invoice = "SELECT invoiceno,invoicedate
		FROM trninvoicetomember_frquotation  
		 
				  
		ORDER BY `memberinvoicesid` DESC limit 0,1";

		$sqllist_invoice = $invoice_obj->getInvoice('',$sql_invoice);
		if(is_array($sqllist_invoice))
		{
			 $rowcount_invoice = count($sqllist_invoice);
		}

		
				 	$invoiceno  				= $sqllist_invoice[0]['invoiceno'];
				 	$invoicedate  				= $sqllist_invoice[0]['invoicedate'];
				 	
  $sql_invoice1 = "SELECT companyname,membercompanyid
		FROM user_company  a 
		ORDER BY `membercompanyid` DESC limit 0,1";

		$sqllist_invoice1 = $invoice_obj->getInvoice('',$sql_invoice1);
if(is_array($sqllist_invoice1))
		{
			 $rowcount_invoice1 = count($sqllist_invoice1);
		}

				 	$invoice_fromcompanyid  				= $sqllist_invoice1[0]['membercompanyid'];
				 	$invoice_fromcompanyname  				= $sqllist_invoice1[0]['companyname'];
		require_once("header1.html");
		require_once("leftnav.html");
		require_once("create_quotes1.html");
		require_once("footer1.html");
}
else if (!headers_sent($filename, $linenum)) 
{
				$redirect_url = DOC_ROOT."login.php";
				header("Location: $redirect_url");
    				exit;
					// You would most likely trigger an error here.
}
else 
{
				echo "Headers already sent in $filename on line $linenum\n" .
          			"Cannot redirect, for now please click this <a ";
    				exit;
}   

?>
