<?php
session_start();
// Sends the user to the login-page if not logged in
if(!isset($_SESSION['tkusernameCART'])) {
   header('Location:login.php');
   $_SESSION['msglog']="Require Login";
   $_SESSION['msgloglogin']=true;
   exit;
}
else
{
include("include/db.conn.php");
					$CARTUSERNAME=$_SESSION['tkusernameCART'];     
					$CARTTOKEN=$_SESSION['token']; 
					$ecrypt_customer_company=md5("customer");
					
					if($ecrypt_customer_company==$_SESSION['tkcompanyCART'])
					{
						$COMPANY_ID="CUSTOMER";
						if(isset($_SESSION['ONE_BACK_ID']))
						{$bk=$_SESSION['ONE_BACK_ID'];}
					}
					else
					{
						$COMPANY_ID=$_SESSION['tkcompanyCART'];
						$bk='login.php';	
					}
					$TOKEN_ID=$_GET['token_id'];
					
					if($TOKEN_ID!=$CARTTOKEN)
					{
						header("location:logout.php");
						exit;
					}
					
					$page_name=basename($_SERVER['PHP_SELF']);
}
	
			
?>