Ejemplo n.º 1
0
if ($_POST['height'] != "") {
    $page->m_items['height']->setValue($_POST['height']);
}
$page->m_items['height']->addValidation("MinMaxFloat", "0", "240", "2");
$page->m_items['height']->setSize("10");
$page->m_items['height']->m_validationrule->setErrorMessage("Please enter a height");
$page->addItem("InputField", "weight", "in_template");
if ($_POST['weight'] != "") {
    $page->m_items['weight']->setValue($_POST['weight']);
}
$page->m_items['weight']->addValidation("MinMaxFloat", "0", "240", "1");
$page->m_items['weight']->setSize("10");
$page->m_items['weight']->m_validationrule->setErrorMessage("Please enter a weight");
$page->addItem("Hidden", "token", "in_template");
$page->m_items['token']->setValue("test");
$countries = $page->getCountries();
// check whether there is a teamplay and there is still room for a person/
$page->addItem("DropDown", "nationality", "in_template");
$page->m_items['nationality']->changeOnSubmit();
$page->m_items['nationality']->setValues($countries);
if ($_POST['nationality'] != "") {
    $page->m_items['nationality']->setDefaultValue($_POST['nationality']);
} else {
    $page->m_items['nationality']->startEmpty("-------------");
}
$page->m_items['nationality']->addValidation("MinMaxFloat", "0", "240", "1");
$page->m_items['nationality']->m_validationrule->setErrorMessage("Please enter a nationality");
if ($_POST['nationality'] != "") {
    $page->m_smarty->assign("selectednationality", $_POST['nationality']);
    $teamdata = $page->getTeamData($_POST['nationality']);
    $page->m_smarty->assign("memberamount", $teamdata[0]['memberamount']);