コード例 #1
0
ファイル: sessions.php プロジェクト: skdong/nfs-ovd
     echo '  <input type="hidden" name="action" value="del" />';
     echo '<input type="submit" name="kill" value="' . _('Kill') . '" />';
     echo '</td>';
     echo '	</tr>';
     echo '</tfoot>';
 }
 echo '</table>';
 echo '</td><td style="vertical-align: top;">';
 echo '<table style="margin-left: auto; margin-right: 0px;" class="main_sub sortable" border="0" cellspacing="1" cellpadding="3">';
 echo '<tr class="title">';
 echo '<th>' . _('Status') . '</th>';
 echo '<th>' . _('Number of sessions') . '</th>';
 echo '</tr>';
 echo '<tfoot>';
 $i = 0;
 foreach (Session::getAllStates() as $state) {
     $total = Abstract_Session::countByStatus($state);
     if ($total == 0) {
         continue;
     }
     $css_class = 'content' . ($i++ % 2 == 0 ? 1 : 2);
     echo '<tr class="' . $css_class . '">';
     echo '<td><span class="msg_' . Session::colorStatus($state) . '">' . Session::textStatus($state) . '</span></td>';
     echo '<td style="text-align: right;">' . $total . '</td>';
     echo '</tr>';
 }
 echo '</tfoot>';
 echo '</table>';
 echo '</td></tr></table>';
 if (isset($pagechanger)) {
     echo $pagechanger;
コード例 #2
0
ファイル: api.php プロジェクト: bloveing/openulteo
 public function sessions_count()
 {
     $this->check_authorized('viewStatus');
     $ret = array('total' => 0);
     foreach (Session::getAllStates() as $state) {
         $nb = Abstract_Session::countByStatus($state);
         if ($nb == 0) {
             continue;
         }
         $ret[$state] = $nb;
         $ret['total'] += $nb;
     }
     return $ret;
 }