<?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>
 <?php include("sponsorsTable.php"); ?>
<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>
<!-- Commented out for now, until needed
<h4>Full station XML download</h4>
<p><font color="red">As part of the ISC migration to the Agency.Deployment.Station.Location (ADSL) naming convention we have provided a combined IR & FDSN station list in both stationxml and text format, downloadable using the links below. All other station listings and searches on the ISC website are currently limited to IR only. We anticipate that the station listings and searches should be updated to include FDSN stations by 2024. FDSN station coordinates and operational times are obtained using the FDSN web service (<a href=http://www.fdsn.org/webservices/>http://www.fdsn.org/webservices</a>).</font></p>
<button class="button white medium num"><a href=../include/stationXML.zip download>XML (zip)</a></button>
<button class="button white medium num"><a href=../include/station.zip download>Text (zip)</a></button>-->
</center>
<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>
