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>
<th><?=i18n("Source Location URL")?></th>
<th><?=i18n("Check")?></th>
</tr>
</tr></thead>
<?
$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>
<th><?=i18n("Source Name")?></th>
<th><?=i18n("Send")?></th>
<th><?=i18n("Additional<br />Info")?></th>
</tr>
</tr></thead>
<?
while($r=mysql_fetch_object($q)) {
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");
echo "<table class=\"tableview\">";
echo "<tr>";
echo "<thead><tr>";
echo " <th>".i18n("Name")."</th>";
echo " <th>".i18n("Type")."</th>";
echo " <th>".i18n("Actions")."</th>";
echo "</tr>";
echo "</tr></thead>";
while($r=mysql_fetch_object($q)) {
if($r->fundraising_campaigns_id) $fcid=$r->fundraising_campaigns_id;
else $fcid='null';
@ -893,7 +893,9 @@ case "email_get_list":
<script type="text/javascript">
function refreshEmailList() {
$("#emaillist").load("communication.php?action=email_get_list",null,function(){
$('.tableview').tablesorter();
});
}
$(document).ready(function() {
refreshEmailList();

View File

@ -41,7 +41,7 @@
echo "<table class=\"tableview\">";
echo "<tr>";
echo "<thead><tr>";
echo " <th>".i18n("Name")."</th>\n";
echo " <th>".i18n("Subject")."</th>\n";
echo " <th>".i18n("Started")."</th>\n";
@ -49,7 +49,7 @@
echo " <th>".i18n("Duration")."</th>\n";
echo " <th>".i18n("ETA")."</th>\n";
echo " <th>".i18n("Cancel")."</th>\n";
echo "</tr>\n";
echo "</tr></thead>\n";
while($r=mysql_fetch_object($q)) {
echo "<tr>";
@ -92,7 +92,7 @@
$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 "<table class=\"tableview\">\n";
echo "<tr>";
echo "<thead><tr>";
echo " <th>".i18n("Name")."</th>\n";
echo " <th>".i18n("Subject")."</th>\n";
echo " <th>".i18n("Started")."</th>\n";
@ -102,7 +102,7 @@
echo " <th>".i18n("Failed")."</th>\n";
//FIXME: comment bounced until we implement it
// echo " <th>".i18n("Bounced")."</th>\n";
echo "</tr>\n";
echo "</tr></thead>\n";
while($r=mysql_fetch_object($q)) {
echo "<tr>";
echo " <td>$r->name</td>\n";

View File

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

View File

@ -81,6 +81,7 @@ switch($_GET['action']) {
}
exit;
break;
case 'sponsorshipinfo_load':
$id=intval($_GET['id']);
echo "<h4>".i18n("Summary")."</h4>\n";
@ -137,8 +138,10 @@ switch($_GET['action']) {
AND fundraising_donations.fiscalyear='{$config['FISCALYEAR']}'
ORDER BY datereceived DESC");
echo mysql_Error();
if(mysql_num_rows($q)) {
echo "<table class=\"tableview\">";
echo "<thead>";
echo "<tr>";
echo " <th>".i18n("Date")."</th>\n";
echo " <th>".i18n("Purpose")."</th>\n";
@ -146,6 +149,7 @@ switch($_GET['action']) {
echo " <th>".i18n("Value")."</th>\n";
echo " <th>".i18n("Remove")."</th>\n";
echo "</tr>";
echo "</thead>";
while($r=mysql_fetch_object($q)) {
echo "<tr>\n";
echo " <td>".format_date($r->datereceived)."</td>\n";
@ -159,15 +163,16 @@ switch($_GET['action']) {
echo "</tr>\n";
}
echo "</table>\n";
}
else
}else{
echo i18n("No donations this year")."<br />";
}
echo "<a href=\"#\" onclick=\"return togglefulldonationhistory()\" id=\"fullhistorylink\">".i18n("View full donation history")."</a>";
echo "</div>";
echo "<div id=\"fulldonationhistory\" style=\"display: none;\">";
echo "<a href=\"#\" onclick=\"return togglefulldonationhistory()\" id=\"fullhistorylink\">".i18n("View this year's donation history")."</a>";
echo "<table class=\"tableview\">";
echo "<thead>";
echo "<tr>";
echo " <th>".i18n("Date")."</th>\n";
echo " <th>".i18n("Purpose")."</th>\n";
@ -175,6 +180,7 @@ switch($_GET['action']) {
echo " <th>".i18n("Value")."</th>\n";
echo " <th>".i18n("Remove")."</th>\n";
echo "</tr>";
echo "</thead>";
$q=mysql_query("SELECT fundraising_donations.*,
fundraising_campaigns.name AS campaignname
@ -295,8 +301,6 @@ switch($_GET['action']) {
*/
echo "<tr><td colspan=\"2\" style=\"text-align: center;\"><input type=\"submit\" value=\"".i18n("Add donation/sponsorship")."\" /></td></tr>\n";
echo "</table>\n";
echo "</form>\n";
exit;
@ -361,7 +365,6 @@ switch($_GET['action']) {
$("#contactnewsave").attr("disabled","disabled");
</script>
<?
}
else {
?>
@ -767,20 +770,19 @@ function draw_activityinfo_form(){
?>
<form id="activityinfo">
<table class="tableview" style="width:99%">
<thead><tr>
<thead>
<tr>
<th><?=i18n("Date")?></th>
<th><?=i18n("Committee Member")?></th>
<th><?=i18n("Contact Type")?></th>
<th><?=i18n("Appeal")?></th>
<th><?=i18n("Notes")?></th>
</tr></thead>
<tbody>
</tr>
<tr>
<td align="center" ><input type="submit" value="<?=i18n("Add Log")?>" onClick="return activityinfo_save()" /></td>
<td align="center"><?=$_SESSION['name']?></td>
<td align="center">
<?
<?php
echo "<select name=\"type\">";
echo "<option value=\"\">".i18n("Choose Type")."</option>\n";
$logtypes=array("Appeal","Phone Call","Email","Personal Visit","Other");
@ -791,7 +793,7 @@ function draw_activityinfo_form(){
?>
</td>
<td align="center">
<?
<?php
$q=mysql_query("SELECT * FROM fundraising_campaigns WHERE fiscalyear='{$config['FISCALYEAR']}' ORDER BY name");
echo "<select name=\"fundraising_campaigns_id\">";
echo "<option value=\"\">".i18n("Choose Appeal")."</option>\n";
@ -803,6 +805,9 @@ function draw_activityinfo_form(){
</td>
<td><input type="text" name="comment" style="width: 99%;"/></td>
</tr>
</thead>
<tbody>
<?php
$query = "SELECT CONCAT_WS('&nbsp;', users.firstname, users.lastname) AS name, fdl.dt, fdl.log, fdl.type,
@ -844,7 +849,6 @@ function save_activityinfo($comment, $donorId, $userId, $type, $campaign_id=null
'".mysql_real_escape_string($comment)."',
'".mysql_real_escape_string($type)."',
$cid)";
mysql_query($query);
echo mysql_error();
}
@ -1029,6 +1033,7 @@ function update_sponsorshipinfo()
var id=sponsor_id;
$("#editor_tab_sponsorship").load("<?=$_SERVER['PHP_SELF']?>?action=sponsorshipinfo_load&id="+id, null,function() {
$(".date").datepicker({ dateFormat: 'yy-mm-dd' });
$('.tableview').tablesorter();
});
}
@ -1071,14 +1076,11 @@ function contactsinfo_delete(uid) {
function update_activityinfo()
{
var id=sponsor_id;
$("#editor_tab_activity").load("<?=$_SERVER['PHP_SELF']?>?action=activityinfo_load&id="+id);
/*
var id=sponsor_id;
$.getJSON("<?=$_SERVER['PHP_SELF']?>?action=activityinfo_load&id="+id,
function(json){
$("#sponsor_id").val(json.id);
});
*/
$("#editor_tab_activity").load(
"<?=$_SERVER['PHP_SELF']?>?action=activityinfo_load&id="+id,
null,
function(){$('.tableview').tablesorter(); }
);
return false;
}
@ -1094,9 +1096,10 @@ function activityinfo_save() {
function donorsearch(realsearch) {
$("#searchresults").show();
if(realsearch)
$("#searchresults").load("donors_search.php", $("#searchform").serializeArray());
$("#searchresults").load("donors_search.php", $("#searchform").serializeArray(), function(){$('.tableview').tablesorter(); });
else
$("#searchresults").load("donors_search.php"); //, $("#searchform").serializeArray());
$("#searchresults").load("donors_search.php", null, function(){$('.tableview').tablesorter(); }); //, $("#searchform").serializeArray());
return false;
}

View File

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

View File

@ -131,12 +131,12 @@ echo mysql_error();
if(mysql_num_rows($q)) {
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("Amount")."</th>\n";
echo "<th>".i18n("Generate Thank You")."</th>\n";
echo "<th>".i18n("Thanked")."</th>\n";
echo "</tr>\n";
echo "</tr></thead>\n";
while($r=mysql_fetch_object($q)) {
$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();
if(mysql_num_rows($q)) {
echo "<table class=\"tableview\">";
echo "<tr>";
echo "<thead><tr>";
echo " <th>".i18n("Appeal")."</th>\n";
echo " <th>".i18n("Start Date")."</th>\n";
echo " <th>".i18n("Follow-Up Date")."</th>\n";
echo "</tr>\n";
echo "</tr></thead>\n";
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";
}

View File

@ -205,13 +205,15 @@ switch($_GET['action']){
$q=mysql_query("SELECT * FROM fundraising_campaigns WHERE id='$campaign_id' AND fiscalyear='{$config['FISCALYEAR']}'");
if($campaign=mysql_fetch_object($q)) {
echo "<table class=\"tableview\">";
echo "<thead>";
echo "<tr>";
echo " <th>".i18n("Date")."</th>\n";
echo " <th>".i18n("Donor/Sponsor")."</th>\n";
echo " <th>".i18n("Purpose")."</th>\n";
echo " <th>".i18n("Amount")."</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'
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);
}
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() {
$("#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 "<table class=\"tableview\">";
echo "<tr>";
echo "<thead><tr>";
echo "<th>".i18n("Team")."</th>";
echo "<th>".i18n("Timeslots and Projects")."</th>";
echo "</tr>";
echo "</tr></thead>";
$teams=getJudgingTeams();
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\">";
echo "<table class=\"tableview\" width=\"100%\">";
echo "<tr><td width=\"50%\"></td>";
echo "<thead><tr><td width=\"50%\"></td>";
foreach($cats AS $c=>$cn) {
echo "<th>$cn<br /><nobr>".i18n("Stud | Proj")."</nobr></th>";
}
echo "<th>".i18n("Total")."<br /><nobr>".i18n("Stud | Proj")."</th>";
echo "</tr>";
echo "</tr></thead>";
foreach($divs AS $d=>$dn) {
echo "<tr><td>$dn</td>";
$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\">";
echo "<table class=\"tableview\" width=\"100%\">";
echo "<tr><td width=\"50%\"></td>";
echo "<thead><tr><td width=\"50%\"></td>";
foreach($cats AS $c=>$cn) {
echo "<th>$cn<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);
foreach($schools_names AS $id=>$sn)

View File

@ -254,7 +254,7 @@ $(document).ready(function() {
$x++;
if($last_category != $i->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').': ';
echo "{$i->category}</h3></td></tr>";
$last_category = $i->category;

View File

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

@ -23,7 +23,7 @@
?>
<?
echo "To run this script, edit it and comment out the 'exit' (and this message) at the beginning";
exit;
//exit;
include "../common.inc.php";
$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");
$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))
{
//1 in 4 chance of actually using this school
@ -67,7 +67,7 @@ for($x=0;$x<$numprojects;$x++)
$pd=rand(1,$prob_unpaid);
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())
{
@ -88,7 +88,7 @@ for($x=0;$x<$numprojects;$x++)
$firstname=getrand($firstnames);
$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";
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')");
}
}