Source for file week.php
Documentation is available at week.php
* This file displays the week view consiting of seven UARS days.
* This file is part of HRDIODB.
* HRDIODB is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
* HRDIODB is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with HRDIODB; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
/** Configuration file */
require_once("conf.php");
/** Debugging functions */
require_once("debugging.php");
require_once("week_class.php");
/** HRDI database class */
require_once("hrdi_db_class.php");
require_once("session_class.php");
require_once("common_class.php");
require_once("user_class.php");
// Check to see if we're in offline mode
// HRDI database instance
$page_title = "Week View";
$user = new user($hdb, $session);
// Get the day from the command line argument
// Get the day from the $_GET array
$uars_day = @$_GET['uars_day'];
print "UARS Day is not valid";
require_once("header.php");
error("UARS Day is not valid");
require_once("footer.php");
// Create a week class instance for the UARS day
$week = new week ($hdb, $uars_day);
// Include the correct header
require_once("offline_header.php");
require_once("header.php");
print "<div class=\"prev_next\">";
// Generate previous week link
if (($uars_day - $week->dow) > 0) {
if ($pday < 1) $pday = 1;
$pweek = floor(($pday + 3) / 7);
$link = "week_$pweek.html";
$link = "week.php?uars_day=$pday";
print "<a href=\"$link\">← Previous Week</a>";
print " ";
if (($uars_day - $week->dow + 7) < $week->newest) {
// Generate next week link
$nweek = floor(($nday + 3) / 7);
$link = "week_$nweek.html";
$link = "week.php?uars_day=$nday";
print "<a href=\"$link\">Next Week →</a></div>";
// Display the week table
<table class="hrdi" id="week">
<td>Flight Direction</td>
<td>Beta Angle (deg.)</td>
<td nowrap>Pid: Azimuths</td>
<td align="left" width="49%">Comments</td>
// Initialize the pids array
for ($i = 0; $i < 7; $i++ ) {
// Display each UARS day object
$link = "day_". $week->days[$i]->day. ".html";
$link = "day.php?uars_day=". $week->days[$i]->day;
// determine pretty output for Data_Valid flag
if ($week->days[$i]->data['Data_Valid'] == NULL) {
$valid_str = "Unspecified";
} elseif ($week->days[$i]->data['Data_Valid'] == 1) {
} else if ($week->days[$i]->data['Data_Valid'] === "0") {
$valid_str = "Not Valid";
// Print out the UARS day data
print "<tr class=\"data\" valign=\"top\"><td><a href=\"$link\">"
. $week->days[$i]->data['Year']
. $week->days[$i]->data['Day_Of_Year']
. $week->days[$i]->data['Date']
. @$week->days[$i]->data['Flight_Direction']
. @$week->days[$i]->data['Beta_Angle']
foreach ($week->days[$i]->modes as $mode) {
// If the mode has a description
// We already have the description
$def = $pids[$mode['Description']]['Def'];
$pids[$mode['Description']]['Pid'] = $mode['Process_ID'];
$pids[$mode['Description']]['Def'] = $def = $j;
print $mode['Process_ID'];
// Add line breaks to meet the minimum number of mode rows
for ($j = count($week->days[$i]->modes); $j < $min_mode_rows; $j++ ) {
// Print out the comments
. @$week->days[$i]->data['Comments']
// Create the additional JavaScript array indexes for the popup display
foreach ($pids as $desc => $keys) {
$pids_string .= "<tr class=\"data\"><td>{$keys['Pid']}</td><td>$desc</td></tr>\n";
$jscript_string .= "defs['{$keys['Def']}'] = '$desc';\n";
<table class="hrdi" id="pids">
<tr class="label"><td>Pid</th><td>Description</td></tr>
// Print out the pids table
<script type="text/javascript">
// Print out the JavaScript array
// Include the page footer
require_once("footer.php");
|