forked from science-ation/science-ation
Minor update to the person class
This commit is contained in:
parent
f03dcb782b
commit
335330dd35
@ -2,6 +2,11 @@
|
|||||||
|
|
||||||
|
|
||||||
class person {
|
class person {
|
||||||
|
var $id;
|
||||||
|
|
||||||
|
function person($person_id) {
|
||||||
|
$this->id = $person_id;
|
||||||
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -53,18 +58,23 @@ function editor_setup($editor)
|
|||||||
/* Functions for $this */
|
/* 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.*
|
$q=mysql_query("SELECT judges.*
|
||||||
FROM judges
|
FROM judges
|
||||||
WHERE judges.id='$id'");
|
WHERE judges.id='$id'");
|
||||||
echo mysql_error();
|
echo mysql_error();
|
||||||
|
|
||||||
print("Loading Judge ID $id\n");
|
|
||||||
|
|
||||||
/* We assume that the field names in the array we want to return
|
/* 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
|
* are the same as those in the database, so we'll turn the entire
|
||||||
@ -82,7 +92,11 @@ function load($id)
|
|||||||
print_r($j);
|
print_r($j);
|
||||||
|
|
||||||
return $j;
|
return $j;
|
||||||
|
}
|
||||||
|
|
||||||
|
function save()
|
||||||
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
@ -598,8 +598,8 @@ class TableEditor
|
|||||||
echo "<h2>".i18n("Edit %1",array($this->recordType))."</h2>";
|
echo "<h2>".i18n("Edit %1",array($this->recordType))."</h2>";
|
||||||
echo "<input type=\"hidden\" name=\"TableEditorAction\" value=\"editsave\">";
|
echo "<input type=\"hidden\" name=\"TableEditorAction\" value=\"editsave\">";
|
||||||
echo "<input type=\"hidden\" name=\"editsave\" value=\"{$_GET['edit']}\">";
|
echo "<input type=\"hidden\" name=\"editsave\" value=\"{$_GET['edit']}\">";
|
||||||
$person = new $this->classname();
|
$person = new $this->classname($_GET['edit']);
|
||||||
$e = $person->load($_GET['edit']);
|
$e = $person->load();
|
||||||
/* $query="SELECT {$this->primaryKey}";
|
/* $query="SELECT {$this->primaryKey}";
|
||||||
foreach($this->editfields AS $f=>$n)
|
foreach($this->editfields AS $f=>$n)
|
||||||
$query.=", `$f`";
|
$query.=", `$f`";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user