File: /home/httpd/html/seekya.com/DEAD/beta/manage/admin_users.php
<?php session_start();
include("../includes/connect.php");
include("../includes/func.php");?>
<?php //if (empty($_SESSION["admin"])) redirect("index.php?e=1");
if ($_SESSION["user_type"]!=1) redirect("index.php?e=1");
$sql="SELECT * from user_master where user_type in (1,2,3) order by user_id desc";
$cmd = mysql_query($sql);
//Single Delete
if (!empty($_GET["delid"])) {
mysql_query("delete from user_master where `user_id`=" . $_GET["delid"]);
redirect($_SERVER["HTTP_REFERER"]);
}
?>
<?php include("includes/header.php"); ?>
<??>
<form name="frmMain" action="member.php" method=post>
<table width="98%" height="100" border="0" align="center" cellpadding="5" cellspacing="5">
<tr>
<td height="50"><span style="font-weight: bold">User Management </span> [<a href="javascript:" onClick="openWin('userPopup.php', 'width=450, height=330');" class="BlackAri12B">Add New User</a>]
<hr size="1"> </td>
</tr>
<?php
//if any records retrieved
if (mysql_num_rows($cmd) != 0) {
?>
<tr>
<td class="BlackAri12B" colspan=2><table width="100%" border="0" cellpadding="2" cellspacing="1" class="bgDarkGray">
<tr class="bgLightGray">
<td width="5%"> </td>
<td width="20%" class="BlackAri12B">User Name</td>
<td width="20%" class="BlackAri12B">Login Name</td>
<td width="20%" class="BlackAri12B">User Type</td>
<td width="5%" class="BlackAri12B">Status</td>
<td width="40%" class="BlackAri12B">email</td>
</tr>
<?php getErr("4"); ?>
<tr>
<td colspan="7" height="10" class="bgWhite"></td>
</tr>
<?php
//loop thru records and display category listing
while ($rs = mysql_fetch_array($cmd)) {
if ($bgclass == "bgExtraLightGray")
$bgclass = "bgWhite";
else
$bgclass = "bgExtraLightGray";
$category_parent='';
switch($rs["user_type"]){
case 1:
$user_type="<b>Super admin</b>";
break;
case 2:
$user_type="Admin";
break;
case 3:
$user_type="subscribers";
break;
}
?>
<tr class="<?php echo($bgclass); ?>">
<td><table border="0" align="center">
<tr>
<td><a href="javascript:" onClick="openWin('userPopup.php?user_id=<?php echo($rs["user_id"]); ?>', 'width=450, height=330');"><img src="../images/icons/view.gif" width="16" height="16" border="0" alt="Edit Record"></a></td>
<td><a href="admin_users.php?delid=<?php echo($rs["user_id"]); ?>" onClick="return window.confirm('Are you sure you want to delete this record.');"><img
src="../images/icons/delete.gif" width="16" height="16" border="0" alt="Delete Record"></a></td>
</tr>
</table></td>
<td class="BlackAri12" valign=top width="20%"><?php echo($rs["last_name"]); ?> <?php echo($rs["first_name"]); ?></td>
<td class="BlackAri12" valign=top width="20%"> <?php echo($rs["user_name"]); ?>
</td>
<td class="BlackAri12" width="20%"> <small><?php echo($user_type); ?></small></td>
<td align="center" width="20%"><?php stsfx($rs["active"]); ?></td>
<td align="center" width="10%" class="BlackAri12" ><?php echo $rs["email"]; ?></td>
</tr>
<?php } ?>
</table></td>
</tr>
<?php } else { ?>
<tr>
<td align="center" class="err">No User found.</td>
</tr>
<?php } ?>
<tr>
<td height="50" align="center"> </td>
</tr>
</table>
</form>
<?php include("includes/footer.php"); ?>