• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP iemdb函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中iemdb函数的典型用法代码示例。如果您正苦于以下问题:PHP iemdb函数的具体用法?PHP iemdb怎么用?PHP iemdb使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了iemdb函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: get_iemprop

function get_iemprop($propname)
{
    $dbconn = iemdb("mesosite");
    $rs = pg_prepare($dbconn, "SELECT321" . $propname, "SELECT * from properties where\n        propname = \$1");
    $rs = pg_execute($dbconn, "SELECT321" . $propname, array($propname));
    if (pg_num_rows($rs) < 1) {
        return null;
    }
    $row = pg_fetch_array($rs, 0);
    return $row["propvalue"];
}
开发者ID:muthulatha,项目名称:iem,代码行数:11,代码来源:iemprop.php


示例2: neighbors

function neighbors($station, $lat, $lon)
{
    $con = iemdb("mesosite");
    $rs = pg_prepare($con, "_SELECT", "SELECT *,\n         ST_distance(ST_transform(geom,3857), \n                     ST_transform(ST_GeomFromEWKT('SRID=4326;POINT(" . $lon . " " . $lat . ")'), 3857)) /1000.0 as dist from stations \n         WHERE ST_point_inside_circle(geom, " . $lon . ", " . $lat . ", 0.25) \n         and id != \$1 ORDER by dist ASC");
    $result = pg_execute($con, "_SELECT", array($station));
    $s = "<table class=\"table table-striped\">\n   <thead><tr><th>Distance [km]</th><th>Network</th><th>Station Name</th></tr></thead>";
    for ($i = 0; $row = @pg_fetch_assoc($result, $i); $i++) {
        $s .= sprintf("<tr><td>%.3f</td><td><a href=\"locate.php?network=%s\">%s</a></td><td><a href=\"site.php?station=%s&network=%s\">%s</a></td></tr>", $row["dist"], $row["network"], $row["network"], $row["id"], $row["network"], $row["name"]);
    }
    $s .= "</table>";
    return $s;
}
开发者ID:muthulatha,项目名称:iem,代码行数:12,代码来源:neighbors.php


示例3: get_data2

function get_data2()
{
    global $phenomena, $significance;
    $dbconn = iemdb("postgis");
    $rs = pg_query("\n\t\tWITH data as (\n\t\t\tSELECT distinct wfo, eventid, extract(year from issue) as yr\n\t\t\tfrom warnings where phenomena = '{$phenomena}' and\n\t\t\tsignificance = '{$significance}'\n\t\t)\n\t\tSELECT wfo, yr, count(*) from data GROUP by wfo, yr\n\t");
    $data = array();
    for ($i = 0; $row = @pg_fetch_assoc($rs, $i); $i++) {
        $yr = $row["yr"];
        if (!array_key_exists($yr, $data)) {
            $data[$yr] = array();
        }
        $data[$yr][$row["wfo"]] = $row["count"];
    }
    return $data;
}
开发者ID:muthulatha,项目名称:iem,代码行数:15,代码来源:yearly_counts.php


示例4: NetworkTable

 function NetworkTable($a)
 {
     $this->table = array();
     $this->dbconn = iemdb("mesosite", PGSQL_CONNECT_FORCE_NEW);
     $rs = pg_prepare($this->dbconn, "SELECT", "SELECT *, ST_x(geom) as lon, \n    \tST_y(geom) as lat from stations WHERE network = \$1 ORDER by name ASC");
     $rs = pg_prepare($this->dbconn, "SELECTST", "SELECT *, ST_x(geom) as lon, \n    \tST_y(geom) as lat from stations WHERE id = \$1");
     if (is_string($a)) {
         $this->load_network($a);
     } else {
         if (is_array($a)) {
             foreach ($a as $network) {
                 $this->load_network($network);
             }
         }
     }
 }
开发者ID:muthulatha,项目名称:iem,代码行数:16,代码来源:network.php


