コード例 #1
0
ファイル: wsDashWU.php プロジェクト: shakaran/weatherpro
        echo $htmlicons;
        echo '<br /></div>' . PHP_EOL;
    }
    #-------------------------------------------------------------------------------
    # the graphs
    if ($printGraph && !$graphsSeparate) {
        echo '<div class="tabbertab" style=""><h2>' . wswufcttransstr($trans . 'Graphs') . '</h2><br />' . PHP_EOL;
        echo '<div id="containerTemp" style="height: 340px;">';
        echo 'here the graph will be drawn';
        echo '</div>' . PHP_EOL;
        echo $graphPart1 . PHP_EOL;
        echo '</div>' . PHP_EOL;
    }
    #-------------------------------------------------------------------------------
    if ($printTable && !$tableSeparate) {
        echo '<div class="tabbertab" style="height: ' . $wuTabHeight . '"><h2>' . wswufcttransstr($trans . 'Table') . '</h2>' . PHP_EOL;
        echo '<div style="">';
        echo $htmltable;
        echo '</div>' . PHP_EOL;
        echo '</div>' . PHP_EOL;
    }
    echo '</div>' . PHP_EOL;
}
#-------------------------------------------------------------------------------
if ($printCredit) {
    echo $credit;
}
#
echo '</div>' . PHP_EOL;
#
$myLang = $lang = $saved_lang;
コード例 #2
0
ファイル: wu_fct_page.php プロジェクト: shakaran/weatherpro
            $extra = '';
        }
        echo '<option value="' . $n . '" ' . $extra . '>' . $select_list[$n] . '</option>' . "\n";
    }
    echo '</select>
<input type="hidden" style="padding: 0px; border: 0px; margin: 0px" name="p" value="' . $p . '">
<input type="hidden" style="padding: 0px; border: 0px; margin: 0px" name="lang" value="' . $lang . '">' . PHP_EOL;
    if ($SITE['ipad']) {
        echo '<input type="hidden" style="padding: 0px; border: 0px; margin: 0px" name="ipad" value ="y"/>' . PHP_EOL;
    }
    echo '<input type="submit" value="submit" />
</fieldset>
</form>
</td>
<td>
<h3 style=""> 10 ' . wswufcttransstr($trans . 'day forecast for') . ' ' . wswufcttransstr($select_list[$default]) . '</h3>
</td>
</tr></table>
</div>' . PHP_EOL;
} elseif ($printHead) {
    echo $headStr;
}
#-------------------------------------------------------------------------------
if ($printIcons) {
    echo '<div style="margin: 10px 0px;">' . $htmlicons . '</div>' . PHP_EOL;
}
if ($printGraph) {
    echo '<div id="containerTemp" style="height: 340px; margin: 10px 0px;">here the graph will be drawn</div>' . PHP_EOL;
    echo $graphPart1 . PHP_EOL;
}
if ($printTable) {
コード例 #3
0
ファイル: wuforecast3.php プロジェクト: shakaran/weatherpro
    if ($style == 'row-light') {
        // for odd even lines with different color
        $style = 'row-dark';
    } else {
        $style = 'row-light';
    }
}
// end for loop
$htmltable .= '
<tr>
<td colspan="3" style="text-align: right;"><img src="' . $myfolder . 'img/WUlogo.png"  alt="wu logo" /></td>
<td colspan="4" style="text-align: left;"><a href="' . $returnArray['request']['link'] . '" target="_blank" style="vertical-align: middle;">' . wswufcttransstr($trans . 'Weather forecast by') . '  WeatherUnderground</a></td>
</tr>
</tbody></table>' . PHP_EOL;
$credit = '<div class="blockHead">&nbsp;<small>(v3) ' . wswufcttransstr($trans . 'Original script by') . '&nbsp;<a href="http://leuven-template.eu/?lang=en" target="_blank">Weerstation Leuven</a>&nbsp;' . wswufcttransstr($trans . 'Forecast for') . '&nbsp;' . $returnArray['request']['city'] . '&nbsp;&nbsp;' . $returnArray['request']['updated'] . '</small></div>' . PHP_EOL;
$headStr = '<div class="blockHead"> 10 ' . wswufcttransstr($trans . 'day forecast for') . ' ' . $myWeatherstation . '</div>' . PHP_EOL;
#-------------------------------------------------------------------------------------
#  convert windspeed
function wuconvertwind($value)
{
    global $fromwind, $towind, $wsDebug;
    if ($fromwind == $towind) {
        if ($wsDebug) {
            echo '<!-- function wuconvertwind: in = speed: ' . $value . ', unitFrom: ' . $fromwind . ', unitTo: ' . $towind . '. No conversion needed -->' . PHP_EOL;
        }
        return $value;
    }
    $amount = str_replace(',', '.', $value);
    $out = 0;
    $convertArr = array("kmh" => array('kmh' => 1, 'kts' => 0.5399568034557235, 'ms' => 0.2777777777777778, 'mh' => 0.6213711922373339), "kts" => array('kmh' => 1.852, 'kts' => 1, 'ms' => 0.5144444444444445, 'mh' => 1.1507794480235425), "ms" => array('kmh' => 3.6, 'kts' => 1.9438444924406046, 'ms' => 1, 'mh' => 2.236936292054402), "mh" => array('kmh' => 1.609344, 'kts' => 0.8689762419006479, 'ms' => 0.44704, 'mh' => 1));
    if ($fromwind === 'kmh' || $fromwind === 'kts' || $fromwind === 'ms' || $fromwind === 'mh') {