예제 #1
0
 public function unclaimedSessions()
 {
     $user = $this->getIdentity();
     if (empty($user->id)) {
         return;
     }
     $unclaimed = \Support\Models\ChatSessions::unclaimed();
     $is_online = \Support\Models\Operators::isOnline($user);
     echo $this->outputJson($this->getJsonResponse(array('alert' => $is_online ? true : false, 'count' => count($unclaimed), 'result' => $this->theme->renderView('Support/Admin/Views::livechat/fragment_unclaimed_sessions.php'))));
 }
<?php

$unclaimed = \Support\Models\ChatSessions::unclaimed();
?>
Unclaimed Sessions: <span id="unclaimed-sessions-alert" data-count="<?php 
echo count($unclaimed);
?>
" class="alert <?php 
echo empty($unclaimed) ? 'alert-info' : 'alert-danger';
?>
"><?php 
echo count($unclaimed);
?>
</span>