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


PHP uptimef函数代码示例

本文整理汇总了PHP中uptimef函数的典型用法代码示例。如果您正苦于以下问题:PHP uptimef函数的具体用法?PHP uptimef怎么用?PHP uptimef使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了uptimef函数的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: lastonline_date

function lastonline_date($timestamp)
{
    global $CONFIG;
    if (!$timestamp) {
        return null;
    }
    $delta = time() - $timestamp;
    if ($delta > $CONFIG['phpui']['lastonline_limit']) {
        if ($delta > 59) {
            return trans('$a ago ($b)', uptimef($delta), date('Y/m/d, H:i', $timestamp));
        } else {
            return date('(Y/m/d, H:i)', $timestamp);
        }
    }
    return trans('online');
}
开发者ID:pcela,项目名称:lms,代码行数:16,代码来源:common.php

示例2: lastonline_date

function lastonline_date($timestamp)
{
    if (!$timestamp) {
        return null;
    }
    $delta = time() - $timestamp;
    if ($delta > ConfigHelper::getConfig('phpui.lastonline_limit')) {
        if ($delta > 59) {
            return trans('$a ago ($b)', uptimef($delta), date('Y/m/d, H:i', $timestamp));
        } else {
            return date('(Y/m/d, H:i)', $timestamp);
        }
    }
    return trans('online');
}
开发者ID:oswida,项目名称:lms,代码行数:15,代码来源:common.php

