source: trunk/htdocs/index.php @ 233

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