You searched for ";
}
// Searching for a building
if ($building != "none") {
$searchQuery .= "AND building LIKE '%".$building."%'";
$searchMessage .= "Building:
".$building."";
}
// Room
if ($room != "none") {
$searchQuery .= " AND room = '".$room."'";
$searchMessage .= " Room:
".$room."";
}
// Searching for equipment
if ($searchEquipment != "none") {
$searchQuery .= " AND name LIKE '%".$searchEquipment."%'";
$searchMessage .= " Equipment:
".$searchEquipment."";
}
// For a lifetime listing
if (isset($_POST['lifetimeList'])) {
$lifeMonth = $_POST['lifeMonth'];
$lifeDay = $_POST['lifeDay'];
$lifeYear = $_POST['lifeYear'];
echo "
Listing the equipment in which the lifetime has run out as of $lifeMonth–$lifeDay–$lifeYear
";
$lifeView = mktime(0, 0, 0, $lifeMonth, $lifeDay, $lifeYear);
$searchQuery .= " AND lifetime < $lifeView";
}
// For a warranty listing
if (isset($_POST['warrantyList'])) {
$warrantyMonth = $_POST['warrantyMonth'];
$warrantyDay = $_POST['warrantyDay'];
$warrantyYear = $_POST['warrantyYear'];
echo "
Listing the equipment in which the warranty has run out as of $warrantyMonth–$warrantyDay–$warrantyYear
";
$warrantyView = mktime(0, 0, 0, $warrantyMonth, $warrantyDay, $warrantyYear);
$searchQuery .= " AND warranty_expiration < $warrantyView";
}
// Order the results
$searchQuery .= " ORDER BY b.building, (b.room + 0), b.room";
$searchResult = mysql_query($searchQuery);
if ($searchResult) {
// The search worked
// Number of results
$searchNum = @mysql_numrows($searchResult);
if ($searchNum == 0) {
// There were no results
$searchMessage .= "
There were
no results for your search.
";
echo $searchMessage;
} else {
// The search worked, and there were results
$searchMessage .= "View full entry.
";
$viewResult = mysql_query($viewQuery);
if ($viewResult) {
// The search worked
// Colors for the table
$colors = array("#EFFFA6", "#D6E1A5");
?>