<commit_before><?php
include("../../config/settings.inc.php");
include("$rootpath/include/database.inc.php");
$pgconn = iemdb("postgis");
pg_query($pgconn, "SET TIME ZONE 'GMT'");
include("$rootpath/include/lsrs.php");
include("$rootpath/include/google_keys.php");
include("$rootpath/include/wfoLocs.php");
include("$rootpath/include/forms.php");

/* Calling API */
$ts = isset($_GET["ts"]) ? strtotime($_GET["ts"]) : time();
$ts2 = isset($_GET["ts2"]) ? strtotime($_GET["ts2"]) : $ts;
$wfo = isset($_GET["wfo"]) ? $_GET["wfo"] : "DMX";
$lat0 = isset($_GET["lat0"]) ? $_GET["lat0"] : $wfos[$wfo]["lat"];
$lon0 = isset($_GET["lon0"]) ? $_GET["lon0"] : $wfos[$wfo]["lon"];
$year = isset($_GET["year"]) ? $_GET["year"] : date("Y", $ts);
if ($ts2 != $ts){
  $lat0 = $wfos[$wfo]["lat"];
  $lon0 = $wfos[$wfo]["lon"];
}

$smonth = isset($_GET["smonth"]) ? $_GET["smonth"] : date("m", $ts);
$sday = isset($_GET["sday"]) ? $_GET["sday"] : date("d", $ts);
$shour = isset($_GET["shour"]) ? $_GET["shour"] : date("H", $ts);
$sminute = isset($_GET["sminute"]) ? $_GET["sminute"] : date("i", $ts);

$emonth = isset($_GET["emonth"]) ? $_GET["emonth"] : date("m", $ts2);
$eday = isset($_GET["eday"]) ? $_GET["eday"] : date("d", $ts2);
$ehour = isset($_GET["ehour"]) ? $_GET["ehour"] : date("H", $ts2);
$eminute = isset($_GET["eminute"]) ? $_GET["eminute"] : date("i", $ts2);

if (! isset($_GET["ts"])){ $ts = mktime($shour, $sminute, 0, $smonth, $sday, $year);}
if (! isset($_GET["ts2"])){ $ts2 = mktime($ehour, $eminute, 0, $emonth, $eday, $year);}

$tsSQL = date("Y-m-d H:i:00+00", $ts);
$tsSQL2 = date("Y-m-d H:i:00+00", $ts2);
$year = date("Y", $ts);
$d1 = date("d M Y H:i" ,  $ts);
$d2 = date("d M Y H:i" ,  $ts2);

$basets = $ts - (($sminute % 5) * 60);

if ($ts >= $ts2){
$minx = $lon0 - 0.02;
$maxx = $lon0 + 0.02;
$miny = $lat0 - 0.02;
$maxy = $lat0 + 0.02;
$sql = "select distinct source, county, state, typetext,remark, x(geom) as lon, y(geom) as lat, 
        city, magnitude, valid, geom, type as ltype, wfo from lsrs_${year} 
        WHERE valid = '$tsSQL' and
        geom && GeomFromEWKT('SRID=4326;MULTIPOLYGON((($minx $miny,$minx $maxy,$maxx $maxy,$maxx $miny,$minx $miny)))') ORDER by valid ASC";
} else {
  $sql = "select distinct source, typetext, remark, county, state,
        x(geom) as lon, y(geom) as lat,
        city, magnitude, valid, geom, type as ltype, wfo from lsrs_${year}
        WHERE valid >= '$tsSQL' and valid <= '$tsSQL2' and
        wfo = '$wfo' ORDER by valid ASC";
}
$rs = pg_exec($pgconn, $sql);
$g = "";
$lats = Array();
$lons = Array();
$table = "<table cellspacing=\"0\" cellpadding=\"3\" border=\"1\">
<tr style=\"background: #fafa00;\"><th>GMT Time</th><th>County</th><th>Location</th><th>Type</th><th>Magnitude</th></tr>";

