source: trunk/htdocs/index.php @ 215

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

Extended functionality of logger_write and added wrapper fucntions for it logger_login, logger_query and logger_download. Added code to use these new logging function sto index.php,conesearch.php and query.php.

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