<?php
$nr = isset($_GET['nr']) ? (int)$_GET['nr'] : 1;
$title = "ProForma Example $nr";
$output = '';
require '../proforma/autoload.php';
try {
require "example{$nr}.php";
$form->setDepth(3);
if ($form->isValid()) {
$output .= '<h2>Form validated!</h2>';
foreach ($form->getIterator() as $item) {
$output .= '<h3><em>' . $item->getName() . '</em>: ' . $item->getValue() . '</h3>';
}
} else {
$output .= $form;
}
} catch (pfException $e) {
$output .= $e->getMessage();
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title><?php echo $title ?></title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="css/main.css" media="screen" type="text/css" />
<link rel="stylesheet" href="css/form.css" media="screen" type="text/css" />
<!--[if lte IE 7]>
<link rel="stylesheet" href="css/form-ie.css" media="screen" type="text/css" />
<![endif]-->
</head>
<body>
<div id="page">
<div id="header">
<h1><?php echo $title ?></h1>
</div> <!-- END #header -->
<div id="content">
<p>
This is a <a href="http://sourceforge.net/projects/proforma" title="SourceForge.net: ProForma">ProForma</a> example script.
</p>
<?php echo $output ?>
</div><!-- END #content -->
</div> <!-- END #page -->
</body>
</html>