Location: PHPKode > projects > Helpdesk Over Web > how/calls/callsearchresults.php
<?php
// Search Results Page

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

// Set Page Title and Include HTML Header
$page_title = 'HOW - Calls - Search Results';
include_once('../includes/header.html');

echo '<H1>Call Management</H1>';

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

// Retrieve Results from Form
$month = $_POST['month'];
$severity = $_POST['severity'];
$user = $_POST['user'];
$asset = $_POST['asset'];
$category = $_POST['category'];

// Query the database.
$query = "SELECT * FROM calls WHERE category LIKE '%$category%' AND asset LIKE '%$asset%' AND user LIKE '%$user%';";		
$result = mysql_query($query)
   or die("Invalid query: " . mysql_error());
$num_rows = mysql_num_rows($result);
if($num_rows == 0)
	{
	echo "<H4>Sorry - No Entries Found</H4>";
	echo ("<P><B><A HREF='javascript:history.back()'>Back to Previous Page</A></B></P>");
	}
else {
echo '<p>Click on a solution title to view further details and to edit or delete.</P>';
echo ("<TABLE WIDTH='600'><TR><TD><B>Call ID</B></TD><TD><b>Date</b></TD><TD><b>Category</b></TD><TD><b>Severity</b></TD></TR>");
while($i = mysql_fetch_row($result)) { 
	echo ("<TR>");
	echo ("<TD><A HREF='editcall.php?selectedcall=$i[0]'>$i[0]</TD>");
	echo ("<TD>$i[1]</A></TD>");
	echo ("<TD>$i[8]</A></TD>");
	echo ("<TD>$i[7]</A></TD>");
	}
echo ("</TABLE>");
echo ("<P><P><B>Total Entries: </B> $num_rows</P>");
echo ("<P><B><A HREF='javascript:history.back()'>Back to Previous Page</A></B></P>");
}
// Include HTML footer.
include_once('../includes/footer.html');
?>
Return current item: Helpdesk Over Web