当前位置: 首页>>代码示例>>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;未经允许,请勿转载。