<?php
/**
 * {{$Page.PageTitle}}. (First created by PHPGEN at {{$Page.CreatedTime}})
 *
 * @author          {{$Page.Author}}
 * @package         {{$Page.PackageName}}
 * @version         {{$IdTag}}
 */
/* Init the system. */
require_once("{{$Page.IncludePath}}Include/Init.php");
{{foreach from=$Page.Blocks key=BlockID item=Block}}

/*Query from the {{$Block.TableName}} table. */
$SQL      = "SELECT {{$Block.Fields}} FROM {{$Block.TableName}} {{$Block.Where}}";
$ResultID = $MyDB->query($SQL);
if($ResultID)
{
    while($Block = $ResultID->fetchRow())
    {
        $Blocks["{{$BlockID}}"][] = $Block;
    }
}
else
{
    die($MyDB->errorMsg());
}
{{/foreach}}

/* Assign and display. */
$MyTPL->assign("PageTitle", "{{$Page.PageTitle}}");
$MyTPL->assign("Blocks",    $Blocks);
$MyTPL->display("{{$Page.TplFile}}");
?>