Made tables of the "tableview" class sortable

This commit is contained in:
jacob 2010-03-31 18:44:42 +00:00
parent 2332d89736
commit 4ad5ec9d68
16 changed files with 481 additions and 557 deletions

View File

@ -262,11 +262,11 @@ if(!function_exists('curl_init')) {
} }
?> ?>
<table class="tableview"> <table class="tableview"><thead>
<tr><th><?=i18n("Source Name")?></th> <tr><th><?=i18n("Source Name")?></th>
<th><?=i18n("Source Location URL")?></th> <th><?=i18n("Source Location URL")?></th>
<th><?=i18n("Check")?></th> <th><?=i18n("Check")?></th>
</tr> </tr></thead>
<? <?
$q=mysql_query("SELECT * FROM fairs WHERE enable_awards='yes' ORDER BY name"); $q=mysql_query("SELECT * FROM fairs WHERE enable_awards='yes' ORDER BY name");

View File

@ -510,12 +510,12 @@ echo mysql_error();
?> ?>
<table class="tableview"> <table class="tableview"><thead>
<tr><th><?=i18n("Award Name")?></th> <tr><th><?=i18n("Award Name")?></th>
<th><?=i18n("Source Name")?></th> <th><?=i18n("Source Name")?></th>
<th><?=i18n("Send")?></th> <th><?=i18n("Send")?></th>
<th><?=i18n("Additional<br />Info")?></th> <th><?=i18n("Additional<br />Info")?></th>
</tr> </tr></thead>
<? <?
while($r=mysql_fetch_object($q)) { while($r=mysql_fetch_object($q)) {
echo "<tr><td>{$r->awardname}</td>\n"; echo "<tr><td>{$r->awardname}</td>\n";

View File

@ -608,11 +608,11 @@ case "email_get_list":
$q=mysql_query("SELECT * FROM emails ORDER BY type,name"); $q=mysql_query("SELECT * FROM emails ORDER BY type,name");
echo "<table class=\"tableview\">"; echo "<table class=\"tableview\">";
echo "<tr>"; echo "<thead><tr>";
echo " <th>".i18n("Name")."</th>"; echo " <th>".i18n("Name")."</th>";
echo " <th>".i18n("Type")."</th>"; echo " <th>".i18n("Type")."</th>";
echo " <th>".i18n("Actions")."</th>"; echo " <th>".i18n("Actions")."</th>";
echo "</tr>"; echo "</tr></thead>";
while($r=mysql_fetch_object($q)) { while($r=mysql_fetch_object($q)) {
if($r->fundraising_campaigns_id) $fcid=$r->fundraising_campaigns_id; if($r->fundraising_campaigns_id) $fcid=$r->fundraising_campaigns_id;
else $fcid='null'; else $fcid='null';
@ -892,8 +892,10 @@ case "email_get_list":
?> ?>
<script type="text/javascript"> <script type="text/javascript">
function refreshEmailList() { function refreshEmailList() {
$("#emaillist").load("communication.php?action=email_get_list",null,function() { $("#emaillist").load("communication.php?action=email_get_list",null,function(){
}); $('.tableview').tablesorter();
});
} }
$(document).ready(function() { $(document).ready(function() {
refreshEmailList(); refreshEmailList();

View File

@ -41,7 +41,7 @@
echo "<table class=\"tableview\">"; echo "<table class=\"tableview\">";
echo "<tr>"; echo "<thead><tr>";
echo " <th>".i18n("Name")."</th>\n"; echo " <th>".i18n("Name")."</th>\n";
echo " <th>".i18n("Subject")."</th>\n"; echo " <th>".i18n("Subject")."</th>\n";
echo " <th>".i18n("Started")."</th>\n"; echo " <th>".i18n("Started")."</th>\n";
@ -49,7 +49,7 @@
echo " <th>".i18n("Duration")."</th>\n"; echo " <th>".i18n("Duration")."</th>\n";
echo " <th>".i18n("ETA")."</th>\n"; echo " <th>".i18n("ETA")."</th>\n";
echo " <th>".i18n("Cancel")."</th>\n"; echo " <th>".i18n("Cancel")."</th>\n";
echo "</tr>\n"; echo "</tr></thead>\n";
while($r=mysql_fetch_object($q)) { while($r=mysql_fetch_object($q)) {
echo "<tr>"; echo "<tr>";
@ -92,7 +92,7 @@
$q=mysql_query("SELECT * FROM emailqueue WHERE finished IS NOT NULL ORDER BY started DESC LIMIT 10"); $q=mysql_query("SELECT * FROM emailqueue WHERE finished IS NOT NULL ORDER BY started DESC LIMIT 10");
echo "<h4>".i18n("Completed Send Queues")."</h4>\n"; echo "<h4>".i18n("Completed Send Queues")."</h4>\n";
echo "<table class=\"tableview\">\n"; echo "<table class=\"tableview\">\n";
echo "<tr>"; echo "<thead><tr>";
echo " <th>".i18n("Name")."</th>\n"; echo " <th>".i18n("Name")."</th>\n";
echo " <th>".i18n("Subject")."</th>\n"; echo " <th>".i18n("Subject")."</th>\n";
echo " <th>".i18n("Started")."</th>\n"; echo " <th>".i18n("Started")."</th>\n";
@ -102,7 +102,7 @@
echo " <th>".i18n("Failed")."</th>\n"; echo " <th>".i18n("Failed")."</th>\n";
//FIXME: comment bounced until we implement it //FIXME: comment bounced until we implement it
// echo " <th>".i18n("Bounced")."</th>\n"; // echo " <th>".i18n("Bounced")."</th>\n";
echo "</tr>\n"; echo "</tr></thead>\n";
while($r=mysql_fetch_object($q)) { while($r=mysql_fetch_object($q)) {
echo "<tr>"; echo "<tr>";
echo " <td>$r->name</td>\n"; echo " <td>$r->name</td>\n";

View File

@ -211,10 +211,10 @@ include "xml.inc.php";
echo "<br />"; echo "<br />";
$error=false; $error=false;
echo "<form method=\"post\" action=\"cwsfregister.php\">"; echo "<form method=\"post\" action=\"cwsfregister.php\">";
echo "<table class=\"tableview\">"; echo "<table class=\"tableview\"><thead>";
echo "<tr><th>".i18n("Project Information")."</th>"; echo "<tr><th>".i18n("Project Information")."</th>";
echo "<th>".i18n("Project Division / CWSF Project Division")."</th>"; echo "<th>".i18n("Project Division / CWSF Project Division")."</th>";
echo "</tr>"; echo "</tr></thead>";
foreach($winners AS $winner) foreach($winners AS $winner)
{ {

File diff suppressed because it is too large Load Diff

View File

@ -78,12 +78,14 @@
} }
echo "<table class=\"tableview\">"; echo "<table class=\"tableview\">";
echo "<thead>";
echo "<tr>"; echo "<tr>";
echo " <th>".i18n("Donor/Sponsor")."</th>"; echo " <th>".i18n("Donor/Sponsor")."</th>";
echo " <th>".i18n("Total $ this year")."</th>"; echo " <th>".i18n("Total $ this year")."</th>";
echo " <th>".i18n("Total $ last year")."</th>"; echo " <th>".i18n("Total $ last year")."</th>";
echo " <th>".i18n("% change")."</th>"; echo " <th>".i18n("% change")."</th>";
echo "</tr>\n"; echo "</tr>";
echo "</thead>\n";
$x=0; $x=0;
@ -118,5 +120,5 @@
echo "</table>\n"; echo "</table>\n";
?> ?>

View File

@ -131,12 +131,12 @@ echo mysql_error();
if(mysql_num_rows($q)) { if(mysql_num_rows($q)) {
echo "<table class=\"tableview\">"; echo "<table class=\"tableview\">";
echo "<tr><th>".i18n("Name")."</th>\n"; echo "<thead><tr><th>".i18n("Name")."</th>\n";
echo "<th>".i18n("Date Received")."</th>\n"; echo "<th>".i18n("Date Received")."</th>\n";
echo "<th>".i18n("Amount")."</th>\n"; echo "<th>".i18n("Amount")."</th>\n";
echo "<th>".i18n("Generate Thank You")."</th>\n"; echo "<th>".i18n("Generate Thank You")."</th>\n";
echo "<th>".i18n("Thanked")."</th>\n"; echo "<th>".i18n("Thanked")."</th>\n";
echo "</tr>\n"; echo "</tr></thead>\n";
while($r=mysql_fetch_object($q)) { while($r=mysql_fetch_object($q)) {
$dq=mysql_query("SELECT organization AS name FROM sponsors WHERE id='$r->sponsors_id'"); $dq=mysql_query("SELECT organization AS name FROM sponsors WHERE id='$r->sponsors_id'");
@ -217,11 +217,11 @@ $q=mysql_query("SELECT * FROM fundraising_campaigns WHERE followupdate>=NOW() OR
echo mysql_error(); echo mysql_error();
if(mysql_num_rows($q)) { if(mysql_num_rows($q)) {
echo "<table class=\"tableview\">"; echo "<table class=\"tableview\">";
echo "<tr>"; echo "<thead><tr>";
echo " <th>".i18n("Appeal")."</th>\n"; echo " <th>".i18n("Appeal")."</th>\n";
echo " <th>".i18n("Start Date")."</th>\n"; echo " <th>".i18n("Start Date")."</th>\n";
echo " <th>".i18n("Follow-Up Date")."</th>\n"; echo " <th>".i18n("Follow-Up Date")."</th>\n";
echo "</tr>\n"; echo "</tr></thead>\n";
while($r=mysql_fetch_object($q)) { while($r=mysql_fetch_object($q)) {
echo "<tr><td>$r->name</td><td>".format_date($r->startdate)."</td><td>".format_date($r->followupdate)."</td></tr>\n"; echo "<tr><td>$r->name</td><td>".format_date($r->startdate)."</td><td>".format_date($r->followupdate)."</td></tr>\n";
} }

View File

@ -205,13 +205,15 @@ switch($_GET['action']){
$q=mysql_query("SELECT * FROM fundraising_campaigns WHERE id='$campaign_id' AND fiscalyear='{$config['FISCALYEAR']}'"); $q=mysql_query("SELECT * FROM fundraising_campaigns WHERE id='$campaign_id' AND fiscalyear='{$config['FISCALYEAR']}'");
if($campaign=mysql_fetch_object($q)) { if($campaign=mysql_fetch_object($q)) {
echo "<table class=\"tableview\">"; echo "<table class=\"tableview\">";
echo "<thead>";
echo "<tr>"; echo "<tr>";
echo " <th>".i18n("Date")."</th>\n"; echo " <th>".i18n("Date")."</th>\n";
echo " <th>".i18n("Donor/Sponsor")."</th>\n"; echo " <th>".i18n("Donor/Sponsor")."</th>\n";
echo " <th>".i18n("Purpose")."</th>\n"; echo " <th>".i18n("Purpose")."</th>\n";
echo " <th>".i18n("Amount")."</th>\n"; echo " <th>".i18n("Amount")."</th>\n";
echo " <th>".i18n("Type of Support")."</th>\n"; echo " <th>".i18n("Type of Support")."</th>\n";
echo "</tr>\n"; echo "</tr>";
echo "</thead>\n";
$q=mysql_query("SELECT * FROM fundraising_donations WHERE fundraising_campaigns_id='$campaign_id' $q=mysql_query("SELECT * FROM fundraising_donations WHERE fundraising_campaigns_id='$campaign_id'
AND status='received' ORDER BY datereceived DESC"); AND status='received' ORDER BY datereceived DESC");
@ -614,7 +616,11 @@ function update_tab_overview() {
$("#campaign_tab_overview").load("<?$_SERVER['PHP_SELF']?>?action=manage_tab_overview&id="+currentcampaignid); $("#campaign_tab_overview").load("<?$_SERVER['PHP_SELF']?>?action=manage_tab_overview&id="+currentcampaignid);
} }
function update_tab_donations() { function update_tab_donations() {
$("#campaign_tab_donations").load("<?$_SERVER['PHP_SELF']?>?action=manage_tab_donations&id="+currentcampaignid); $("#campaign_tab_donations").load(
"<?$_SERVER['PHP_SELF']?>?action=manage_tab_donations&id="+currentcampaignid,
null,
function(){$('.tableview').tablesorter();}
);
} }
function update_tab_prospects() { function update_tab_prospects() {
$("#campaign_tab_prospects").load("<?$_SERVER['PHP_SELF']?>?action=manage_tab_prospects&id="+currentcampaignid); $("#campaign_tab_prospects").load("<?$_SERVER['PHP_SELF']?>?action=manage_tab_prospects&id="+currentcampaignid);

View File

@ -338,10 +338,10 @@ if( ($action=="edit" || $action=="assign" ) && $edit)
echo "<input type=\"hidden\" name=\"action\" value=\"assign\">"; echo "<input type=\"hidden\" name=\"action\" value=\"assign\">";
echo "<table class=\"tableview\">"; echo "<table class=\"tableview\">";
echo "<tr>"; echo "<thead><tr>";
echo "<th>".i18n("Team")."</th>"; echo "<th>".i18n("Team")."</th>";
echo "<th>".i18n("Timeslots and Projects")."</th>"; echo "<th>".i18n("Timeslots and Projects")."</th>";
echo "</tr>"; echo "</tr></thead>";
$teams=getJudgingTeams(); $teams=getJudgingTeams();
foreach($teams AS $team) foreach($teams AS $team)

View File

@ -162,12 +162,12 @@ else $wherestatus="";
echo "<tr><td colspan=\"2\"><h3>{$status_str[$showstatus]} - ".i18n("Students / projects per age category / division")."</h3></td></tr>"; echo "<tr><td colspan=\"2\"><h3>{$status_str[$showstatus]} - ".i18n("Students / projects per age category / division")."</h3></td></tr>";
echo "<tr><td colspan=\"2\">"; echo "<tr><td colspan=\"2\">";
echo "<table class=\"tableview\" width=\"100%\">"; echo "<table class=\"tableview\" width=\"100%\">";
echo "<tr><td width=\"50%\"></td>"; echo "<thead><tr><td width=\"50%\"></td>";
foreach($cats AS $c=>$cn) { foreach($cats AS $c=>$cn) {
echo "<th>$cn<br /><nobr>".i18n("Stud | Proj")."</nobr></th>"; echo "<th>$cn<br /><nobr>".i18n("Stud | Proj")."</nobr></th>";
} }
echo "<th>".i18n("Total")."<br /><nobr>".i18n("Stud | Proj")."</th>"; echo "<th>".i18n("Total")."<br /><nobr>".i18n("Stud | Proj")."</th>";
echo "</tr>"; echo "</tr></thead>";
foreach($divs AS $d=>$dn) { foreach($divs AS $d=>$dn) {
echo "<tr><td>$dn</td>"; echo "<tr><td>$dn</td>";
$tstud=0; $tstud=0;
@ -218,12 +218,12 @@ else $wherestatus="";
echo "<tr><td colspan=\"2\"><h3>{$status_str[$showstatus]} - ".i18n("Students / projects per age category / school")."</h3></td></tr>"; echo "<tr><td colspan=\"2\"><h3>{$status_str[$showstatus]} - ".i18n("Students / projects per age category / school")."</h3></td></tr>";
echo "<tr><td colspan=\"2\">"; echo "<tr><td colspan=\"2\">";
echo "<table class=\"tableview\" width=\"100%\">"; echo "<table class=\"tableview\" width=\"100%\">";
echo "<tr><td width=\"50%\"></td>"; echo "<thead><tr><td width=\"50%\"></td>";
foreach($cats AS $c=>$cn) { foreach($cats AS $c=>$cn) {
echo "<th>$cn<br /><nobr>".i18n("Stud | Proj")."</nobr></th>"; echo "<th>$cn<br /><nobr>".i18n("Stud | Proj")."</nobr></th>";
} }
echo "<th>".i18n("Total")."<br /><nobr>".i18n("Stud | Proj")."</nobr></th>"; echo "<th>".i18n("Total")."<br /><nobr>".i18n("Stud | Proj")."</nobr></th>";
echo "</tr>"; echo "</tr></thead>";
asort($schools_names); asort($schools_names);
foreach($schools_names AS $id=>$sn) foreach($schools_names AS $id=>$sn)

View File

@ -254,7 +254,7 @@ $(document).ready(function() {
$x++; $x++;
if($last_category != $i->category) { if($last_category != $i->category) {
/* New category */ /* New category */
echo '<tr><td style="border:0px;" colspan="2" style="even"><h3>'; echo '<tr><td style="border:0px;" colspan="3" style="even"><h3>';
if($edit_mode == true) echo i18n('Category').': '; if($edit_mode == true) echo i18n('Category').': ';
echo "{$i->category}</h3></td></tr>"; echo "{$i->category}</h3></td></tr>";
$last_category = $i->category; $last_category = $i->category;

View File

@ -181,14 +181,14 @@
if(mysql_num_rows($q)) if(mysql_num_rows($q))
{ {
echo "<table class=\"tableview\">"; echo "<table class=\"tableview\">";
echo "<tr>"; echo "<thead><tr>";
echo " <th>".i18n("Name")."</th>"; echo " <th>".i18n("Name")."</th>";
echo " <th>".i18n("Email")."</th>"; echo " <th>".i18n("Email")."</th>";
echo " <th>".i18n("Phone (Work)")."</th>"; echo " <th>".i18n("Phone (Work)")."</th>";
echo " <th>".i18n("Phone (Cell)")."</th>"; echo " <th>".i18n("Phone (Cell)")."</th>";
echo " <th>".i18n("Primary")."</th>"; echo " <th>".i18n("Primary")."</th>";
echo " <th>Actions</th>"; echo " <th>Actions</th>";
echo "</tr>\n"; echo "</tr></thead>\n";
while($r=mysql_fetch_object($q)) while($r=mysql_fetch_object($q))

View File

@ -1,89 +0,0 @@
<?
/*
This file is part of the 'Science Fair In A Box' project
SFIAB Website: http://www.sfiab.ca
Copyright (C) 2005 Sci-Tech Ontario Inc <info@scitechontario.org>
Copyright (C) 2005 James Grant <james@lightbox.org>
Copyright (C) 2006 Justin Reardon <webmaster@rcrsf.ca>
This program 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, version 2.
This program 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 this program; see the file COPYING. If not, write to
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
?>
<?
//this file is meant to be used as a popup from the registration list page to view student info
//it needs the student ID passed into it.
//thus, we do not need the normal header and footer
require("../common.inc.php");
require_once("../user.inc.php");
user_auth_required('committee', 'admin');
if($_GET['id'])
{
$q=mysql_query("SELECT
students.*,
schools.school
FROM
students
LEFT OUTER JOIN schools ON schools.id=students.schools_id
WHERE
students.id='".$_GET['id']."'");
echo mysql_error();
$studentinfo=mysql_fetch_object($q);
send_popup_header(i18n("Student Information - %1 %2",array($studentinfo->firstname,$studentinfo->lastname)));
echo "<table class=\"tableview\">\n";
echo "<tr>\n";
echo " <th>".i18n("First Name")."</th><td>$studentinfo->firstname</td>\n";
echo " <th>".i18n("Last Name")."</th><td>$studentinfo->lastname</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo " <th>".i18n("Grade")."</th><td>$studentinfo->grade</td>\n";
echo " <th>".i18n("Gender")."</th><td>$studentinfo->sex</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo " <th>".i18n("Email Address")."</th><td>$studentinfo->email</td>\n";
echo " <th>".i18n("Phone")."</th><td>$studentinfo->phone</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo " <th>".i18n("Address")."</th><td>$studentinfo->address</td>\n";
echo " <th>".i18n("City")."</th><td>$studentinfo->city</td>\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo " <th>".i18n($config['provincestate'])."</th><td>$studentinfo->province";
echo " <th>".i18n($config['postalzip'])."</th><td>$studentinfo->postalcode</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo " <th>".i18n("Medical Information")."</th><td>$studentinfo->medicalalert";
echo " <th>".i18n("School")."</th><td>$studentinfo->school</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo " <th>".i18n("Teacher Name")."</th><td>$studentinfo->teachername";
echo " <th>".i18n("Teacher Email")."</th><td>$studentinfo->teacheremail</td>\n";
echo "</tr>\n";
echo "</table>";
}
else
{
send_popup_header("Student Information");
echo error(i18n("No Student ID passed to Student Info"));
}
send_popup_footer();
?>

View File

@ -849,4 +849,4 @@
if(table.config.debug) { $.tablesorter.benchmark("Applying Zebra widget", time); } if(table.config.debug) { $.tablesorter.benchmark("Applying Zebra widget", time); }
} }
}); });
})(jQuery); })(jQuery);

View File

@ -23,7 +23,7 @@
?> ?>
<? <?
echo "To run this script, edit it and comment out the 'exit' (and this message) at the beginning"; echo "To run this script, edit it and comment out the 'exit' (and this message) at the beginning";
exit; //exit;
include "../common.inc.php"; include "../common.inc.php";
$numprojects=150; $numprojects=150;
@ -49,7 +49,7 @@ $nouns=array("age","animal","arm","baby","ball","bat","bear","boat","camp","car"
$starters=array("effects of","study of","analysis of"); $starters=array("effects of","study of","analysis of");
$joiners=array("on","combined with","broken apart by","burned with","attacked by","left alone with"); $joiners=array("on","combined with","broken apart by","burned with","attacked by","left alone with");
$numschools=mysql_query("SELECT id FROM schools WHERE year='2008'"); $numschools=mysql_query("SELECT id FROM schools WHERE year='2011'");
while($s=mysql_fetch_object($numschools)) while($s=mysql_fetch_object($numschools))
{ {
//1 in 4 chance of actually using this school //1 in 4 chance of actually using this school
@ -67,7 +67,7 @@ for($x=0;$x<$numprojects;$x++)
$pd=rand(1,$prob_unpaid); $pd=rand(1,$prob_unpaid);
if($pd==1) $status='paymentpending'; else $status='complete'; if($pd==1) $status='paymentpending'; else $status='complete';
$q=mysql_query("INSERT INTO registrations (num,email,start,status,year) VALUES ('$regnum','$email',NOW(),'$status',2008)"); $q=mysql_query("INSERT INTO registrations (num,email,start,status,year) VALUES ('$regnum','$email',NOW(),'$status',2011)");
if($id=mysql_insert_id()) if($id=mysql_insert_id())
{ {
@ -88,7 +88,7 @@ for($x=0;$x<$numprojects;$x++)
$firstname=getrand($firstnames); $firstname=getrand($firstnames);
$email=strtolower($firstname)."@".getrand($domains); $email=strtolower($firstname)."@".getrand($domains);
mysql_query("INSERT INTO students (registrations_id,firstname,lastname,email,sex,grade,year,schools_id) VALUES ('$id','$firstname','".getrand($lastnames)."','$email','$sex','$grade','2008','$schools_id')"); mysql_query("INSERT INTO students (registrations_id,firstname,lastname,email,sex,grade,year,schools_id) VALUES ('$id','$firstname','".getrand($lastnames)."','$email','$sex','$grade','2011','$schools_id')");
} }
@ -105,7 +105,7 @@ for($x=0;$x<$numprojects;$x++)
if($langnum<4) $lang="fr"; else $lang="en"; if($langnum<4) $lang="fr"; else $lang="en";
mysql_query("INSERT INTO projects (registrations_id,projectcategories_id,projectdivisions_id,title,year,req_electricity,req_table,language) VALUES ('$id','$cat','$div','$title $lang',2008,'$req_e','$req_t','$lang')"); mysql_query("INSERT INTO projects (registrations_id,projectcategories_id,projectdivisions_id,title,year,req_electricity,req_table,language) VALUES ('$id','$cat','$div','$title $lang',2011,'$req_e','$req_t','$lang')");
} }
} }