示例5: StationData

 function StationData($a, $n = "")
 {
     $this->table = array();
     $this->dbconn = iemdb("mesosite");
     $rs = pg_prepare($this->dbconn, "SELECT  ST1", "SELECT *, " . "ST_x(geom) as lon, ST_y(geom) as lat from stations " . "WHERE id = \$1 and network = \$2");
     $rs = pg_prepare($this->dbconn, "SELECT  ST2", "SELECT *, " . "ST_x(geom) as lon, ST_y(geom) as lat from stations " . "WHERE id = \$1");
     if (is_string($a)) {
         $this->load_station($a, $n);
     } else {
         if (is_array($a)) {
             foreach ($a as $id) {
                 $this->load_station($id, $n);
             }
         }
     }
 }
开发者ID:muthulatha,项目名称:iem,代码行数:16,代码来源:station.php


示例6: download_data

function download_data($sts, $ets)
{
    $dbconn = iemdb('other');
    $rs = pg_prepare($dbconn, "SELECT", "SELECT * from asi_data WHERE\n\t\t\tvalid >= \$1 and valid < \$2 ORDER by valid ASC");
    $rs = pg_execute($dbconn, "SELECT", array(date("Y-m-d", $sts), date("Y-m-d", $ets)));
    header("Content-type: text/plain");
    echo "station,valid,";
    for ($i = 1; $i < 13; $i++) {
        echo sprintf("ch%savg,ch%ssd,ch%smax,ch%smin,", $i, $i, $i, $i);
    }
    echo "\n";
    for ($i = 0; $row = @pg_fetch_assoc($rs, $i); $i++) {
        echo sprintf("%s,%s,", $row['station'], $row['valid']);
        for ($j = 1; $j < 13; $j++) {
            echo sprintf("%s,%s,%s,%s,", $row["ch{$j}avg"], $row["ch{$j}sd"], $row["ch{$j}max"], $row["ch{$j}min"]);
        }
        echo "\n";
    }
}
开发者ID:muthulatha,项目名称:iem,代码行数:19,代码来源:asi.php


示例7: selectNetwork

function selectNetwork($selected, $extra = array())
{
    $selected = strtoupper($selected);
    include_once dirname(__FILE__) . "/database.inc.php";
    $dbconn = iemdb('mesosite');
    $rs = pg_exec($dbconn, "SELECT * from networks ORDER by name ASC");
    $s = "<select name=\"network\">\n";
    reset($extra);
    while (list($idx, $sid) = each($extra)) {
        $s .= "<option value=\"{$idx}\" ";
        if ($selected == $idx) {
            $s .= "SELECTED";
        }
        $s .= ">{$sid}</option>\n";
    }
    for ($i = 0; $row = @pg_fetch_array($rs, $i); $i++) {
        $s .= "<option value=\"" . $row["id"] . "\" ";
        if ($row["id"] == $selected) {
            $s .= "SELECTED";
        }
        $s .= ">" . $row["name"] . "</option>\n";
    }
    return $s;
}
开发者ID:muthulatha,项目名称:iem,代码行数:24,代码来源:imagemaps.php


示例8: define

