Location: PHPKode > projects > Helpdesk Over Web > how/calls/callsearch.php
<?php

// Allows searching of Calls

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

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

// Connect to Database
require_once ('../includes/mysql_connect.php');

// Determine current month.
$currentmonth = date('Y-m');

echo ("<H1>Call Management</H1>");
echo ("<H2>Call Search</H2>");
echo "<P>Select search parameters using the form below. </P>";
echo "<FORM ACTION='callsearchresults.php' METHOD='post'>";
echo "<P><B>Month:</B> &nbsp;&nbsp;<input type='text' name='month' maxlength='10' size='10' value=$currentmonth> (YYYY-MM format)</P>";
echo "<P><B>User ID:</B> &nbsp;&nbsp;<select name='user'><option selected value='%'>All Users</option>";
	$sql = "SELECT * FROM users ORDER BY UserID;";
	$userlist = mysql_query($sql)
	   or die("Invalid query: " . mysql_error());
	while($i = mysql_fetch_row($userlist)) 
		{ 
		echo "<OPTION VALUE='$i[0]'>$i[0], $i[1] $i[2] ($i[3])</OPTION>";
		}
echo "</SELECT>";
echo "<P><B>Asset:</B> &nbsp;&nbsp;<select name='asset'><option selected value='%'>All Assets</option>";
	$sql = "SELECT * FROM assets;";
	$assetlist = mysql_query($sql)
	   or die("Invalid query: " . mysql_error());
	while($i = mysql_fetch_row($assetlist)) 
		{ 
		echo "<OPTION VALUE='$i[0]'>$i[0] - $i[1] - $i[2] $i[3]</OPTION>";
		}
echo "</SELECT>";
echo "<P><B>Severity:</B> &nbsp;&nbsp;<select name='severity'><option selected value='%'>All Severity Levels</option>";
	$sql = "SELECT * FROM sevcategories ORDER BY SeverityText;";
	$sevlist = mysql_query($sql)
	   or die("Invalid query: " . mysql_error());
	while($i = mysql_fetch_row($sevlist)) 
		{ 
		echo "<OPTION >$i[1]</OPTION>";
		}
echo "</SELECT>";
echo "<P><B>Category:</B> &nbsp;&nbsp;<select name='category'><option selected value='%'>All Categories</option>";
	$sql = "SELECT * FROM kbcategories;";
	$catlist = mysql_query($sql)
	   or die("Invalid query: " . mysql_error());
	while($i = mysql_fetch_row($catlist)) 
		{ 
		echo "<OPTION>$i[1]</OPTION>";
		}
echo "</SELECT><BR><BR>";
echo "<INPUT TYPE='submit' VALUE='Search' NAME='submit'></FORM>";
include_once('../includes/footer.html');
?>
Return current item: Helpdesk Over Web