source: trunk/htdocs/index.php @ 213

Last change on this file since 213 was 213, checked in by MatthewWhiting, 16 years ago

Making the login page look and work better, and updating the users' guide.

File size: 23.0 KB
Line 
1<?php   session_start(); ?>
2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html>
3<?php
4 // index.php
5 // Matthew Whiting Nov 2007
6 // From the original by Albert Teoh
7 //
8 // The opening page for the ATNF Pulsar Data Archive
9 // system. Used to search for observation archive
10 // files.
11 
12 // BEGIN Javascript for expansion blocks
13 // Thanks to:
14 // http://assn9.blogspot.com/
15 // Douglas Bowman
16 // URL:      www.stopdesign.com
17 // Used in: http://www.bloggerforum.com/modules/newbb/viewtopic.php?topic_id=8725&forum=6
18 // Date:     26 Feb 2004
19 //
20
21?>
22<head>
23<link rel="stylesheet" type="text/css" href="styles/opal.css" />
24<link rel="stylesheet" type="text/css" href="styles/style.css" />
25<link rel="stylesheet" type="text/css" href="styles/query.css" />
26<link rel="stylesheet" type="text/css" href="styles/results.css" />
27<link rel="stylesheet" type="text/css" href="styles/atnf.css" />
28<meta http-equiv="Content-Type" content="text/html; charset=iso-8759-1" />
29<meta name="DC.Creator" lang="en" content="personalName=Teoh,Albert" />
30<meta name="ATNF.Maintainer" content="contactName=Webmaster,the" />
31<meta name="DC.Title.alt" lang="en" content="" />
32<meta name="DC.Subject" lang="en" content="pulsar" />
33<meta name="DC.Description" lang="en" content="Searches the data archives at the ATNF" />
34<meta name="DC.Date.created" scheme="ISO8601" content="2002-12-12" />
35<meta name="ATNF.Site" content="Marsfield" />
36<meta name="ATNF.AccessPermission" content="Public" />
37    <meta name="ATNF.MetaVersion" content="1.0" />
38   
39    <script type="text/javascript" src="scripts/atnf-oo-utils.js"></script>
40    <script type="text/javascript" src="scripts/atnf-string-utils.js"></script>
41    <script type="text/javascript" src="scripts/atnf-dom-utils.js"></script>
42    <script type="text/javascript" src="scripts/atnf-validation.js"></script>
43    <script type="text/javascript" src="scripts/atoa-query.js"></script>
44
45<!--
46   <script type="text/javascript" src="scripts/atnf-dom-utils.js"></script>
47   <script type="text/javascript" src="scripts/atoa-query.js"></script>
48   <script type="text/javascript" src="scripts/process.js"></script>
49-->
50
51
52<script type="text/javascript" language="javascript1.2">
53
54function toggleInstructions()
55{
56  var div = document.getElementById( "divInstructions" ) ;
57  if ( div.style.display == 'none' || div.style.display == '' )
58    div.style.display = "block" ;
59  else div.style.display = "none" ;
60}
61
62function togglecomments (id1,id2) {
63
64                var obj1 = document.getElementById(id1);
65                var obj2 = document.getElementById(id2);
66                (obj1.className=="commentshown") ? obj1.className="commenthidden" : obj1.className="commentshown";
67                (obj1.className=="commentshown") ? obj2.innerHTML="<< Hide" : obj2.innerHTML="Show all >>";
68
69}
70
71function checkAll(objName, FormName, FieldName ) {
72
73        var obj = document.getElementsByName(objName);
74        var CheckValue = obj[0].checked;
75
76        if(!document.forms[FormName])
77                return;
78        var objCheckBoxes = document.forms[FormName].elements[FieldName];
79        if(!objCheckBoxes)
80                return;
81        var countCheckBoxes = objCheckBoxes.length;
82        if(!countCheckBoxes)
83                objCheckBoxes.checked = CheckValue;
84        else
85                // set the check value for all check boxes
86                for(var i = 0; i < countCheckBoxes; i++)
87                        objCheckBoxes[i].checked = CheckValue;
88}
89
90function updateSelectAll(objId, allId) {
91        var obj = document.getElementById(objId);
92        var allCheckbox = document.getElementById(allId);       
93       
94        if (!objId.checked && allCheckbox.checked) {
95                allCheckbox.checked = false;
96        }
97               
98               
99}
100</script>
101
102</head>
103
104<title>ATNF Pulsar Data Archive Home</title>
105
106<!-- Start Content -->
107<?php
108       
109include_once("constants.php");
110include_once("security.php");
111include_once("database.php");
112include_once("date.php");
113
114$now_day = date("j");
115$now_month = date("n");
116$now_year = date("Y");
117
118$all_params_id = "all_params";
119$all_others_id = "all_others";
120
121$link = db_connect();
122
123if(!$link){
124  include_once("header.html");
125
126  echo"<body class=\"atoa\">\n\n";
127 
128  echo "<h1>ATNF Pulsar Data Archive</h1>\n\n";
129
130  echo "<b>\n The Archive is currently down for maintenance. <br>\n Please call again soon!. <br>\n</b>\n\n";
131
132  include_once("footer.html");
133 
134  echo "\n</body>\n</html>\n";
135 
136  exit;
137 }
138
139//$link = db_connect_admin();
140//loadNewTables();
141//////////////////////////////
142// Initialise error messages
143//
144
145$date_error = "";
146
147///////////////////////////////////
148// Find out the first and last dates
149//$query = "select min(mjd), max(mjd) from ".OBSERVATIONS_TABLE;
150$query = "select min(t.mjd), max(t.mjd) from ((select mjd from ".S70_TABLE.") union (select mjd from ".OBSERVATIONS_TABLE.")) as t";
151$result = mysql_query($query) or die('Query 1 failed: ' . mysql_error());
152
153$row = mysql_fetch_array($result);
154
155$min_mjd = $row[0];
156$max_mjd = $row[1];
157
158// Convert from MJD to JD
159$min_jd = $min_mjd + 2400000.5;
160$max_jd = $max_mjd + 2400000.5;
161
162// convert the mjd to a date
163$min_jd = floor($min_jd);
164$max_jd = ceil($max_jd);
165
166$min_unix = jdtounix($min_jd);
167$max_unix = jdtounix($max_jd);
168$min_date_text = date("j F Y", $min_unix);
169$max_date_text = date("j F Y", $max_unix);
170$minDay   = date("j",$min_unix);
171$minMonth = date("n",$min_unix);
172$minYear  = date("Y",$min_unix);
173$maxDay   = date("j",$max_unix);
174$maxMonth = date("n",$max_unix);
175$maxYear  = date("Y",$max_unix);
176
177// proprietry date limit
178$today_mjd = cal_to_jd ( CAL_GREGORIAN, date("n"), date("j"), date("Y") ) - 2400000.5;
179$prop_mjd = $today_mjd - PROPRIETRY_PERIOD_DAY;
180$prop_unix = jdtounix($prop_mjd+2400000.5);
181$prop_date_text = date("j F Y", $prop_unix);
182
183
184// Free resultset
185mysql_free_result($result);
186
187// Clear any old form inputs in session cache
188init($link);
189
190//////////////////////////////////////////////
191// Get the field names to fill form checkboxes
192
193$query = "SHOW COLUMNS FROM ".OBSERVATIONS_TABLE;
194$result = mysql_query($query) or die ('Query 2 failed: ' . mysql_error());
195
196$fields = array();
197if (mysql_num_rows($result)) {
198        while($row = mysql_fetch_assoc($result)) {
199          if(($row['Field'] != "data_loc") && ($row['Field'] != "file_size_bytes"))
200            array_push($fields, $row);
201        }
202}
203
204$field_names = Array("filename" => "Filename",
205                     "src_name" => "Source Name",
206                     "project_id" => "Project ID",
207                     "raj" => "RA (J2000, hh:mm:ss)",
208                     "decj" => "Dec (J2000, dd:mm:ss)",
209                     "data_type" => "Data Type",
210                     "obsfreq" => "Frequency",
211                     "bw" => "Bandwidth",
212                     "scanlen" => "Scan Length",
213                     "date" => "UT Date",
214                     "ut" => "UT Time",
215                     "MJD" => "MJD",
216                     "rajd" => "RA (J2000, degs)",
217                     "decjd" => "Dec (J2000, degs)",
218                     "gl" => "Gal. Long. (degs)",
219                     "gb" => "Gal. Lat. (degs)",
220                     "BMAJ" => "Beamsize: BMAJ",
221                     "BMIN" => "Beamsize: BMIN",
222                     "BPA" => "Beam: BPA",
223                     "dm" => "D.M.",
224                     "period" => "Period",
225                     "nchan" => "# channels",
226                     "npol" => "# polarisations",
227                     "nbin" => "# bins",
228                     "nsub" => "# subintegrations",
229                     "tsamp" => "Sample time",
230                     "nbits" => "# bits per sample",
231                     "nbeam" => "# beams",
232                     "cnfg" => "Configuration",
233                     "inst" => "Instrument",
234                     "rcvr" => "Receiver",
235                     "hdrver" => "PSRFITS version",
236                     "survey" => "Survey name",
237                     "telescope" => "Telescope",
238                     "site" => "Site ID",
239                     "obsrvr" => "Observer ID" );
240
241///////////////////////////////////////////////
242// Get the data types available in the database
243//
244
245//$query = "select distinct data_type from " . OBSERVATIONS_TABLE . " order by data_type";
246$query = "(select distinct data_type from ".OBSERVATIONS_TABLE.") union (select distinct data_type from ".S70_TABLE.")";
247$result = mysql_query($query) or die ('Query 3 failed: ' . mysql_error());
248
249$data_types = array();
250
251if (mysql_num_rows($result)) {
252        while($row = mysql_fetch_array($result, MYSQL_NUM)) {
253                array_push($data_types, $row[0]);
254        }
255}
256
257///////////////////////////////////////////////
258// If the user clicked on the logout button
259if (isset($HTTP_GET_VARS['command'])) {
260        $command = $HTTP_GET_VARS['command'];
261        if ($command == 'logout') {
262                //unset($_SESSION['auth_code']);
263                //unset($_SESSION['username']);
264                $_SESSION = array();
265        }
266}
267
268// If the user hasn't logged in before or if the previous
269// session's authentication wasn't successful
270// Then use the submitted username and password
271if (!isset($_SESSION['auth_code']) || $_SESSION['auth_code'] != OK) {
272  //    $username = $HTTP_POST_VARS["username"];
273//      $password = $HTTP_POST_VARS["password"];
274  $username = $HTTP_POST_VARS["opalEmail"];
275  $password = $HTTP_POST_VARS["opalPassword"];
276  $type = $HTTP_POST_VARS['authenticateType'];
277  if($type == "anon"){
278    $username = $HTTP_POST_VARS["email"];
279    $auth_code = OK;
280  }
281  else{
282    $auth_code = authenticate($username, $password);
283    //$auth_code = newAuthenticate();
284  }
285}
286else {
287        $auth_code = $_SESSION['auth_code'];
288        $username = $_SESSION['username'];
289}
290
291//echo "auth_code = $auth_code<br>\n";
292
293///////////////////////////////////////////////////////////////
294// Set the new maximum search range if not an atnf staff member
295//
296
297// if (!atnf_staff($username)) {
298//      $max_cal_assoc['day'] = date("j");
299//      $max_cal_assoc['month'] = date("n");
300//      $max_cal_assoc['year'] = date("Y")-2;
301       
302//      echo "$username not atnf<br>\n";
303// }
304
305include_once("header.html");
306
307
308// Initial state where no username or password supplied OR bad login state
309if ($auth_code != OK) { ?>
310        <body class="front_page">
311
312
313<div class="bodycontents">
314
315<h1>The ATNF Pulsar Data Archive</h1>
316
317<p>The ATNF Pulsar Data Archive provides access to pulsar observations
318made with the Parkes radio Telescope. Data older than <b>
319<?php echo PROPRIETRY_PERIOD_MONTH ?> months</b> is
320publicly available, and can be accessed by simply providing your email
321address. More recent data is proprietry, and can only be accessed by
322those who were involved in the proposal. We plan to do this via the
323<a href="http://opal.atnf.csiro.au">OPAL system</a>, but this is
324currently not enabled. In the interim, those who have previously
325obtained a login for the Data Archive can use that option below
326(making sure to check the "Data Archive login" button!). </p>
327
328<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="POST">
329<table width="700" style="border: 0px;">
330
331  <tr>
332    <td><input type="radio" name="authenticateType" checked value="anon">Non-proprietry access<br>
333      <table class="login" width="500" style="border: 0px;">
334        <tr>
335          <td class="form_field">Email: </td>
336          <td><input type="text" name="email"></td>
337        </tr>
338      </table>
339      <br>
340    </td>
341  </tr>
342 
343  <tr>
344    <td><input type="radio" name="authenticateType" value="opal">Data Archive login<br>
345      <table class="login" width="500" style="border: 0px;">
346        <tr><td class="form_field">Email: </td><td><input type="text" name="opalEmail"></td></tr>
347        <tr><td class="form_field">Password: </td><td><input type="password" name="opalPassword"></td></tr>
348      </table>
349      <br>
350    </td>
351  </tr>
352 
353  <tr>
354    <td><input type="submit" value="Login"><input type="reset" value="Reset"></td>
355  </tr>
356</table>
357
358</form>
359
360
361<?php } else {
362        $_SESSION['username'] = $username;
363        $_SESSION['auth_code'] = $auth_code;
364        $_SESSION['logintype'] = $HTTP_POST_VARS['authenticateType'];
365
366        $actions = $HTTP_GET_VARS['actions'];
367       
368        if ($actions == "new_query") {
369                init();
370        }
371        else if ($actions == "error") {
372          //            $date_error = "You are only authorised to access data > 18 months old";
373        }
374?>
375<body class="atoa">
376    <div class="bodycontents">
377
378    <h1>ATNF Pulsar Data Archive</h1>
379
380    <p>This archive provides access to pulsar observations taken at the Parkes radio telescope between the dates of <b><?php echo $min_date_text."</b> and <b>".$max_date_text?></b>.</p>
381   <?php
382   if (!atnf_staff($_SESSION['username'])) {
383     //if($_SESSION['logintype']=="anon") {
384     echo "<p>Note that you do not have access to data more recent than <b>".$prop_date_text."</b>.</p>\n";
385   }?>
386<p>See the Users Guide link for more details. </p>
387   
388    <table width="700" style="border: 0px;">
389    <tr align="center">
390    <td>
391    <a class="top_menu" href="<?php echo $PHP_SELF; ?>?command=logout">Logout</a>
392    <!--a href="login?_action=logout">Logout</a-->
393
394    </td>
395        <td>
396        <a class="top_menu" href="change_password.html?prev_page=<?php echo urlencode("index.php"); ?>">Change Password</a>
397        </td>
398        <td size="30">
399        &nbsp;
400    </td>
401        <td>
402        <a href="#" onClick="toggleInstructions();return false;">Instructions</a>
403        </td>
404        <td size="30">
405        &nbsp;
406    </td>
407        <td>
408        <a href="pulsar_archive_guide.html">Users Guide</a>
409        </td>
410        </tr>
411
412        </table>
413
414        <div id="divInstructions" style="display:none" >
415          <dl class="top">
416            <h2>Instructions</h2>
417        <i>To hide, click "Instructions" again. </i>
418              <dt> Display Parameters </dt>
419                <dd> Check the fields you want shown in the results table. Suggested columns are checked by default</dd>
420                <dd> The results can be ordered by one of the parameters in the "Order By" drop-down list</dd>
421              <dt> Coordinates </dt>
422                <dd> The sky position can be specified by a Pulsar name or a RA/Dec position.
423                      The pulsar name takes precedence. The search radius must be given. </dd>
424              <dt> Filter Options </dt>
425                <dd> Results can be limited to observations just from a particular project - use the Project ID box</dd>
426                <dd> The date range can be specified - the defaults are the range of dates in the archive.</dd>
427                <dd> Either timing data (particular pulsar) or survey data can be specified. Or both! </dd>
428                <dd> The type of instrument can be specified. Default is any type.</dd>
429                <dd> More than one frequency band can be specified.
430              <dt> Display Other </dt>
431        <dd> Calibraton observations taken within a given time period of the queried observations can also be shown and downloaded. Check the box to do so, and specify the time interval. </dd>
432            </dl>
433        </div>
434
435
436
437<!--<table class="noborder">
438<tr><td><a class="top_menu" href="<?php echo $PHP_SELF; ?>?command=logout">Logout</a> | <a class="top_menu" href="change_password.html?prev_page=<?php echo urlencode("index.php"); ?>">Change Password</a></td>
439</tr>
440</table>-->
441
442
443<form action="query.php" method="GET" name="data_archive_form" id="data_archive_form">
444<input type="hidden" name="state" value="results">
445   
446
447   
448   
449<table class="noborder" cellpadding=0>
450
451    <tr><td colspan=3>
452        <br>
453        <center><input type="submit" value="submit" name="submit_button" style="float: center;"> &nbsp;
454        <input type="reset" value="reset" name="reset_button" style="float: center;"></center>
455        <br>
456    </td></tr>
457   
458    <tr>
459       
460<!-- **************************** -->
461    <td valign="top" class="form_field" rowspan="1">
462
463    <fieldset>
464                <legend>DISPLAY PARAMETERS</legend>
465                <input type="checkbox" name="<?php echo $all_params_id; ?>" id="<?php echo $all_params_id; ?>" onClick="checkAll('<?php echo $all_params_id; ?>', 'data_archive_form', 'params[]')" >Select all<br>
466                        <!--font size="-1"><a href="javascript:togglecomments('params', 'toggler1')" id="toggler1">Show all >></a></font--><br>
467                        <!span class="commenthidden" id="params">
468                        <div id="list">
469                                <?php
470                                $def_fields = Array( "filename", "src_name", "project_id", "raj", "decj",
471                                                     "data_type", "obsfreq", "bw", "scanlen", "date", "ut" );
472
473                                foreach ($fields as $field) {
474                                  echo "<input
475onClick=\"updateSelectAll('".$field['Field']."', '$all_params_id')\" type=\"checkbox\" name=\"params[]\" value=\"".$field['Field']."\" id=\"".$field['Field']."\"";
476                                  if( in_array( $field['Field'], $def_fields ) )
477                                    echo ' checked="true"';
478                                  echo " >".$field_names[$field['Field']]."<br>\n";
479                                }
480                                ?>
481                        </div>
482                        </span>
483        </fieldset>
484                       
485        </td>
486
487<!-- **************************** -->
488
489        <td class="form_field" height="10%" rowspan="1">
490        <!-- Position Options -->
491
492        <table cellspacing=0 cellpadding=0 style="border: 0px;">
493        <tr><td>
494        <fieldset id="flsPosition">
495                <legend>POSITION REQUIREMENTS</legend>
496               
497                <!-- Pulsar Name -->
498                <fieldset>
499                <legend>Pulsar Name</legend>
500                <input type="text" name="pulsar_name" size="20">
501                <br>
502                <p>Note that search-by-name takes precedence over search-by-RA/Dec.</p>
503                </fieldset>
504
505                <br>
506               
507                <fieldset>
508                <legend>Right Ascension (J2000)</legend>
509               
510                <input type="text" id="txtRAHour" name="rahour" size="3" tabindex="1" />
511                <label for="txtRAHour" class="coordinate"><abbr title="hours"><sup>h</sup></abbr></label>
512                                             
513                <input type="text" id="txtRAMinute" name="ramin" size="3" tabindex="1" />
514                <label for="txtRAMinute" class="coordinate"><abbr title="minutes"><sup>m</sup></abbr></label>
515               
516                <input type="text" id="txtRASecond" name="rasec" size="6" tabindex="1" />
517                <label for="txtRASecond" class="coordinate"><abbr title="seconds"><sup>s</sup></abbr></label>
518                </fieldset>
519       
520                <fieldset>
521                <legend>Declination (J2000)</legend>
522               
523                <input type="text" id="txtDecDegree" name="decdeg" size="3" tabindex="1" />
524                <label for="txtDecDegree" class="coordinate"><abbr title="degrees">&deg;</abbr></label>
525               
526                <input type="text" id="txtDecMinute" name="decmin" size="3" tabindex="1" />
527                <label for="txtDecMinute" class="coordinate"><abbr title="minutes">&prime;</abbr></label>
528               
529                <input type="text" id="txtDecSecond" name="decsec" size="6" tabindex="1" />
530                <label for="txtDecSecond" class="coordinate"><abbr title="seconds">&Prime;</abbr></label>
531                </fieldset>
532
533                <br>
534                <br>
535        </fieldset>
536
537        <fieldset id="flsSearchRadius">
538        <legend>SEARCH WINDOW [arcmin]</legend>
539        <input type="text" id="txtSearchWindow" name="radius" size="20" tabindex="1" value="60"/>
540        </fieldset>
541
542<br>
543        <fieldset id="flsProjectID">
544        <legend>PROJECT ID</legend>
545        <input type="text" id="txtSearchWindow" name="projID" size="20" tabindex="1" value=""/>
546        </fieldset>
547
548        </td></tr>
549</table>
550</td>
551
552<!-- **************************** -->
553
554        <td class="form_field" height="10%">
555        <!-- Filter Options -->
556        <table cellspacing=0 cellpadding=0 style="border: 0px;">
557        <tr><td>
558        <fieldset id="flsObsDate">
559                               
560                <legend>FILTER OPTIONS</legend>
561<br>
562
563                <!-- Date range -->
564                <fieldset>
565                        <legend>Date Range</legend>
566                       
567                          From:                                                                       
568                            <select name="from_day">
569                            <?php
570                            for ($i = 1; $i <= 31; $i++) {
571                              echo "\t\t\t<option";
572                              if ($i == $minDay) { echo " selected"; }
573                              echo " value=\"$i\">$i</option>\n";
574                            }
575                                ?>
576                            </select>
577                        <select name="from_month">
578                                <?php
579                                $monthlist = cal_info(0);
580                                for ($i = 1; $i <= 12; $i++) {
581                                  echo "\t\t\t<option";
582                                  $month = $monthlist[abbrevmonths][$i];
583                                  if ($i == $minMonth) { echo " selected"; }
584                                  echo " value=\"$i\">$month</option>\n";
585                                }
586                                ?>
587                                  </select>
588<!-- <input type="text" size="4" name="from_year" value="<?php echo $min_cal_assoc['year']; ?>"> -->
589                      <select name="from_year">
590                                      <?php
591                                      for ($i = $minYear; $i <= $maxYear; $i++) {
592                                        echo "\t\t\t<option";
593                                        if ($i == $minYear) { echo " selected"; }
594                                  echo " value=\"$i\">$i</option>\n";
595                                }
596                                ?>
597                            </select>
598                        <?php echo "<font size=\"-1\" color=\"red\">$date_error</font>" ?>
599                                &nbsp To:
600                        <select name="to_day">
601                                <?php
602                                        for ($i = 1; $i <= 31; $i++) {
603                                          echo "\t\t\t<option";
604                                          if ($i == $maxDay) { echo " selected"; }
605                                          echo " value=\"$i\">$i</option>\n";
606                                        }
607                                ?>
608                        </select>
609                        <select name="to_month">
610                                <?php
611                            for ($i = 1; $i <= 12; $i++) {
612                              echo "\t\t\t<option";
613                              $month = $monthlist[abbrevmonths][$i];
614                              if ($i == $maxMonth) { echo " selected"; }
615                              echo " value=\"$i\">$month</option>\n";
616                            }
617                                ?>
618                        </select>
619<!-- <input type="text" size="4" name="to_year" value="<?php echo $max_cal_assoc['year']; ?>"> -->
620                      <select name="to_year">
621                                      <?php
622                                      for ($i = $minYear; $i <= $maxYear; $i++) {
623                                        echo "\t\t\t<option";
624                                        if ($i == $maxYear) { echo " selected"; }
625                                  echo " value=\"$i\">$i</option>\n";
626                                }
627                                ?>
628                            </select>
629                </fieldset>
630 
631<br>
632                <!-- Obs Mode -->
633                <fieldset>
634                        <legend>Obs Mode</legend>
635
636                        <select name="obs_mode" onchange="ObsModeChanged()" id="ObsModeList">
637                                <option value="any"> Any </option>
638                                <option value="timing"> Only timing data </option>
639                                <option value="search"> Only search data </option>
640                        </select>
641                </fieldset>
642
643                <!-- Data Type -->
644                <fieldset>
645                        <legend>Data Type</legend>
646
647                        <select name="data_type">
648                                <option value="" selected> Any </option>
649                                <?php
650                                foreach ($data_types as $data_type) {
651                                        echo "
652                                        <option value=\"$data_type\"> $data_type </option>";
653                                }
654                                ?>
655                        </select>
656                </fieldset>     
657
658                <!-- Frequency band -->
659                <fieldset>
660                        <legend>Band Name</legend>
661                            <select id="selBand" name="bandname[]" multiple="multiple" size="5">
662                            <option value="anyBand" selected="selected">Any</option>
663                            <option value="70cm"   >70cm (~0.44 GHz)</option>     
664                            <option value="50cm"   >50cm (~0.66 GHz)</option>     
665                            <option value="20cm">20/18cm (1.2-1.8 GHz)</option>     
666                            <option value="13cm"   >13cm (2.0-2.5 GHz)</option>     
667                            <option value="10cm"   >10cm (2.6-3.6 GHz)</option>     
668                            <option value="6cm"    >6cm (4.5-5.1 GHz)</option>     
669                            <option value="5cm"    >5cm (5.9-6.8 GHz)</option>     
670                            <option value="3cm"    >3cm (8.1-8.6 GHz)</option>     
671                            <option value="1.3cm"  >1.3cm (21.-24. GHz)</option>     
672          </select>
673     </fieldset>
674
675       </fieldset>
676        </td></tr>
677        <tr><td>
678                <fieldset>
679                    <legend>ORDER RESULTS BY</legend>
680                            <table cellspacing="0px" cellpadding="0px" style="border: 0px;">
681                            <tr><td>
682                      <select name="orderBy" id="OrderByList">
683                            <option selected value="distance">Distance
684                            <option value="date">Date
685                            <option value="obsfreq">Frequency
686                            <option value="filename">Filename
687                      </select>
688                            </td><td>
689                            &nbsp;<input type="radio" name="orderDir" id="orderDirectionSel" checked value="asc">Ascending
690                            <br>
691                            &nbsp;<input type="radio" name="orderDir" id="orderDirectionSel" value="desc">Descending
692                            </td></tr>
693                            </table>
694                    <br>
695                </fieldset>
696        </td></tr>
697        <tr><td>
698                <fieldset>
699                    <legend>DISPLAY OTHER DATA</legend>
700                               
701                    <input type="checkbox" name="cals" value="cals" id="cals" checked="true" />
702                                Display Cals taken within
703                    <input type="text" name="cals_within_mins" value="30" maxlength="5" size="3"/>
704                                mins of Observations
705                    <br>
706                                               
707                </fieldset>
708        </td></tr>
709        </table>
710        <br>
711        </td>
712        </tr>   
713</table>
714
715
716</form>
717<div style="min-height: 20px; max-height: 1000px;"> </div>
718<?php
719}?>
720</div>
721
722<div id=\"footer\">
723<?php   include "footer.html"; ?>
724</div>
725
726</body>
727
728</html>
729
730
731<?php //////////// Function definitions ///////////////
732
733
734// Initialise the input form variables. If the "New query" button is clicked
735// no argument is passed to init(), hence the need for a default NULL value
736// because there is no need for updating user access statistics
737function init($link=NULL) {
738
739        if ($link) {
740                // Update the users table
741                updateUsersTable($link);
742        }
743       
744        unset($_SESSION['cals']); // The result set of cals
745        unset($_SESSION['obs']); // The result set of observations
746        //unset($_SESSION['cart_items']); // The result set of observations
747}
748
749mysql_close($link);
750
751?>
Note: See TracBrowser for help on using the repository browser.