<?
require ("class.QuickTemplate.php");
$tpl = new QuickTemplate("t1.tpl");
$MARKS["John"] = 10;
$MARKS["Michael"] = 9;
$MARKS["Bob"] = 7;
$MARKS["Robert"] = 8;
$MARKS["Jane"] = 7;
$MARKS["Alice"] = 9;
$MARKS["David"] = 10;
$MARKS["James"] = 8;
$MARKS["Toni"] = 7;
$MARKS["Bebe"] = 9;
$CLASSES["101A"] = array("John", "Robert", "Jane");
$CLASSES["101B"] = array("Bob", "Alice", false, "Toni");
$CLASSES["100C"] = array("Michael", "David", "James");
$CLASSES["100D"] = array();
$tpl->SetNullString("<b>-</b>");
$tpl->SetAutoincrement("main.table.row", 1);
$tpl->Assign("MYNAME", "Stefan Bocskai");
while (list($Class, $Members) = each($CLASSES))
{
$tpl->SetAutoincrement("main.table.row", 1);
$tpl->Assign("CLASSROOM",$Class);
if (gettype($Members) == "array")
while (list($k, $member) = each($Members))
{
$MEMBERDATA = array(NAME => $member,
MARK => $MARKS[$member]);
$tpl->AssignLocal("main.table.row", "DATA", $MEMBERDATA);
$tpl->parse("main.table.row");
}
if (!$tpl->Parsed("main.table.row"))
$tpl->parse("main.table.error");
$tpl->parse("main.table");
}
$tpl->parse("main");
$tpl->quickPrint("main");
?> |