HEX
Server: Apache
System: Linux p3plzcpnl489526.prod.phx3.secureserver.net 4.18.0-553.54.1.lve.el8.x86_64 #1 SMP Wed Jun 4 13:01:13 UTC 2025 x86_64
User: vmasmheia229 (9244908)
PHP: 7.4.33
Disabled: NONE
Upload Files
File: /home/vmasmheia229/domains/taylornetcloud.com/html/admin/delete-category.php
<?php
include('../api/include/webzone.php');

$id = $_GET['id'];

$t1 = new Template_class_admin();
$t1->setPageName('Delete a category');
$t1->setMetaTags(array('title'=>'', 'description'=>''));
$t1->displayHeader();

$c1 = new Store_locator_category();
$result = $c1->loadByFields('id',$id);

if(count($result)>0) {
	
	$s1 = new Store_locator();
	$result2 = $s1->loadByFields('category_id',$id);
	
	if(count($result2)>0) {
		echo "You cannot delete this category because it's still containing some stores.<br>";
		echo '<a href="./categories.php">Back to categories list</a>';
	}
	
	else {

		if($_GET['confirm']==1) {
			
			$c1->delete($id);
			
			echo '<script>';
			echo 'window.location="./categories.php";';
			echo '</script>';
			
		}
		else {
			echo '<p>Are you sure you want to delete this category?</p>';
			echo '<a href="?id='.$id.'&confirm=1">Yes, delete this category</a> - <a href="./categories.php">Cancel</a>';
		}
		
	}
}

else {
	echo '<p>No category to delete here !</p>';
	echo '<a href="./categories.php">Categories list</a>';
}

$t1->displayFooter();
?>