Location: PHPKode > projects > EasyFest > new/viewIncomeItem.php
<?php 
	include_once("include/db_connection.php");
	session_start();
	if($_SESSION["adminloggedIn"] == FALSE){
			header("Location:admin_login.php");
				exit;
	}
	include_once("config_admin.php");
checkLoggedIn("yes");
	include('header.php');
	include('left1.php');?>
    
    
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Premium Series by Free CSS Templates</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>
</head>

<body>
<div id="wrapper">
	<!-- start page -->
	<div id="page">
    	  <!-- start content -->
        <div id="prtCnt" align="center">
		<div id="content" align="center">
		  <div class="post">
	    <h2 class="title">&nbsp;</h2>
	    <div class="entry">
<?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'];*/?>
<a href="download.php?EventName=<?php echo "$EventName"."&Table=incomes";?>">save as csv</a>
<?php
$sql1="SELECT * FROM incomes WHERE EventName='$EventName'";
$result1=mysql_query($sql1);
$datetime=date("d/m/y h:i:s");
$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="27%" align="center" bgcolor="#E6E6E6"><strong>Description</strong></td>

<td width="14%" align="center" bgcolor="#E6E6E6"><strong>Item Type</strong></td>
<td width="10%" align="center" bgcolor="#E6E6E6"><strong>Amount Received per income item </strong></td>
<td width="11%" align="center" bgcolor="#E6E6E6"><strong>Company Name</strong></td>

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

<td width="13%" align="center" bgcolor="#E6E6E6"><strong>Date/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['Description']; ?></td>
<td align="center" bgcolor="#FFFFFF"><?php echo $row['ItemType']; ?></td>
<td align="center" bgcolor="#FFFFFF"><?php echo $row['AmountRPI']; ?></td>
<td align="center" bgcolor="#FFFFFF"><?php echo $row['CompanyName']; ?></td>
<td align="center" bgcolor="#FFFFFF"><?php echo $row['Quantity']; ?></td>

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




<?php 
$j++;
$numberOfRows--;
}
}
else
echo "No items found!!";
?>
</table>
<BR>
<a href="addIncomeItem.php<?php// echo $EventName;?>">Add Income Item</a>
<?php	}
?>
<form id="form2"   name="createEvent" 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>
		</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