for ($i=0;$row = @pg_fetch_array($rs,$i); $i++)
{
   $timestamp = strtotime(substr($row["valid"],0,16));
   //$imgx = intval(($row["lon"] - $minx) / $dx);
   //$imgy = intval(($maxy - $row["lat"]) / $dy);
   $lats[] = $row["lat"];
   $lons[] = $row["lon"];
   $wfo = $row["wfo"];
   $table .= sprintf("<tr><td><a href=\"javascript: showMarker($i);\">%s</a></td><td>%s</td><td>%s,%s</td><td>%s</td><td>%s</td></tr><tr><td></td><td colspan=\"4\">%s</td></tr>",
    date("m/d/Y H:i", $timestamp), $row["county"], $row["city"], 
    $row["state"], $row["typetext"], $row["magnitude"], $row["remark"]);

   $desc = "<b>Event:</b> ". $row['typetext'] ."<br /><b>Time:</b> ". date('d M Y H:i', $timestamp) ." GMT<br /><b>Magnitude:</b> ". $row['magnitude'] ."<br /><b>Source:</b> ". $row['source'] ."<br /><b>Remark:</b> ". $row['remark'] ;

   $g .= "
 markers[$i] = new GMarker(new GLatLng(". $row["lat"] .", ". $row["lon"] ."));
    GEvent.addListener(markers[$i], \"click\", function() {
            markers[$i].openInfoWindowHtml(\"$desc\",
              {maxWidth: 300});
          });
    map.addOverlay(markers[$i]);
    markers[$i].openInfoWindowHtml(\"$desc\",
              {maxWidth: 300});
    ";
} /* End for() loop */

$table .= "</table>";

?>
<?php 
$TITLE = "Local Storm Reports";
$THISPAGE = "severe-";
$BODYEXTRA = "onload=\"load()\" onunload=\"GUnload()\"";
$HEADEXTRA = "
<script src=\"tooltip.js\" type=\"text/javascript\"></script>
<script src=\"http://maps.google.com/maps?file=api&amp;v=2&amp;key=". $GOOGLEKEYS[$rooturl]["maplsr"] ."\" type=\"text/javascript\"></script>";

include("$rootpath/include/header.php");?>
<script type="text/javascript">
//<![CDATA[
var icon = new GIcon();
icon.image = "http://labs.google.com/ridefinder/images/mm_20_blue.png";
icon.shadow = "http://labs.google.com/ridefinder/images/mm_20_shadow.png";
icon.iconSize = new GSize(12, 20);
icon.shadowSize = new GSize(22, 20);
icon.iconAnchor = new GPoint(6, 20);
icon.infoWindowAnchor = new GPoint(5, 1);

var map;
var sbwLayer;
var markers = new Array();


