echo '</table></fieldset>'; echo '<p><input type="hidden" name="s_submitted" value="1"><input type="submit" name="Search" value="Search">'; echo '</form></p>'; // if user hit "Search" button, query the database and display the results if (@$_POST['s_submitted']) { $type = $_POST['s_type']; $status = $_POST['s_status']; $group = $_POST['s_group']; $role = $_POST['s_role']; $name = trim(str_replace('\'', ''', htmlentities($_POST['s_name']))); $day = $_POST['s_day']; $week = $_POST['s_week']; // now go after the volunteers that fit the search criteria include_once 'database/dbPersons.php'; include_once 'domain/Person.php'; $result = getonlythose_dbPersons($type, $status, $group, $role, $name, $day, $week); echo '<p><strong>Search Results:</strong> <p>Found ' . sizeof($result) . ' ' . $status . ' '; if ($type != "") { echo $type . "s"; } else { echo "persons"; } if ($name != "") { echo ' with name like "' . $name . '"'; } if ($group != "") { echo ' with group like "' . $group . '"'; } if ($role != "") { echo ' with role like "' . $role . '"'; }
echo '<option value="' . $shiftno . '">' . $shiftname . '</option>'; } echo '</select>'; echo "</tr>"; echo '</table></fieldset>'; echo '<p><input type="submit" name="Search" value="Search">'; echo '</form></p>'; // if user hit "Search" button, query the database and display the results if ($_POST['Search']) { $type = $_POST['s_type']; $status = $_POST['s_status']; $name = trim(str_replace('\'', ''', htmlentities($_POST['s_name']))); // now go after the volunteers that fit the search criteria include_once 'database/dbPersons.php'; include_once 'domain/Person.php'; $result = getonlythose_dbPersons($type, $status, $name, $_POST['s_day'], $_POST['s_shift'], $_SESSION['venue']); //added s_venue echo '<p><strong>Search Results:</strong> <p>Found ' . sizeof($result) . ' ' . $status . ' '; if ($type != "") { echo $type . "s"; } else { echo "persons"; } if ($name != "") { echo ' with name like "' . $name . '"'; } $availability = $_POST['s_day'] . " " . $_POST['s_shift']; //added s_venue if ($availability != " ") { echo " with availability " . $availability; }