本文整理汇总了PHP中DAL::selectUniqueId方法的典型用法代码示例。如果您正苦于以下问题:PHP DAL::selectUniqueId方法的具体用法?PHP DAL::selectUniqueId怎么用?PHP DAL::selectUniqueId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DAL
的用法示例。
在下文中一共展示了DAL::selectUniqueId方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: DAL
require_once 'access.php';
require_once 'dal.php';
require_once 'utils.php';
require_once 'email.php';
$error = null;
$message = null;
$user = null;
$unique_id = null;
$dal = new DAL($opts['hn'], $opts['db'], $opts['un'], $opts['pw']);
try {
$dal->beginTransaction();
$user = $dal->selectUser();
if ($user === null) {
throw new UserException('Login required.');
}
$unique_id = $dal->selectUniqueId($_GET['uniqueid_id']);
if ($unique_id === null) {
throw new UserException('Range not found.');
}
if ($user['person_id'] !== $unique_id['person_id'] && $user['person_is_moderator'] !== 'y') {
throw new UserException('Moderator login required.');
}
if (isset($_POST['transfer'])) {
$person = $dal->selectPersonByEmail($_POST['email']);
if ($person === null) {
throw new UserException('Profile not found.');
}
$unique_id['person_id'] = $person['person_id'];
$dal->updateUniqueId($unique_id);
$subject = "OpenLCB Unique ID Range Transferred";
$body = "Hi " . formatPersonName($unique_id) . ",\r\n\r\nThe following OpenLCB Unique ID Range has been Transferred.\r\n\r\n" . formatUniqueIdHex($unique_id) . "\r\n\r\nFrom delegating organization or person: " . formatPersonName($unique_id) . "\r\nTo delegating organization or person: " . formatPersonName($person) . "\r\nURL: " . $unique_id['uniqueid_url'] . "\r\nComment: " . $unique_id['uniqueid_user_comment'] . "\r\n\r\nThe OpenLCB Group";