当前位置: 首页>>代码示例>>PHP>>正文


PHP Events::setSignupStatus方法代码示例

本文整理汇总了PHP中Events::setSignupStatus方法的典型用法代码示例。如果您正苦于以下问题:PHP Events::setSignupStatus方法的具体用法?PHP Events::setSignupStatus怎么用?PHP Events::setSignupStatus使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Events的用法示例。


在下文中一共展示了Events::setSignupStatus方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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.');
 }
开发者ID:CWFranklin,项目名称:lan-party-site,代码行数:8,代码来源:FormForceSignup.php

示例2: process

 public function process()
 {
     $sql = 'INSERT INTO finance_transactions (amount, description, timestamp, account) VALUES (:amount, :title, now(), :account) ';
     $stmt = DatabaseFactory::getInstance()->prepare($sql);
     foreach (Basket::getContents() as $basketItem) {
         $stmt->bindValue(':amount', $basketItem['cost']);
         $stmt->bindValue(':title', '(given cash) ' . $basketItem['title'] . ' ticket for ' . $basketItem['username']);
         $stmt->bindValue(':account', $this->getElementValue('username'));
         $stmt->execute();
         Events::setSignupStatus($basketItem['userId'], $basketItem['eventId'], 'CASH_IN_POST');
     }
 }
开发者ID:CWFranklin,项目名称:lan-party-site,代码行数:12,代码来源:FormPayTicketCash.php

示例3: 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);
 }
开发者ID:CWFranklin,项目名称:lan-party-site,代码行数:23,代码来源:FormSignup.php

示例4: 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);
}
开发者ID:CWFranklin,项目名称:lan-party-site,代码行数:31,代码来源:machineAuthentication.php

示例5: foreach

     break;
 case 'bacsComplete':
     foreach (Basket::getContents() as $ticket) {
         Events::setSignupStatus(Session::getUser()->getId(), $ticket['eventId'], 'BACS_WAITING');
     }
     Basket::clear();
     redirect('account.php', 'Thanks, you will be marked as PAID by an admin when they receive the transfer.');
     break;
 case 'paypalFail':
     logAndRedirect('account.php', 'Paypal transaction failed.');
     break;
 case 'paypalComplete':
     logActivity('Started processing PayPal payment notification');
     foreach (Basket::getContents() as $ticket) {
         logActivity('PayPal transaction processing - setting status to PAID for event. Ticket owner _u_, event _e_', $ticket['userId'], array('event' => $ticket['eventId'], 'user' => Session::getUser()->getId()));
         Events::setSignupStatus($ticket['userId'], $ticket['eventId'], 'PAID');
     }
     logActivity('Finished processing PayPal payment notification.');
     Basket::clear();
     redirect('account.php', 'Thanks, payment complete!');
     break;
 default:
     require_once 'includes/widgets/header.php';
     require_once 'includes/widgets/sidebar.php';
     startBox();
     echo str_replace('%BASKETTOTAL%', doubleToGbp($cost), getContent('selectPaymentMethod'));
     $tpl->assign('cost', $cost);
     $tpl->assign('costPaypal', getPaypalCommission($cost));
     $tpl->assign('paypalEmail', getSiteSetting('paypalEmail'));
     $tpl->assign('listBasketContents', Basket::getContents());
     $tpl->assign('baseUrl', getSiteSetting('baseUrl'));
开发者ID:CWFranklin,项目名称:lan-party-site,代码行数:31,代码来源:checkout.php


注:本文中的Events::setSignupStatus方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。