<?php
require_once("../include/config.php");
require_once("../include/startup.php");
$obj1  = new Company();

if($G_memberid > 0)
{
	//echo "<pre>";
	//print_r($_POST);
	//die();
	
	$memberid = $G_memberid;
	$companyname = sanitize($_POST['opt'],SQL);
	$membercompanyid = sanitize($_POST['newmembercompanyid'],SQL);
	//echo $memberid;
	//echo $companyname;
	//echo $membercompanyid;
	//die();
	//$memberuserscompanyid = $G_memberuserscompanyid;
	//$membercompanyid= $G_membercompanyid;

	$companyid						= intval($_GET['companyid']);
//echo $companyid;
	//die();
	$sql = "select * from user_company  DESC limit 0,1 ";
	$sqllist = $obj1->getCompany('','',$sql);
	if(is_array($sqllist))
	{
		$rowcount = count($sqllist);
	}
	session::add_param('companyid',$companyid);
	$G_companyid				= 	session::get_param('companyid');
	//echo $G_membercompanyidincoice;
	//die();
 if($G_companyid)
		 		{
					//echo"<script> alert('Invoice is completed');setTimeout(function() { window.location = 'viewInvoice.php'; } ); </script>";
					$redirect_url = DOC_ROOT."admin/index.php";
					header("Location: $redirect_url");
					exit;
				 }
	//require_once("index.php");
}
?>