<commit_before><?php
include("../../config/settings.inc.php");
session_start();
$metar = isset($_GET['metar']) ? $_GET["metar"] : "no";
$sortcol = isset($_GET["sortcol"]) ? $_GET["sortcol"] : "ts";
$expiry = 60*60*24*100; // 100 days
//setcookie(session_name(), session_id(), time()+$expiry, "/");

if (!isset($_SESSION['stations'])){
  $_SESSION['stations'] = Array();
  if (isset($_COOKIE['stations'])){
    $_SESSION['stations'] = explode(",", $_COOKIE['stations']);
  }
} 

$st = isset($_GET["st"]) ? $_GET["st"] : "";
$str = isset($_GET["str"]) ? $_GET["str"] : "";

if ($st != ""){
    foreach ($st as $key => $value) {
      if (strlen($value) > 0 && $value != "ahack") {
        array_push( $_SESSION['stations'], $value);
      }
    }
  }
  if ($str != ""){
   foreach ($str as $key => $value) {
      if (strlen($value) > 0 && $value != "ahack") {
        foreach ($_SESSION['stations'] as $key2 => $value2){
          if ($value2 == $value){
            unset($_SESSION['stations'][$key2]);
          }
        }
      }
    } 
}
setcookie("stations", implode(",", $_SESSION['stations']),time()+$expiry, "/");

?>

<?php 
 $TITLE = "MY IEM | Current Conditions";
 $REFRESH = "<meta http-equiv=\"refresh\" content=\"60;
 URL=current.phtml?sortcol=$sortcol&metar=$metar\">";
 $HEADEXTRA = '<script language="JavaScript" type="text/javascript">
<!--//BEGIN Script
function new_window(url) {
	link = 
	window.open(url,"Link","toolbar=0,location=0,directories=0,status=0,menubar=no,scrollbars=yes,resizable=yes,width=800,height=600");
} 
//END Script-->
</script>
<script type="text/javascript" src="/js/tableruler.js"></script>
<script type="text/javascript">
    window.onload=function(){tableruler();}
</script>';
 $THISPAGE = "current-sort";
 include("$rootpath/include/header.php"); ?>
<?php include("$rootpath/include/mlib.php"); ?>
<?php include("$rootpath/include/iemaccess.php"); ?>
<?php include("$rootpath/include/iemaccessob.php"); ?>

<?php $current_network = "My Favorites"; include("$rootpath/include/current_bar.inc.php"); ?>
<form method="GET" action="current.phtml">
<input type="hidden" name="sortcol" value="<?php echo $sortcol; ?>">

<div class="text"><p>
<table class="back" border=1 cellspacing=0 cellpadding=1>
<tr>
  <th>View Options:</th>
  <td>Include METARS (ASOS):
  <input value="no" type="radio" name="metar" <?php if ($metar == "no") echo  "CHECKED"; ?>> No
  <input value="yes" type="radio" name="metar" <?php if ($metar == "yes") echo  "CHECKED"; ?>> Yes
</td>
<td><input type="submit" value="Go!"></form></td>
</tr></table><p>


<h3 class="subtitle"><center>Current Conditions</center></h3><p>

<?php
if (strlen($sortcol) == 0) {
  $sortcol = "valid";
}
$vals = Array("valid" => "Observation Time", "tmpf" => "Temperature", 
 "dwpf" => "Dew Point", "pres" => "Altimeter", "relh" => "Relative Humidity",
 "sknt" => "Wind Speed", 12 => "20 min Gust",
"gust" => "Peak Gust Today", "gtim" => "Time of Peak Gust", 
"pday" => "Today's Precipitation", "feel" => "Feels Like", 
"pmonth" => "Month's Precipitation", "phour" => "Hourly Precip",
"tmpf0" => "Sensor 1 - Temp [F]",  "sname" => "Station Name",
  "tmpf1" => "Sensor 2 - Temp [F]",
  "tmpf2" => "Sensor 3 - Temp [F]",
  "tmpf3" => "Sensor 4 - Temp [F]",
  "dry0" => "Sensor 1 - Cond [F]",
  "dry1" => "Sensor 2 - Cond [F]",
  "dry2" => "Sensor 3 - Cond [F]",
  "dry3" => "Sensor 4 - Cond [F]",
  "ts" => "Observation Time", "min_tmpf" => "Low Air Temperature Today",
  "vsby" => "Visibility", "max_tmpf" => "High Air Temperature Today",
  "max_sknt_ts" => "Time of Peak Gust",
  "max_sknt" => "Wind Gust [knots]",
  "city" => "Site Name");

echo "<br>Sorted by: <b>(". $vals[$sortcol] .")</b>  &nbsp; &nbsp; Click on a column to sort it.<br>\n";

?>

<?php
// http://www.php.net/manual/en/function.asort.php

