<?php
  //use environmental variables for my path
// Works as of PHP 4.3.0
$home = getenv('WEB');
#home=$_ENV['WEB'];
set_include_path("$home/html/include");
// Works in all PHP versions
ini_set('include_path', "$home/html/registries/include");

//get a list of distinct zones to list as regions
# DB
$user = "web";
$pass = "webuser";
$host = getenv('PGHOSTADDR');
$port = "5432";
$dbne = "isc";

/*
#Open database connection
$dbh = pg_connect("host=$host port=$port dbname=$dbne user=$user password=$pass") or die("Could not connect") ;
pg_query($dbh, "set search_path to isc");
#Database command
$cmd = "SELECT distinct zone
FROM isc.site s
WHERE s.zone is not null
AND s.net is null";
#Execute the query
$result = pg_query($dbh, $cmd);
$allzones= array();
// fetch_row is supposed to be faster than fetch_array
while ($row = pg_fetch_row($result)) {

  $zone  = $row[0];
  #error_log($zone);
  # Push the network into an array
  array_push($allzones, $zone);

}
pg_close($dbh);
*/
?>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
    <meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
  <title>International Registry of Seismograph Stations: station book listing</title>
    <link rel="icon" href="/images/favicon.ico" type="image/ico" />
    <link rel="stylesheet" type="text/css" href="/css/iscschema.css">
  </head>
   <body>
  <div id="container">
   <?php include("$home/html/include/header.php"); ?>

   <div id="maingeneral">
    <div id="content">
  <?php include("leftmenu.php"); ?>
    <div id="rightinner">
 <div id=lefttitle><h3>Station book listings</h3></div>


 <!-- Table with sponsor logo-->
    <h3 align="center">Sponsored by:</h3>
     <table align="center" width="80%">
         <tr>
             <td align="center" style="padding-top:15px;">
                 <a href="http://reftek.com/" target="_blank" rel="noopener noreferrer"><img src="/images/misc/REF-TEK-logo.png" width="170"></a>
             </td>
             <td align="center" width="5%">
                 &nbsp;
             </td>

             <td align="center" style="padding-top:15px;">
                 <a href="http://www.geosig.com/" target="_blank" rel="noopener noreferrer"><img src="/images/misc/GS_logo.png" width="170"></a>
             </td>
             <td align="center" width="5%">
                 &nbsp;
             </td>
             <td align="center" style="padding-top:15px;">
                <a href="http://www.tai-de.com/en/" target="_blank" rel="noopener noreferrer"><img src="/sponsors/images/Taide_logo.jpg" width="170"></a>
             </td>
             <td align="center" width="5%">
                 &nbsp;
             </td>
<!--             <td align="center" style="padding-top:15px;">
                <a href="http://www.guralp.com"><img src="/images/misc/Guralp.jpg" width="170"></a>
             </td>
             <td align="center" width="5%">
                 &nbsp;
             </td>-->
<!---             <td align="center" style="padding-top:15px;">
                <a href="http://src.com.au"><img src="/sponsors/images/SRC_Logo.jpg" width="170"></a>
             </td>-->

         </tr>
     </table>
<!--2ndTable-->
     <table align="center" width="80%">
         <tr>
             <td align="center" style="padding-top:15px;">
                <a href="https://asirseismic.com/" target="_blank" rel="noopener noreferrer"><img src="/sponsors/images/ASIR_logo_black.png" width="170"></a>
             </td>
             <td align="center" width="5%">
                 &nbsp;
             </td>
             <td align="center" width="5%">
                 &nbsp;
             </td>
             <td align="center" style="padding-top:15px;">
                <a href="https://sara.pg.it/" target="_blank" rel="noopener noreferrer"><img src="/sponsors/images/SARA_logo_screenshot.png" width="170"></a>
             </td>

         </tr>
     </table>

<!--3rdTable-->
     <table align="center" width="80%">
         <tr>
             <td align="center" style="padding-top:15px;">
                <a href="http://www.guralp.com" target="_blank" rel="noopener noreferrer"><img src="/images/misc/Guralp.jpg" width="170"></a>
             </td>
             <td align="center" width="5%">
                 &nbsp;
             </td>
             <td align="center" width="5%">
                 &nbsp;
             </td>
             <td align="center" style="padding-top:15px;">
                <a href="http://src.com.au" target="_blank" rel="noopener noreferrer"><img src="/sponsors/images/SRC_Logo.jpg" width="170"></a>
             </td>

         </tr>
     </table>


<br>


<br/>

<center>
<a name="CODE"><h4>Station code</h4></a>
<p>Station details listed alphabetically by code.</p>

