/** * Get the date-time array representation * @param String value * @param Boolean forCaption * @return Array */ protected function getDateTimeArray($value, $forCaption = false) { if ($forCaption) { $timeArray = parsenumbers($value); return array(0, 0, 0, $timeArray[0], $timeArray[1], $timeArray[2]); } $timeInSeonds = $this->getValueInSeconds($value); return addSeconds($this->baseDateArray, $timeInSeonds); }
if ($mosaicurl != "") { echo '<input type="hidden" value="' . $mosaicurl . '" name="mosaicurl" />'; } # Call up the appropriate spectrogram list($previousSubnet, $nextSubnet) = findprevnextsubnets($subnet, $subnets); # make sure the date is valid if (!checkdate($month, $day, $year)) { echo "<p>invalid date</p></body></html>"; } else { # Time parameters of previous spectrogram and its path list($pyear, $pmonth, $pday, $phour, $pminute, $psecs) = addSeconds($year, $month, $day, $hour, $minute, 0, -60 * $numMins); $pminute = floorminute($pminute); $previous_sgram = "{$WEBPLOTS}/{$subnet}/{$pyear}/{$pmonth}/{$pday}/" . $pyear . $pmonth . $pday . "T" . $phour . $pminute . "00.png"; $previous_sgram_url = "{$scriptname}?subnet={$subnet}&year={$pyear}&month={$pmonth}&day={$pday}&hour={$phour}&minute={$pminute}&mosaicurl={$mosaicurl}"; # Time parameters of next spectrogram & its path list($nyear, $nmonth, $nday, $nhour, $nminute, $nsecs) = addSeconds($year, $month, $day, $hour, $minute, 0, 60 * $numMins); $nminute = floorminute($nminute); $next_sgram = "{$WEBPLOTS}/{$subnet}/{$nyear}/{$nmonth}/{$nday}/" . $nyear . $nmonth . $nday . "T" . $nhour . $nminute . "00.png"; $next_sgram_url = "{$scriptname}?subnet={$subnet}&year={$nyear}&month={$nmonth}&day={$nday}&hour={$nhour}&minute={$nminute}&mosaicurl={$mosaicurl}"; ######################### THINGS THAT DEPEND ON KISKA TIME, WHICH MAY NOT BE CURRENT TIME ####################### # The current time - albeit from Kiska which might be slow (or fast) #list ($cyear, $cmonth, $cday, $chour, $c1minute) = epoch2YmdHM(now()); #$cminute = floorminute($c1minute); # Age of previous spectrogram #$pAge = timeDiff($pyear, $pmonth, $pday, $phour, $pminute, $psecs, $cyear, $cmonth, $cday, $chour, $cminute, 0); # Age of current spectrogram #$age = $pAge - 600; # Age of next spectrogram #$nAge = $age - 600; ################################################################################################################## # Add sound file links & imageMap?
/** * Get the date slider's where * @return string */ static function getDateSliderWhere($fName, $pSet, $cipherer, $table, $SearchFor, $SearchFor2, $strSearchOption, $fullFieldName) { $firstDelimPos = strpos($SearchFor, "-"); $lastDelimPos = strrpos($SearchFor, "-"); if ($firstDelimPos === FALSE || $firstDelimPos == $lastDelimPos) { return ""; } $stepType = $pSet->getFilterStepType($fName); $timeValueEnvolved = false; if ($stepType == FSST_SECONDS || $stepType == FSST_MINUTES || $stepType == FSST_HOURS) { $timeValueEnvolved = true; } $value1 = $cipherer->MakeDBValue($fName, $SearchFor, "", true); switch ($strSearchOption) { case "slider": $firstDelimPos = strpos($SearchFor2, "-"); $lastDelimPos = strrpos($SearchFor2, "-"); if ($firstDelimPos === FALSE || $firstDelimPos == $lastDelimPos) { return ""; } $cleanvalue2 = prepare_for_db($fName, $SearchFor2, ""); $timeArr = db2time($cleanvalue2); if (!$timeValueEnvolved) { // for dates without time, add one day $timeArr = adddays($timeArr, 1); $value2 = $timeArr[0] . "-" . $timeArr[1] . "-" . $timeArr[2]; } else { if ($stepType == FSST_SECONDS) { $timeArr = addSeconds($timeArr, 1); } else { $timeArr = addMinutes($timeArr, 1); } $dateString = $timeArr[0] . "-" . $timeArr[1] . "-" . $timeArr[2]; $hours = $timeArr[3] < 10 ? '0' . $timeArr[3] : $timeArr[3]; $minutes = $timeArr[4] < 10 ? '0' . $timeArr[4] : $timeArr[4]; $seconds = $timeArr[5] < 10 ? '0' . $timeArr[5] : $timeArr[5]; $timeString = $hours . ":" . $minutes . ":" . $seconds; $value2 = $dateString . " " . $timeString; } $value2 = add_db_quotes($fName, $value2, $table); return $fullFieldName . ">=" . $value1 . " and " . $fullFieldName . "<" . $value2; case 'moreequal': return $fullFieldName . ">=" . $value1; case 'lessequal': return $fullFieldName . "<=" . $value1; default: return ""; } }