Login   Register  
PHP Classes
elePHPant
Icontem

File: t1.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Stefan Bocskai  >  QuickTemplate  >  t1.php  >  Download  
File: t1.php
Role: ???
Content type: text/plain
Description: Samples source
Class: QuickTemplate
Author: By
Last change:
Date: 12 years ago
Size: 1,242 bytes
 

Contents

Class file image Download
<?
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");

?>