echo $metnoDetailTable . PHP_EOL; echo '</div>' . PHP_EOL; } } if ($tableInTabs || $metno_meteogram_in_tabs) { echo '</div>' . PHP_EOL; } if (!$tableInTabs) { $style = 'style="' . $width . $margin . $tableHeight . ' overflow: auto;"'; if ($metnoTable) { echo '<div class="tabbertab" ' . $style . '><h2>' . metnotransstr('Forecast by 6 hour intervals') . '</h2>' . PHP_EOL; echo $metnoListTable . PHP_EOL; echo '</div>' . PHP_EOL; } if ($metnoDetailsTable) { echo '<div class="tabbertab" ' . $style . '><h2>' . metnotransstr('Forecast details') . '</h2>' . PHP_EOL; echo $metnoDetailTable . PHP_EOL; echo '</div>' . PHP_EOL; } } /* $style = 'style="'.$width.$margin.'"'; echo '<div id="credit" '.$style.'>'; echo $creditString; echo '</div>'.PHP_EOL; #echo '<br />'.PHP_EOL; */ #-------------------I M P O R T A N T ------------------------------------- # now we add the needed javascripts if we display the graphs # if you use this script inside another script make sure you add the javascripts yourself #---------------------------------------------------------------------------
function metnodateline($time, &$rowColor) { global $latitude, $longitude, $timeFormat, $imgDir, $srise, $sset, $cols; $srise = date_sunrise($time, SUNFUNCS_RET_TIMESTAMP, $latitude, $longitude); // standard time integer $sset = date_sunset($time, SUNFUNCS_RET_TIMESTAMP, $latitude, $longitude); $dlength = $sset - $srise; $dlengthHr = floor($dlength / 3600); $dlengthMin = round(($dlength - 3600 * $dlengthHr) / 60); $strDayLength = $dlengthHr . ':' . substr('00' . $dlengthMin, -2); $longDate = metnolongdate($time); $string = '<tr class="dateline ' . $rowColor . '"><td colspan="' . $cols . '"> <span style="float:left; position:relative;"> <b>' . $longDate . '</b></span> <span style="float:right;position:relative;"> <span class="rTxt"> <img src="' . $imgDir . '/sunrise.png" alt="sunrise" /> ' . date($timeFormat, $srise) . ' <img src="' . $imgDir . '/sunset.png" alt="sunset" /> ' . date($timeFormat, $sset) . ' ' . metnotransstr('Daylength') . ': ' . $strDayLength . ' </span> </span> </td></tr>' . PHP_EOL; if ($rowColor == 'row-dark') { $rowColor = 'row-light'; } else { $rowColor = 'row-dark'; } return $string; }