- Only lookup _GET['showstatus'] once, for a minute speed increase and easier

handling.
This commit is contained in:
dave 2008-02-26 08:32:00 +00:00
parent b1ed8e4b4a
commit f70314653b

View File

@ -73,8 +73,10 @@ function openstudentinfo(id)
$status_str['open'] = i18n("Open");
$status_str['new'] = i18n("New");
$showstatus = $_GET['showstatus'];
foreach($status_str as $s=>$str) {
$sel = ($_GET['showstatus'] == $s) ? "selected=\"selected\"" : '';
$sel = ($showstatus == $s) ? "selected=\"selected\"" : '';
echo "<option $sel value=\"$s\">$str</option>\n";
}
echo "</select>";
@ -88,7 +90,7 @@ $q=mysql_query("SELECT * FROM projectdivisions WHERE year='$year' ORDER BY id");
while($r=mysql_fetch_object($q))
$divs[$r->id]=$r->division;
if($_GET['showstatus']) $wherestatus="AND status='".$_GET['showstatus']."' ";
if($showstatus) $wherestatus="AND status='$showstatus' ";
else $wherestatus="";
switch($_GET['sort'])
{
@ -124,7 +126,7 @@ else $wherestatus="";
echo "<table class=\"summarytable\">";
echo "<tr>";
if($_GET['showstatus']) $stat="&showstatus=".$_GET['showstatus'];
if($showstatus) $stat="&showstatus=".$showstatus;
echo "<th><a href=\"registration_list.php?sort=status$stat\">".i18n("Status")."</a></th>";
echo "<th><a href=\"registration_list.php?sort=email\">".i18n("Email Address")."</a></th>";
echo "<th><a href=\"registration_list.php?sort=num$stat\">".i18n("Reg Num")."</a></th>";