CustomGetTileUrl=function(a,b,c) {
  if (typeof(window['this.myMercZoomLevel'])=="undefined") this.myMercZoomLevel=0;
  if (typeof(window['this.myStyles'])=="undefined") this.myStyles="default";
  var lULP = new GPoint(a.x*256,(a.y+1)*256);
  var lLRP = new GPoint((a.x+1)*256,a.y*256);
  var lUL = G_NORMAL_MAP.getProjection().fromPixelToLatLng(lULP,b,c);
  var lLR = G_NORMAL_MAP.getProjection().fromPixelToLatLng(lLRP,b,c);
  // switch between Mercator and DD if merczoomlevel is set
  if (this.myMercZoomLevel!=0 && map.getZoom() < this.myMercZoomLevel) {
    var lBbox=dd2MercMetersLng(lUL.lngDegrees)+","+dd2MercMetersLat(lUL.latDegrees)+","+dd2MercMetersLng(lLR.lngDegrees)+","+dd2MercMetersLat(lLR.latDegrees);<commit_msg>and add it in on the banner please<commit_after><?php
include("../../config/settings.inc.php");
include("$rootpath/include/database.inc.php");
$pgconn = iemdb("postgis");
pg_query($pgconn, "SET TIME ZONE 'GMT'");
include("$rootpath/include/lsrs.php");
include("$rootpath/include/google_keys.php");
include("$rootpath/include/wfoLocs.php");
include("$rootpath/include/forms.php");

/* Calling API */
$ts = isset($_GET["ts"]) ? strtotime($_GET["ts"]) : time();
$ts2 = isset($_GET["ts2"]) ? strtotime($_GET["ts2"]) : $ts;
$wfo = isset($_GET["wfo"]) ? $_GET["wfo"] : "DMX";
$lat0 = isset($_GET["lat0"]) ? $_GET["lat0"] : $wfos[$wfo]["lat"];
$lon0 = isset($_GET["lon0"]) ? $_GET["lon0"] : $wfos[$wfo]["lon"];
$year = isset($_GET["year"]) ? $_GET["year"] : date("Y", $ts);
if ($ts2 != $ts){
  $lat0 = $wfos[$wfo]["lat"];
  $lon0 = $wfos[$wfo]["lon"];
}

$smonth = isset($_GET["smonth"]) ? $_GET["smonth"] : date("m", $ts);
$sday = isset($_GET["sday"]) ? $_GET["sday"] : date("d", $ts);
$shour = isset($_GET["shour"]) ? $_GET["shour"] : date("H", $ts);
$sminute = isset($_GET["sminute"]) ? $_GET["sminute"] : date("i", $ts);

$emonth = isset($_GET["emonth"]) ? $_GET["emonth"] : date("m", $ts2);
$eday = isset($_GET["eday"]) ? $_GET["eday"] : date("d", $ts2);
$ehour = isset($_GET["ehour"]) ? $_GET["ehour"] : date("H", $ts2);
$eminute = isset($_GET["eminute"]) ? $_GET["eminute"] : date("i", $ts2);

if (! isset($_GET["ts"])){ $ts = mktime($shour, $sminute, 0, $smonth, $sday, $year);}
if (! isset($_GET["ts2"])){ $ts2 = mktime($ehour, $eminute, 0, $emonth, $eday, $year);}

$tsSQL = date("Y-m-d H:i:00+00", $ts);
$tsSQL2 = date("Y-m-d H:i:00+00", $ts2);
$year = date("Y", $ts);
$d1 = date("d M Y H:i" ,  $ts);
$d2 = date("d M Y H:i" ,  $ts2);

$basets = $ts - (($sminute % 5) * 60);

if ($ts >= $ts2){
$minx = $lon0 - 0.02;
$maxx = $lon0 + 0.02;
$miny = $lat0 - 0.02;
$maxy = $lat0 + 0.02;
$sql = "select distinct source, county, state, typetext,remark, x(geom) as lon, y(geom) as lat, 
        city, magnitude, valid, geom, type as ltype, wfo from lsrs_${year} 
        WHERE valid = '$tsSQL' and
        geom && GeomFromEWKT('SRID=4326;MULTIPOLYGON((($minx $miny,$minx $maxy,$maxx $maxy,$maxx $miny,$minx $miny)))') ORDER by valid ASC";
} else {
  $sql = "select distinct source, typetext, remark, county, state,
        x(geom) as lon, y(geom) as lat,
        city, magnitude, valid, geom, type as ltype, wfo from lsrs_${year}
        WHERE valid >= '$tsSQL' and valid <= '$tsSQL2' and
        wfo = '$wfo' ORDER by valid ASC";
}
$rs = pg_exec($pgconn, $sql);
$g = "";
$lats = Array();
$lons = Array();
$table = "<table cellspacing=\"0\" cellpadding=\"3\" border=\"1\">
<tr style=\"background: #fafa00;\"><th>GMT Time</th><th>County</th><th>Location</th><th>Type</th><th>Magnitude</th></tr>";

for ($i=0;$row = @pg_fetch_array($rs,$i); $i++)
{
   $timestamp = strtotime(substr($row["valid"],0,16));
   //$imgx = intval(($row["lon"] - $minx) / $dx);
   //$imgy = intval(($maxy - $row["lat"]) / $dy);
   $lats[] = $row["lat"];
   $lons[] = $row["lon"];
   $wfo = $row["wfo"];
   $table .= sprintf("<tr><td><a href=\"javascript: showMarker($i);\">%s</a></td><td>%s</td><td>%s,%s</td><td>%s</td><td>%s</td></tr><tr><td></td><td colspan=\"4\">%s</td></tr>",
    date("m/d/Y H:i", $timestamp), $row["county"], $row["city"], 
    $row["state"], $row["typetext"], $row["magnitude"], $row["remark"]);

   $desc = "<b>Event:</b> ". $row['typetext'] ."<br /><b>Time:</b> ". date('d M Y H:i', $timestamp) ." GMT<br /><b>Magnitude:</b> ". $row['magnitude'] ."<br /><b>Source:</b> ". $row['source'] ."<br /><b>Remark:</b> ". $row['remark'] ;

   $g .= "
 markers[$i] = new GMarker(new GLatLng(". $row["lat"] .", ". $row["lon"] ."));
    GEvent.addListener(markers[$i], \"click\", function() {
            markers[$i].openInfoWindowHtml(\"$desc\",
              {maxWidth: 300});
          });
    map.addOverlay(markers[$i]);
    markers[$i].openInfoWindowHtml(\"$desc\",
              {maxWidth: 300});
    ";
} /* End for() loop */

$table .= "</table>";

?>
<?php 
$TITLE = "Local Storm Reports";
$THISPAGE = "severe-lsr";
$BODYEXTRA = "onload=\"load()\" onunload=\"GUnload()\"";
$HEADEXTRA = "
<script src=\"tooltip.js\" type=\"text/javascript\"></script>
<script src=\"http://maps.google.com/maps?file=api&amp;v=2&amp;key=". $GOOGLEKEYS[$rooturl]["maplsr"] ."\" type=\"text/javascript\"></script>";

include("$rootpath/include/header.php");?>
<script type="text/javascript">
//<![CDATA[
var icon = new GIcon();
icon.image = "http://labs.google.com/ridefinder/images/mm_20_blue.png";
icon.shadow = "http://labs.google.com/ridefinder/images/mm_20_shadow.png";
icon.iconSize = new GSize(12, 20);
icon.shadowSize = new GSize(22, 20);
icon.iconAnchor = new GPoint(6, 20);
icon.infoWindowAnchor = new GPoint(5, 1);

var map;
var sbwLayer;
var markers = new Array();


CustomGetTileUrl=function(a,b,c) {
  if (typeof(window['this.myMercZoomLevel'])=="undefined") this.myMercZoomLevel=0;
  if (typeof(window['this.myStyles'])=="undefined") this.myStyles="default";
  var lULP = new GPoint(a.x*256,(a.y+1)*256);
  var lLRP = new GPoint((a.x+1)*256,a.y*256);
  var lUL = G_NORMAL_MAP.getProjection().fromPixelToLatLng(lULP,b,c);
  var lLR = G_NORMAL_MAP.getProjection().fromPixelToLatLng(lLRP,b,c);
  // switch between Mercator and DD if merczoomlevel is set
  if (this.myMercZoomLevel!=0 && map.getZoom() < this.myMercZoomLevel) {
    var lBbox=dd2MercMetersLng(lUL.lngDegrees)+","+dd2MercMetersLat(lUL.latDegrees)+","+dd2MercMetersLng(lLR.lngDegrees)+","+dd2MercMetersLat(lLR.latDegrees);
{'fraction_non_alphanumeric': 0.2693899586107612, 'fraction_numerical': 0.02015475976246176, 'mean_word_length': 4.84384858044164, 'pattern_counts': {'":': 0, '<': 119, '<?xml version=': 0, '>': 117, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '320094', 'n_tokens_mistral': 4687, 'n_tokens_neox': 4527, 'n_words': 820}