Location: PHPKode > projects > Helpdesk Solutions > helpdesk/scripts/request/del_request.php
<?
include($DOCUMENT_ROOT.'/helpdesk/include/database.php');
include($DOCUMENT_ROOT.'/helpdesk/include/new_user.php');


session_start();

if ($valid != "yes") {
	header("Location: /helpdesk/login.php");
	exit;
}

$head = "Delete Request?";
$bttm_menu = " &nbsp;&nbsp;<a class=bttm_menu href='/helpdesk/scripts/main_adminmenu.php'>Main Menu</a>&nbsp;&nbsp;|
				&nbsp;&nbsp;<a class=bttm_menu href='/helpdesk/scripts/request/view_requests.php'>View Requests</a>&nbsp;&nbsp;|
				&nbsp;&nbsp;<a class=bttm_menu href='/helpdesk/scripts/request/select_user.php'>Create Request</a>&nbsp;&nbsp;|
				&nbsp;&nbsp;<a class=bttm_menu href='/helpdesk/scripts/request/search_request.php'>Search for a  Request</a>&nbsp;&nbsp;|
				&nbsp;&nbsp;<a class=bttm_menu href='/helpdesk/logout.php'>Log Out</a>&nbsp;&nbsp;|
";

if (!$submit) {
	$sql = "SELECT user_name, log_summary  FROM requests WHERE request_id = '$select_requestid'";
	$result = mysql_query($sql,$conn) or die(mysql_errno().":2 ".mysql_error());
	while ($row = mysql_fetch_array($result)) {
		$user_name = $row['user_name'];
		$log_summary = $row['log_summary'];
	}


	$bottom = "
	<h3>Are you sure you wish to remove this Request?</h3>

	<form method=get action='$phpself'>
	<table>
	<tr><td class=user width=180>Name:<td>$select_requestid
	<tr><td class=user>Username:<td>$user_name
	<tr><td class=other>Department:<td>$log_summary
	</table>
	<br>
	<input type=hidden name=select_userid value='$select_requestid'>
	<input type=submit name=submit value='Yes - Remove this Request'>
	</form>
	";
}

if ($submit) {
	$sql = "DELETE FROM requests WHERE request_id = '$select_requestid'";
	$result = mysql_query($sql,$conn) or die(mysql_errno().":2 ".mysql_error());

	$bottom = "<h3>Request has been removed from the system";
}



include($DOCUMENT_ROOT.'/helpdesk/include/template.inc.php');
?>
Return current item: Helpdesk Solutions