Location: PHPKode > projects > @1 File Store > control/groups/delete.php
<?
if(!isset($_GET["id"]) || $_GET["id"]=="") {
	exit("Bad request");
}
require_once("const.php");

$smarty->assign("action", $lang['delete_group_2']);
$form["submit"]=$lang['delete'];
$form["readonly"]=1;
$form["hidden_fields"]=array("id"=>$_GET["id"]);

if($_SERVER["REQUEST_METHOD"]==$form["method"]) {		
	$SQL="DELETE FROM `".DB_PREFIX."user_groups`  WHERE `id`='".$_POST["id"]."'";
	if(!$mysql->query($SQL)) {
		exit($mysql->error);
	}
	$SQL2="DELETE FROM `".DB_PREFIX."access_list`  WHERE `group_id`='".$_POST["id"]."'";
	if(!$mysql->query($SQL2)) {
		exit($mysql->error);
	}
	$SQL3="UPDATE `".DB_PREFIX."users` SET `level`='99999' WHERE `level`='".$_POST["id"]."'";
	if(!$mysql->query($SQL3)) {
		exit($mysql->error);
	}
	Header("Location:index.php");
	exit();
} else {
	$SQL="SELECT * FROM `".DB_PREFIX."user_groups` WHERE `id`='".$_GET["id"]."'";
	if(!$mysql->query($SQL)) {
		exit($mysql->error);
	} else {
		$userform->load($form["fields"], $mysql->arr);
	}
}
$smarty->assign("form", $form);
$smarty->display("control/form.tpl");
?>
Return current item: @1 File Store