Location: PHPKode > projects > Simple PHP Shopping cart - asaancart > asaancart v-0.9/admin/del_sub_cat.php
<?php
session_start();
/*
asaancart - easy shopping cart solution
---------------------------------------

Copyright 2009 Nasir Ahmad Khan
Email: hide@address.com

This file is part of asaancart - open source easy shopping cart solution.

asaancart is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

asaancart is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with asaancart.  If not, see <http://www.gnu.org/licenses/>.

*/

include("../config/config.php");
include("includes/chk_login_status_inc.php");

$smarty->assign('title','Manage Categories');
$category_id = $_GET['category_id'];
$parent_cat_id = $_GET['parent_cat_id'];
$parent_cat_name = $_GET['parent_cat_name'];

$sql = "DELETE FROM sub_category WHERE parent_cat_id=$parent_cat_id AND category_id=$category_id";
$results = mysql_query($sql);

//manage 
$sql = "SELECT * FROM sub_category WHERE parent_cat_id=$parent_cat_id";
$results = mysql_query($sql);
$total_selected_cat = mysql_num_rows($results);
$smarty->assign('total_selected_cat', $total_selected_cat);

while($row = mysql_fetch_assoc($results) )
{
	$sql_cat_data = "SELECT * FROM category WHERE category_id=".$row['category_id'];
	$results_cat_data = mysql_query($sql_cat_data);
	while($row_cat_data = mysql_fetch_assoc($results_cat_data) )
	{	
		$selected_sub_cat_list[] = $row_cat_data;	
	}	
}

$smarty->assign('parent_cat_id', $parent_cat_id);
$smarty->assign('parent_cat_name', $parent_cat_name);
$smarty->assign('selected_sub_cat_list', $selected_sub_cat_list);
//end manage

$smarty->display('show_sub_cat.tpl');
?>
Return current item: Simple PHP Shopping cart - asaancart