define("IEM_APPID", 156);
include_once "../../include/myview.php";
include_once "../../include/database.inc.php";
include_once "../../include/forms.php";
include_once "../../include/imagemaps.php";
include_once "../../include/network.php";
$nt = new NetworkTable("NWSCLI");
$station = isset($_GET["station"]) ? $_GET["station"] : 'KDSM';
$year = isset($_GET["year"]) ? intval($_GET["year"]) : date("Y");
$month = isset($_GET["month"]) ? intval($_GET["month"]) : null;
$day = isset($_GET["day"]) ? intval($_GET["day"]) : null;
$opt = isset($_GET["opt"]) ? $_GET["opt"] : "bystation";
$ys = yearSelect(2009, $year, "year");
$ms = monthSelect($month, "month");
$ds = daySelect($day, "day");
$pgconn = iemdb("iem");
$byday = false;
if ($opt === "bystation") {
    $title = sprintf("Station: %s for Year: %s", $station, $year);
    $col1label = "Date";
    $rs = pg_prepare($pgconn, "SELECT", "SELECT *,\n\t\t\tarray_to_string(high_record_years, ' ') as hry,\n\t\t\tarray_to_string(low_record_years, ' ') as lry,\n\t\t\tarray_to_string(precip_record_years, ' ') as pry,\n\t\t\tarray_to_string(snow_record_years, ' ') as sry\n\t\t\tfrom cli_data where\n\t\t\tstation = \$1 and valid BETWEEN \$2 and \$3 ORDER by valid ASC");
    $rs = pg_execute($pgconn, "SELECT", array($station, "{$year}-01-01", "{$year}-12-31"));
} else {
    $col1label = "Station";
    $byday = true;
    $day = mktime(0, 0, 0, $month, $day, $year);
    $title = sprintf("All Stations for Date: %s", date("d F Y", $day));
    $rs = pg_prepare($pgconn, "SELECT", "SELECT *,\n\t\t\tarray_to_string(high_record_years, ' ') as hry,\n\t\t\tarray_to_string(low_record_years, ' ') as lry,\n\t\t\tarray_to_string(precip_record_years, ' ') as pry,\n\t\t\tarray_to_string(snow_record_years, ' ') as sry\n\t\t\tfrom cli_data where\n\t\t\tvalid = \$1 ORDER by station ASC");
    $rs = pg_execute($pgconn, "SELECT", array(date("Y-m-d", $day)));
}
$table = <<<EOF
开发者ID:muthulatha,项目名称:iem,代码行数:31,代码来源:clitable.php


