Location: PHPKode > projects > Simple PHP Shopping cart - asaancart > asaancart v-0.9/admin/delete_brand.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 Brands');

$brand_id = $_GET['brand_id'];
$mode = $_GET['mode'];
$brand_logo = $_GET['brand_logo'];

if($mode=="delete"){
	$sql = "DELETE FROM brands WHERE brand_id=$brand_id";
	$results = mysql_query($sql);
	if($brand_logo!=""){
	unlink(APP_ROOT."/brand_images/".$brand_logo);	
	}
}

//show brand 
$sql = "SELECT * FROM brands ORDER BY brand_name";
$results = mysql_query($sql);
while($row = mysql_fetch_assoc($results) )
{
	$all_brands[] = $row;
}
$smarty->assign('all_brands', $all_brands);

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