// data hour of data line
 if ($skip == true) {
     if ($hrInput < $startHr) {
         continue;
     }
     // skip all outdated lines
     $skip = false;
     // we found at least one current line
 }
 // eo skip old lines
 if ($prevDay < date('Ymd', $dateThisLine - 60)) {
     // print a line with sunrise and set information for this new day
     for ($n = 0; $n < count($printTable); $n++) {
         $startHour = date('H', $dateThisLine) + $printHours[$n];
         if ($startHour <= 24 && $printHoursMax[$n] >= 0) {
             $table[$n] .= $dataString = myDateLinePrint($dateThisLine);
             // and print it in every table
             $table[$n] .= $tableHeading[$n];
         }
     }
     $prevDay = date('Ymd', $dateThisLine);
     $graphsDays[] = 1000 * ($dateThisLine + $utcDiff - 3600);
 }
 for ($n = 0; $n < count($printTable); $n++) {
     // for every table print all required datafields in one row
     $array = $wsWxsimArray[$i];
     // put the data line into an array
     eval($stringNotPresent . PHP_EOL);
     $thisLineHour = date('H', $array['time']);
     $thisLineMinute = date('i', $array['time']);
     if ($n == 0) {
示例#2
0
$dataLine = $firstTime = true;
#echo '<pre>'; print_r ($returnArray); exit;
for ($i = 1; $i < count($returnArray['forecast']); $i++) {
    $arr = $returnArray['forecast'][$i];
    if ($skip == true) {
        if ($now > $arr['timestamp']) {
            continue;
        }
    }
    $skip = false;
    if ($dataLine == true) {
        if ($firstTime == true) {
            $firstTime = false;
            $hwaListTable .= myDateLinePrint($arr['timestamp'] - 3600);
        } else {
            $hwaListTable .= myDateLinePrint($arr['timestamp']);
        }
        $dataLine = false;
        $hour = date('H', $arr['timestamp']);
        if ($hour != 0) {
            $oldDay = $arr['date'];
        }
    }
    if ($oldDay != $arr['date']) {
        // do we have a new day
        $oldDay = $arr['date'];
        $graphsDays[] = 1000 * $arr['timestamp'];
        $dataLine = true;
    }
    //
    # first the javascript graph
 }
 if (!$popFound) {
     $arr['pop'] = '-';
 }
 #
 if ($noaaIconsOwn) {
     $iconUrl = $arr['noaaIconSmlUrl'];
 } else {
     $iconUrl = $arr['defailtIconSmlUrl'];
 }
 $time = $arr['toStamp'] + $utcDiff;
 $graphsData .= 'tsv[' . $i . '] ="' . $time . '|' . $arr['tempNU'] . '|' . 1.0 * $arr['tempAppNU'] . '|' . $arr['dewpNU'] . '|' . $arr['windSpeedNU'] . '|' . $arr['windGustNU'] . '|' . $arr['windDirDeg'] . '|' . $arr['windLbl'] . '|' . $arr['hum'] . '|' . $arr['snowNU'] . '|' . $arr['liquidNU'] . '|' . $iconUrl . '|' . '";' . PHP_EOL;
 #
 if ($dataLine == true) {
     $tableColoms = $cntFcstTableCols;
     $wsFcstTable .= myDateLinePrint($arr['toStamp'], $rowColor);
     $wsFcstTable .= $wsFcstTableHdr;
     $dataLine = false;
 }
 $wsFcstTable .= '<tr class="' . $rowColor . '">' . PHP_EOL;
 if ($rowColor == 'row-dark') {
     $rowColor = 'row-light';
 } else {
     $rowColor = 'row-dark';
 }
 # period
 $to = date($hourOnlyFormat, $arr['toStamp']);
 if (!isset($startNext)) {
     $start = date($hourOnlyFormat, $arr['toStamp'] - 3 * 60 * 60);
 } else {
     $start = $startNext;