<?php
include "header.php";
//require('db_connect.php'); // database connect script.
@mysql_select_db($db_name) or die( "Unable to select database");
if ($logged_in == 0) {
die('You are not logged in so you can not view giftlists');
}
?>
<html>
<head>
<title>My Giftlists</title>
My Gift List
<br>
</font>
<br><br>
</head>
<body>
<?php
$date=date("Y-m-d");
$dbQuery = "SELECT DISTINCT gift_name, gift_price, last_login, gift_description, gift_url_store, date_added, del_gift ";
$dbQuery .= "FROM users,gifts WHERE gifts.username != ('$_SESSION[username]') AND users.last_login < gifts.date_added AND del_gift = 'no' ";
$dbQuery .= "ORDER BY gift_name ASC";
$result = mysql_query($dbQuery) or die("Couldn't get file list");
?>
<table align="center" border="1" cellpadding="0" cellspacing="0" bordercolor="#111111" width="90%">
<tr>
<td width="20%" bgcolor="#FF9900" height="21">
<p style="margin-left: 10"><b><font size="2" face="Verdana" color="#FFFFFF">
Gift Name</font></b></td>
<td width="13%" bgcolor="#FF9900" height="21">
<p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF">
Gift Price</font></b></td>
<td width="13%" bgcolor="#FF9900" height="21">
<p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF">
Gift Comments</font></b></td>
<td width="43%" bgcolor="#FF9900" height="21">
<p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF">
Store / Web site URL</font></b></td>
</tr>
<?php
while($row = mysql_fetch_array($result))
{
?>
<tr>
<td width="20%" bgcolor="#FFDCA8" height="21">
<p style="margin-left: 10; margin-right: 10">
<font face="Verdana" size="2">
<?php echo $row["gift_name"]; ?>
</font>
</td>
<td width="13%" bgcolor="#FFDCA8" height="21">
<p style="margin-left: 10"><font face="Verdana" size="2">
<?php echo '£',$row["gift_price"]; ?>
</a></font>
</td>
<td width="30%" bgcolor="#FFDCA8" height="21">
<p style="margin-left: 10"><font face="Verdana" size="2">
<?php echo $row["gift_description"]; ?>
</a></font>
</td>
<td width="50%" bgcolor="#FFDCA8" height="21">
<p style="margin-left: 10"><font face="Verdana" size="2">
<?php echo $row["gift_url_store"]; ?>
</a></font>
</td>
</tr>
<?php
}
echo "</table>";
?>
<?php
?>
</body>
</html>