示例9: sqrt

    $var = sqrt($sum / (count($std) - 1));
    return round($var, 2);
}
$station = isset($_GET["station"]) ? $_GET['station'] : 'IA0200';
/* Setup start/end dates */
$smonth = isset($_GET['smonth']) ? $_GET['smonth'] : 5;
$sday = isset($_GET['sday']) ? $_GET['sday'] : 1;
$emonth = isset($_GET['emonth']) ? $_GET['emonth'] : 5;
$eday = isset($_GET['eday']) ? $_GET['eday'] : 31;
$sts = mktime(0, 0, 0, $smonth, $sday, 2000);
$ets = mktime(0, 0, 0, $emonth, $eday, 2000);
$stsSQL = date("Y-m-d", $sts);
$etsSQL = date("Y-m-d", $ets);
$subtitle = sprintf("Between %s and %s", date('M d', $sts), date('M d', $ets));
/* Query out the average accumulations during that time */
$coop = iemdb("coop");
pg_prepare($coop, "SELECTOR", "select year, round(sum(precip)::numeric,2) as rain from alldata_ia\n  WHERE extract(doy from day) BETWEEN extract(doy from '{$stsSQL}'::date) and \n  extract(doy from '{$etsSQL}'::date) and station = \$1 and \n  year < extract(year from now()) GROUP by year ORDER by rain ASC");
$rs = pg_execute($coop, "SELECTOR", array($station));
/* Generate plot */
$rowcount = pg_numrows($rs);
$data = array();
$rdata = array();
for ($i = 0; $row = @pg_fetch_array($rs, $i); $i++) {
    if ($i == 0) {
        $lowVal = $row["rain"];
        $lowYear = $row["year"];
    }
    if ($i == $rowcount - 1) {
        $hiVal = $row["rain"];
        $hiYear = $row["year"];
    }
开发者ID:raprasad,项目名称:iem,代码行数:31,代码来源:precip_cdf.php


示例10: header

<?php

header("Content-type: text/plain");
echo 'Title: SchoolNet Where is it raining?
Refresh: 1 
Color: 200 200 255
Font: 1, 11, 1, "Courier New"

';
include "../../../config/settings.inc.php";
include "../../../include/database.inc.php";
include "../../../include/mlib.php";
include "../../../include/network.php";
$nt = new NetworkTable(array("KCCI", "KIMT", "KELO"));
$pgconn = iemdb("access");
$rs = pg_query($pgconn, "select * from events WHERE \n\t\tvalid > now() - '5 minutes'::interval and event = 'P+' ");
for ($i = 0; $row = @pg_fetch_array($rs, $i); $i++) {
    $lat = $nt->table[$row["station"]]["lat"];
    $lon = $nt->table[$row["station"]]["lon"];
    $hover = sprintf("Name: %s\\n15 minute:%s IN", $nt->table[$row["station"]]["name"], $row["magnitude"]);
    echo "Object: " . $lat . "," . $lon . "\n  Text:  0, 0, 1, \"" . $row["magnitude"] . "\", \"{$hover}\"\n End: \n\n";
}
开发者ID:muthulatha,项目名称:iem,代码行数:22,代码来源:snet_raining.php


示例11: putenv

<?php

putenv("TZ=GMT");
include "../../config/settings.inc.php";
include "../../include/database.inc.php";
$mos = iemdb("mos");
pg_exec($mos, "SET TIME ZONE 'GMT'");
$year1 = isset($_GET["year1"]) ? $_GET["year1"] : date("Y", time() + 86400);
$year2 = isset($_GET["year2"]) ? $_GET["year2"] : date("Y", time() + 86400);
$month1 = isset($_GET["month1"]) ? $_GET["month1"] : date("m", time() + 86400);
$month2 = isset($_GET["month2"]) ? $_GET["month2"] : date("m", time() + 86400);
$day1 = isset($_GET["day1"]) ? $_GET["day1"] : date("d", time() + 86400);
$day2 = isset($_GET["day2"]) ? $_GET["day2"] : date("d", time() + 86400);
$hour1 = isset($_GET["hour1"]) ? $_GET["hour1"] : 0;
$hour2 = isset($_GET["hour2"]) ? $_GET["hour2"] : 12;
$model = isset($_GET["model"]) ? $_GET["model"] : "GFS";
$station = isset($_GET["station"]) ? strtoupper($_GET["station"]) : "KAMW";
$sts = mktime($hour1, 0, 0, $month1, $day1, $year1);
$ets = mktime($hour2, 0, 0, $month2, $day2, $year2);
$table = "alldata";
if ($year1 == $year2) {
    $table = sprintf("t%s", $year1);
}
$rs = pg_prepare($mos, "SELECTOR", "select *, t06_1 ||'/'||t06_2 as t06, \n                 t12_1 ||'/'|| t12_2 as t12  from {$table} WHERE station = \$1\n                 and runtime >= \$2 and runtime <= \$3 and \n                 (model = \$4 or model = \$5)\n                 ORDER by runtime,ftime ASC");
if ($model == "NAM") {
    $model2 = "ETA";
}
if ($model == "GFS") {
    $model2 = "AVN";
}
$rs = pg_execute($mos, "SELECTOR", array($station, date("Y-m-d H:i", $sts), date("Y-m-d H:i", $ets), $model, $model2));
开发者ID:muthulatha,项目名称:iem,代码行数:31,代码来源:dl.php


示例12: iemdb

$snet->set("status", MS_ON);
$iards = $map->getlayerbyname("iards");
$iards->set("status", MS_ON);
$bar640t = $map->getlayerbyname("bar640t");
$bar640t->set("status", MS_ON);
$ponly = $map->getlayerbyname("pointonly");
$ponly->set("status", MS_ON);
$states = $map->getlayerbyname("states");
$states->set("status", MS_ON);
$img = $map->prepareImage();
$counties->draw($img);
$states->draw($img);
$iards->draw($img);
$bar640t->draw($img);
$c = iemdb("isuag");
$climatedb = iemdb("coop");
$sstr = strftime("%Y-%m-%d", $gs_start);
$estr = strftime("%Y-%m-%d", $gs_end);
$cStart = "2000" . strftime("-%m-%d", $gs_start);
$cEnd = "2000" . strftime("-%m-%d", $gs_end);
$sstr_txt = strftime("%b %d", $gs_start);
$estr_txt = strftime("%b %d", $gs_end);
function gdd($high, $low, $ceiling, $floor)
{
    if ($low < $floor) {
        $low = $floor;
    }
    if ($high > $ceiling) {
        $high = $ceiling;
    }
    if ($high < $floor) {
开发者ID:muthulatha,项目名称:iem,代码行数:31,代码来源:gsplot.php


示例13: iemdb

<?php

include "../../config/settings.inc.php";
include "../../include/database.inc.php";
$con = iemdb("postgis");
$sql = "SELECT max(valid) as valid from roads_current";
$rs = pg_query($con, $sql);
$row = pg_fetch_array($rs, 0);
$valid = substr($row["valid"], 0, 16);
$map = ms_newMapObj('roads.map');
//$map->setProjection("init=epsg:4326");
$map->setProjection("init=epsg:26915");
$map->selectOutputFormat("jpeg");
$map->setextent(122487.56, 4443095.235, 809431.656, 4919662.5);
$map->set("width", 720);
$map->set("height", 496);
$img = $map->prepareImage();
$background = $map->getlayerbyname("kwwlback");
$background->set("status", MS_ON);
$background->set("data", "images/26915/kcau.tif");
$background->draw($img);
//$counties = $map->getlayerbyname("counties");
//$counties->set("status", MS_ON);
//$counties->draw($img);
//$states = $map->getlayerbyname("states");
//$states->set("status", MS_ON);
//$states->draw($img);
$roads = $map->getlayerbyname("roads");
$roads->set("status", MS_ON);
if (isset($_GET["extreme"])) {
    $roads->set("data", "geom from (select b.type as rtype, b.int1, b.oid as boid, b.segid, c.cond_code, b.geom from roads_base b, roads_2007_log c WHERE b.segid = c.segid and c.valid = '2007-03-02 00:11' and b.type > 1  ORDER by b.segid DESC) as foo using UNIQUE boid using SRID=26915");
开发者ID:muthulatha,项目名称:iem,代码行数:31,代码来源:kcau.php


示例14: isset

<?php

include "../../config/settings.inc.php";
include "../../include/database.inc.php";
/* We need to get some CGI vars! */
$year = isset($_GET['year']) ? $_GET['year'] : die;
$month = isset($_GET['month']) ? $_GET['month'] : die;
$day = isset($_GET['day']) ? $_GET['day'] : die;
$pvar = isset($_GET['pvar']) ? $_GET['pvar'] : die;
$sts = mktime(0, 0, 0, $month, $day, $year);
$vars = array();
$pgconn = iemdb("other");
$sql = "SELECT * from flux_vars ORDER by details ASC";
$rows = pg_exec($pgconn, $sql);
for ($i = 0; $row = @pg_fetch_array($rows, $i); $i++) {
    $vars[$row["name"]] = array("units" => $row["units"], "details" => $row["details"]);
}
$rs = pg_prepare($pgconn, "SELECT", "SELECT * from flux_data WHERE\n      valid >= \$1 and valid < (\$1 + '1 day'::interval) \n\t  and {$pvar} IS NOT NULL ORDER by valid ASC");
$rs = pg_prepare($pgconn, "METADATA", "SELECT * from flux_meta WHERE \n      sts < \$1 and ets > \$1");
$rs = pg_execute($pgconn, "SELECT", array(date('Y-m-d', $sts)));
$data = array("NSTL11" => array(), "NSTL10" => array(), "NSTL30FT" => array(), "NSTL110" => array(), "NSTLNSPR" => array());
$times = array("NSTL11" => array(), "NSTL10" => array(), "NSTL30FT" => array(), "NSTL110" => array(), "NSTLNSPR" => array());
for ($i = 0; $row = @pg_fetch_array($rs, $i); $i++) {
    $ts = strtotime(substr($row["valid"], 0, 16));
    $stid = $row["station"];
    $val = floatval($row[$pvar]);
    if ($val > -90000) {
        $data[$stid][] = floatval($row[$pvar]);
        $times[$stid][] = $ts;
    }
}
开发者ID:bthoover,项目名称:iem,代码行数:31,代码来源:plot.php


示例15: sprintf

    $windhail = "";
    if ($warn["windtag"] != null) {
        $windhail = sprintf("<br />H: %s\"<br />W: %s", $warn["hailtag"], $warn["windtag"]);
    }
    $s = sprintf("<tr><td style=\"background: %s;\"><a href=\"%s\">%s.%s</a>%s</td>\n  \t\t<td>%s</td><td>%s</td>\n  \t\t<td colspan=\"2\"><a href=\"%s\" target=\"_new\">%s</a></td>\n  \t\t<td><a href=\"%s\">%s</a></td><td>%.0f sq km</td>\n  \t\t<td>%.0f sq km</td><td>%.0f %%</td>\n  \t\t<td>%.0f%% <a href=\"/GIS/radmap.php?layers[]=legend&layers[]=ci&layers[]=cbw&layers[]=sbw&layers[]=uscounties&layers[]=bufferedlsr&vtec=%s.K%s.%s.%s.%04d&lsrbuffer=%s\">Visual</a></td>\n  \t\t<td>%s</td></tr>\n", $background, $uri, $warn["phenomena"], $warn["eventid"], $windhail, gmdate("m/d/Y H:i", $warn["sts"]), gmdate("m/d/Y H:i", $warn["expire"]), $uri, implode(", ", $warn["ugcname"]), $uri, $warn["status"], $warn["parea"], $warn["carea"], ($warn["carea"] - $warn["parea"]) / $warn["carea"] * 100, $bratio, date("Y", $ts), $warn["wfo"], $warn["phenomena"], $warn["significance"], $warn["eventid"], $lsrbuffer, clean_area_verify($warn["buffered"], $warn["parea"]));
    reset($warn["lsrs"]);
    if (sizeof($warn["lsrs"]) == 0 && $warn["verify"]) {
        $s .= "<tr><td></td><td colspan=\"10\">The warning above had one or more local\n  \t\t\tstorm reports that were within previously issued warnings and are\n  \t\t\tnot double counted here.  Thus the warning appears as verified,\n  \t\t\tbut no local storm reports are shown. Future code improvements may \n  \t\t\tbe added to the Cow to better account for these.</td></tr>";
    }
    while (list($k, $lsr) = each($warn["lsrs"])) {
        $s .= printLSR($cow->lsrs[$lsr]);
    }
    return $s;
}
include_once "../../include/cow.php";
$cow = new Cow(iemdb("postgis"));
$cow->setLimitWFO(array($wfo));
$cow->setLimitTime($sts, $ets);
$cow->setHailSize($hail);
$cow->setWind($wind);
$cow->setLimitType($wtype);
$cow->setLimitLSRType($ltype);
$cow->setLSRBuffer($lsrbuffer);
$cow->setWarningBuffer($warnbuffer);
if (isset($useWindHailTag) && $useWindHailTag == 'Y') {
    $cow->useWindHailTag = true;
}
if (isset($limitwarns) && $limitwarns == 'Y') {
    $cow->limitwarns = true;
}
$cow->milk();
开发者ID:muthulatha,项目名称:iem,代码行数:31,代码来源:worker.php


示例16: define

<?php

include "../../config/settings.inc.php";
define("IEM_APPID", 6);
include "../../include/database.inc.php";
include_once "../../include/myview.php";
include_once "../../include/forms.php";
$pgconn = iemdb("mesosite");
$network = isset($_GET['network']) ? $_GET['network'] : 'IA_ASOS';
if ($network == '_ALL_') {
    $sql = "SELECT *,\n            ST_x(geom) as longitude, ST_y(geom) as latitude from stations\n            WHERE online = 'y' and '_ALL_' = \$1 ORDER by name";
} else {
    if (isset($_GET["special"]) && $_GET["special"] == 'allasos') {
        $sql = "SELECT *,\n            ST_x(geom) as longitude, ST_y(geom) as latitude from stations\n            WHERE online = 'y' and\n\t\t\t(network ~* 'ASOS' or network = 'AWOS') and\n\t\t\t'IA_ASOS' = \$1 ORDER by name";
        $network = "IA_ASOS";
    } else {
        $sql = "SELECT *,\n            ST_x(geom) as longitude, ST_y(geom) as latitude from stations\n            WHERE online = 'y' and\n\t\t\tnetwork = \$1 ORDER by name";
    }
}
$rs = pg_prepare($pgconn, "NTSELECT", $sql);
include "../../include/imagemaps.php";
$format = isset($_GET['format']) ? $_GET['format'] : 'html';
$nohtml = isset($_GET['nohtml']);
$table = "";
if (strlen($network) > 0) {
    $result = pg_execute($pgconn, "NTSELECT", array($network));
    if ($format == "html") {
        $table .= "<p><table class=\"table table-striped\">\n";
        $table .= "<caption><b>" . $network . " Network</b></caption>\n";
        $table .= "<thead><tr><th>ID</th><th>Station Name</td><th>Latitude<sup>1</sup></th>\n\t\t\t<th>Longitude<sup>1</sup></th><th>Elevation [m]</th><th>Archive Begins</th><th>IEM Network</th></tr></thead>\n";
        for ($i = 0; $row = @pg_fetch_array($result, $i); $i++) {
开发者ID:muthulatha,项目名称:iem,代码行数:31,代码来源:networks.php


示例17: array

    $shefcodes = array();
    $rs = pg_query($mesosite, "SELECT * from shef_physical_codes");
    for ($i = 0; $row = @pg_fetch_assoc($rs, $i); $i++) {
        $shefcodes[$row['code']] = $row['name'];
    }
    $durationcodes = array();
    $rs = pg_query($mesosite, "SELECT * from shef_duration_codes");
    for ($i = 0; $row = @pg_fetch_assoc($rs, $i); $i++) {
        $durationcodes[$row['code']] = $row['name'];
    }
    $extremumcodes = array();
    $rs = pg_query($mesosite, "SELECT * from shef_extremum_codes");
    for ($i = 0; $row = @pg_fetch_assoc($rs, $i); $i++) {
        $extremumcodes[$row['code']] = $row['name'];
    }
    $pgconn = iemdb('access');
    pg_query($pgconn, "SET time zone '" . $metadata['tzname'] . "'");
    $rs = pg_prepare($pgconn, "SELECT", "SELECT * from current_shef\n \t\t\twhere station = \$1 ORDER by physical_code ASC");
    $rs = pg_execute($pgconn, "SELECT", array($station));
    $table .= "<table class=\"table table-striped\">\n\t\t\t<thead><tr><th>Physical Code</th><th>Duration</th><th>Extremum</th>\n\t\t\t<th>Valid</th><th>Value</th></thead>";
    for ($i = 0; $row = @pg_fetch_assoc($rs, $i); $i++) {
        $ts = strtotime($row["valid"]);
        $depth = "";
        if ($row["depth"] > 0) {
            $depth = sprintf("%d inch", $row["depth"]);
        }
        $table .= sprintf("<tr><td>[%s] %s %s</td><td>[%s] %s</td><td>[%s] %s</td><td>%s</td><td>%s</td></tr>", $row["physical_code"], $shefcodes[$row["physical_code"]], $depth, $row["duration"], $durationcodes[$row["duration"]], $row["extremum"] == 'Z' ? '-' : $row['extremum'], $extremumcodes[$row["extremum"]], date('d M Y g:i A', $ts), $row["value"]);
    }
    $table .= "</table>";
} else {
    include "../../include/iemaccess.php";
开发者ID:muthulatha,项目名称:iem,代码行数:31,代码来源:current.php


示例18: foreach

            foreach ($Rcities as $key => $value) {
                $station = $key;
                include "plot_1min.php";
            }
        } else {
            foreach ($stations as $key => $value) {
                $station = $value;
                include "plot_1min.php";
            }
        }
    } else {
        header("Content-type: text/plain");
    }
}
if ($what != "plot") {
    $connection = iemdb("rwis");
    $query1 = "SET TIME ZONE 'GMT'";
    $result = pg_exec($connection, $query1);
    $rs = pg_exec($connection, $sqlStr);
    pg_close($connection);
    if ($gis == "yes") {
        echo "station,station_name,lat,lon,valid(GMT),";
    } else {
        echo "station,station_name,valid(GMT),";
    }
    for ($j = 0; $j < $num_vars; $j++) {
        echo $vars[$j] . $d[$delim];
        if ($vars[$j] == "ca1") {
            echo "ca1code" . $d[$delim];
        }
        if ($vars[$j] == "ca2") {
开发者ID:muthulatha,项目名称:iem,代码行数:31,代码来源:traffic_dl.php


示例19: iemdb

<?php

/*
 * Generate Watch by county placefile
 */
include "../../../config/settings.inc.php";
include "{$rootpath}/include/database.inc.php";
$dbconn = iemdb("postgis");
header("Content-type: text/plain");
$rs = pg_query($dbconn, "select phenomena, eventid, \n \t\tST_asText(ST_Multi(ST_buffer(ST_collect( u.geom ),0))) as g \n \t\tfrom warnings w JOIN ugcs u on (u.gid = w.gid) \n \t\tWHERE significance = 'A' and phenomena IN ('TO','SV') and \n \t\tissue <= now() and expire > now() \n \t\tand substr(w.ugc,3,1) = 'C' GROUP by phenomena, eventid \n \t\tORDER by phenomena ASC");
echo "Refresh: 10\n";
echo "Threshold: 999\n";
echo "Title: SPC Watch by County\n";
for ($i = 0; $row = @pg_fetch_array($rs, $i); $i++) {
    $geom = $row["g"];
    if ($geom == null) {
        continue;
    }
    //echo $geom ."\n";
    $geom = str_replace("MULTIPOLYGON(((", "", $geom);
    $geom = str_replace(")))", "", $geom);
    $tokens3 = preg_split("/\\)\\),\\(\\(/", $geom);
    foreach ($tokens3 as $token3) {
        $tokens = preg_split("/\\),\\(/", $token3);
        foreach ($tokens as $token) {
            if ($row["phenomena"] == "SV") {
                $c = ", 255, 255, 0, 255";
            } else {
                $c = ", 255, 0, 0, 255";
            }
            echo "\n;" . $row["phenomena"] . " Watch Number " . $row["eventid"] . "\n";
开发者ID:muthulatha,项目名称:iem,代码行数:31,代码来源:watch_by_county.php


示例20: isset

$cities = $nt->table;
$station = isset($_GET["station"]) ? $_GET["station"] : "SKCI4";
$year = isset($_GET["year"]) ? $_GET["year"] : date("Y");
$month = isset($_GET["month"]) ? $_GET["month"] : date("m");
$day = isset($_GET["day"]) ? $_GET["day"] : date("d");
$myTime = mktime(0, 0, 0, $month, $day, $year);
$yesterday = mktime(0, 0, 0, date("m"), date("d"), date("Y")) - 96400;
if ($myTime >= $yesterday) {
    /* Look in IEM Access! */
    $dbconn = iemdb("access");
    $tbl = "current_log";
    $pcol = ", pres as alti";
    $rs = pg_prepare($dbconn, "SELECT", "SELECT * {$pcol} from {$tbl} c JOIN stations s ON (s.iemid = c.iemid)\n                 WHERE id = \$1 and date(valid) = \$2 ORDER by valid ASC");
} else {
    /* Dig in the archive for our data! */
    $dbconn = iemdb("snet");
    $tbl = sprintf("t%s", date("Y_m", $myTime));
    $pcol = "";
    $rs = pg_prepare($dbconn, "SELECT", "SELECT * {$pcol} from {$tbl} \n                 WHERE station = \$1 and date(valid) = \$2 ORDER by valid ASC");
}
$rs = pg_execute($dbconn, "SELECT", array($station, date("Y-m-d", $myTime)));
if (pg_num_rows($rs) == 0) {
    $led = new DigitalLED74();
    $led->StrokeNumber('NO DATA FOR THIS DATE', LEDC_GREEN);
    die;
}
$titleDate = strftime("%b %d, %Y", $myTime);
$cityname = $cities[$station]['name'];
/* BEGIN GOOD WORK HERE */
$times = array();
$temps = array();
开发者ID:muthulatha,项目名称:iem,代码行数:31,代码来源:1min_T.php



注:本文中的iemdb函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP ifLabel函数代码示例发布时间:2022-05-15
下一篇:
PHP iefixStart函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap