Location: PHPKode > projects > VoxRank > voxrankfree/admin/sites.php
<?php
error_reporting(E_ALL);
require '../gzdoc.php';
require '../functions.php';

if (empty($_REQUEST['action'])) $action = ''; else $action = $_REQUEST['action'];
if (empty($_REQUEST['password'])) $password = ''; else $password = $_REQUEST['password'];
if (empty($_REQUEST['id'])) $id = ''; else $id = $_REQUEST['id'];


session_start();

SecureLoginRquireAuthentication('Admin');


db_connect();
checkip();

if (isset($id) & $action == 'remove') {
mysql_query("DELETE FROM voxrank_comments WHERE site_id = '".$id."'");
mysql_query("DELETE FROM voxrank WHERE id = '".$id."'");
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="Cache-control" content="no-cache">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Expires" content="-1">
<meta http-equiv="author" content="Jeremy Ross">
<title>VoxRank Administration Suite</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>

<body bgcolor="#FFFFFF" text="#000000" link="#993333" vlink="#993333" alink="#993366">

<div align="center" class="pagetitle">Edit / Delete Sites</div>
<br>
<table border="0" cellpadding="3" cellspacing="1" width="95%" align="center">
<tr bgcolor="#CC0000"><td><b style="color:#FFFFFF;">Site ID</b></td><td><b style="color:#FFFFFF;">Site Name</b></td><td><b style="color:#FFFFFF;">Date Joined</b></td><td><b style="color:#FFFFFF;">Member Name</b></td><td><b style="color:#FFFFFF;">Action</b></td></tr>
<?php
$bg=1;
$query2 = mysql_query('SELECT * FROM voxrank ORDER BY id');
while ($i = mysql_fetch_assoc($query2)) {
$uq = mysql_query("SELECT * FROM voxrank_users WHERE id='".$i['user_id']."'");
while ($r = mysql_fetch_assoc($uq)) {
$user_id = $r['id'];
$username = $r['username'];
$email = $r['email'];
}

if ($bg > 2) $bg=1;
if ($bg == 1) {
$bgcolor = '#FFFFFF';
} else {
$bgcolor = '#EEEEEE';
}

?>
<tr bgcolor="<?php echo $bgcolor; ?>"><td><font face="verdana" size="2"><?php echo $i['id']; ?></font></td><td><a href="<?php echo $i['url']; ?>" target="new"><?php echo $i['name']; ?></a></td><td><?php echo date("l, F j, Y", $i['id']); ?></td><td><?php echo $username; ?></td>
<td><a href="editsite.php?id=<?php echo $i['id']; ?>&user_id=<?php echo $user_id; ?>">Edit Site / Site Information</a><br>
  <a href="sites.php?id=<?php echo $i['id']; ?>&action=remove&password=<?php echo $password; ?>">Delete Site</a></td></tr>
<?php
$bg++;
}
?>
</table>

</body>
</html>
<? gzdocout(); ?>
Return current item: VoxRank