Location: PHPKode > projects > Helpdesk Over Web > how/sysmgmt/deletesetting.php
<?php

// Purpose : Deletes a setting value.

// Include Configuration File
require_once ('../includes/config.inc'); 

// Set the page title and include the HTML header.
$page_title = 'Helpdesk Over Web - Delete Setting';
include ('../includes/header.html');

// Connect to Database
require_once ('../includes/mysql_connect.php');
	
echo "<H1>System Users</H1>";
echo "<H3>Delete User</H3>";

$settingtype = $HTTP_GET_VARS['type'];
$recordtodelete = $HTTP_GET_VARS['id'];

if($settingtype == 'link')
	{
	$sql = "DELETE FROM usefullinks WHERE (LinkID = '$recordtodelete') LIMIT 1;";
	$records = range(1, 500);
	$result = mysql_query($sql)
	   or die("Invalid query: " . mysql_error());
	header ('Location: /how/sysmgmt/usefullinks.php');
	exit();
	}
elseif ($settingtype == 'statcat')
	{
	$sql = "DELETE FROM statcategories WHERE (RecordID = '$recordtodelete') LIMIT 1;";
	$records = range(1, 500);
	$result = mysql_query($sql)
	   or die("Invalid query: " . mysql_error());
	header ('Location: /how/sysmgmt/statcats.php');
	exit();
	}
elseif ($settingtype == 'site')
	{
	$sql = "DELETE FROM sites WHERE (SiteID = '$recordtodelete') LIMIT 1;";
	$records = range(1, 500);
	$result = mysql_query($sql)
	   or die("Invalid query: " . mysql_error());
	header ('Location: /how/sysmgmt/sites.php');
	exit();
	}
elseif ($settingtype == 'sevcat')
	{
	$sql = "DELETE FROM sevcategories WHERE (RecordID = '$recordtodelete') LIMIT 1;";
	$records = range(1, 500);
	$result = mysql_query($sql)
	   or die("Invalid query: " . mysql_error());
	header ('Location: /how/sysmgmt/sevcats.php');
	exit();
	}
elseif ($settingtype == 'kbcat')
	{
	$sql = "DELETE FROM kbcategories WHERE (RecordID = '$recordtodelete') LIMIT 1;";
	$records = range(1, 500);
	$result = mysql_query($sql)
	   or die("Invalid query: " . mysql_error());
	header ('Location: /how/sysmgmt/kbcats.php');
	exit();
	}
elseif ($settingtype == 'dept')
	{
	$sql = "DELETE FROM depts WHERE (DeptID = '$recordtodelete') LIMIT 1;";
	$records = range(1, 500);
	$result = mysql_query($sql)
	   or die("Invalid query: " . mysql_error());
	header ('Location: /how/sysmgmt/depts.php');
	exit();
	}
elseif ($settingtype == 'assettype')
	{
	$sql = "DELETE FROM hwcategories WHERE (RecordID = '$recordtodelete') LIMIT 1;";
	$records = range(1, 500);
	$result = mysql_query($sql)
	   or die("Invalid query: " . mysql_error());
	header ('Location: /how/sysmgmt/assettypes.php');
	exit();
	}
// Include standard HTML footer
include ('../includes/footer.html');
?>

Return current item: Helpdesk Over Web