source: trunk/htdocs/index.php @ 224

Last change on this file since 224 was 224, checked in by DavidSmith, 16 years ago

Created a new class PulsarArchiveDB which inherits from MysqlDB and contains functions for interaction with the database. Added code to index.php to use this class.

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