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


PHP secondsToTime函数代码示例

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


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

示例1: serverStatus

function serverStatus($dbh)
{
    $q = $dbh->prepare("SELECT id,hostname,distro,uptime,seen,host_status FROM sysinfo");
    $q->execute();
    $sysStat = array();
    while ($r = $q->fetch()) {
        $uptimeString = secondsToTime($r['uptime']);
        $lastSeen = timestring($r['seen']);
        $sysStat[$r['hostname']] = array('serverid' => $r['id'], 'os' => $r['distro'], 'uptime' => $uptimeString, 'lastSeen' => $lastSeen, 'status' => $r['host_status']);
    }
    return $sysStat;
}
开发者ID:kkrolikowski,项目名称:spine,代码行数:12,代码来源:dashboard.php

示例2: summary

 public function summary()
 {
     $from = $this->from;
     $to = $this->to;
     /* @var $collection Collection */
     $collection = Collection::first();
     $decks = Input::get('decks');
     if ($decks) {
         $decks = explode(',', $decks);
     } else {
         $decks = $this->myDecks();
     }
     $query = DB::table('revlog')->select(DB::raw('count() as cards'), DB::raw('sum(time)/1000 as the_time'), DB::raw('sum(case when ease = 1 then 1 else 0 end) as failed'), DB::raw('sum(case when type = 0 then 1 else 0 end) as learning'), DB::raw('sum(case when type = 1 then 1 else 0 end) as review'), DB::raw('sum(case when type = 2 then 1 else 0 end) as relearn'), DB::raw('sum(case when type = 3 then 1 else 0 end) as filter'));
     $this->whereFromTo($query, $from, $to);
     $result = $query->first();
     $cards = $result->cards ?: 0;
     $the_time = $result->the_time ?: 0;
     $failed = $result->failed ?: 0;
     $learning = $result->learning ?: 0;
     $review = $result->review ?: 0;
     $relearn = $result->relearn ?: 0;
     $filter = $result->filter ?: 0;
     echo '<pre>';
     var_dump($result);
     echo '</pre>';
     echo '<br/>';
     echo 'Studied ' . $cards . ' card(s) in ' . secondsToTime($the_time) . '<br/>';
     echo 'Again count: ' . $failed;
     if ($cards) {
         echo ' (' . sprintf('%0.1f', (1 - $failed / $cards) * 100) . '% correct)';
     }
     echo '<br/>';
     echo 'Learn: ' . $learning . ', Review: ' . $review . ', Relearn: ' . $relearn . ', Filtered: ' . $filter . '<br/>';
     $query = DB::table('revlog')->select(DB::raw('count() as mature_count'), DB::raw('sum(case when ease = 1 then 0 else 1 end) as mature_sum'));
     $this->whereFromTo($query, $from, $to);
     $this->whereDecks($query, $decks);
     $matureInterval = 21;
     $result = $query->where('lastIvl', '>=', $matureInterval)->first();
     if ($result->mature_count) {
         echo 'Correct answers on mature cards ' . $result->mature_sum . '/' . $result->mature_count . ' (' . sprintf('%0.1f', $result->mature_sum / $result->mature_count * 100) . '%)';
     } else {
         echo 'No mature cards were studied today.';
     }
 }
开发者ID:tomzx,项目名称:anki-charts,代码行数:44,代码来源:HomeController.php

