- Add the table editor class (not heavily modified for SFIAB yet)

- Add the table editor style sheet, and load it in the header (needs editing)
- Add a judge class (not complete)
- Add a judge manager php file that doesn't interfere with what's already in the system

THis is a proof of concept, it sorta works, but the table editor is still reading directly from the judges class.  It will be updated to make calls only into the calling class type, thus abstracting away all the SQL stuff, and allowing the group class (judge in this case) to hide
all the cross table references we need to make for loading, saving, deleting, etc.
This commit is contained in:
dave 2006-10-11 00:28:58 +00:00
parent 952047cc11
commit 1e9f68a35e
5 changed files with 1437 additions and 0 deletions

61
admin/judges_manager.php Normal file
View File

@ -0,0 +1,61 @@
<?
/*
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>
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.
*/
?>
<?
require("../common.inc.php");
auth_required('admin');
include "judges.inc.php";
require("../judge.class.php");
require("../tableeditor.class.php");
send_header("Administration - Judges - Manager");
?>
<script language="javascript" type="text/javascript">
function openjudgeinfo(id)
{
if(id)
currentid=id;
else
currentid=document.forms.judges["judgelist[]"].options[document.forms.judges["judgelist[]"].selectedIndex].value;
window.open("judges_info.php?id="+currentid,"JudgeInfo","location=no,menubar=no,directories=no,toolbar=no,width=770,height=500,scrollbars=yes");
return false;
}
</script>
<?
echo "<a href=\"index.php\">&lt;&lt; ".i18n("Back to Administration")."</a>\n";
echo "<a href=\"judges.php\">&lt;&lt; ".i18n("Back to Judges")."</a>\n";
$icon_path = $config['SFIABDIRECTORY']."/images/16/";
$icon_exitension = $config['icon_extension'];
$editor = new TableEditor('judge');
$editor->setDebug(true);
$editor->execute();
send_footer();
?>

View File

@ -344,6 +344,7 @@ function send_header($title="")
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" >
<head><title><?=i18n($title)?></title>
<link rel="stylesheet" href="<?=$config['SFIABDIRECTORY']?>/sfiab.css" type="text/css" />
<link media=all href="<?=$config['SFIABDIRECTORY']?>/tableeditor.css" type=text/css rel=stylesheet>
</head>
<body>
<script language="javascript" type="text/javascript">
@ -532,6 +533,7 @@ function send_popup_header($title="")
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" >
<head><title><?=i18n($title)?></title>
<link rel="stylesheet" href="<?=$config['SFIABDIRECTORY']?>/sfiab.css" type="text/css" />
<link media=all href="<?=$config['SFIABDIRECTORY']?>/tableeditor.css" type=text/css rel=stylesheet>
</head>
<body onload="window.focus()">
<?

51
judge.class.php Normal file
View File

@ -0,0 +1,51 @@
<?
class person {
};
class judge extends person {
/* Static members for the table editor */
function editor_setup($editor)
{
/* Setup the table editor with the fields we want to display
* when displaying a list of judges, and also the type of each
* field where required */
$l = array( 'id' => 'ID',
'firstname' => 'First Name',
'lastname' => 'Last Name'
);
$e = array( 'firstname' => 'First Name',
'lastname' => 'Last Name',
'address' =>"Address 1",
'address2' =>"Address 2",
'complete' => "Complete" );
$editor->setTable('judges');
$editor->setListFields($l);
$editor->setEditFields($e);
// $editor->setFieldOptions('complete', array('yes','no'));
}
/* Functions for $this */
function judge()
{
}
function load()
{
}
};
?>

1243
tableeditor.class.php Normal file

File diff suppressed because it is too large Load Diff

80
tableeditor.css Normal file
View File

@ -0,0 +1,80 @@
select {
font-size: 1.0em;
}
input {
font-size: 1.0em;
}
.happy {
color: green;
font-weight: bold;
font-size: 1.1em;
}
.error {
color: red;
font-weight: bold;
font-size: 1.1em;
}
.tableview {
border-collapse: collapse;
border-spacing: 1px;
color: black;
margin-left: 20px;
margin-right: 20px;
border: 0px;
font-size: 12px;
}
.tableview td {
border: 1px solid #000000;
padding: 1px;
}
.tableview th {
border: 1px solid #000000;
font-weight: bold;
text-align: center;
color: #FFFFFF;
background-color: #880000;
padding: 3px;
}
.tableview th a {
font-weight: bold;
color: #FFFFFF;
}
.tableview th a:hover {
font-weight: bold;
background-color: #00346A;
color: #3D90E9;
}
.tableedit {
border-collapse: collapse;
border-spacing: 1px;
color: black;
margin-left: 20px;
margin-right: 20px;
font-size: 12px;
border: 0px;
}
.tableedit td {
border: 0px solid #880000;
padding: 2px;
}
.tableedit th {
border: 1px solid #880000;
font-weight: bold;
text-align: left;
color: #FFFFFF;
background-color: #880000;
padding: 2px;
}