本文整理汇总了PHP中DAL::selectPersonById方法的典型用法代码示例。如果您正苦于以下问题:PHP DAL::selectPersonById方法的具体用法?PHP DAL::selectPersonById怎么用?PHP DAL::selectPersonById使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DAL
的用法示例。
在下文中一共展示了DAL::selectPersonById方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: DAL
$user = null;
$person = null;
$dal = new DAL($opts['hn'], $opts['db'], $opts['un'], $opts['pw']);
try {
$dal->beginTransaction();
if (isset($_GET['verify'])) {
if (!$dal->loginWithEmailSharedSecret($_GET['person_id'], $_GET['person_email_shared_secret'])) {
throw new UserException('Login failed.');
}
}
$user = $dal->selectUser();
if ($user === null) {
throw new UserException('Login required.');
}
if (isset($_GET['person_id'])) {
$person = $dal->selectPersonById($_GET['person_id']);
if ($person === null) {
throw new UserException('Profile not found.');
}
} else {
$person = $user;
}
if ($user['person_id'] !== $person['person_id'] && $user['person_is_moderator'] !== 'y') {
throw new UserException('Moderator login required.');
}
if (isset($_POST['save'])) {
$person['person_first_name'] = $_POST['person_first_name'];
$person['person_last_name'] = $_POST['person_last_name'];
$person['person_organization'] = $_POST['person_organization'];
if ($user['person_is_moderator'] === 'y') {
$person['person_is_moderator'] = $_POST['person_is_moderator'];