Location: PHPKode > projects > EasyFest > new/associate_viewSponsorItem.php
<?php 
	include_once("include/db_connection.php");
	session_start();
	if($_SESSION["loggedIn"] == FALSE){
			header("Location:admin_login.php");
				exit;
	}
	include_once("config.php");
checkLoggedIn("yes");
	
	$UserName1=$_SESSION['UserName'];

	include('header1.php');
	$query1=mysql_fetch_array(mysql_query("select UserName FROM users WHERE Type='1' AND  UserName='$UserName1'" ));
if($UserName==$query1['UserName'] ){
	 //echo $UserName;
	 include('left_user.php');}
	 else{
	
	 include('left_coord.php');
	}?>
    
    
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>view sponsor item</title>
<meta name="keywords" content="" />
<meta name="Premium Series" content="" />
<link href="default.css" rel="stylesheet" type="text/css" media="screen" />

<script language="JavaScript" src="gen_validatorv31.js" type="text/javascript"></script>

<title>Untitled Document</title>
<style type="text/css">
<!--
.style1 {
	color: #343434;
	font-size: 16px;
}
-->
</style>
</head>

<body>
<div id="wrapper">
	<!-- start page -->
	<div id="page">
    	  <!-- start content -->
        <div id="prtCnt" align="center">
		<div id="content" align="center">
		
	    <span class="style1">View Contacts</span><br>
	    <br><br>
	    
<?php
//$tbl_name2="forum_answer"; // Switch to table "forum_answer"
$UserName1 = $_SESSION['UserName'];

if(isset($_POST['EventName'])&& $_POST['EventName']!=NULL)
	{
		$EventName = $_POST['EventName'];
		
		
//$result = mysql_query($query) or die("Invalid query: " . mysql_error() . "<br><br>". $query);
		//echo "Event successfully added!!";
	

/*$sql2=mysql_query("SELECT * FROM events WHERE EventHead='$UserName'  ");
$sql3=mysql_query("SELECT * FROM events WHERE  EventAssociate='eve'");
$sql4=mysql_query("SELECT * FROM events WHERE EventCoord1='$UserName'");
//$result2=mysql_query($sql2);
$numberOfRows = MYSQL_NUM_ROWS($sql2);
$numberOfRows += MYSQL_NUM_ROWS($sql3);
$numberOfRows += MYSQL_NUM_ROWS($sql4);
if(MYSQL_NUM_ROWS($sql2)>0 && MYSQL_NUM_ROWS($sql3)<=0 && MYSQL_NUM_ROWS($sql4)<=0){}
else if(MYSQL_NUM_ROWS($sql2)<=0 && MYSQL_NUM_ROWS($sql3)>0 && MYSQL_NUM_ROWS($sql4)<=0) {$sql2=$sql3;}
else if(MYSQL_NUM_ROWS($sql2)<=0 && MYSQL_NUM_ROWS($sql3)<=0 && MYSQL_NUM_ROWS($sql4)>0) {$sql2=$sql4;}
while($numberOfRows>0){
$result3=mysql_fetch_row($sql2);
$EventName=$result3['EventName'];*/?>

<?php
$sql1="SELECT * FROM sponsorships WHERE EventName='$EventName'";
$result1=mysql_query($sql1);

$j=1;
$numberOfRows = MYSQL_NUM_ROWS($result1);
if($numberOfRows>0){?>

<table width="90%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#CCCCCC">
<tr>
<td width="3%" align="center" bgcolor="#E6E6E6"><strong>ID</strong></td>
<td width="15%" align="center" bgcolor="#E6E6E6"><strong>Added by</strong></td>
<td width="11%" align="center" bgcolor="#E6E6E6"><strong>Company Name</strong></td>
<td width="11%" align="center" bgcolor="#E6E6E6"><strong>Phone No.</strong></td>
<td width="11%" align="center" bgcolor="#E6E6E6"><strong>Contacted Person</strong></td>

<td width="27%" align="center" bgcolor="#E6E6E6"><strong>Post in Company</strong></td>

<td width="14%" align="center" bgcolor="#E6E6E6"><strong>Method</strong></td>
<td width="10%" align="center" bgcolor="#E6E6E6"><strong>Date </strong></td>


<td width="7%" align="center" bgcolor="#E6E6E6"><strong>Time</strong></td>


<td width="13%" align="center" bgcolor="#E6E6E6"><strong>Action</strong></td>
</tr>
<?php

while($numberOfRows>0){

$row=mysql_fetch_array($result1)
?>

<tr>
<td bgcolor="#FFFFFF"><?php echo $j; ?></td>
<td bgcolor="#FFFFFF"><?php echo $row['UserName']; ?></td>

<td align="center" bgcolor="#FFFFFF"><?php echo $row['CompanyName']; ?></td>
<td align="center" bgcolor="#FFFFFF"><?php echo $row['CompanyPhoneNo']; ?></td>
<td align="center" bgcolor="#FFFFFF"><?php echo $row['Name']; ?></td>
<td align="center" bgcolor="#FFFFFF"><?php echo $row['CompanyPost']; ?></td>
<td align="center" bgcolor="#FFFFFF"><?php echo $row['Method']; ?></td>

<td align="center" bgcolor="#FFFFFF"><?php echo $row['Date']; ?></td>
<td align="center" bgcolor="#FFFFFF"><?php echo $row['Time'];  ?> </td>

<td align="center" bgcolor="#FFFFFF"><a href="associate_deleteSponsorItem.php?SponsorId=<?php echo $row['SponsorId'];?>	"> Delete</a></td>
</tr>




<?php 
$j++;
$numberOfRows--;
}
}
else
echo "No items found!!";
?>
</table>
<BR>
<a href="associate_addSponsorItem.php<?php// echo $EventName;?>">Add more Contacts</a>
<?php	}
?> <br>
<form id="form2"   name="selectEvent" method="post" action="<?php print $_SERVER["PHP_SELF"]; ?>">
<select name="EventName">
		  <?php  $sqlQuery = "SELECT * FROM rights WHERE UserName='$UserName1'";
		  $result = MYSQL_QUERY($sqlQuery);
$numberOfRows = MYSQL_NUM_ROWS($result);
	$i = 0;
	?><option value="">Select an Option</option>
<?php
	while ($i<$numberOfRows)
	{
$EventName = MYSQL_RESULT($result,$i,"EventName");?>
<option value="<?php echo $EventName; ?>"><?php echo $EventName; ?></option>
<?php $i++;}?>
</select>

<INPUT TYPE=SUBMIT VALUE="Go">
</FORM>



                    </p>
				
		 
		</div>
        </div>
        <!-- end content -->
		<!-- start sidebars -->
		<!-- end sidebars -->
	  <div style="clear: both;">&nbsp;</div>
	</div>
	<!-- end page -->
</div>
</html>
<?php
	include('footer.php');
?>
Return current item: EasyFest