<p>
<a href=/cgi-bin/stations?listc=A>A</a> &middot;
<a href=/cgi-bin/stations?listc=B>B</a> &middot;
<a href=/cgi-bin/stations?listc=C>C</a> &middot;
<a href=/cgi-bin/stations?listc=D>D</a> &middot;
<a href=/cgi-bin/stations?listc=E>E</a> &middot;
<a href=/cgi-bin/stations?listc=F>F</a> &middot;
<a href=/cgi-bin/stations?listc=G>G</a> &middot;
<a href=/cgi-bin/stations?listc=H>H</a> &middot;
<a href=/cgi-bin/stations?listc=I>I</a> &middot;
<a href=/cgi-bin/stations?listc=J>J</a> &middot;
<a href=/cgi-bin/stations?listc=K>K</a> &middot;
<a href=/cgi-bin/stations?listc=L>L</a> &middot;
<a href=/cgi-bin/stations?listc=M>M</a> &middot;
<a href=/cgi-bin/stations?listc=N>N</a> &middot;
<a href=/cgi-bin/stations?listc=O>O</a> &middot;
<a href=/cgi-bin/stations?listc=P>P</a> &middot;
<a href=/cgi-bin/stations?listc=Q>Q</a> &middot;
<a href=/cgi-bin/stations?listc=R>R</a> &middot;
<a href=/cgi-bin/stations?listc=S>S</a> &middot;
<a href=/cgi-bin/stations?listc=T>T</a> &middot;
<a href=/cgi-bin/stations?listc=U>U</a> &middot;
<a href=/cgi-bin/stations?listc=V>V</a> &middot;
<a href=/cgi-bin/stations?listc=W>W</a> &middot;
<a href=/cgi-bin/stations?listc=X>X</a> &middot;
<a href=/cgi-bin/stations?listc=Y>Y</a> &middot;
<a href=/cgi-bin/stations?listc=Z>Z</a>
</p>
</center>

<center>
<a name=NAME><h4>Station Name</h4></a>
<p>Station details listed alphabetically by name.</p>
<p>
<a href=/cgi-bin/stations?listn=A>A</a> &middot;
<a href=/cgi-bin/stations?listn=B>B</a> &middot;
<a href=/cgi-bin/stations?listn=C>C</a> &middot;
<a href=/cgi-bin/stations?listn=D>D</a> &middot;
<a href=/cgi-bin/stations?listn=E>E</a> &middot;
<a href=/cgi-bin/stations?listn=F>F</a> &middot;
<a href=/cgi-bin/stations?listn=G>G</a> &middot;
<a href=/cgi-bin/stations?listn=H>H</a> &middot;
<a href=/cgi-bin/stations?listn=I>I</a> &middot;
<a href=/cgi-bin/stations?listn=J>J</a> &middot;
<a href=/cgi-bin/stations?listn=K>K</a> &middot;
<a href=/cgi-bin/stations?listn=L>L</a> &middot;
<a href=/cgi-bin/stations?listn=M>M</a> &middot;
<a href=/cgi-bin/stations?listn=N>N</a> &middot;
<a href=/cgi-bin/stations?listn=O>O</a> &middot;
<a href=/cgi-bin/stations?listn=P>P</a> &middot;
<a href=/cgi-bin/stations?listn=Q>Q</a> &middot;
<a href=/cgi-bin/stations?listn=R>R</a> &middot;
<a href=/cgi-bin/stations?listn=S>S</a> &middot;
<a href=/cgi-bin/stations?listn=T>T</a> &middot;
<a href=/cgi-bin/stations?listn=U>U</a> &middot;
<a href=/cgi-bin/stations?listn=V>V</a> &middot;
<a href=/cgi-bin/stations?listn=W>W</a> &middot;
<a href=/cgi-bin/stations?listn=X>X</a> &middot;
<a href=/cgi-bin/stations?listn=Y>Y</a> &middot;
<a href=/cgi-bin/stations?listn=Z>Z</a>
</p>
</center>

<!--
<center>
<a name=REG><h4>Region</h4></a>
<p>Station details listed by region and alphabetically by code.</p>
<table width=100%>
<?php
/*
  // loop over 4 zones at a time

  for ($i = 0; $i < sizeof($allzones); $i+=4) {
    print "<tr>";

    $zone1 = $allzones[$i];
# subsititute spaces in the zone name
    $zonelink1 = preg_replace('/\s+/', '+', $zone1);
    $zone2 = $allzones[$i+1];
    $zonelink2 = preg_replace('/\s+/', '+', $zone2);
    $zone3 = $allzones[$i+2];
    $zonelink3 = preg_replace('/\s+/', '+', $zone3);
    $zone4 = $allzones[$i+3];
    $zonelink4 = preg_replace('/\s+/', '+', $zone4);
    #error_log("$zone1,$zone2,$zone3,$zone4");
    print "<td width=25% align=center><a href=/cgi-bin/regions?zone=$zonelink1>$zone1</a></td>";
    print "<td width=25% align=center><a href=/cgi-bin/regions?zone=$zonelink2>$zone2</a></td>";
    print "<td width=25% align=center><a href=/cgi-bin/regions?zone=$zonelink3>$zone3</a></td>";
    print "<td width=25% align=center><a href=/cgi-bin/regions?zone=$zonelink4>$zone4</a></td>";
    print "</tr>";
  }
*/
?>
</table>
</center>

<br/>
<br/>
<br/>
<br/>
-->

</div>


  </div>

  </div>
<?php include("$home/html/include/footer.php"); ?>
   <?php
//close the container div
?>
</div>
</body>
</html>
