本文整理汇总了PHP中Events::appendSignupComment方法的典型用法代码示例。如果您正苦于以下问题:PHP Events::appendSignupComment方法的具体用法?PHP Events::appendSignupComment怎么用?PHP Events::appendSignupComment使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Events
的用法示例。
在下文中一共展示了Events::appendSignupComment方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: process
public function process()
{
$event = Events::getById($this->getElementValue('id'));
Events::setSignupStatus($this->user->getId(), $event['id'], 'SIGNEDUP');
Events::appendSignupComment($this->user->getId(), $event['id'], 'Forced signup.', Session::getUser()->getUsername());
logActivity('Forced signup of:' . $this->getElementValue('username') . ' to event: ' . $event['id'] . ' (' . $event['name'] . ')');
redirect('viewEvent.php?id=' . $event['id'], 'They have been signed up.');
}
示例2: process
public function process()
{
$event = Events::getById($this->getElementValue('event'));
switch ($event['signups']) {
case 'staff':
$initialSignupStatus = 'STAFF';
break;
case 'punters':
$initialSignupStatus = 'SIGNEDUP';
break;
case 'waitinglist':
$initialSignupStatus = 'WAITING_LIST';
break;
default:
throw new Exception('Cannot determine your initial signup status when the event signup status is: ' . $event['signups']);
}
Events::setSignupStatus($this->getElementValue('user'), $this->getElementValue('event'), $initialSignupStatus);
$userReq = $this->getElementValue('comment');
if (!empty($userReq)) {
$userReq = 'User requirement: ' . $userReq;
}
Events::appendSignupComment($this->getElementValue('user'), $this->getElementValue('event'), 'User self signup. ' . $userReq);
}
示例3: getAuthenticatedMachines
case 'PAID':
$authenticatedMachines = getAuthenticatedMachines($user->getId(), $event['id']);
$sql = 'SELECT s.numberMachinesAllowed FROM signups s WHERE s.user = :user AND s.event = :event';
$stmt = DatabaseFactory::getInstance()->prepare($sql);
$stmt->bindValue(':user', $user->getId());
$stmt->bindValue(':event', $event['id']);
$stmt->execute();
$signup = $stmt->fetchRowNotNull();
if (count($authenticatedMachines) >= $signup['numberMachinesAllowed']) {
apiReturn('reject-overuse');
} else {
$sql = 'INSERT INTO authenticated_machines (user, event, seat, ip, hostname, mac) VALUES (:user, :event, :seat, :ip, :hostname, :mac)';
$stmt = DatabaseFactory::getInstance()->prepare($sql);
$stmt->bindValue(':user', $user->getId());
$stmt->bindValue(':event', $event['id']);
$stmt->bindValue(':seat', $sanitizer->filterString('seat'));
$stmt->bindValue(':ip', $sanitizer->filterString('ip'));
$stmt->bindValue(':hostname', $sanitizer->filterString('hostname'));
$stmt->bindValue(':mac', $sanitizer->filterString('mac'));
$stmt->execute();
Events::setSignupStatus($user->getId(), $event['id'], 'ATTENDED');
Events::appendSignupComment($user->getId(), $event['id'], 'Authenticated machine: ' . $sanitizer->filterString('mac'));
apiReturn('allow');
}
case 'STAFF':
apiReturn('allow-full');
case 'SIGNEDUP':
apiReturn('reject-payment');
default:
apiReturn('fatal', 'Unrecognised signup status: ' . $signupStatus);
}