HEX
Server: Apache
System: Linux msm5694.mjhst.com 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64
User: camjab_ssh (1000)
PHP: 5.3.29
Disabled: NONE
Upload Files
File: /home/httpd/html/seekya.com/DEAD/beta/manage/admin_category.php
<?php
session_start();
include("../includes/connect.php"); 
include("../includes/func.php");?>
<?php

if (empty($_SESSION["admin"])) redirect("index.php?e=1");
$sql="SELECT * from category_master order by category_id desc";
$cmd = mysql_query($sql);

//Single Delete
if (!empty($_GET["delid"])) {
	mysql_query("delete from `category_master` where `category_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">Category Management </span> [<a href="javascript:" onClick="openWin('categoryPopup.php', 'width=560, height=330');" class="BlackAri12B">Add New Category</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%">&nbsp;</td>
				<td width="20%" class="BlackAri12B">Category Name</td>
                <td width="10%" class="BlackAri12B">Display Order</td>
                <td width="50%" class="BlackAri12B">Description</td>
				<td width="10%" class="BlackAri12B">Status</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";
				
			?>
			
            <tr class="<?php echo($bgclass); ?>">
                <td><table border="0" align="center">
                    <tr>
                        <td><a href="javascript:" onClick="openWin('categoryPopup.php?category_id=<?php echo($rs["category_id"]); ?>', 'width=560, height=330');"><img src="../images/icons/view.gif" width="16" height="16" border="0" alt="Edit Record"></a></td>
                        <td><a href="admin_category.php?delid=<?php echo($rs["category_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%">&nbsp;<small><?php echo($rs["category_name"]); ?><small></td>
                <td class="BlackAri12" valign=top width="20%">&nbsp;<small><?php echo($rs["category_display_order"]); ?><small>
				</td>
				<td class="BlackAri12" width="50%">&nbsp;<small><?php echo($rs["category_description"]); ?></small></td>
				<td align="center"><?php stsfx($rs["category_status"]); ?></td>
				
            </tr>
			<?php } ?>
            
        </table></td>
	</tr>
	
	<?php } else { ?>
	<tr>
		<td align="center" class="err">No Category found.</td>
	</tr>
	<?php } ?>
	<tr>
		<td height="50" align="center">&nbsp;</td>
	</tr>
</table>
</form>

<?php include("includes/footer.php"); ?>