if ($myrow[6] > $maxdate) { $maxdate = $myrow[6]; } // Choose between light and dark rows if ($rownum != 0) { $id = 'id="OsRow3"'; echo " <tr id=OsRow>\n"; $rownum = 0; } else { $id = 'id="OsRow4"'; echo " <tr id=OsRow2>\n"; $rownum = 1; } $SQL3 = "SELECT `lastday` FROM `periods` WHERE `periodno`=" . $myrow[0]; $longdate = singleResult($SQL3, $db); echo ' <td ' . $id . ' align="left">' . convertDateShort($longdate) . "</td>\n"; echo ' <td ' . $id . ' align="right">' . $myrow[1] . "</td>\n"; echo ' <td ' . $id . ' align="right">' . $myrow[2] . "</td>\n"; echo ' <td ' . $id . ' align="right">' . $myrow[3] . "</td>\n"; echo ' <td ' . $id . ' align="right">' . $myrow[4] . "</td>\n"; // Calculate totals for the obvious ones $TQNI = $TQNI + $myrow[1]; $TQTC = $TQTC + $myrow[2]; $TQTR = $TQTR + $myrow[3]; $TSess = $TSess + $myrow[4]; // For manhours, use reported if available if ($myrow[5] > 0) { echo ' <td ' . $id . ' align="right">' . $myrow[5] . "</td>\n"; $TMH = $TMH + $myrow[5]; } else { if ($myrow[4] > 0 && $myrow[3] > 0) {
echo "<p><h1>Public Service Honor Roll for " . $call . "</h1></p>\n"; // Get the actual report data for this call $SQL = "SELECT period,cat1,cat2,cat3,cat4,cat5,cat6,total,comment,updated " . "FROM `pshr` WHERE `call`='" . $call . "' ORDER BY period DESC"; $result = getResult($SQL, $db); echo "<table>\n"; echo "<th>Period<th>Nets<th>Tfc<th>Appt<th>Pl<th>Unpl<th>BBS<th>" . "Total<th>Comments<tr>\n"; // Loop through the result set and display the data $rownum = 1; while ($myrow = getRow($result, $db)) { if ($myrow[9] > $maxdate) { $maxdate = $myrow[9]; } $SQL2 = "SELECT lastday FROM periods WHERE periodno = " . $myrow[0]; $result2 = getResult($SQL2, $db); $myrow2 = getRow($result2, $db); $displaydate = convertDateShort($myrow2[0]); if ($rownum != 0) { $class1 = 'OsRow'; $class2 = 'OsRow3'; $rownum = 0; } else { $class1 = 'OsRow2'; $class2 = 'OsRow4'; $rownum = 1; } echo " <tr id=" . $class1 . ">\n"; echo ' <td id=' . $class2 . '>' . $displaydate . "</TD>\n"; echo ' <td id=' . $class2 . ' align="right">' . $myrow[1] . "</TD>\n"; echo ' <td id=' . $class2 . ' align="right">' . $myrow[2] . "</TD>\n"; echo ' <td id=' . $class2 . ' align="right">' . $myrow[3] . "</TD>\n"; echo ' <td id=' . $class2 . ' align="right">' . $myrow[4] . "</TD>\n";
$SQL3 = "SELECT COUNT(*) FROM `pshr` WHERE `total`>69 AND `period` " . "BETWEEN " . $startperiod . " AND " . $period . " AND `call`='" . $row1[0] . "'"; $count = singleResult($SQL3, $db); // If >17 then this station is eligible if ($count > 17) { echo "<p>" . callsign($row1[0]) . " eligible - >=70 " . $count . " months in past 24"; echo "<br />\n"; // Get the list of qualifying months $SQL4 = "SELECT `lastday` FROM `pshr` A, `periods` B " . "WHERE `total`>69 AND `period` BETWEEN " . $startperiod . " AND " . $period . " AND `call`='" . $row1[0] . "' AND A.`period`=B.`periodno` ORDER BY A.`period`"; $result4 = getResult($SQL4, $db); $dashed = 0; while ($row4 = getRow($result4, $db)) { if ($dashed) { echo " - "; } $dashed = 1; echo convertDateShort($row4[0]); } } } echo "</p>\n"; } ?> </div> <?php sectLeaders($db); footer($starttime, $maxdate, "\$Revision: 1.1 \$ - \$Date: 2011-01-17 13:37:44-05 \$"); ?> </div> </body> </html>