本文整理匯總了PHP中Head::select方法的典型用法代碼示例。如果您正苦於以下問題:PHP Head::select方法的具體用法?PHP Head::select怎麽用?PHP Head::select使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Head
的用法示例。
在下文中一共展示了Head::select方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: foreach
foreach ($h->getHeads('org') as $head) {
// name of all event organisers from the DB
echo '<option>', $head['username'], '</option>';
}
// we set a hidden input eventorg to eventorg, so that we know we want to assign an event to organiser
echo '</select><br><input type="hidden" name="eventorg" value="eventorg"/><input type="submit" value="Assign" /></form>';
}
break;
case 'eventvol':
// case -> assign event volunteer
if (isset($_POST['eventvol'])) {
if (isset($_POST['eventname']) and isset($_POST['headname'])) {
$e = new Event();
$h = new Head();
if ($e->select($_POST['eventname'])) {
if ($h->select($_POST['headname'])) {
echo $e->addHead($h->getId(), 'vol');
// assigning the event to head
} else {
echo 'Username Does Not Exist';
}
} else {
echo 'Event Does Not Exist';
}
} else {
echo 'Please check your entries';
}
} else {
// displaying the list of all events and heads
$e = new Event();
$h = new Head();