<?
if ($akashaID == $ID) {
include ("includes/global.inc"); // Global Variables
include ("includes/functions.inc"); // Global Functions
include ("includes/head.inc"); // Standart Headers
include ("stylesheets/homestyle.inc"); // Stylesheets
echo "</head>\n";
echo "<body bgcolor='#FFFFFF' text='#000000' link='#3457A9' vlink='#3457A9' alink='#009966'>\n";
echo "<table width='100%' border='0' cellspacing='0' cellpadding='0' height='200'>\n";
echo " <tr>\n";
echo " <td align='center'>\n";
echo " <table width='100%' border='0' cellspacing='0' cellpadding='0'>\n";
echo " <tr bgcolor='#2B3D61'>\n";
echo " <td><b><font color='#DCD7CB'><i>Favorites</i></font></b></td>\n";
echo " </tr>\n";
echo " \n";
echo " </table>\n";
echo " <div align='center'><br>\n";
echo " <table width='100%' border='0' cellspacing='0' cellpadding='0'>\n";
echo " <tr>\n";
echo " <td bgcolor='#DCD7CB'><b><font color='#2B3D61'>Site Title</font></b></td>\n";
echo " <td bgcolor='#DCD7CB' colspan='2'><b><font color='#2B3D61'>Site URL</font></b></td>\n";
echo " </tr>\n";
$user_id = findUserByHash($ID);
$favoritesay = 0;
$query = "select count(favorite_id) from tblFavorites where user_id = $user_id";
$result = mysql_db_query("$dbname",$query);
if($result) {
while ($r = mysql_fetch_array($result)) {
$favoritesay = $r["count(favorite_id)"];
}
}
if ($favoritesay == 0) {
echo " <tr>\n";
echo " <td nowrap colspan='3'><div align='center'> <br><b><font color='#304167'>No Favorites Recorded</font></b></div></td>\n";
echo " </tr>\n";
} else {
$query = "select * from tblFavorites where user_id = $user_id order by favorite_id desc";
$result = mysql_db_query("$dbname",$query);
if($result) {
while ($r = mysql_fetch_array($result)) {
$favorite_id = $r["favorite_id"];
$url = $r["url"];
$url_title = $r["url_title"];
echo " <tr>\n";
echo " <td width='50%' nowrap bgcolor='#E3E7E8'><a href='favorite_modify.php?ID=$ID&favorite_id=$favorite_id'>$url_title</a></td>\n";
echo " <td width='43%' nowrap bgcolor='#E3E7E8'><a href='$url' target='_blank'>$url</a></td>\n";
echo " <td width='7%' nowrap bgcolor='#E3E7E8'>\n";
echo " <div align='center'><a href='favorite_delete.php?ID=$ID&favorite_id=$favorite_id'>Delete</a></div>\n";
echo " </td>\n";
echo " </tr>\n";
}
}
}
echo " </table>\n";
echo " <br>\n";
echo " <form method='post' action='favorite_add.php?ID=$ID'>\n";
echo " <div align='center'>\n";
echo " </div>\n";
echo " <table width='500' border='1' cellspacing='0' cellpadding='0' align='center' bgcolor='#999999'>\n";
echo " <tr>\n";
echo " <td>\n";
echo " <table width='500' border='0' cellspacing='0' cellpadding='0' align='center'>\n";
echo " <tr bgcolor='#2B3D61'>\n";
echo " <td><b><font color='#DCD7CB'>Add new URL</font></b></td>\n";
echo " </tr>\n";
echo " <tr align='center' bgcolor='#DCD7CB'>\n";
echo " <td>\n";
echo " <table width='500' border='0' cellspacing='0' cellpadding='0'>\n";
echo " <tr>\n";
echo " <td align='center' width='100'>Site Title</td>\n";
echo " <td width='400'>\n";
echo " <input type='text' name='txttitle' size='45' class='stiltextfield'>\n";
echo " </td>\n";
echo " </tr>\n";
echo " <tr>\n";
echo " <td align='center' width='100'>Site URL</td>\n";
echo " <td width='400'>\n";
echo " <input type='text' name='txturl' value='http://' size='45' class='stiltextfield'>\n";
echo " </td>\n";
echo " </tr>\n";
echo " <tr>\n";
echo " <td width='100%' align='center' colspan='2'>\n";
echo " <input type='image' src='images/add.gif' border='0' width='70' height='30'>\n";
echo " </td>\n";
echo " </tr>\n";
echo " </table>\n";
echo " </td>\n";
echo " </tr>\n";
echo " </table>\n";
echo " </td>\n";
echo " </tr>\n";
echo " </table>\n";
echo " </form>\n";
echo " <br>\n";
echo " </div>\n";
echo " </td>\n";
echo " </tr>\n";
echo "</table>\n";
echo "</body>\n";
echo "</html>\n";
} else {
Header("Location: main.php?error_code=1");
}
?>