示例3: GetTicketContents

    public function GetTicketContents($id)
    {
        global $RT_STATES;
        $ticket = $this->db->GetRow('SELECT t.id AS ticketid, t.queueid, rtqueues.name AS queuename, 
				    t.requestor, t.state, t.owner, t.customerid, t.cause, t.creatorid, c.name AS creator, ' . $this->db->Concat('customers.lastname', "' '", 'customers.name') . ' AS customername, 
				    o.name AS ownername, t.createtime, t.resolvetime, t.subject
				FROM rttickets t
				LEFT JOIN rtqueues ON (t.queueid = rtqueues.id)
				LEFT JOIN users o ON (t.owner = o.id)
				LEFT JOIN users c ON (t.creatorid = c.id)
				LEFT JOIN customers ON (customers.id = t.customerid)
				WHERE t.id = ?', array($id));
        $ticket['categories'] = $this->db->GetAllByKey('SELECT categoryid AS id FROM rtticketcategories WHERE ticketid = ?', 'id', array($id));
        $ticket['messages'] = $this->db->GetAll('(SELECT rtmessages.id AS id, mailfrom, subject, body, createtime, ' . $this->db->Concat('customers.lastname', "' '", 'customers.name') . ' AS customername, 
				    userid, users.name AS username, customerid, NULL AS type
				FROM rtmessages
				LEFT JOIN customers ON (customers.id = customerid)
				LEFT JOIN users ON (users.id = userid)
				WHERE ticketid = ?)
				UNION
				(SELECT rtnotes.id AS id, NULL, NULL, body, createtime, NULL,
				    userid, users.name AS username, NULL, rtnotes.type
				FROM rtnotes
				LEFT JOIN users ON (users.id = userid)
				WHERE ticketid = ?)
				ORDER BY createtime ASC', array($id, $id));
        foreach ($ticket['messages'] as $idx => $message) {
            $ticket['messages'][$idx]['attachments'] = $this->db->GetAll('SELECT filename, contenttype FROM rtattachments WHERE messageid = ?', array($message['id']));
        }
        if (!$ticket['customerid']) {
            list($ticket['requestor'], $ticket['requestoremail']) = sscanf($ticket['requestor'], "%[^<]<%[^>]");
        } else {
            list($ticket['requestoremail']) = sscanf($ticket['requestor'], "<%[^>]");
        }
        //	$ticket['requestoremail'] = preg_replace('/^.* <(.+@.+)>$/', '\1',$ticket['requestor']);
        //      $ticket['requestor'] = str_replace(' <'.$ticket['requestoremail'].'>','',$ticket['requestor']);
        $ticket['status'] = $RT_STATES[$ticket['state']];
        $ticket['uptime'] = uptimef($ticket['resolvetime'] ? $ticket['resolvetime'] - $ticket['createtime'] : time() - $ticket['createtime']);
        return $ticket;
    }
开发者ID:Akheon23,项目名称:lms,代码行数:40,代码来源:LMSHelpdeskManager.php

示例4: ON

 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 *  USA.
 *
 *  $Id$
 */
$id = $_GET['id'];
if (!$LMS->TicketExists($id)) {
    $SESSION->redirect('?m=rtqueuelist');
}
$rights = $LMS->GetUserRightsRT($AUTH->id, 0, $id);
$catrights = $LMS->GetUserRightsToCategory($AUTH->id, 0, $id);
if (!$rights || !$catrights) {
    $SMARTY->display('noaccess.html');
    $SESSION->close();
    die;
}
$ticket = $DB->GetRow('SELECT t.id, t.cause, t.creatorid, c.name AS creator, 
		    t.createtime, t.resolvetime
		    FROM rttickets t
		    LEFT JOIN users c ON (t.creatorid = c.id)
		    WHERE t.id = ?', array($id));
$ticket['message'] = $DB->GetOne('SELECT body FROM rtmessages
		    WHERE ticketid = ?
		    ORDER BY createtime DESC LIMIT 1', array($id));
$ticket['uptime'] = uptimef($ticket['resolvetime'] ? $ticket['resolvetime'] - $ticket['createtime'] : time() - $ticket['createtime']);
$SMARTY->assign('ticket', $ticket);
$SMARTY->display('rtticketinfoshort.html');
开发者ID:oswida,项目名称:lms,代码行数:31,代码来源:rtticketinfo.php

示例5: GetNodeSessions

    public function GetNodeSessions($nodeid)
    {
        $nodesessions = $this->DB->GetAll('SELECT INET_NTOA(ipaddr) AS ipaddr, mac, start, stop,
		download, upload, terminatecause, type
		FROM nodesessions WHERE nodeid = ? ORDER BY stop DESC LIMIT ' . intval(ConfigHelper::getConfig('phpui.nodesession_limit', 10)), array($nodeid));
        if (!empty($nodesessions)) {
            foreach ($nodesessions as $idx => $session) {
                list($number, $unit) = setunits($session['download']);
                $nodesessions[$idx]['download'] = round($number, 2) . ' ' . $unit;
                list($number, $unit) = setunits($session['upload']);
                $nodesessions[$idx]['upload'] = round($number, 2) . ' ' . $unit;
                $nodesessions[$idx]['duration'] = uptimef($session['stop'] - $session['start']);
            }
        }
        return $nodesessions;
    }
开发者ID:jarecky,项目名称:lms,代码行数:16,代码来源:LMS.class.php

示例6: GetNodeSessions

    public function GetNodeSessions($nodeid)
    {
        $nodesessions = $this->DB->GetAll('SELECT INET_NTOA(ipaddr) AS ipaddr, mac, start, stop, download, upload
			FROM nodesessions WHERE nodeid = ? ORDER BY stop DESC LIMIT 10', array($nodeid));
        if (!empty($nodesessions)) {
            foreach ($nodesessions as $idx => $session) {
                list($number, $unit) = setunits($session['download']);
                $nodesessions[$idx]['download'] = round($number, 2) . ' ' . $unit;
                list($number, $unit) = setunits($session['upload']);
                $nodesessions[$idx]['upload'] = round($number, 2) . ' ' . $unit;
                $nodesessions[$idx]['duration'] = uptimef($session['stop'] - $session['start']);
            }
        }
        return $nodesessions;
    }
开发者ID:oswida,项目名称:lms,代码行数:15,代码来源:LMS.class.php

示例7: implode

            }
            break;
    }
}
$nodesessions = $DB->GetAll('SELECT s.*, c.name, c.lastname FROM nodesessions s
	LEFT JOIN nodes n ON n.id = s.nodeid
	LEFT JOIN customers c ON c.id = s.customerid
	WHERE ' . implode(' AND ', $where) . '
	ORDER BY s.start DESC LIMIT 5000');
if (!empty($nodesessions)) {
    foreach ($nodesessions as &$session) {
        list($number, $unit) = setunits($session['download']);
        $session['download'] = round($number, 2) . ' ' . $unit;
        list($number, $unit) = setunits($session['upload']);
        $session['upload'] = round($number, 2) . ' ' . $unit;
        $session['duration'] = $session['stop'] ? uptimef($session['stop'] - $session['start']) : '-';
    }
}
$pagelimit = ConfigHelper::getConfig('phpui.nodesession_pagelimit', 100);
$page = !isset($_GET['page']) ? 1 : intval($_GET['page']);
$listdata['total'] = count($nodesessions);
if (($page - 1) * $pagelimit > $listdata['total']) {
    $page = 1;
}
$SMARTY->assign('listdata', $listdata);
$SMARTY->assign('pagelimit', $pagelimit);
$SMARTY->assign('start', ($page - 1) * $pagelimit);
$SMARTY->assign('page', $page);
$SMARTY->assign('filtertype', $filtertype);
$SMARTY->assign('filtervalue', $filtervalue);
$SMARTY->assign('datefrom', $datefrom ? strftime('%Y/%m/%d %H:%M', $datefrom) : '');
开发者ID:itav,项目名称:lms,代码行数:31,代码来源:nodesessionlist.php


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