Location: PHPKode > projects > EasyFest > new/associate_addingBooth.php
<?php
include_once("include/db_connection.php");
	header("Expires: Thu, 17 May 2001 10:17:17 GMT");    // Date in the past
	header ("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); // always modified
	header ("Cache-Control: no-cache, must-revalidate");  // HTTP/1.1
	header ("Pragma: no-cache");                          // HTTP/1.0              
	session_start();
		if($_SESSION["loggedIn"] == FALSE){
		header("Location:user_login.php");
		exit;
			
	}include_once("config.php");
		$UserName=$_SESSION['UserName'];

	include('header1.php');
	$query1=mysql_fetch_array(mysql_query("select UserName FROM users WHERE Type='1' AND  UserName='$UserName'" ));
if($UserName==$query1['UserName'] ){
	 //echo $UserName;
	 include('left_user.php');}
	 else{
	
	 include('left_coord.php');
	}
	function checkRights($UserName, $module) 
{
 
  $query1 = "SELECT $module FROM rights where UserName='$UserName'";
  	$result1=mysql_query($query1);
	$row=mysql_fetch_array($result1);
	if($row[0]==1)
	{
	  return true;
	}
     else
	  return false; 

}
	if(checkRights($UserName, "Sponsorships", $EventName))
	{
	
	 
	
	//$uid = $_SESSION['ud'];
	$BoothType = $_POST['BoothType'];
	$UserName = $_SESSION['UserName'];
	$CompanyName = $_POST['CompanyName'];

	$CheckInDate = $_POST['CheckInDate'];
	$CheckOutDate = $_POST['CheckOutDate'];
	$Length = $_POST['Length'];
	$Width = $_POST['Width'];
	$Charge = $_POST['Charge'];
	$Status = $_POST['Status'];
	$AddressCompany = $_POST['AddressCompany'];
	$CompanyPhoneNo = $_POST['CompanyPhoneNo'];
	
		
		$sqlQuery = "INSERT INTO  booths(`BoothType`,`UserName`,`CompanyName`,`CheckInDate`,`CheckOutDate`,`Length`,`Width` ,`Charge` ,`Status`,`AddressCompany`,`CompanyPhoneNo`) VALUES 
('$BoothType', '$UserName', '$CompanyName', '$CheckInDate', '$CheckOutDate', '$Length' , '$Width', '$Charge', '$Status', '$AddressCompany', '$CompanyPhoneNo')";
	

$result = mysql_query($sqlQuery) or die("Invalid query: " . mysql_error() . "<br><br>". $sqlQuery);
echo "Booth information has been added";
//header("Location:indexApproval.php");	//header("Location:user_viewprof.php");
?>
<script type="text/javascript">
<!--
window.location = "associate_viewAllBooth.php";
//-->
</script>
<?php
 }
else { 
	
	?>
	 <script type="text/javascript">
<!--
window.location = "error.php";
//-->
</script>	
<?php 	}  
?>
	
Return current item: EasyFest