PHP Classes
elePHPant
Icontem

File: examples/example5.php

Recommend this page to a friend!
  Classes of Barton Phillips  >  PHP Site Class  >  examples/example5.php  >  Download  
File: examples/example5.php
Role: Example script
Content type: text/plain
Description: Example script
Class: PHP Site Class
Create database driven Web sites
Author: By
Last change:
Date: 4 months ago
Size: 859 bytes
 

Contents

Class file image Download
<?php
// example5.php

$_site = require_once(getenv("SITELOAD")."/siteload.php");

ErrorClass::setNoEmailErrs(true);
ErrorClass::setDevelopment(true);

$S = new $_site->className($_site);
$T = new dbTables($S);

// Pass some info to getPageTopBottom method
$h->title = "Example 5"; // Goes in the <title></title>
$h->banner = "<h1>Example 5</h1>"; // becomes the <header> section
// Add some local css to but a border and padding on the table
$h->css = <<<EOF
<style>
main table * {
  padding: .5em;
  border: 1px solid black;
}
  </style>
EOF;

list(
$top, $footer) = $S->getPageTopBottom($h);

// create a table from the memberTable

$sql = "select * from $S->memberTable";

list(
$tbl) = $T->maketable($sql);

echo <<<EOF
$top
<main>
<h3>Create a table from the members database table</h3>
<p>The members table follows:</p>
$tbl
</main>
<hr>
$footer
EOF;