Location: PHPKode > projects > EZphotopress > ezphotopress-1.0.0/admin/categories/enableDisableCategory.php
<h3><?=ENABLEDISABLECATEGORY_TITLE?></h3>
<br>
<?php
if (isset($catid) && $catid != "" && is_numeric($catid) && $catid >= 0) {
	//get user details
	$query = $db->query("select name from ".TABPREFIX."categories where id=".$catid) or die("get ".TABPREFIX."categories delete info - ");
	$row = $query->fetch();

	if ($enable == "off") {
		$resultC = $db->query("update ".TABPREFIX."categories set deleted = 1,last_modify=NOW() where id=".$catid) or die("update disabled categories - ");
		if ($resultC->sizeIDU() > 0) {
			?>				
			<p class="ok">
				<?=ENABLEDISABLECATEGORY_THE_CATEGORY?><?=$row['name']?><?=ENABLEDISABLECATEGORY_SUCCESS_UNPUBLISH?>
			</p>
			<br>
			<center>
				<a href="home.php?id=cate&action=manage&type=e" class="back"><?=ENABLEDISABLECATEGORY_CONTINUE?></a>
			</center>
			<?php
		} else {
			?>				
			<p class="ok">
				<?=ENABLEDISABLECATEGORY_THE_CATEGORY?><?=$row['name']?><?=ENABLEDISABLECATEGORY_ERROR_UNPUBLISH?><br><br>
			</p>
			<br>
			<center>
				<a href="home.php?id=cate&action=manage&type=e" class="back"><?=ENABLEDISABLECATEGORY_CONTINUE?></a>
			</center>
			<?php	
		}
	} else if ($enable == "on") {
		$resultC = $db->query("update ".TABPREFIX."categories set deleted = 0, last_modify=NOW() where id=".$catid) or die("update enable categories - ");
		if ($resultC->sizeIDU() > 0) {
			?>				
			<p class="ok">
				<?=ENABLEDISABLECATEGORY_THE_CATEGORY?><?=$row['name']?><?=ENABLEDISABLECATEGORY_SUCCESS_PUBLISH?>
			</p>
			<br>
			<center>
				<a href="home.php?id=cate&action=manage&type=d" class="back"><?=ENABLEDISABLECATEGORY_CONTINUE?></a>
			</center>
			<?php
		} else {
			?>				
			<p class="ok">
				<?=ENABLEDISABLECATEGORY_THE_CATEGORY?><?=$row['name']?><?=ENABLEDISABLECATEGORY_ERROR_PUBLISH?>
			</p>
			<br>
			<center>
				<a href="home.php?id=cate&action=manage&type=d" class="back"><?=ENABLEDISABLECATEGORY_CONTINUE?></a>
			</center>
			<?php	
		}
	}	
}
?>

Return current item: EZphotopress