\n"; echo " \n"; echo " \"2013\n"; echo " \n"; searchform($groupname,$category,$company,$agency); echo " \n"; echo " \n"; echo "\n"; } else { if ($groupname == "All Groups") { $groupname = ''; } if ($category == "All Categories") { $category = ''; } $groupname_d = stripslashes($groupname); $category_d = stripslashes($category); $company_d = stripslashes($company); $agency_d = stripslashes($agency); $mash = ""; $mash_display = ""; if ($groupname != '') { //$groupname = str_replace("'", "\'"); $groupname = addslashes($groupname); $mash .= " && groupname = '$groupname'"; $mash_display .= "Group: $groupname_d
"; } if ($category != '') { $mash .= " && category = '$category'"; $mash_display .= "Category: $category_d
"; } if ($company != '') { $mash .= " && company like '%$company%'"; $mash_display .= "Company: \"$company_d\"
"; } if ($agency != '') { $mash .= " && agency like '%$agency%'"; $mash_display .= "Agency: \"$agency_d\"
"; } $sql = "select * from aster_2013a where award != ''".$mash. " order by company, agency"; $result = mysql_query($sql) or die(mysql_error()); $output = mysql_num_rows($result); echo ""; echo " "; echo " \n"; echo " \n"; echo " \n"; echo "
"; if (($mash != '') && ($output != 0)) { while ($row = mysql_fetch_array($result)) { if ($row[company_city] != '') { $company_loc = "-- $row[company_city], $row[company_state]"; } if ($row[agency_city] != '') { $agency_loc = "-- $row[agency_city], $row[agency_state]"; } if ($row[company] != '') { echo "$row[company] $company_loc
"; } if (($row[agency] != '') && ($row[company] == '')) { echo "$row[agency] $agency_loc
\n"; } else if ($row[agency] != '') { echo "Agency: $row[agency] $agency_loc
\n"; } echo "Award: $row[award]
\n"; echo "Entry Name: $row[entry]
\n"; echo "Group: $row[groupname]
\n"; echo "Category: $row[category]

\n\n"; $agency_loc = ''; $company_loc = ''; } } else { echo "\"2013"; } echo "
\n"; echo "
\n"; if (($output != 0) && ($mash_display != '')) { echo "Current Search: $output Result[s].\n"; // echo "

$mash_display\n"; } else if (($output == 0) && ($mash_display != '')) { echo "Current Search: $output Result[s]. Please try again.\n"; // echo "

$mash_display\n"; } else { echo "Your search returned too many results for display. Please refine your search with the parameters below."; } echo "
\n"; searchform($groupname,$category,$company,$agency); echo "
\n"; } function searchform($groupname_f,$category_f,$company_f,$agency_f) { $groupname_f = stripslashes($groupname_f); $category_f = stripslashes($category_f); $company_f = htmlspecialchars(stripslashes($company_f)); $agency_f = htmlspecialchars(stripslashes($agency_f)); echo "
"; echo "
\n"; echo "
Search by Group:
\n\n"; echo "
"; echo "
Search by Category:
\n
\n"; echo "
Organization Name:
\n"; echo "
Agency Name:
\n"; //echo "
 
\n"; echo "
\n"; echo "\n"; echo "
\n"; } ?>