Location: PHPKode > projects > The Community Wish List Server > wlserver/admin/wishes.php
<?php

print("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
print("<!DOCTYPE html\n");
print("PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\"\n");
print("\t\" http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\" >\n");
print("\t<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n");
print("\t\t<head>\n");
print("\t\t\t<title>All Wishes</title>\n");
print("<script language=\"JavaScript1.2\" type=\"text/javascript\" src=\"../wishlist.js\"></script>\n");
print("<link rel=\"STYLESHEET\" type=\"text/css\" href=\"../wishlist.css\" />");
print("\t\t</head>\n");
print("\t<body bgcolor=\"#ffffff\">\n");

include("../../php/dbconnect.php");

$giftsClaimedQuery="
	select
		g.giftName as gift,
		g.dateAdded as date,
		p.fName as fName,
		p.lName as lName
	from
		giftList g,
		person p,
		personWishesForGift w
	where
		g.giftKey = w.giftKey and
		w.personKey = p.personKey
	order by
		g.dateAdded desc";
$gifts=mysql_query($giftsClaimedQuery);
if (!$gifts) die ("Could not get to gifts table: <br /><b>$giftsClaimedQuery</b><br />".mysql_error());
$numGifts=mysql_num_rows($gifts);
print ("<table border=\"1\">\n");
print ("<tr><th>Gift</th><th>Wisher</th><th>Date Added</th></tr>\n");
for ($giftCount=0;$giftCount<$numGifts;$giftCount++) {
	$giftName=mysql_result($gifts,$giftCount,"gift");
	$wisher=mysql_result($gifts,$giftCount,"fName")." ".mysql_result($gifts,$giftCount,"lName");
	$dateAdded=mysql_result($gifts,$giftCount,"date");
	if ($colorSwitch==1) {
		$backc="#66ffff";
		$colorSwitch=0;
	} else {
		$backc="#ffffff";
		$colorSwitch=1;
	}
	print ("<tr bgcolor=\"$backc\">\n");
	print ("<td>$giftName</td><td>$wisher</td><td>$dateAdded</td>\n");
	print ("</tr>\n");
}
print ("</table>\n");
print ("</body>\n</html>\n");
?>
Return current item: The Community Wish List Server