當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Ticket::getNumberTicketInQueue方法代碼示例

本文整理匯總了PHP中Ticket::getNumberTicketInQueue方法的典型用法代碼示例。如果您正苦於以下問題:PHP Ticket::getNumberTicketInQueue方法的具體用法?PHP Ticket::getNumberTicketInQueue怎麽用?PHP Ticket::getNumberTicketInQueue使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Ticket的用法示例。


在下文中一共展示了Ticket::getNumberTicketInQueue方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: execute

 public function execute()
 {
     global $gvOfficeCode, $gvQueueLengthAppLimit, $gvQueueEtaAppLimit;
     if (empty($_POST['queueCode']) || empty($_POST['noticeBefore'])) {
         throw new InvalidParamException();
     } else {
         $td_code = $_POST['queueCode'];
         $noticeBefore = $_POST['noticeBefore'];
     }
     if ($noticeBefore <= 0) {
         throw new InvalidParamException();
     } else {
         $noticeBefore = (int) $noticeBefore;
     }
     if (Ticket::fromDatabaseBySourceId($this->token)) {
         return array('ErrorCode' => "AE???", 'ErrorMsg' => "Ticket already exists for this token");
     }
     $td = TopicalDomain::fromDatabaseByCode($td_code);
     if (!$td || !$td->getActive()) {
         return array('ErrorCode' => "AE003", 'ErrorMsg' => "Queue specified does not exist");
     }
     if ($td->getEta() < $gvQueueEtaAppLimit || Ticket::getNumberTicketInQueue($td_code) < $gvQueueLengthAppLimit) {
         return array('ErrorCode' => "AE???", 'ErrorMsg' => "Queue limit not satisfied");
     }
     $ticket = Ticket::nextNewTicket($td_code, 'app', $this->token, $noticeBefore);
     $ticket->save();
     list($people, $eta) = $ticket->getPeopleAndEta();
     $content = array();
     $content['OfficeCode'] = $gvOfficeCode;
     $content['Ticket'] = $ticket->getTextString();
     $content['Eta'] = (int) ($eta / 60);
     $content['PeopleBefore'] = $people;
     $content['AssignedNoticeBefore'] = $noticeBefore;
     return $content;
 }
開發者ID:adntec,項目名稱:queueManage,代碼行數:35,代碼來源:AppNewTicket.php

示例2: execute

 public function execute()
 {
     global $gvOfficeCode;
     $tdList = TopicalDomain::fromDatabaseCompleteList();
     $content = array();
     if (!$tdList) {
         $content['ErrorCode'] = "AE003";
         $content['ErrorMsg'] = "No queues in this office";
         return $content;
     }
     $content['OfficeCode'] = $gvOfficeCode;
     $content['NumQueues'] = count($tdList);
     $content['Queues'] = array();
     foreach ($tdList as $td) {
         $queueObj = array('Code' => $td->getCode(), 'Name' => $td->getName(), 'Description' => $td->getDescription(), 'Eta' => (int) ($td->getEta() / 60), 'PeopleWaiting' => Ticket::getNumberTicketInQueue($td->getCode()));
         $content['Queues'][] = $queueObj;
     }
     return $content;
 }
開發者ID:adntec,項目名稱:queueManage,代碼行數:19,代碼來源:AppGetQueueStatus.php

示例3: getTableBody

 private function getTableBody()
 {
     $topicalDomains = TopicalDomain::fromDatabaseCompleteList(true);
     $tableBody = '';
     for ($i = 0; $i < count($topicalDomains); $i++) {
         $td = $topicalDomains[$i];
         $description = $td->getCode() . " - " . htmlspecialchars($td->getName());
         $queueLength = Ticket::getNumberTicketInQueue($td->getCode());
         $checkbox = $this->getCheckBox($td->getCode(), $description, $queueLength, in_array($td->getCode(), $this->td_served));
         if ($i % 4 === 0) {
             $tableBody .= "<tr>\n";
         }
         $tableBody .= "<td style=\"padding: 5px;\">{$checkbox}</td>\n";
         if (($i + 1) % 4 === 0) {
             $tableBody .= "</tr>\n";
         }
     }
     // Close row if not closed
     if (substr($tableBody, -6) !== "</tr>\n") {
         $tableBody .= "</tr>\n";
     }
     return $tableBody;
 }
開發者ID:adntec,項目名稱:queueManage,代碼行數:23,代碼來源:OperatorPage.php

示例4: canBeDeactivated

 public function canBeDeactivated()
 {
     $queueLength = Ticket::getNumberTicketInQueue($this->td_code);
     return $queueLength === 0;
 }
開發者ID:adntec,項目名稱:queueManage,代碼行數:5,代碼來源:TopicalDomain.php

示例5: getTable

    public function getTable()
    {
        $ret = <<<EOS
<table id="listTable">
    <tr>
        <th>Servizio</th>
        <th>Clienti in coda</th>
        <th>Attesa stimata</th>
    </tr>
EOS;
        foreach ($this->tdList as $td) {
            $code = $td->getCode();
            $text = $code . " - " . $td->getName();
            $queueLength = Ticket::getNumberTicketInQueue($code);
            $eta = intval($td->getEta() / 60);
            $eta .= " min";
            $row = <<<EOS
    <tr class="clickable" data-code="{$code}">
        <td>{$text}</td>
        <td>{$queueLength}</td>
        <td>{$eta}</td>
    </tr>
EOS;
            $ret .= $row;
        }
        $ret .= "\n</table>\n";
        return $ret;
    }
開發者ID:adntec,項目名稱:queueManage,代碼行數:28,代碼來源:WebTdSelection.php


注:本文中的Ticket::getNumberTicketInQueue方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。