source: trunk/htdocs/index.php @ 211

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

Trialling out new login procedures, and implementing proprietry periods.

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