<?php
require_once("../include/config.php");
require_once("../include/startup.php");
	
	if($G_memberid > 0)
	{
	
		$memberid = $G_memberid;
		$obj  = new Company();
	
		$sql = "select * from mstmember x
				  inner join trninvoicetomember_frquotation a on x.memberid = a.memberid 
				  inner join trninvoicetomemberdetails_frquotation b on a.memberinvoicesid = b.memberinvoicesid
				  where x.memberid = $memberid and quotes_proforma_invoice = 0 group by a.memberinvoicesid";
	/*	echo $sql = "select a.memberinvoicesid,a.billed_membercompanyid,a.billing_membercompanyid,a.invoiceno,a.InvoiceTotalAmount,a.invoicedate,a.duedate,a.billed_membername,c.TotalAmount from mstmember x
				  inner join trninvoicetomember_frquotation a on x.memberid = a.memberid 
				  inner join trninvoicetomemberdetails_frquotation b on a.memberinvoicesid = b.memberinvoicesid
				  left join user_company_payment_header  c on a.memberinvoicesid = c.memberinvoicesid
				  left join user_company_payment_detail  d on a.memberinvoicesid = d.memberinvoicesid
				  where x.memberid = $memberid and quotes_proforma_invoice = 0 group by a.memberinvoicesid";*/
		$sqllist = $obj->getCompany('','',$sql);
		if(is_array($sqllist))
		{
			$rowcount = count($sqllist);
		}
	//print_r($sqllist);
		require_once("header1.html");
		require_once("leftnav.html");
		require_once("viewQuotes1.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;
}  


	
	
?>
