} echo "</div>"; /*-- Outdoors --*/ $result = $mysqli->query("SELECT * from Location WHERE cityID = '{$city}' AND cat_id = 4 "); echo "<div id='outdoors' class='list_sub'>"; while ($array = mysqli_fetch_array($result)) { if (checkDates($array, $start, $end) == true) { echo "<span><input type=\"checkbox\" value=" . $array['locID'] . " />" . $array['name'] . "</span>"; } } echo "</div>"; /*-- Museums And Art --*/ $result = $mysqli->query("SELECT * from Location WHERE cityID = '{$city}' AND cat_id = 5 "); echo "<div id='museums' class='list_sub'>"; while ($array = mysqli_fetch_array($result)) { if (checkDates($array, $start, $end) == true) { echo "<span><input type=\"checkbox\" value=" . $array['locID'] . " />" . $array['name'] . "</span>"; } } echo "</div>"; function checkDates($arr, $start, $end) { $dates = $arr['dates']; $dateArray = explode("*", $dates); $startDate = intval(strtotime($start) / 86400); $endDate = intval(strtotime($end) / 86400); $overlap = false; //check to see if location dates overlap with trip dates for ($i = 0; $i < sizeof($dateArray); $i++) { if (strcmp($dateArray[0], "all") == 0) { $overlap = true;
function verifyData($names, $lengths, $insert) { $result = checkMandatoryFields($names, $lengths); if ($result != "") { return $result; } $result = checkFieldsLength($names, $lengths); if ($result != "") { return $result; } $result = checkSymbols($names, $lengths); if ($result != "") { return $result; } $result = checkAges(); if ($result != "") { return $result; } $result = checkDates(); if ($result != "") { return $result; } $result = checkPasswords(); if ($result != "") { return $result; } }