[163] | 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 |
---|
[189] | 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. |
---|
[193] | 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 | |
---|
[163] | 21 | ?> |
---|
| 22 | <head> |
---|
[213] | 23 | <link rel="stylesheet" type="text/css" href="styles/opal.css" /> |
---|
[163] | 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" /> |
---|
[170] | 27 | <link rel="stylesheet" type="text/css" href="styles/atnf.css" /> |
---|
[163] | 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" /> |
---|
[193] | 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> |
---|
[189] | 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"> |
---|
[198] | 53 | |
---|
| 54 | function 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 | |
---|
[163] | 62 | function 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 | |
---|
| 71 | function 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 | |
---|
| 90 | function 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 | } |
---|
[189] | 100 | </script> |
---|
[163] | 101 | |
---|
[189] | 102 | </head> |
---|
| 103 | |
---|
[163] | 104 | <title>ATNF Pulsar Data Archive Home</title> |
---|
| 105 | |
---|
| 106 | <!-- Start Content --> |
---|
| 107 | <?php |
---|
| 108 | |
---|
[229] | 109 | require_once 'constants.php'; |
---|
| 110 | require_once 'security.php'; |
---|
[224] | 111 | require_once 'PulsarArchiveDB.php'; |
---|
[229] | 112 | require_once 'date.php'; |
---|
[215] | 113 | require_once 'logger.php'; |
---|
[163] | 114 | |
---|
[229] | 115 | include 'header.html'; |
---|
| 116 | |
---|
[219] | 117 | try { |
---|
[215] | 118 | |
---|
[219] | 119 | |
---|
[163] | 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 | |
---|
[219] | 127 | //$link = db_connect(); |
---|
[224] | 128 | $db = new PulsarArchiveDB(); |
---|
[229] | 129 | $db->connect( DB_SERVER . ':' . DB_PORT, DB_USERNAME, DB_PASS, DB_NAME ); |
---|
[203] | 130 | |
---|
| 131 | |
---|
[163] | 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 | |
---|
[224] | 144 | $min_mjd = ''; |
---|
| 145 | $max_mjd = ''; |
---|
[163] | 146 | |
---|
[224] | 147 | $db->GetMinMaxMJD( $min_mjd, $max_mjd ); |
---|
[163] | 148 | |
---|
| 149 | // Convert from MJD to JD |
---|
[188] | 150 | $min_jd = $min_mjd + 2400000.5; |
---|
| 151 | $max_jd = $max_mjd + 2400000.5; |
---|
[163] | 152 | |
---|
| 153 | // convert the mjd to a date |
---|
[188] | 154 | $min_jd = floor($min_jd); |
---|
| 155 | $max_jd = ceil($max_jd); |
---|
[163] | 156 | |
---|
[188] | 157 | $min_unix = jdtounix($min_jd); |
---|
| 158 | $max_unix = jdtounix($max_jd); |
---|
[189] | 159 | $min_date_text = date("j F Y", $min_unix); |
---|
| 160 | $max_date_text = date("j F Y", $max_unix); |
---|
[188] | 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); |
---|
[163] | 167 | |
---|
[213] | 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 | |
---|
[163] | 175 | |
---|
| 176 | // Clear any old form inputs in session cache |
---|
[224] | 177 | init(); |
---|
[163] | 178 | |
---|
| 179 | ////////////////////////////////////////////// |
---|
| 180 | // Get the field names to fill form checkboxes |
---|
| 181 | |
---|
[224] | 182 | $fields = $db->GetObservationFields(); |
---|
[163] | 183 | |
---|
[188] | 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 | |
---|
[163] | 221 | /////////////////////////////////////////////// |
---|
| 222 | // Get the data types available in the database |
---|
| 223 | // |
---|
| 224 | |
---|
[224] | 225 | $data_types = $db->GetDataTypes(); |
---|
[163] | 226 | |
---|
| 227 | /////////////////////////////////////////////// |
---|
| 228 | // If the user clicked on the logout button |
---|
| 229 | if (isset($HTTP_GET_VARS['command'])) { |
---|
[219] | 230 | $command = $HTTP_GET_VARS['command']; |
---|
| 231 | if ($command == 'logout') { |
---|
| 232 | //unset($_SESSION['auth_code']); |
---|
| 233 | //unset($_SESSION['username']); |
---|
| 234 | $_SESSION = array(); |
---|
| 235 | } |
---|
[163] | 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 |
---|
| 241 | if (!isset($_SESSION['auth_code']) || $_SESSION['auth_code'] != OK) { |
---|
[213] | 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; |
---|
[215] | 250 | logger_login( $username, 'Anonymous', 'success' ); |
---|
[213] | 251 | } |
---|
| 252 | else{ |
---|
| 253 | $auth_code = authenticate($username, $password); |
---|
[215] | 254 | if( $auth_code == OK ) |
---|
| 255 | logger_login( $username, 'Opal', 'success' ); |
---|
| 256 | else |
---|
| 257 | logger_login( $username, 'Opal', 'failure' ); |
---|
[213] | 258 | //$auth_code = newAuthenticate(); |
---|
| 259 | } |
---|
[163] | 260 | } |
---|
| 261 | else { |
---|
| 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 |
---|
| 267 | if ($auth_code != OK) { ?> |
---|
[219] | 268 | <body class="front_page"> |
---|
[163] | 269 | |
---|
| 270 | |
---|
[213] | 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 |
---|
| 276 | made with the Parkes radio Telescope. Data older than <b> |
---|
| 277 | <?php echo PROPRIETRY_PERIOD_MONTH ?> months</b> is |
---|
| 278 | publicly available, and can be accessed by simply providing your email |
---|
| 279 | address. More recent data is proprietry, and can only be accessed by |
---|
| 280 | those 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 |
---|
| 282 | currently not enabled. In the interim, those who have previously |
---|
| 283 | obtained a login for the Data Archive can use that option below |
---|
| 284 | (making sure to check the "Data Archive login" button!). </p> |
---|
| 285 | |
---|
[214] | 286 | <p>A <a href="pulsar_archive_guide.html">Users Guide</a> to the archive is available.</p> |
---|
| 287 | |
---|
[213] | 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> |
---|
[233] | 304 | |
---|
[213] | 305 | <td><input type="radio" name="authenticateType" value="opal">Data Archive login<br> |
---|
| 306 | <table class="login" width="500" style="border: 0px;"> |
---|
[233] | 307 | <tr><td class="form_field">Username: </td><td><input type="text" name="opalEmail"></td></tr> |
---|
[213] | 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 | |
---|
[163] | 322 | <?php } else { |
---|
| 323 | $_SESSION['username'] = $username; |
---|
| 324 | $_SESSION['auth_code'] = $auth_code; |
---|
[213] | 325 | $_SESSION['logintype'] = $HTTP_POST_VARS['authenticateType']; |
---|
[163] | 326 | |
---|
| 327 | $actions = $HTTP_GET_VARS['actions']; |
---|
| 328 | |
---|
| 329 | if ($actions == "new_query") { |
---|
| 330 | init(); |
---|
| 331 | } |
---|
| 332 | else if ($actions == "error") { |
---|
[213] | 333 | // $date_error = "You are only authorised to access data > 18 months old"; |
---|
[163] | 334 | } |
---|
| 335 | ?> |
---|
| 336 | <body class="atoa"> |
---|
[213] | 337 | <div class="bodycontents"> |
---|
| 338 | |
---|
[188] | 339 | <h1>ATNF Pulsar Data Archive</h1> |
---|
[163] | 340 | |
---|
[213] | 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> |
---|
[238] | 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"; |
---|
[240] | 347 | // // // }?> |
---|
[213] | 348 | <p>See the Users Guide link for more details. </p> |
---|
[172] | 349 | |
---|
[184] | 350 | <table width="700" style="border: 0px;"> |
---|
[172] | 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> |
---|
[198] | 358 | <a href="#" onClick="toggleInstructions();return false;">Instructions</a> |
---|
[172] | 359 | </td> |
---|
| 360 | <td size="30"> |
---|
| 361 | |
---|
| 362 | </td> |
---|
| 363 | <td> |
---|
| 364 | <a href="pulsar_archive_guide.html">Users Guide</a> |
---|
| 365 | </td> |
---|
| 366 | </tr> |
---|
| 367 | |
---|
| 368 | </table> |
---|
| 369 | |
---|
[198] | 370 | <div id="divInstructions" style="display:none" > |
---|
| 371 | <dl class="top"> |
---|
| 372 | <h2>Instructions</h2> |
---|
[213] | 373 | <i>To hide, click "Instructions" again. </i> |
---|
[185] | 374 | <dt> Display Parameters </dt> |
---|
[198] | 375 | <dd> Check the fields you want shown in the results table. Suggested columns are checked by default</dd> |
---|
| 376 | <dd> The results can be ordered by one of the parameters in the "Order By" drop-down list</dd> |
---|
| 377 | <dt> Coordinates </dt> |
---|
| 378 | <dd> The sky position can be specified by a Pulsar name or a RA/Dec position. |
---|
| 379 | The pulsar name takes precedence. The search radius must be given. </dd> |
---|
[185] | 380 | <dt> Filter Options </dt> |
---|
[213] | 381 | <dd> Results can be limited to observations just from a particular project - use the Project ID box</dd> |
---|
[198] | 382 | <dd> The date range can be specified - the defaults are the range of dates in the archive.</dd> |
---|
| 383 | <dd> Either timing data (particular pulsar) or survey data can be specified. Or both! </dd> |
---|
| 384 | <dd> The type of instrument can be specified. Default is any type.</dd> |
---|
| 385 | <dd> More than one frequency band can be specified. |
---|
[185] | 386 | <dt> Display Other </dt> |
---|
[198] | 387 | <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> |
---|
[185] | 388 | </dl> |
---|
[172] | 389 | </div> |
---|
| 390 | |
---|
| 391 | |
---|
[184] | 392 | |
---|
[172] | 393 | <!--<table class="noborder"> |
---|
[189] | 394 | <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> |
---|
[163] | 395 | </tr> |
---|
[172] | 396 | </table>--> |
---|
[163] | 397 | |
---|
| 398 | |
---|
| 399 | <form action="query.php" method="GET" name="data_archive_form" id="data_archive_form"> |
---|
| 400 | <input type="hidden" name="state" value="results"> |
---|
[184] | 401 | |
---|
[163] | 402 | |
---|
[184] | 403 | |
---|
| 404 | |
---|
| 405 | <table class="noborder" cellpadding=0> |
---|
[163] | 406 | |
---|
[188] | 407 | <tr><td colspan=3> |
---|
| 408 | <br> |
---|
| 409 | <center><input type="submit" value="submit" name="submit_button" style="float: center;"> |
---|
| 410 | <input type="reset" value="reset" name="reset_button" style="float: center;"></center> |
---|
| 411 | <br> |
---|
[184] | 412 | </td></tr> |
---|
| 413 | |
---|
| 414 | <tr> |
---|
[163] | 415 | |
---|
[188] | 416 | <!-- **************************** --> |
---|
| 417 | <td valign="top" class="form_field" rowspan="1"> |
---|
[184] | 418 | |
---|
| 419 | <fieldset> |
---|
[188] | 420 | <legend>DISPLAY PARAMETERS</legend> |
---|
[184] | 421 | <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> |
---|
| 422 | <!--font size="-1"><a href="javascript:togglecomments('params', 'toggler1')" id="toggler1">Show all >></a></font--><br> |
---|
| 423 | <!span class="commenthidden" id="params"> |
---|
[163] | 424 | <div id="list"> |
---|
| 425 | <?php |
---|
[180] | 426 | $def_fields = Array( "filename", "src_name", "project_id", "raj", "decj", |
---|
| 427 | "data_type", "obsfreq", "bw", "scanlen", "date", "ut" ); |
---|
[163] | 428 | |
---|
| 429 | foreach ($fields as $field) { |
---|
[188] | 430 | echo "<input |
---|
[180] | 431 | onClick=\"updateSelectAll('".$field['Field']."', '$all_params_id')\" type=\"checkbox\" name=\"params[]\" value=\"".$field['Field']."\" id=\"".$field['Field']."\""; |
---|
[188] | 432 | if( in_array( $field['Field'], $def_fields ) ) |
---|
| 433 | echo ' checked="true"'; |
---|
| 434 | echo " >".$field_names[$field['Field']]."<br>\n"; |
---|
[163] | 435 | } |
---|
| 436 | ?> |
---|
| 437 | </div> |
---|
| 438 | </span> |
---|
| 439 | </fieldset> |
---|
[184] | 440 | |
---|
[163] | 441 | </td> |
---|
| 442 | |
---|
[188] | 443 | <!-- **************************** --> |
---|
| 444 | |
---|
| 445 | <td class="form_field" height="10%" rowspan="1"> |
---|
| 446 | <!-- Position Options --> |
---|
| 447 | |
---|
| 448 | <table cellspacing=0 cellpadding=0 style="border: 0px;"> |
---|
| 449 | <tr><td> |
---|
| 450 | <fieldset id="flsPosition"> |
---|
| 451 | <legend>POSITION REQUIREMENTS</legend> |
---|
| 452 | |
---|
[194] | 453 | <!-- Pulsar Name --> |
---|
[188] | 454 | <fieldset> |
---|
[194] | 455 | <legend>Pulsar Name</legend> |
---|
| 456 | <input type="text" name="pulsar_name" size="20"> |
---|
| 457 | <br> |
---|
| 458 | <p>Note that search-by-name takes precedence over search-by-RA/Dec.</p> |
---|
| 459 | </fieldset> |
---|
[188] | 460 | |
---|
[194] | 461 | <br> |
---|
[188] | 462 | |
---|
[194] | 463 | <fieldset> |
---|
| 464 | <legend>Right Ascension (J2000)</legend> |
---|
| 465 | |
---|
| 466 | <input type="text" id="txtRAHour" name="rahour" size="3" tabindex="1" /> |
---|
| 467 | <label for="txtRAHour" class="coordinate"><abbr title="hours"><sup>h</sup></abbr></label> |
---|
| 468 | |
---|
| 469 | <input type="text" id="txtRAMinute" name="ramin" size="3" tabindex="1" /> |
---|
| 470 | <label for="txtRAMinute" class="coordinate"><abbr title="minutes"><sup>m</sup></abbr></label> |
---|
| 471 | |
---|
| 472 | <input type="text" id="txtRASecond" name="rasec" size="6" tabindex="1" /> |
---|
| 473 | <label for="txtRASecond" class="coordinate"><abbr title="seconds"><sup>s</sup></abbr></label> |
---|
| 474 | </fieldset> |
---|
[188] | 475 | |
---|
[194] | 476 | <fieldset> |
---|
| 477 | <legend>Declination (J2000)</legend> |
---|
[188] | 478 | |
---|
[194] | 479 | <input type="text" id="txtDecDegree" name="decdeg" size="3" tabindex="1" /> |
---|
| 480 | <label for="txtDecDegree" class="coordinate"><abbr title="degrees">°</abbr></label> |
---|
[188] | 481 | |
---|
[194] | 482 | <input type="text" id="txtDecMinute" name="decmin" size="3" tabindex="1" /> |
---|
| 483 | <label for="txtDecMinute" class="coordinate"><abbr title="minutes">′</abbr></label> |
---|
[188] | 484 | |
---|
[194] | 485 | <input type="text" id="txtDecSecond" name="decsec" size="6" tabindex="1" /> |
---|
| 486 | <label for="txtDecSecond" class="coordinate"><abbr title="seconds">″</abbr></label> |
---|
| 487 | </fieldset> |
---|
[188] | 488 | |
---|
[194] | 489 | <br> |
---|
| 490 | <br> |
---|
| 491 | </fieldset> |
---|
[188] | 492 | |
---|
[194] | 493 | <fieldset id="flsSearchRadius"> |
---|
| 494 | <legend>SEARCH WINDOW [arcmin]</legend> |
---|
| 495 | <input type="text" id="txtSearchWindow" name="radius" size="20" tabindex="1" value="60"/> |
---|
| 496 | </fieldset> |
---|
[189] | 497 | |
---|
[211] | 498 | <br> |
---|
| 499 | <fieldset id="flsProjectID"> |
---|
| 500 | <legend>PROJECT ID</legend> |
---|
| 501 | <input type="text" id="txtSearchWindow" name="projID" size="20" tabindex="1" value=""/> |
---|
| 502 | </fieldset> |
---|
| 503 | |
---|
[188] | 504 | </td></tr> |
---|
| 505 | </table> |
---|
| 506 | </td> |
---|
| 507 | |
---|
| 508 | <!-- **************************** --> |
---|
| 509 | |
---|
[163] | 510 | <td class="form_field" height="10%"> |
---|
| 511 | <!-- Filter Options --> |
---|
[184] | 512 | <table cellspacing=0 cellpadding=0 style="border: 0px;"> |
---|
[188] | 513 | <tr><td> |
---|
| 514 | <fieldset id="flsObsDate"> |
---|
[163] | 515 | |
---|
[188] | 516 | <legend>FILTER OPTIONS</legend> |
---|
[189] | 517 | <br> |
---|
[163] | 518 | |
---|
| 519 | <!-- Date range --> |
---|
| 520 | <fieldset> |
---|
| 521 | <legend>Date Range</legend> |
---|
| 522 | |
---|
[189] | 523 | From: |
---|
[188] | 524 | <select name="from_day"> |
---|
| 525 | <?php |
---|
| 526 | for ($i = 1; $i <= 31; $i++) { |
---|
| 527 | echo "\t\t\t<option"; |
---|
| 528 | if ($i == $minDay) { echo " selected"; } |
---|
| 529 | echo " value=\"$i\">$i</option>\n"; |
---|
| 530 | } |
---|
[163] | 531 | ?> |
---|
[188] | 532 | </select> |
---|
[163] | 533 | <select name="from_month"> |
---|
| 534 | <?php |
---|
[188] | 535 | $monthlist = cal_info(0); |
---|
| 536 | for ($i = 1; $i <= 12; $i++) { |
---|
| 537 | echo "\t\t\t<option"; |
---|
| 538 | $month = $monthlist[abbrevmonths][$i]; |
---|
| 539 | if ($i == $minMonth) { echo " selected"; } |
---|
| 540 | echo " value=\"$i\">$month</option>\n"; |
---|
| 541 | } |
---|
[163] | 542 | ?> |
---|
[188] | 543 | </select> |
---|
| 544 | <!-- <input type="text" size="4" name="from_year" value="<?php echo $min_cal_assoc['year']; ?>"> --> |
---|
| 545 | <select name="from_year"> |
---|
| 546 | <?php |
---|
| 547 | for ($i = $minYear; $i <= $maxYear; $i++) { |
---|
| 548 | echo "\t\t\t<option"; |
---|
| 549 | if ($i == $minYear) { echo " selected"; } |
---|
| 550 | echo " value=\"$i\">$i</option>\n"; |
---|
| 551 | } |
---|
| 552 | ?> |
---|
| 553 | </select> |
---|
[163] | 554 | <?php echo "<font size=\"-1\" color=\"red\">$date_error</font>" ?> |
---|
[189] | 555 |   To: |
---|
[163] | 556 | <select name="to_day"> |
---|
| 557 | <?php |
---|
| 558 | for ($i = 1; $i <= 31; $i++) { |
---|
[188] | 559 | echo "\t\t\t<option"; |
---|
| 560 | if ($i == $maxDay) { echo " selected"; } |
---|
| 561 | echo " value=\"$i\">$i</option>\n"; |
---|
[163] | 562 | } |
---|
| 563 | ?> |
---|
| 564 | </select> |
---|
| 565 | <select name="to_month"> |
---|
| 566 | <?php |
---|
[188] | 567 | for ($i = 1; $i <= 12; $i++) { |
---|
| 568 | echo "\t\t\t<option"; |
---|
| 569 | $month = $monthlist[abbrevmonths][$i]; |
---|
| 570 | if ($i == $maxMonth) { echo " selected"; } |
---|
| 571 | echo " value=\"$i\">$month</option>\n"; |
---|
| 572 | } |
---|
[163] | 573 | ?> |
---|
| 574 | </select> |
---|
[188] | 575 | <select name="to_year"> |
---|
| 576 | <?php |
---|
| 577 | for ($i = $minYear; $i <= $maxYear; $i++) { |
---|
| 578 | echo "\t\t\t<option"; |
---|
| 579 | if ($i == $maxYear) { echo " selected"; } |
---|
| 580 | echo " value=\"$i\">$i</option>\n"; |
---|
| 581 | } |
---|
| 582 | ?> |
---|
| 583 | </select> |
---|
[163] | 584 | </fieldset> |
---|
[189] | 585 | |
---|
| 586 | <br> |
---|
| 587 | <!-- Obs Mode --> |
---|
| 588 | <fieldset> |
---|
| 589 | <legend>Obs Mode</legend> |
---|
| 590 | |
---|
| 591 | <select name="obs_mode" onchange="ObsModeChanged()" id="ObsModeList"> |
---|
| 592 | <option value="any"> Any </option> |
---|
| 593 | <option value="timing"> Only timing data </option> |
---|
| 594 | <option value="search"> Only search data </option> |
---|
| 595 | </select> |
---|
| 596 | </fieldset> |
---|
| 597 | |
---|
| 598 | <!-- Data Type --> |
---|
| 599 | <fieldset> |
---|
| 600 | <legend>Data Type</legend> |
---|
| 601 | |
---|
| 602 | <select name="data_type"> |
---|
| 603 | <option value="" selected> Any </option> |
---|
| 604 | <?php |
---|
| 605 | foreach ($data_types as $data_type) { |
---|
[219] | 606 | echo ' |
---|
| 607 | <option value="' . $data_type['data_type'] . '"> ' . $data_type['data_type'] . '</option>'; |
---|
[189] | 608 | } |
---|
| 609 | ?> |
---|
| 610 | </select> |
---|
| 611 | </fieldset> |
---|
| 612 | |
---|
| 613 | <!-- Frequency band --> |
---|
| 614 | <fieldset> |
---|
| 615 | <legend>Band Name</legend> |
---|
| 616 | <select id="selBand" name="bandname[]" multiple="multiple" size="5"> |
---|
| 617 | <option value="anyBand" selected="selected">Any</option> |
---|
| 618 | <option value="70cm" >70cm (~0.44 GHz)</option> |
---|
| 619 | <option value="50cm" >50cm (~0.66 GHz)</option> |
---|
| 620 | <option value="20cm">20/18cm (1.2-1.8 GHz)</option> |
---|
| 621 | <option value="13cm" >13cm (2.0-2.5 GHz)</option> |
---|
| 622 | <option value="10cm" >10cm (2.6-3.6 GHz)</option> |
---|
| 623 | <option value="6cm" >6cm (4.5-5.1 GHz)</option> |
---|
| 624 | <option value="5cm" >5cm (5.9-6.8 GHz)</option> |
---|
| 625 | <option value="3cm" >3cm (8.1-8.6 GHz)</option> |
---|
| 626 | <option value="1.3cm" >1.3cm (21.-24. GHz)</option> |
---|
| 627 | </select> |
---|
| 628 | </fieldset> |
---|
| 629 | |
---|
| 630 | </fieldset> |
---|
[188] | 631 | </td></tr> |
---|
| 632 | <tr><td> |
---|
| 633 | <fieldset> |
---|
[189] | 634 | <legend>ORDER RESULTS BY</legend> |
---|
| 635 | <table cellspacing="0px" cellpadding="0px" style="border: 0px;"> |
---|
| 636 | <tr><td> |
---|
| 637 | <select name="orderBy" id="OrderByList"> |
---|
| 638 | <option selected value="distance">Distance |
---|
| 639 | <option value="date">Date |
---|
| 640 | <option value="obsfreq">Frequency |
---|
| 641 | <option value="filename">Filename |
---|
| 642 | </select> |
---|
| 643 | </td><td> |
---|
| 644 | <input type="radio" name="orderDir" id="orderDirectionSel" checked value="asc">Ascending |
---|
| 645 | <br> |
---|
| 646 | <input type="radio" name="orderDir" id="orderDirectionSel" value="desc">Descending |
---|
| 647 | </td></tr> |
---|
| 648 | </table> |
---|
| 649 | <br> |
---|
| 650 | </fieldset> |
---|
| 651 | </td></tr> |
---|
| 652 | <tr><td> |
---|
| 653 | <fieldset> |
---|
| 654 | <legend>DISPLAY OTHER DATA</legend> |
---|
[184] | 655 | |
---|
[189] | 656 | <input type="checkbox" name="cals" value="cals" id="cals" checked="true" /> |
---|
| 657 | Display Cals taken within |
---|
| 658 | <input type="text" name="cals_within_mins" value="30" maxlength="5" size="3"/> |
---|
| 659 | mins of Observations |
---|
[184] | 660 | <br> |
---|
| 661 | |
---|
[188] | 662 | </fieldset> |
---|
| 663 | </td></tr> |
---|
| 664 | </table> |
---|
[163] | 665 | <br> |
---|
| 666 | </td> |
---|
| 667 | </tr> |
---|
| 668 | </table> |
---|
| 669 | |
---|
| 670 | |
---|
| 671 | </form> |
---|
[184] | 672 | <div style="min-height: 20px; max-height: 1000px;"> </div> |
---|
[172] | 673 | <?php |
---|
[219] | 674 | } |
---|
| 675 | |
---|
| 676 | } catch( MysqlDBException $e ) { |
---|
| 677 | logger_exception( $_SESSION['username'], $e->getCode, $e->getMessage(), '' ); |
---|
| 678 | echo '<p><div class="exception_box">' . |
---|
| 679 | '<center>' . |
---|
| 680 | '<b>A database error was encountered</b> <br>' . |
---|
| 681 | 'the details of the error have been logged, please contact the system administrator for futher assistance <br>' . |
---|
| 682 | '</center>' . |
---|
| 683 | '</div><p>'; |
---|
| 684 | } |
---|
| 685 | |
---|
| 686 | ?> |
---|
[213] | 687 | </div> |
---|
[163] | 688 | |
---|
[213] | 689 | <div id=\"footer\"> |
---|
| 690 | <?php include "footer.html"; ?> |
---|
| 691 | </div> |
---|
| 692 | |
---|
[163] | 693 | </body> |
---|
| 694 | |
---|
| 695 | </html> |
---|
| 696 | |
---|
| 697 | |
---|
| 698 | <?php //////////// Function definitions /////////////// |
---|
| 699 | |
---|
| 700 | |
---|
| 701 | // Initialise the input form variables. If the "New query" button is clicked |
---|
| 702 | // no argument is passed to init(), hence the need for a default NULL value |
---|
| 703 | // because there is no need for updating user access statistics |
---|
| 704 | function init($link=NULL) { |
---|
| 705 | |
---|
| 706 | unset($_SESSION['cals']); // The result set of cals |
---|
| 707 | unset($_SESSION['obs']); // The result set of observations |
---|
[233] | 708 | unset($_SESSION['cart_items']); // The result set of observations |
---|
[163] | 709 | } |
---|
| 710 | |
---|
| 711 | |
---|
[219] | 712 | |
---|
[224] | 713 | |
---|
[163] | 714 | ?> |
---|