Make registration list sortable

Make links in summarytable header be white
(something in pdf?)
This commit is contained in:
james 2005-01-14 17:00:24 +00:00
parent 43cf64ee89
commit d3b1223e92
3 changed files with 73 additions and 10 deletions

View File

@ -28,6 +28,16 @@
if($_GET['showstatus']) $wherestatus="AND status='".$_GET['showstatus']."' ";
else $wherestatus="";
switch($_GET['sort'])
{
case 'status': $ORDERBY="registrations.status DESC, projects.title"; break;
case 'num': $ORDERBY="registrations.num"; break;
case 'title': $ORDERBY="projects.title, registrations.status DESC"; break;
case 'cat': $ORDERBY="projects.projectcategories_id, projects.title"; break;
case 'div': $ORDERBY="projects.projectdivisions_id, projects.title"; break;
default: $ORDERBY="registrations.status DESC, projects.title"; break;
}
$q=mysql_query("SELECT registrations.id AS reg_id,
registrations.num AS reg_num,
@ -43,18 +53,18 @@ else $wherestatus="";
AND registrations.year='".$config['FAIRYEAR']."'
$wherestatus
ORDER BY
registrations.status DESC,
projects.title
$ORDERBY
");
echo mysql_error();
echo "<table class=\"summarytable\">";
echo "<tr>";
echo "<th>".i18n("Status")."</th>";
echo "<th>".i18n("Reg Num")."</th>";
echo "<th>".i18n("Project Title")."</th>";
echo "<th>".i18n("Age Category")."</th>";
echo "<th>".i18n("Division")."</th>";
if($_GET['showstatus']) $stat="&showstatus=".$_GET['showstatus'];
echo "<th><a href=\"registration_list.php?sort=status$stat\">".i18n("Status")."</a></th>";
echo "<th><a href=\"registration_list.php?sort=num$stat\">".i18n("Reg Num")."</a></th>";
echo "<th><a href=\"registration_list.php?sort=title$stat\">".i18n("Project Title")."</a></th>";
echo "<th><a href=\"registration_list.php?sort=cat$stat\">".i18n("Age Category")."</a></th>";
echo "<th><a href=\"registration_list.php?sort=div$stat\">".i18n("Division")."</a></th>";
echo "<th>".i18n("School(s)")."</th>";
echo "<th>".i18n("Student(s)")."</th>";
echo "</tr>";

View File

@ -104,8 +104,6 @@ class lpdf
if($table['data'])
{
pdf_setfont($this->pdf,$this->normalfont,10);
foreach($table['data'] AS $dataline)
{
$xpos=$xpos_of_table;
@ -123,6 +121,57 @@ class lpdf
pdf_stroke($this->pdf);
$this->yloc-=$height['tabledata'];
if($this->yloc<1)
{
//now draw all the vertical lines
$xpos=$xpos_of_table;
for($c=0;$c<$table_cols;$c++)
{
$width=$table['widths'][$c];
//draw the line below the table data)
pdf_moveto($this->pdf,$this->loc($xpos),$this->loc($top_of_table+$height['tableheader']));
pdf_lineto($this->pdf,$this->loc($xpos),$this->loc($this->yloc+$height['tableheader']-.02));
pdf_stroke($this->pdf);
$xpos+=$width;
}
//and the final line on the right side of the table:
pdf_moveto($this->pdf,$this->loc($xpos),$this->loc($top_of_table+$height['tableheader']));
pdf_lineto($this->pdf,$this->loc($xpos),$this->loc($this->yloc+$height['tableheader']-.02));
pdf_stroke($this->pdf);
$this->newPage();
//draw the top line of the table (above the table header)
pdf_moveto($this->pdf,$this->loc($xpos_of_table),$this->loc($this->yloc+$height['tableheader']));
pdf_lineto($this->pdf,$this->loc($xpos_of_table+$table_width),$this->loc($this->yloc+$height['tableheader']));
pdf_stroke($this->pdf);
//draw the top line of the table (below the table header)
pdf_moveto($this->pdf,$this->loc($xpos_of_table),$this->loc($this->yloc));
pdf_lineto($this->pdf,$this->loc($xpos_of_table+$table_width),$this->loc($this->yloc));
pdf_stroke($this->pdf);
//do the header first
if($table['header'])
{
pdf_setfont($this->pdf,$this->headerfont,12);
$xpos=$xpos_of_table;
for($c=0;$c<$table_cols;$c++)
{
$head=$table['header'][$c];
$width=$table['widths'][$c];
pdf_show_boxed($this->pdf,$head,$this->loc($xpos),$this->loc($this->yloc),$this->loc($width),$this->loc($height['tableheader']),"center",null);
$xpos+=$width;
}
$this->yloc-=$height['tableheader'];
}
pdf_setfont($this->pdf,$this->normalfont,10);
}
}
}

View File

@ -153,8 +153,12 @@ a {
font-size: 1.05em;
color: white;
font-weight: bold;
}
.summarytable th a{
font-size: 1.05em;
color: white;
font-weight: bold;
}
.summarytable td {