function aSortBySecondIndex($multiArray, $secondIndex) {
	while (list($firstIndex, ) = each($multiArray))<commit_msg>undefs<commit_after><?php
include("../../config/settings.inc.php");
session_start();
$metar = isset($_GET['metar']) ? $_GET["metar"] : "no";
$sortcol = isset($_GET["sortcol"]) ? $_GET["sortcol"] : "ts";
$expiry = 60*60*24*100; // 100 days
//setcookie(session_name(), session_id(), time()+$expiry, "/");

if (!isset($_SESSION['stations'])){
  $_SESSION['stations'] = Array();
  if (isset($_COOKIE['stations'])){
    $_SESSION['stations'] = explode(",", $_COOKIE['stations']);
  }
} 

$st = isset($_GET["st"]) ? $_GET["st"] : "";
$str = isset($_GET["str"]) ? $_GET["str"] : "";

if ($st != ""){
    foreach ($st as $key => $value) {
      if (strlen($value) > 0 && $value != "ahack") {
        array_push( $_SESSION['stations'], $value);
      }
    }
  }
  if ($str != ""){
   foreach ($str as $key => $value) {
      if (strlen($value) > 0 && $value != "ahack") {
        foreach ($_SESSION['stations'] as $key2 => $value2){
          if ($value2 == $value){
            unset($_SESSION['stations'][$key2]);
          }
        }
      }
    } 
}
setcookie("stations", implode(",", $_SESSION['stations']),time()+$expiry, "/");

?>

<?php 
 $TITLE = "MY IEM | Current Conditions";
 $REFRESH = "<meta http-equiv=\"refresh\" content=\"60;
 URL=current.phtml?sortcol=$sortcol&metar=$metar\">";
 $HEADEXTRA = '<script language="JavaScript" type="text/javascript">
<!--//BEGIN Script
function new_window(url) {
	link = 
	window.open(url,"Link","toolbar=0,location=0,directories=0,status=0,menubar=no,scrollbars=yes,resizable=yes,width=800,height=600");
} 
//END Script-->
</script>
<script type="text/javascript" src="/js/tableruler.js"></script>
<script type="text/javascript">
    window.onload=function(){tableruler();}
</script>';
 $THISPAGE = "current-sort";
 include("$rootpath/include/header.php"); ?>
<?php include("$rootpath/include/mlib.php"); ?>
<?php include("$rootpath/include/iemaccess.php"); ?>
<?php include("$rootpath/include/iemaccessob.php"); ?>

<?php $current_network = "My Favorites"; include("$rootpath/include/current_bar.inc.php"); ?>
<form method="GET" action="current.phtml">
<input type="hidden" name="sortcol" value="<?php echo $sortcol; ?>">

<div class="text"><p>
<table class="back" border=1 cellspacing=0 cellpadding=1>
<tr>
  <th>View Options:</th>
  <td>Include METARS (ASOS):
  <input value="no" type="radio" name="metar" <?php if ($metar == "no") echo  "CHECKED"; ?>> No
  <input value="yes" type="radio" name="metar" <?php if ($metar == "yes") echo  "CHECKED"; ?>> Yes
</td>
<td><input type="submit" value="Go!"></form></td>
</tr></table><p>


<h3 class="subtitle"><center>Current Conditions</center></h3><p>

<?php
if (strlen($sortcol) == 0) {
  $sortcol = "valid";
}
$vals = Array("valid" => "Observation Time", "tmpf" => "Temperature", 
 "dwpf" => "Dew Point", "pres" => "Altimeter", "relh" => "Relative Humidity",
 "sknt" => "Wind Speed", 12 => "20 min Gust",
"gust" => "Peak Gust Today", "gtim" => "Time of Peak Gust", 
"pday" => "Today's Precipitation", "feel" => "Feels Like", 
"pmonth" => "Month's Precipitation", "phour" => "Hourly Precip",
"tmpf0" => "Sensor 1 - Temp [F]",  "sname" => "Station Name",
  "tmpf1" => "Sensor 2 - Temp [F]",
  "tmpf2" => "Sensor 3 - Temp [F]",
  "tmpf3" => "Sensor 4 - Temp [F]",
  "dry0" => "Sensor 1 - Cond [F]",
  "dry1" => "Sensor 2 - Cond [F]",
  "dry2" => "Sensor 3 - Cond [F]",
  "dry3" => "Sensor 4 - Cond [F]",
  "ts" => "Observation Time", "min_tmpf" => "Low Air Temperature Today",
  "vsby" => "Visibility", "max_tmpf" => "High Air Temperature Today",
  "max_sknt_ts" => "Time of Peak Gust",
  "max_sknt" => "Wind Gust [knots]", "peak" => "Peak Wind Gust [kts]",
  "peak_ts" => "Time of Peak Wind Gust",
  "city" => "Site Name");

echo "<br>Sorted by: <b>(". $vals[$sortcol] .")</b>  &nbsp; &nbsp; Click on a column to sort it.<br>\n";

?>

<?php
// http://www.php.net/manual/en/function.asort.php

function aSortBySecondIndex($multiArray, $secondIndex) {
	while (list($firstIndex, ) = each($multiArray))
{'fraction_non_alphanumeric': 0.24766000505944852, 'fraction_numerical': 0.014166455856311662, 'mean_word_length': 4.59985835694051, 'pattern_counts': {'":': 0, '<': 97, '<?xml version=': 0, '>': 165, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '5142513', 'n_tokens_mistral': 2998, 'n_tokens_neox': 2917, 'n_words': 630}