source: trunk/htdocs/index.php @ 238

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

removed some commented out code and erroneous use of soon to be removed atnf_staff function.

File size: 22.2 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
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// Initial state where no username or password supplied OR bad login state
267if ($auth_code != OK) { ?>
268  <body class="front_page">
269
270
271<div class="bodycontents">
272
273<h1>The ATNF Pulsar Data Archive</h1>
274
275<p>The ATNF Pulsar Data Archive provides access to pulsar observations
276made with the Parkes radio Telescope. Data older than <b>
277<?php echo PROPRIETRY_PERIOD_MONTH ?> months</b> is
278publicly available, and can be accessed by simply providing your email
279address. More recent data is proprietry, and can only be accessed by
280those who were involved in the proposal. We plan to do this via the
281<a href="http://opal.atnf.csiro.au">OPAL system</a>, but this is
282currently not enabled. In the interim, those who have previously
283obtained a login for the Data Archive can use that option below
284(making sure to check the "Data Archive login" button!). </p>
285
286<p>A <a href="pulsar_archive_guide.html">Users Guide</a> to the archive is available.</p>
287
288<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="POST">
289<table width="700" style="border: 0px;">
290
291  <tr>
292    <td><input type="radio" name="authenticateType" checked value="anon">Non-proprietry access<br>
293      <table class="login" width="500" style="border: 0px;">
294        <tr>
295          <td class="form_field">Email: </td>
296          <td><input type="text" name="email"></td>
297        </tr>
298      </table>
299      <br>
300    </td>
301  </tr>
302 
303  <tr>
304
305    <td><input type="radio" name="authenticateType" value="opal">Data Archive login<br>
306      <table class="login" width="500" style="border: 0px;">
307        <tr><td class="form_field">Username: </td><td><input type="text" name="opalEmail"></td></tr>
308        <tr><td class="form_field">Password: </td><td><input type="password" name="opalPassword"></td></tr>
309      </table>
310      <br>
311    </td>
312  </tr>
313 
314  <tr>
315    <td><input type="submit" value="Login"><input type="reset" value="Reset"></td>
316  </tr>
317</table>
318
319</form>
320
321
322<?php } else {
323        $_SESSION['username'] = $username;
324        $_SESSION['auth_code'] = $auth_code;
325        $_SESSION['logintype'] = $HTTP_POST_VARS['authenticateType'];
326
327        $actions = $HTTP_GET_VARS['actions'];
328       
329        if ($actions == "new_query") {
330                init();
331        }
332        else if ($actions == "error") {
333          //            $date_error = "You are only authorised to access data > 18 months old";
334        }
335?>
336<body class="atoa">
337    <div class="bodycontents">
338
339    <h1>ATNF Pulsar Data Archive</h1>
340
341    <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>
342    <?php
343    // TODO - This code needs to be replaced with opal based code
344// // //    if (!atnf_staff($_SESSION['username'])) {
345// // //      //if($_SESSION['logintype']=="anon") {
346// // //      echo "<p>Note that you do not have access to data more recent than <b>".$prop_date_text."</b>.</p>\n";
347   }?>
348<p>See the Users Guide link for more details. </p>
349   
350    <table width="700" style="border: 0px;">
351    <tr align="center">
352    <td>
353    <a class="top_menu" href="<?php echo $PHP_SELF; ?>?command=logout">Logout</a>
354    <!--a href="login?_action=logout">Logout</a-->
355
356    </td>
357        <td>
358        <a class="top_menu" href="change_password.php?prev_page=<?php echo urlencode("index.php"); ?>">Change Password</a>
359        </td>
360        <td size="30">
361        &nbsp;
362    </td>
363        <td>
364        <a href="#" onClick="toggleInstructions();return false;">Instructions</a>
365        </td>
366        <td size="30">
367        &nbsp;
368    </td>
369        <td>
370        <a href="pulsar_archive_guide.html">Users Guide</a>
371        </td>
372        </tr>
373
374        </table>
375
376        <div id="divInstructions" style="display:none" >
377          <dl class="top">
378            <h2>Instructions</h2>
379        <i>To hide, click "Instructions" again. </i>
380              <dt> Display Parameters </dt>
381                <dd> Check the fields you want shown in the results table. Suggested columns are checked by default</dd>
382                <dd> The results can be ordered by one of the parameters in the "Order By" drop-down list</dd>
383              <dt> Coordinates </dt>
384                <dd> The sky position can be specified by a Pulsar name or a RA/Dec position.
385                      The pulsar name takes precedence. The search radius must be given. </dd>
386              <dt> Filter Options </dt>
387                <dd> Results can be limited to observations just from a particular project - use the Project ID box</dd>
388                <dd> The date range can be specified - the defaults are the range of dates in the archive.</dd>
389                <dd> Either timing data (particular pulsar) or survey data can be specified. Or both! </dd>
390                <dd> The type of instrument can be specified. Default is any type.</dd>
391                <dd> More than one frequency band can be specified.
392              <dt> Display Other </dt>
393        <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>
394            </dl>
395        </div>
396
397
398
399<!--<table class="noborder">
400<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>
401</tr>
402</table>-->
403
404
405<form action="query.php" method="GET" name="data_archive_form" id="data_archive_form">
406<input type="hidden" name="state" value="results">
407   
408
409   
410   
411<table class="noborder" cellpadding=0>
412
413    <tr><td colspan=3>
414        <br>
415        <center><input type="submit" value="submit" name="submit_button" style="float: center;"> &nbsp;
416        <input type="reset" value="reset" name="reset_button" style="float: center;"></center>
417        <br>
418    </td></tr>
419   
420    <tr>
421       
422<!-- **************************** -->
423    <td valign="top" class="form_field" rowspan="1">
424
425    <fieldset>
426                <legend>DISPLAY PARAMETERS</legend>
427                <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>
428                        <!--font size="-1"><a href="javascript:togglecomments('params', 'toggler1')" id="toggler1">Show all >></a></font--><br>
429                        <!span class="commenthidden" id="params">
430                        <div id="list">
431                                <?php
432                                $def_fields = Array( "filename", "src_name", "project_id", "raj", "decj",
433                                                     "data_type", "obsfreq", "bw", "scanlen", "date", "ut" );
434
435                                foreach ($fields as $field) {
436                                  echo "<input
437onClick=\"updateSelectAll('".$field['Field']."', '$all_params_id')\" type=\"checkbox\" name=\"params[]\" value=\"".$field['Field']."\" id=\"".$field['Field']."\"";
438                                  if( in_array( $field['Field'], $def_fields ) )
439                                    echo ' checked="true"';
440                                  echo " >".$field_names[$field['Field']]."<br>\n";
441                                }
442                                ?>
443                        </div>
444                        </span>
445        </fieldset>
446                       
447        </td>
448
449<!-- **************************** -->
450
451        <td class="form_field" height="10%" rowspan="1">
452        <!-- Position Options -->
453
454        <table cellspacing=0 cellpadding=0 style="border: 0px;">
455        <tr><td>
456        <fieldset id="flsPosition">
457                <legend>POSITION REQUIREMENTS</legend>
458               
459                <!-- Pulsar Name -->
460                <fieldset>
461                <legend>Pulsar Name</legend>
462                <input type="text" name="pulsar_name" size="20">
463                <br>
464                <p>Note that search-by-name takes precedence over search-by-RA/Dec.</p>
465                </fieldset>
466
467                <br>
468               
469                <fieldset>
470                <legend>Right Ascension (J2000)</legend>
471               
472                <input type="text" id="txtRAHour" name="rahour" size="3" tabindex="1" />
473                <label for="txtRAHour" class="coordinate"><abbr title="hours"><sup>h</sup></abbr></label>
474                                             
475                <input type="text" id="txtRAMinute" name="ramin" size="3" tabindex="1" />
476                <label for="txtRAMinute" class="coordinate"><abbr title="minutes"><sup>m</sup></abbr></label>
477               
478                <input type="text" id="txtRASecond" name="rasec" size="6" tabindex="1" />
479                <label for="txtRASecond" class="coordinate"><abbr title="seconds"><sup>s</sup></abbr></label>
480                </fieldset>
481       
482                <fieldset>
483                <legend>Declination (J2000)</legend>
484               
485                <input type="text" id="txtDecDegree" name="decdeg" size="3" tabindex="1" />
486                <label for="txtDecDegree" class="coordinate"><abbr title="degrees">&deg;</abbr></label>
487               
488                <input type="text" id="txtDecMinute" name="decmin" size="3" tabindex="1" />
489                <label for="txtDecMinute" class="coordinate"><abbr title="minutes">&prime;</abbr></label>
490               
491                <input type="text" id="txtDecSecond" name="decsec" size="6" tabindex="1" />
492                <label for="txtDecSecond" class="coordinate"><abbr title="seconds">&Prime;</abbr></label>
493                </fieldset>
494
495                <br>
496                <br>
497        </fieldset>
498
499        <fieldset id="flsSearchRadius">
500        <legend>SEARCH WINDOW [arcmin]</legend>
501        <input type="text" id="txtSearchWindow" name="radius" size="20" tabindex="1" value="60"/>
502        </fieldset>
503
504<br>
505        <fieldset id="flsProjectID">
506        <legend>PROJECT ID</legend>
507        <input type="text" id="txtSearchWindow" name="projID" size="20" tabindex="1" value=""/>
508        </fieldset>
509
510        </td></tr>
511</table>
512</td>
513
514<!-- **************************** -->
515
516        <td class="form_field" height="10%">
517        <!-- Filter Options -->
518        <table cellspacing=0 cellpadding=0 style="border: 0px;">
519        <tr><td>
520        <fieldset id="flsObsDate">
521                               
522                <legend>FILTER OPTIONS</legend>
523<br>
524
525                <!-- Date range -->
526                <fieldset>
527                        <legend>Date Range</legend>
528                       
529                          From:                                                                       
530                            <select name="from_day">
531                            <?php
532                            for ($i = 1; $i <= 31; $i++) {
533                              echo "\t\t\t<option";
534                              if ($i == $minDay) { echo " selected"; }
535                              echo " value=\"$i\">$i</option>\n";
536                            }
537                                ?>
538                            </select>
539                        <select name="from_month">
540                                <?php
541                                $monthlist = cal_info(0);
542                                for ($i = 1; $i <= 12; $i++) {
543                                  echo "\t\t\t<option";
544                                  $month = $monthlist[abbrevmonths][$i];
545                                  if ($i == $minMonth) { echo " selected"; }
546                                  echo " value=\"$i\">$month</option>\n";
547                                }
548                                ?>
549                                  </select>
550<!-- <input type="text" size="4" name="from_year" value="<?php echo $min_cal_assoc['year']; ?>"> -->
551                      <select name="from_year">
552                                      <?php
553                                      for ($i = $minYear; $i <= $maxYear; $i++) {
554                                        echo "\t\t\t<option";
555                                        if ($i == $minYear) { echo " selected"; }
556                                  echo " value=\"$i\">$i</option>\n";
557                                }
558                                ?>
559                            </select>
560                        <?php echo "<font size=\"-1\" color=\"red\">$date_error</font>" ?>
561                                &nbsp To:
562                        <select name="to_day">
563                                <?php
564                                        for ($i = 1; $i <= 31; $i++) {
565                                          echo "\t\t\t<option";
566                                          if ($i == $maxDay) { echo " selected"; }
567                                          echo " value=\"$i\">$i</option>\n";
568                                        }
569                                ?>
570                        </select>
571                        <select name="to_month">
572                                <?php
573                            for ($i = 1; $i <= 12; $i++) {
574                              echo "\t\t\t<option";
575                              $month = $monthlist[abbrevmonths][$i];
576                              if ($i == $maxMonth) { echo " selected"; }
577                              echo " value=\"$i\">$month</option>\n";
578                            }
579                                ?>
580                        </select>
581                      <select name="to_year">
582                                      <?php
583                                      for ($i = $minYear; $i <= $maxYear; $i++) {
584                                        echo "\t\t\t<option";
585                                        if ($i == $maxYear) { echo " selected"; }
586                                  echo " value=\"$i\">$i</option>\n";
587                                }
588                                ?>
589                            </select>
590                </fieldset>
591 
592<br>
593                <!-- Obs Mode -->
594                <fieldset>
595                        <legend>Obs Mode</legend>
596
597                        <select name="obs_mode" onchange="ObsModeChanged()" id="ObsModeList">
598                                <option value="any"> Any </option>
599                                <option value="timing"> Only timing data </option>
600                                <option value="search"> Only search data </option>
601                        </select>
602                </fieldset>
603
604                <!-- Data Type -->
605                <fieldset>
606                        <legend>Data Type</legend>
607
608                        <select name="data_type">
609                                <option value="" selected> Any </option>
610                                <?php
611                                foreach ($data_types as $data_type) {
612                                        echo '
613                                        <option value="' . $data_type['data_type'] . '"> ' . $data_type['data_type'] . '</option>';
614                                }
615                                ?>
616                        </select>
617                </fieldset>     
618
619                <!-- Frequency band -->
620                <fieldset>
621                        <legend>Band Name</legend>
622                            <select id="selBand" name="bandname[]" multiple="multiple" size="5">
623                            <option value="anyBand" selected="selected">Any</option>
624                            <option value="70cm"   >70cm (~0.44 GHz)</option>     
625                            <option value="50cm"   >50cm (~0.66 GHz)</option>     
626                            <option value="20cm">20/18cm (1.2-1.8 GHz)</option>     
627                            <option value="13cm"   >13cm (2.0-2.5 GHz)</option>     
628                            <option value="10cm"   >10cm (2.6-3.6 GHz)</option>     
629                            <option value="6cm"    >6cm (4.5-5.1 GHz)</option>     
630                            <option value="5cm"    >5cm (5.9-6.8 GHz)</option>     
631                            <option value="3cm"    >3cm (8.1-8.6 GHz)</option>     
632                            <option value="1.3cm"  >1.3cm (21.-24. GHz)</option>     
633          </select>
634     </fieldset>
635
636       </fieldset>
637        </td></tr>
638        <tr><td>
639                <fieldset>
640                    <legend>ORDER RESULTS BY</legend>
641                            <table cellspacing="0px" cellpadding="0px" style="border: 0px;">
642                            <tr><td>
643                      <select name="orderBy" id="OrderByList">
644                            <option selected value="distance">Distance
645                            <option value="date">Date
646                            <option value="obsfreq">Frequency
647                            <option value="filename">Filename
648                      </select>
649                            </td><td>
650                            &nbsp;<input type="radio" name="orderDir" id="orderDirectionSel" checked value="asc">Ascending
651                            <br>
652                            &nbsp;<input type="radio" name="orderDir" id="orderDirectionSel" value="desc">Descending
653                            </td></tr>
654                            </table>
655                    <br>
656                </fieldset>
657        </td></tr>
658        <tr><td>
659                <fieldset>
660                    <legend>DISPLAY OTHER DATA</legend>
661                               
662                    <input type="checkbox" name="cals" value="cals" id="cals" checked="true" />
663                                Display Cals taken within
664                    <input type="text" name="cals_within_mins" value="30" maxlength="5" size="3"/>
665                                mins of Observations
666                    <br>
667                                               
668                </fieldset>
669        </td></tr>
670        </table>
671        <br>
672        </td>
673        </tr>   
674</table>
675
676
677</form>
678<div style="min-height: 20px; max-height: 1000px;"> </div>
679<?php
680}
681
682} catch( MysqlDBException $e ) {
683  logger_exception( $_SESSION['username'], $e->getCode, $e->getMessage(), '' );
684  echo '<p><div class="exception_box">' .
685       '<center>' .
686       '<b>A database error was encountered</b> <br>' .
687       'the details of the error have been logged, please contact the system administrator for futher assistance <br>' .
688       '</center>' .
689       '</div><p>';
690}
691
692?>
693</div>
694
695<div id=\"footer\">
696<?php   include "footer.html"; ?>
697</div>
698
699</body>
700
701</html>
702
703
704<?php //////////// Function definitions ///////////////
705
706
707// Initialise the input form variables. If the "New query" button is clicked
708// no argument is passed to init(), hence the need for a default NULL value
709// because there is no need for updating user access statistics
710function init($link=NULL) {
711
712        unset($_SESSION['cals']); // The result set of cals
713        unset($_SESSION['obs']); // The result set of observations
714        unset($_SESSION['cart_items']); // The result set of observations
715}
716
717
718
719
720?>
Note: See TracBrowser for help on using the repository browser.