示例3: convEnt2

     $playerName = "System";
 }
 if (isset($colors[$playerID])) {
     $playerColor = $colors[$playerID];
 } else {
     $playerColor = "";
 }
 $text = convEnt2($content['text']);
 $ply = "<span class='GameSystem'><i>(System)</i></span>";
 if ($mode == 'All' || getTeam($playerColor) == 1) {
     $ply = "<a href='" . $website . "?u={$playerName}'><span class='{$playerColor}'>{$playerName}</span></a>";
 }
 if ($mode == 'All' || getTeam($playerColor) == 2) {
     $ply = "<a href='" . $website . "?u={$playerName}'><span class='{$playerColor}'>{$playerName}</span></a>";
 }
 $timeSec = secondsToTime($time / 1000);
 $drawTable = "replay_left";
 include "" . OS_CURRENT_THEME_PATH . "/game_log.php";
 if ($mode == 'All') {
     echo "<td class='all'>[All] {$text}</td>";
     $str .= "<td class='all'>[All] {$text}</td>";
 } else {
     if ($mode == 'System') {
         if ($content['type'] == 'Start') {
             $drawTable = "replay_text";
             include "" . OS_CURRENT_THEME_PATH . "/game_log.php";
         } else {
             if ($content['type'] == 'Hero') {
                 $victim = trim($content['victim']);
                 $killer = $content['killer'];
                 if ($firstBlood) {
开发者ID:WeKiNGSRO,项目名称:OHSystem,代码行数:31,代码来源:get_chat.php

示例4: secondsToTime

                  <h3 class="m0"><?php 
echo secondsToTime($rowts['total_support'], $tl['general']['g230']);
?>
</h3>
               </div>
               <div class="col-xs-1 text-center">
                  <em class="fa fa-clock-o fa-2x">
                  </em>
               </div>
            </div>
         </div>
         <div class="panel-body">
            <!-- Bar chart-->
            <div class="text-center">
               <?php 
echo secondsToTime($rowts['total_support'], $tl['general']['g230']);
?>
            </div>
         </div>
      </div>
   </div>
   <div class="col-md-6">
      <!-- START widget-->
      <div data-toggle="play-animation" data-play="fadeInDown" data-offset="0" data-delay="500" class="panel widget">
         <div class="panel-body bg-warning">
            <div class="row row-table row-flush">
               <div class="col-xs-11">
                  <p class="mb0"><?php 
echo $tl["stat"]["s19"];
?>
</p>
开发者ID:riteshkmr33,项目名称:ovessnce,代码行数:31,代码来源:leads.php

示例5: sleep

        }
        sleep(60);
    }
}
if ($_SERVER['argv'][1] == "-cHidden" || $_SERVER['argv'][1] == "-cRemote1") {
    echo "\n[-] Tracker mode (ON): Waiting the user to get online...\n";
    $wa->SendPresenceSubscription($dst);
    $wa->pollMessage();
    if ($presence == "available") {
        echo "- The user is now online\n\n";
    } else {
        echo "- The user is offline\n\n";
    }
    while (true) {
        $wa->pollMessage();
        if ($lastpresence == "available" && $presence == "unavailable") {
            $timeOffline = date("Y-m-d H:i:s");
            while ($presence == "unavailable") {
                $timeDiff = round(strtotime(date("Y-m-d H:i:s")) - strtotime($timeOffline));
                echo secondsToTime($timeDiff) . "\n";
                if ($_SERVER['argv'][1] == "-cRemote1") {
                    $wa->sendMessage($dst, "(" . $_SERVER['argv'][3] . ") " . secondsToTime($timeDiff));
                }
                $wa->pollMessage();
                sleep(5);
            }
        }
        $lastpresence = $presence;
        sleep(5);
    }
}
开发者ID:centaurustech,项目名称:WA-Tracker,代码行数:31,代码来源:watracker.php

示例6: Get_w3mmdplayers

function Get_w3mmdplayers($gameid)
{
    global $db;
    global $lang;
    $Data = array();
    $ScourgeRow = 0;
    $SentinelRow = 0;
    $SetWinner = 0;
    $Data[0]["winner"] = 0;
    $c = 0;
    $sth = $db->prepare("SELECT g.creatorname, g.duration, g.datetime, g.gamename, g.stats, g.views, g.map\n        FROM " . OSDB_GAMES . " AS g\n        WHERE g.id='" . (int) $gameid . "'");
    $result = $sth->execute();
    $row = $sth->fetch(PDO::FETCH_ASSOC);
    $Data[$c]["creatorname"] = $row["creatorname"];
    $Data[$c]["duration"] = secondsToTime($row["duration"]);
    $Data[$c]["datetime"] = date(OS_DATE_FORMAT, strtotime($row["datetime"]));
    $Data[$c]["gamename"] = $row["gamename"];
    $Data[$c]["stats"] = $row["stats"];
    $Data[$c]["views"] = $row["views"];
    $Map = $row["map"];
    $sth = $db->prepare("SELECT w.id, w.category, w.botid, w.gameid, w.pid, w.name, w.flag, w.leaver, w.practicing, gp.ip, gp.loadingtime, gp.left, gp.leftreason\n        FROM " . OSDB_GP . " as gp\n        LEFT JOIN " . OSDB_W3PL . " as w ON w.gameid = gp.gameid AND gp.name = w.name\n        WHERE w.gameid ='" . (int) $gameid . "' \n        ORDER BY w.pid ASC");
    $result = $sth->execute();
    if ($sth->rowCount() >= 1) {
        if (file_exists("inc/geoip/geoip.inc")) {
            include "inc/geoip/geoip.inc";
            $GeoIPDatabase = geoip_open("inc/geoip/GeoIP.dat", GEOIP_STANDARD);
            $GeoIP = 1;
        }
        while ($row = $sth->fetch(PDO::FETCH_ASSOC)) {
            $Data[$c]["botid"] = $row["botid"];
            $Data[$c]["category"] = $row["category"];
            $Data[$c]["id"] = $row["id"];
            $Data[$c]["gameid"] = $row["gameid"];
            $Data[$c]["pid"] = $row["pid"];
            $Data[$c]["name"] = $row["name"];
            $Data[$c]["full_name"] = $row["name"];
            $Data[$c]["userid"] = $row["name"];
            $Data[$c]["flag"] = $row["flag"];
            $Data[$c]["leaver"] = $row["leaver"];
            $Data[$c]["practicing"] = $row["practicing"];
            $Data[$c]["leftreason"] = $row["leftreason"];
            $Data[$c]["left"] = secondsToTime($row["left"]);
            $Data[$c]["loadingtime"] = $row["loadingtime"];
            $Data[$c]["ip"] = $row["ip"];
            $Data[$c]["hideElement"] = ' hideElement';
            $Data[$c]["totalvotes"] = 0;
            $Data[$c]["totalrate"] = 0;
            $Data[$c]["player_rate"] = 0;
            $Data[$c]["voted"] = 1;
            $Data[$c]["counter"] = '' . ($row["pid"] + 1);
            if ($GeoIP == 1) {
                $Data[$c]["letter"] = geoip_country_code_by_addr($GeoIPDatabase, $row["ip"]);
                $Data[$c]["country"] = geoip_country_name_by_addr($GeoIPDatabase, $row["ip"]);
            }
            $Data[$c]["item1"] = "";
            $Data[$c]["itemname1"] = "";
            $Data[$c]["itemicon1"] = "empty.gif";
            $Data[$c]["item2"] = "";
            $Data[$c]["itemname2"] = "";
            $Data[$c]["itemicon2"] = "empty.gif";
            $Data[$c]["item3"] = "";
            $Data[$c]["itemname3"] = "";
            $Data[$c]["itemicon3"] = "empty.gif";
            $Data[$c]["item4"] = "";
            $Data[$c]["itemname4"] = "";
            $Data[$c]["itemicon4"] = "empty.gif";
            $Data[$c]["item5"] = "";
            $Data[$c]["itemname5"] = "";
            $Data[$c]["itemicon5"] = "empty.gif";
            $Data[$c]["item6"] = "";
            $Data[$c]["itemname6"] = "";
            $Data[$c]["itemicon6"] = "empty.gif";
            $Data[$c]["heroid"] = "blank";
            $Data[$c]["hero"] = "blank";
            $Data[$c]["description"] = "";
            $vars = Get_w3mmdvarsString($gameid, $row["pid"], "race");
            $Hero = Get_TDRace($vars);
            $Data[$c]["hero_link"] = 0;
            if (!empty($Hero) and file_exists("img/heroes/" . $Hero)) {
                $Data[$c]["heroid"] = $Hero;
                $Data[$c]["hero"] = $Hero;
                $Data[$c]["description"] = "";
            }
            $Data[$c]["level"] = "";
            $Data[$c]["class"] = "";
            $Data[$c]["banned"] = "";
            $Data[$c]["admin"] = "";
            $Data[$c]["score_points"] = "";
            $Data[$c]["kills"] = "";
            $Data[$c]["deaths"] = "";
            $Data[$c]["assists"] = "";
            $Data[$c]["creepkills"] = "";
            $Data[$c]["creepdenies"] = "";
            $Data[$c]["towerkills"] = "";
            $Data[$c]["raxkills"] = "";
            $Data[$c]["courierkills"] = "";
            $Data[$c]["neutralkills"] = "";
            $Data[$c]["gold"] = "";
            $Data[$c]["side"] = "";
            $LimitTeam = W3mmdLimitTeams($Map);
//.........这里部分代码省略.........
开发者ID:WeKiNGSRO,项目名称:OHSystem,代码行数:101,代码来源:common-queries.php

示例7: serverStatus

$allHostStatus = serverStatus($dbh);
$spine->assign('allHostStatus', $allHostStatus);
// tworzymy jsona z opcjami konfiguracyjnymi apacza
vhostOptionFile($dbh);
if (isset($_GET['serverid'])) {
    // komplet informacji na temat systemu i zuzycia zasobow
    $q = $dbh->prepare("SELECT ip, ext_ip, hostname, distro, uptime, hdd_total, hdd_free, ram_total, ram_free, host_status, cpu_usage FROM sysinfo WHERE id = " . $_GET['serverid']);
    $q->execute();
    $r = $q->fetch();
    $hdd_used = $r['hdd_total'] - $r['hdd_free'];
    $hdd_percentage_used = $hdd_used / $r['hdd_total'] * 100;
    $hdd_percentage_free = $r['hdd_free'] / $r['hdd_total'] * 100;
    $ram_used = $r['ram_total'] - $r['ram_free'];
    $ram_percentage_used = $ram_used / $r['ram_total'] * 100;
    $ram_percentage_free = $r['ram_free'] / $r['ram_total'] * 100;
    $uptime = secondsToTime($r['uptime']);
    $basicInfo = array('os' => $r['distro'], 'hostname' => $r['hostname'], 'status' => $r['host_status']);
    $spine->assign('basicInfo', $basicInfo);
    $sysinfo = array('ip' => $r['ip'], 'ext_ip' => $r['ext_ip'], 'hostname' => $r['hostname'], 'system' => $r['distro'], 'uptime' => $uptime, 'hdd_percentage_used' => round($hdd_percentage_used, 0), 'hdd_percentage_free' => round($hdd_percentage_free, 0), 'ram_percentage_free' => round($ram_percentage_free, 0), 'hdd_free' => round($r['hdd_free'] / 1073741824, 2), 'hdd_used' => round($hdd_used / 1073741824, 2), 'ram_free' => round($r['ram_free'] / 1073741824, 2), 'ram_total' => round($r['ram_total'] / 1073741824, 2), 'cpu_usage' => $r['cpu_usage'], 'status' => $r['host_status']);
    $spine->assign('sysinfo', $sysinfo);
    // lista uslug i ich status na serwerze
    $q = $dbh->prepare("SELECT service,status FROM service_checks WHERE host_id = " . $_GET['serverid']);
    $q->execute();
    while ($r = $q->fetch()) {
        $services[$r['service']] = $r['status'];
    }
    $spine->assign('hostsrv', $services);
    // Lista kont uzytkownikow w systemie
    $q = $dbh->prepare("SELECT id, login, fullname, email FROM sysusers WHERE system_id = " . $_GET['serverid']);
    $q->execute();
    while ($r = $q->fetch()) {
开发者ID:kkrolikowski,项目名称:spine,代码行数:31,代码来源:index.php

示例8: foreach

    }
    $running = false;
    $memory = 0;
    $memoryu = 0;
    $instances = 0;
    foreach ($app['branches'][$_SESSION['DATA'][$app['id']]['branch']]['instances'] as $i) {
        if ($i['status'] == 'run') {
            $running = true;
        }
        $memory = $memory + $i['memory']['quota'];
        $memoryu = $memoryu + $i['memory']['usage'];
        $instances++;
    }
    $expl = explode('-', $app['name']);
    $language = $expl[0];
    $content = "\n\t\t\t<table>\n\t\t\t\t<tr>\n\t\t\t\t\t<th>{$lang['id']}</th>\n\t\t\t\t\t<th>{$lang['host']}</th>\n\t\t\t\t\t<th>{$lang['port']}</th>\n\t\t\t\t\t<th>{$lang['cpu']}</th>\n\t\t\t\t\t<th>{$lang['memory']}</th>\n\t\t\t\t\t<th>{$lang['uptime']}</th>\n\t\t\t\t\t<th>{$lang['status']}</th>\n\t\t\t\t\t<th style=\"width: 30px; text-align: center;\">{$lang['logs']}</th>\n\t\t\t\t</tr>\n\t";
    $j = 0;
    foreach ($app['branches'][$_SESSION['DATA'][$app['id']]['branch']]['instances'] as $i) {
        if ($i['status'] == 'run') {
            $running = true;
        } else {
            $running = false;
        }
        $info = secondsToTime($i['uptime']);
        $content .= "\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td><span class=\"large\">{$app['name']}-" . security::encode($_SESSION['DATA'][$app['id']]['branch']) . "-{$j}</span></td>\n\t\t\t\t\t\t<td>{$i['host']}</td>\n\t\t\t\t\t\t<td>{$i['port']}</td>\n\t\t\t\t\t\t<td>" . round($i['cpu']['usage'] / 10, 1) . "% / {$i['cpu']['quota']} core</td>\n\t\t\t\t\t\t<td>{$i['memory']['usage']}Mo / {$i['memory']['quota']}Mo</td>\n\t\t\t\t\t\t<td>{$info['d']} {$lang['days']} {$info['h']} {$lang['hours']} {$info['m']} {$lang['minutes']} {$info['s']} {$lang['seconds']}</td>\n\t\t\t\t\t\t<td>" . ($running ? "<div class=\"state running\"><div class=\"state-content\">{$lang['running']}</div></div>" : "<div class=\"state stopped\"><div class=\"state-content\">{$lang['stopped']}") . "</div></div></td>\n\t\t\t\t\t\t<td style=\"width: 30px; text-align: center;\"><a href=\"/panel/apps/log?id={$app['id']}&instance={$i['id']}\" title=\"\"><img class=\"link\" src=\"/{$GLOBALS['CONFIG']['SITE']}/images/icons/small/notebook.png\" alt=\"\" /></a></td>\n\t\t\t\t\t</tr>\n\t\t";
        $j++;
    }
    $content .= "\n\t\t\t\t</table>\n\t";
} catch (Exception $e) {
}
echo $content;
开发者ID:iseth,项目名称:php-www-1,代码行数:31,代码来源:ajax_instances.php

示例9: foreach

     $data['hosts'][$host->hostid] = ['id' => $host->hostid, 'name' => $host->host];
     $data['totals']['hosts']++;
 }
 foreach ($data['hosts'] as $host) {
     // OPERATING SYSTEM
     $osystem = $api->itemGet(array("output" => "extend", "hostids" => $host['id'], "search" => array("key_" => "system.uname")));
     $osystem = explode(" ", $osystem[0]->lastvalue);
     $data['hosts'][$host['id']]['os'] = $osystem[0];
     // IP ADDRESS
     $hostIPs = $api->hostGet(array("output" => "extend", "hostids" => $host['id'], "selectInterfaces" => ["ip"]));
     foreach ($hostIPs as $hostIP) {
         $data['hosts'][$host['id']]['address'] = $hostIP->interfaces[0]->ip;
     }
     // UPTIME
     $uptime = $api->itemGet(array("output" => "extend", "hostids" => $host['id'], "search" => array("key_" => "system.uptime")));
     $data['hosts'][$host['id']]['uptime'] = secondsToTime($uptime[0]->lastvalue);
     // ONLINE STATUS
     $status = $api->itemGet(array("output" => "extend", "hostids" => $host['id'], "search" => array("key_" => "agent.ping")));
     if ($status[0]->lastvalue == 1) {
         $data['hosts'][$host['id']]['status'] = true;
         $data['totals']['online']++;
     } else {
         $data['hosts'][$host['id']]['status'] = false;
     }
     // CPU LOAD
     $cpuLoad = $api->itemGet(array("output" => "extend", "hostids" => $host['id'], "search" => array("key_" => "system.cpu.load[percpu,avg1]")));
     $data['hosts'][$host['id']]['cpuLoad'] = $cpuLoad[0]->lastvalue * 100;
     // DISK USED
     $data['hosts'][$host['id']]['diskUsage'] = 0;
     $disks = $api->itemGet(array("output" => "extend", "hostids" => $host['id'], "searchWildcardsEnabled" => true, "search" => array("key_" => "vfs.fs.size[*,used]")));
     foreach ($disks as $disk) {
开发者ID:jaytwitch,项目名称:watchtower,代码行数:31,代码来源:hosts.php

示例10: foreach

    if (strtotime($val['od']) <= $ted && strtotime($val['do']) >= $ted) {
        $otevreno = true;
    }
}
$otevrenoKdy = "";
$json['otevreno'] = $otevreno;
/**
 * Kdy bude zase otevřeno?
 */
if (!$otevreno) {
    foreach ($otevrenoDalsi as $key => $val) {
        if (strtotime($val['od']) > $ted && $otevrenoKdy == "") {
            $otevrenoKdy = $val['od'];
        }
    }
    $otevrenoTime = secondsToTime(strtotime($otevrenoKdy) - $ted);
    $json['otevreno_kdy'] = $otevrenoTime;
}
// }
// $json['otevreno_dalsi'] = $otevrenoDalsi;
// $json['ted'] = $tedStr;
// $json['kontrola'] = strtotime($val['od'])." - ".$ted;
$status_text = "";
$status["otevreno"] = isset($_POST['otevreno']) ? $_POST['otevreno'] : "Právě máme otevřeno";
$status["zitra"] = isset($_POST['otevreno']) ? $_POST['otevreno'] : "Stavte se zítra";
$status["cas"] = isset($_POST['otevreno']) ? $_POST['otevreno'] : "Již za %%CAS%% otevíráme";
if ($otevreno) {
    $status_text = $status['otevreno'];
} else {
    if ($otevrenoTime['d'] == 1) {
        $status_text = $status['zitra'];
开发者ID:rotten77,项目名称:xcv,代码行数:31,代码来源:provoz.php

示例11: secondsToTime

function secondsToTime($seconds)
{
    $dtF = new DateTime("@0");
    $dtT = new DateTime("@{$seconds}");
    return $dtF->diff($dtT)->format('%a days, %h hours, %i minutes and %s seconds');
}
if ($_SESSION['status'] == 0) {
    $date = new DateTime();
    $initial = $date->getTimestamp();
    $final = $_SESSION['startTime'];
    $secsLeft = $final - $initial;
    if ($secsLeft <= 0) {
        echo "-1";
        die;
    }
    echo secondsToTime($secsLeft) . " to quiz";
} else {
    if ($_SESSION['status'] == 1) {
        $date = new DateTime();
        $initial = $date->getTimestamp();
        $final = $_SESSION['finalTime'];
        $secsLeftSave = $final - $initial;
        $secsLeft = $secsLeftSave;
        $seconds = $secsLeft % 60;
        $secsLeft = floor($secsLeft / 60);
        $mins = $secsLeft % 60;
        $secsLeft = floor($secsLeft / 60);
        $hours = $secsLeft;
        if (floor($seconds / 10) == 0) {
            $seconds = '0' . $seconds;
        }
开发者ID:AGSD,项目名称:quizone,代码行数:31,代码来源:gettime.php

示例12: header

<?php

// page version: 1.1
require "../../../inc/general_conf.inc.php";
if (empty($_SESSION['user'])) {
    header("Location: " . $DOCUMENT_ROOT . "/index.php");
    die("Redirecting to " . $DOCUMENT_ROOT . "/index.php");
}
// Create connection
$connect = mysqli_connect($dbHost, $dbUserName, $dbUserPasswd, $dbName);
// Check connection
if (!$connect) {
    die("Connection failed: " . mysqli_connect_error());
}
$output = mysqli_query($connect, "SELECT vhost_timerunning FROM wow_vhost_status");
while ($row = mysqli_fetch_array($output)) {
    $VhostTime = $row['vhost_timerunning'];
}
//convert string to number (get part of the string befor the dot)
$str = $VhostTime;
$Seconds = substr($str, 0, strrpos($str, '.'));
//convert number to days, hours, minutes
function secondsToTime($seconds)
{
    $dtF = new DateTime("@0");
    $dtT = new DateTime("@{$seconds}");
    return $dtF->diff($dtT)->format('%a days, %hh %imin');
}
echo secondsToTime($Seconds);
开发者ID:nlmaca,项目名称:Wowza_Dashboard,代码行数:29,代码来源:vhost_status_timerunning.php

示例13: number_format

	<h1>Your Stats!</h1>
	<br />
	<p>In game name: <?php 
echo $row['name'];
?>
 </p>
	<p>Cash: $<?php 
echo number_format($row['cash']);
?>
 </p>
	<p>Bank: $<?php 
echo number_format($row['bankacc']);
?>
 </p>	
	<p>Player time: <?php 
echo secondsToTime($row['playtime']);
?>
 </p>
	<p>Bounty: $<?php 
echo number_format(max(0, $row3['wantedBounty']));
?>
 <p>
	<p>Rebel: <?php 
if (strpos($row['civ_licenses'], 'license_civ_rebel') !== false) {
    echo "You dirty rebel!";
} else {
    echo "Good boy, not a rebel!";
}
?>
</p>	
	
开发者ID:steve00010,项目名称:ProphecyWebsite,代码行数:30,代码来源:player.php

示例14: query

require_once 'header.php';
$getmapdetails = query("SELECT SUM(played) as played,SUM(tags) as k, SUM(hold) as a, SUM(prevent) as d, SUM(roam) as r, SUM(powerups) as pup, COUNT(*) as c FROM games WHERE map='" . mysql_real_escape_string($_GET['map']) . "'");
$m = mysql_fetch_assoc($getmapdetails);
$getgames = query("SELECT COUNT(DISTINCT gameno) FROM games WHERE map='" . mysql_real_escape_string($_GET['map']) . "'");
$g = mysql_result($getgames, 0);
function secondsToTime($seconds)
{
    $dtF = new DateTime("@0");
    $dtT = new DateTime("@{$seconds}");
    return $dtF->diff($dtT)->format('%a days, %h hours, %i minutes and %s seconds');
}
?>
<div style="width:100%; margin:0 auto; padding-top:10px" align="center">
<?php 
echo "<span style='font-size: larger'>" . mysql_real_escape_string($_GET['map']);
echo "</span><br />";
echo secondsToTime($m['played']) . " logged total over " . $g . " games.";
echo "<br />";
echo "Of that time, ";
$a = round($m['a'] / $m['played'], 2) * 100;
echo $a . "% was spent carrying the flag and ";
$d = round($m['d'] / $m['played'], 2) * 100;
echo $d . "% was spent in prevent.<br />";
echo "Current death toll: " . $m['k'] . "<br />";
echo "Average kills per game: ";
echo round($m['k'] / $g, 2) . "<br />";
echo $m['pup'] . " powerups grabbed.<br />";
?>
</div>
<?php 
require_once 'footer.php';
开发者ID:supmahbruddah,项目名称:tagprodotme,代码行数:31,代码来源:map.php

示例15: secondsToTime

			<th>Project</th>
			<th>Recorded Time</th>
		</tr>

		<?php 
function secondsToTime($seconds)
{
    $dtF = new DateTime("@0");
    $dtT = new DateTime("@{$seconds}");
    return $dtF->diff($dtT)->format('%h:%i:%s');
}
$apikey = "a5e2dca9-b9b7-41b5-80b4-32774b2ca724";
$contents = file_get_contents('https://wakatime.com/api/v1/users/current/stats/last_7_days?api_key=' . $apikey);
$wakatime_api = json_decode($contents);
$projects = $wakatime_api->data->projects;
if (count($projects)) {
    // Cycle through the array
    foreach ($projects as $idx => $project) {
        $time = secondsToTime($project->total_seconds);
        // Output a row
        echo "<tr>";
        echo "<td>{$project->name}</td>";
        echo "<td>{$time}</td>";
        echo "</tr>";
    }
}
?>
	</table>
</body>
</html>
开发者ID:sgang007,项目名称:wakatime-daemon,代码行数:30,代码来源:wakatime-status-board.php


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