Minor update to the person class

This commit is contained in:
dave 2006-10-15 18:43:46 +00:00
parent f03dcb782b
commit 335330dd35
2 changed files with 19 additions and 5 deletions

View File

@ -2,6 +2,11 @@
class person {
var $id;
function person($person_id) {
$this->id = $person_id;
}
};
@ -53,18 +58,23 @@ function editor_setup($editor)
/* Functions for $this */
function judge()
function judge($judge_id)
{
person::person($judge_id);
}
function load($id)
function load()
{
$id = $this->id;
print("Loading Judge ID $id\n");
$q=mysql_query("SELECT judges.*
FROM judges
WHERE judges.id='$id'");
echo mysql_error();
print("Loading Judge ID $id\n");
/* We assume that the field names in the array we want to return
* are the same as those in the database, so we'll turn the entire
@ -82,7 +92,11 @@ function load($id)
print_r($j);
return $j;
}
function save()
{
}
};

View File

@ -598,8 +598,8 @@ class TableEditor
echo "<h2>".i18n("Edit %1",array($this->recordType))."</h2>";
echo "<input type=\"hidden\" name=\"TableEditorAction\" value=\"editsave\">";
echo "<input type=\"hidden\" name=\"editsave\" value=\"{$_GET['edit']}\">";
$person = new $this->classname();
$e = $person->load($_GET['edit']);
$person = new $this->classname($_GET['edit']);
$e = $person->load();
/* $query="SELECT {$this->primaryKey}";
foreach($this->editfields AS $f=>$n)
$query.=", `$f`";