本文整理汇总了PHP中Registration::setCategory方法的典型用法代码示例。如果您正苦于以下问题:PHP Registration::setCategory方法的具体用法?PHP Registration::setCategory怎么用?PHP Registration::setCategory使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Registration
的用法示例。
在下文中一共展示了Registration::setCategory方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Registration
$html->setH1('PŘIHLÁŠKY');
$html->addTitle("Přihlášky");
$html->addCss('<link rel="stylesheet" href="views/css/registration.css" type="text/css" media="screen">');
$html->addScript('<script src="js/registration.js"></script>');
$registration = new Registration();
$saved = "";
if (isset($_GET['saved']) && $_GET['saved'] == 1) {
$saved = "Přihláška byla odeslána.";
}
$category_men = $registration->getCategories('m');
$category_women = $registration->getCategories('f');
if (isset($_POST['name'])) {
$registration->setName($_POST['name']);
$registration->setPohlavi($_POST['pohlavi']);
$registration->setYear($_POST['year']);
$registration->setClub($_POST['club']);
$registration->setEmail($_POST['email']);
$registration->setPoznamka($_POST['poznamka']);
if ($registration->getPohlavi() == "m") {
$registration->setCategory($_POST['category_m']);
} else {
$registration->setCategory($_POST['category_w']);
}
if ($registration->gerErr() == "") {
$registration->save();
header('Location: index.php?page=registration&saved=1');
}
}
$list = (include 'controllers/registration/list.php');
$html->addToContent(include 'views/registration/form.php');