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


PHP getStats函数代码示例

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


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

示例1: printStats

function printStats($titles)
{
    $columns = array('counter', 'revisions', 'links', 'age');
    $stats = array();
    foreach ($titles as $t) {
        if (!$t) {
            continue;
        }
        $stats[] = getStats($t);
    }
    foreach ($columns as $c) {
        echo "{$c}:\t";
        if (strlen($c) < 6) {
            echo "\t";
        }
        $sum = 0;
        foreach ($stats as $x) {
            $sum += $x[$c];
        }
        if (sizeof($stats) == 0) {
            echo "-\n";
        } else {
            echo number_format($sum / sizeof($stats), 2) . "\n";
        }
    }
    echo "\n\n";
}
开发者ID:biribogos,项目名称:wikihow-src,代码行数:27,代码来源:check_google_index.php

示例2: presentUser

function presentUser($user)
{
    echo '<div class="' . (empty($user['shaddow']) ? 'clean' : 'shaddow') . '" style="border: 1px solid #eee; margin: 1em; padding: .5em">';
    echo '<input style="float: right" type="submit" onclick="setUserid(this, \'' . $user['userid'] . '\', \'useridTo\')" value="Map to this" />';
    echo '<input style="float: right" type="submit" onclick="setUserid(this, \'' . $user['userid'] . '\', \'useridFrom\')" value="Map from this" />';
    echo '<h3 style="color: green">' . $user['username'] . '</h3>';
    echo '<dl>
	
		<dt>UserID</dt>
			<dd><tt>' . $user['userid'] . '</tt></dd>

		<dt>realm</dt>
			<dd><tt>' . $user['realm'] . '</tt></dd>

		<dt>email</dt>
			<dd>' . $user['email'] . '</dd>

		<dt>org</dt>
			<dd>' . $user['org'] . '</dd>

		<dt>orgunit</dt>
			<dd>' . $user['orgunit'] . '</dd>

		<dt>idp</dt>
			<dd><tt>' . $user['idp'] . '</tt></dd>

		<dt>shaddow</dt>
			<dd>' . $user['shaddow'] . '</dd>
			
		<dt>Stats</dt>
			<dd>' . getStats($user['stats']) . '</dd>
			
		</dl>';
    echo '</div>';
}
开发者ID:r4mp,项目名称:Foodle,代码行数:35,代码来源:accountmapping.php

示例3: printTotal

function printTotal()
{
    $votes = getStats();
    $total = 0;
    foreach ($votes as $key => $value) {
        $total += $value;
    }
    $totalMoney = $total / 1000 * 1.56 * 3;
    echo "~ \$" . number_format($totalMoney, 2);
}
开发者ID:JackShort,项目名称:Clicksforchange,代码行数:10,代码来源:donated.php

示例4: presentUser

function presentUser($user, $realmTo)
{
    $to = '';
    if (preg_match('/^(.*?)@/', $user['userid'], $matches)) {
        $to = $matches[1] . '@' . $realmTo;
    }
    echo '<div class="' . (empty($user['shaddow']) ? 'clean' : 'shaddow') . '" style="border: 1px solid #eee; margin: 1em; padding: .5em">';
    echo '<input style="float: right" type="submit" onclick="setUserid(this, \'' . $user['userid'] . '\', \'' . $to . '\')" value="Map this user" />';
    echo '<h3 style="color: green">' . $user['username'] . '</h3>';
    echo '<dl>
	
		<dt>UserID</dt>
			<dd><tt>' . $user['userid'] . '</tt></dd>

		<dt>realm</dt>
			<dd><tt>' . $user['realm'] . '</tt></dd>

		<dt>email</dt>
			<dd>' . $user['email'] . '</dd>

		<dt>org</dt>
			<dd>' . $user['org'] . '</dd>

		<dt>orgunit</dt>
			<dd>' . $user['orgunit'] . '</dd>

		<dt>idp</dt>
			<dd><tt>' . $user['idp'] . '</tt></dd>

		<dt>shaddow</dt>
			<dd>' . $user['shaddow'] . '</dd>
			
		<dt>Stats</dt>
			<dd>' . getStats($user['stats']) . '</dd>
			
		</dl>';
    echo '</div>';
}
开发者ID:r4mp,项目名称:Foodle,代码行数:38,代码来源:accountmapping-prepare.php

示例5: generateStats

/**
 * Function generate file with all stats for one region
 */
function generateStats()
{
    global $bdd, $region;
    $stats = array();
    /*** GLOBAL INFO ***/
    $statement = $bdd->prepare('SELECT count(*) FROM `match`
                                        WHERE region = "' . $region . '"');
    $statement->execute();
    $data = $statement->fetchAll()[0][0];
    $stats["info"]["number"] = $data;
    /*** CHAMPION INFO ***/
    $statement = $bdd->prepare('SELECT * FROM champion');
    $statement->execute();
    $data = $statement->fetchAll();
    $numberOfChampions = count($data);
    for ($i = 0; $i < $numberOfChampions; $i++) {
        $champion = $data[$i];
        $stats["champions"][$i] = ["id" => $champion["id"], "stats" => array()];
    }
    getNumberOfGamesPlayed($stats["champions"]);
    getNumberOfGamesBanned($stats["champions"]);
    getNumberOfGamesWon($stats["champions"]);
    getStats($stats["champions"]);
    /*** BLACK MARKET INFO ***/
    $stats["bwmerc"] = array();
    getKrakensSpent($stats["bwmerc"]);
    getBrawlersStats($stats["bwmerc"]);
    getBestCompositionOfBrawlers($stats["bwmerc"]);
    /*** ITEMS INFO ***/
    $stats["items"] = array();
    getItemsStats($stats["items"]);
    echo '<pre>';
    print_r($stats);
    $fp = fopen($region . '.json', 'w');
    fwrite($fp, json_encode($stats));
    fclose($fp);
}
开发者ID:AlexandreRivet,项目名称:RiotApiChallenge,代码行数:40,代码来源:stats.php

示例6: getLastDate

 if ($argv[0] == "update") {
     //This is used to update the table from the last date
     //data was entered until now
     echo "\n\nSTARTING UPDATE\n\n";
     $startDate = getLastDate($dbr);
     if ($argv[1] != null && preg_match('@[^0-9]@', $endDate) == 0) {
         $now = $argv[1] . "000000";
     } else {
         $now = wfTimestamp(TS_MW, time());
     }
     //Grab the old stats so we can compare
     $oldStats = getStats($dbr);
     //update the new stats
     updateStats($dbw, $dbr, $startDate, $now);
     //Grab the new stats
     $newStats = getStats($dbr);
     $editedStats = array();
     $createdStats = array();
     $nabStats = array();
     $patrolStats = array();
     //Compare the stats and output
     foreach ($newStats as $userId => $data) {
         if ($oldStats[$userId] == null) {
             $oldStats[$userId] = array();
             $oldStats[$userId]['edited'] = 0;
             $oldStats[$userId]['created'] = 0;
             $oldStats[$userId]['nab'] = 0;
             $oldStats[$userId]['patrol'] = 0;
         }
         //first check edited
         foreach ($editLevels as $level) {
开发者ID:biribogos,项目名称:wikihow-src,代码行数:31,代码来源:update_editor_stats.php

示例7: getStats

/***************************************
 * http://www.program-o.com
 * PROGRAM O
 * Version: 2.4.7
 * FILE: stats.php
 * AUTHOR: Elizabeth Perreau and Dave Morton
 * DATE: 12-12-2014
 * DETAILS: Displays chatbot statistics for the currently selected chatbot
 ***************************************/
$oneday = getStats("today");
$oneweek = getStats("-1 week");
$onemonth = getStats("-1 month");
$sixmonths = getStats("-6 month");
$oneyear = getStats("1 year ago");
$alltime = getStats("all");
$singlelines = getChatLines(1, 1);
$alines = getChatLines(1, 25);
$blines = getChatLines(26, 50);
$clines = getChatLines(51, 100);
$dlines = getChatLines(101, 1000000);
$avg = getChatLines("average", 1000000);
$upperScripts = '';
$topNav = $template->getSection('TopNav');
$leftNav = $template->getSection('LeftNav');
$main = $template->getSection('Main');
$navHeader = $template->getSection('NavHeader');
$FooterInfo = getFooter();
$errMsgClass = !empty($msg) ? "ShowError" : "HideError";
$errMsgStyle = $template->getSection($errMsgClass);
$noLeftNav = '';
开发者ID:lordmatt,项目名称:Program-O,代码行数:30,代码来源:stats.php

示例8: printFunction

function printFunction()
{
    $stats = getStats();
    $totalWidth = 300 - 16;
    ?>
		<div class="line-owned">
			<div class="box-icone"><i class="fa fa-check"></i></div>
			<div class="box-bar">
				<div class="box-number-result">
					<span class="result-text"><?php 
    echo number_format($stats['ownArchi'] * 100 / $stats['totalArchi'], 0) . '%';
    ?>
</span>
				</div>
				<div class="empty-bar">
					<div
						class="percentage-bar"
						style="width: <?php 
    echo definedWidth($stats['totalArchi'], $stats['ownArchi'], $totalWidth) . 'px';
    ?>
">
					</div>
				</div>
			</div>
			<div class="box-info">
				<div class="box-number-info">
					<?php 
    echo $stats['ownArchi'] . ' / ' . $stats['totalArchi'];
    ?>
				</div>
			</div>
		</div>
		<div class="line-catchable">
			<div class="box-icone"><i class="fa fa-crosshairs"></i></div>
			<div class="box-bar">
				<div class="box-number-result">
					<span class="result-text"><?php 
    echo $stats['catchArchi'];
    ?>
</span>
				</div>
				<div class="empty-bar">
					<div
						class="percentage-bar"
						style="width: <?php 
    echo definedWidth($stats['totalArchi'], $stats['catchArchi'], $totalWidth) . 'px';
    ?>
">
					</div>
				</div>
			</div>
			<div class="box-info">
				<div class="box-number-info">
					<?php 
    echo number_format($stats['priceCatchArchi'], 0, ',', ' ') . 'K';
    ?>
				</div>
				<?php 
    if ($stats['catchNotPrice'] != 0) {
        ?>
<div class="box-alert"><i class="fa fa-exclamation"></i></div><?php 
    }
    ?>
			</div>
		</div>
		<div class="line-buy">
			<div class="box-icone box-icone-kamas"></div>
			<div class="box-bar">
				<div class="box-number-result">
					<span class="result-text"><?php 
    echo $stats['buyArchi'];
    ?>
</span>
				</div>
				<div class="empty-bar">
					<div
						class="percentage-bar"
						style="width: <?php 
    echo definedWidth($stats['totalArchi'], $stats['buyArchi'], $totalWidth) . 'px';
    ?>
">
					</div>
				</div>
			</div>
			<div class="box-info">
				<div class="box-number-info">
					<?php 
    echo number_format($stats['priceBuyArchi'], 0, ',', ' ') . 'K';
    ?>
				</div>
				<?php 
    if ($stats['buyNotPrice'] != 0) {
        ?>
<div class="box-alert"><i class="fa fa-exclamation"></i></div><?php 
    }
    ?>
			</div>
		</div>
		<?php 
}
开发者ID:audric-perrin,项目名称:sitedofus,代码行数:100,代码来源:printFunction.php

示例9: getResults

function getResults($db, $type)
{
    if ($type == 'all') {
        $sql = "SELECT * FROM " . QUIZDB . " WHERE `locked_quiz` = 0 AND `quiz_end_ts` IS NOT NULL ORDER BY `percentage` DESC";
        return $db->fetch_all_array($sql);
    } elseif ($type == 'my_quiz') {
        $sql = "SELECT * FROM " . QUIZDB . " WHERE  `created_by` = '" . $_SESSION['UA_DETAILS']['randid'] . "' AND `quiz_end_ts` IS NOT NULL ORDER BY `percentage` DESC";
        return $db->fetch_all_array($sql);
    } elseif ($type == 'stats') {
        $stat_arr = getStats($db);
        $stat_arr_max = max($stat_arr);
        $stat_arr_mid = floor($stat_arr_max / 2);
        foreach ($stat_arr as $value) {
            $str2 .= $value . ",";
        }
        $str2 = trim($str2, ",");
        $str = "http://chart.apis.google.com/chart?chxl=0:|0|1-9|10-19|20-29|30-39|40-49|50-59|60-69|70-79|80-89|90-99|100|1:|0|" . $stat_arr_mid . "|" . $stat_arr_max . "|2:|Percentage+Ranges&chxp=2,80&chxt=x,y,x&chbh=31&chs=500x400&cht=bvg&chco=76A4FB&chds=0," . ($stat_arr_max + 10) . "&chd=t:" . $str2 . "&chg=100,10";
        return $str;
    } else {
        $sql = "SELECT * FROM " . QUIZDB . " WHERE  `user` = '" . $_SESSION['UA_DETAILS']['randid'] . "' AND `quiz_end_ts` IS NOT NULL ORDER BY `percentage` DESC";
        return $db->fetch_all_array($sql);
    }
}
开发者ID:sangikumar,项目名称:IP,代码行数:23,代码来源:functions.php

示例10: isset

<?php

require_once "getstats.php";
$_settings = $_SERVER["DOCUMENT_ROOT"] . "/avatars/settings/";
$do = isset($_POST['action']) && $_POST['action'] == 'load' ? 'load' : 'save';
$user = isset($_POST['user']) ? strtolower($_POST['user']) : '';
$set['bColor'] = isset($_POST['bColor']) ? $_POST['bColor'] : '666666';
$set['bgColor'] = isset($_POST['bgColor']) ? $_POST['bgColor'] : '979797';
$set['fontColor'] = isset($_POST['fColor']) ? $_POST['fColor'] : 'cccccc';
$set['smile'] = isset($_POST['smile']) ? $_POST['smile'] : 10;
$set['font'] = isset($_POST['font']) ? $_POST['font'] : 1;
$set['pack'] = isset($_POST['pack']) ? $_POST['pack'] : 1;
$set['showuser'] = isset($_POST['showuser']) && $_POST['showuser'] == 1 ? 1 : 0;
for ($i = 1; $i <= 3; $i++) {
    $set['line' . $i]['title'] = str_replace('&amp;', '&', $_POST['line' . $i]);
    $set['line' . $i]['value'] = $_POST['drp' . $i];
}
if (!empty($user) && $do == 'save') {
    print file_put_contents($_settings . $user . ".set", serialize($set)) ? 1 : 0;
    getStats($user);
} else {
    if (file_exists($_settings . $user . ".set")) {
        print json_encode(unserialize(file_get_contents($_settings . $user . ".set")));
    }
}
开发者ID:ZenoX2012,项目名称:CyBerFuN-CoDeX,代码行数:25,代码来源:save.php

示例11: getPrice

                        <div class="row">
                            <div class="form-and-links-container col-sm-8 col-sm-offset-2">
                                <div class="countdown-label">
                                    <div id="price">
                                        <p class="text-center"><strong>We Buy</strong> : RM<?php 
getPrice('1', 'we_buy');
?>
/g <i class=<?php 
getStats('1', 'we_buy');
?>
></i></p>
                                        <p class="text-center"><strong>We Sell</strong> : RM<?php 
getPrice('1', 'we_sell');
?>
/g <i class=<?php 
getStats('1', 'we_sell');
?>
></i></p>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <!-- /Countdown -->
                <div class="container">
                    <!-- Description -->
                    <div class="row">
                        <p class="description col-sm-8 col-sm-offset-2">— Last update : <?php 
getTime();
?>
开发者ID:anocriny,项目名称:mks-indicative-price,代码行数:31,代码来源:index.php

示例12: getStats

                                <div class="clearfix"></div>
                            </div>
                        </a>
                    </div>
                </div>
                <div class="col-lg-3 col-md-6">
                    <div class="panel panel-red">
                        <div class="panel-heading special-panel">
                            <div class="row">
                                <div class="row text-center">
                                	<i class="glyphicon glyphicon-piggy-bank dashboard"></i>
                                </div>
                                <div class="col-xs-12 text-center">
                                    <div class="moneysize">
                                        <?php 
getStats("SUM(order_totalprice)", "orders");
?>
                                    </div>
                                    <p>Income</p>
                                </div>
                            </div>
                        </div>
                        <a href="#">
                            <div class="panel-footer">
                                <span class="pull-left">View Details</span>
                                <span class="pull-right"><i class="glyphicon glyphicon-circle-arrow-right"></i></span>
                                <div class="clearfix"></div>
                            </div>
                        </a>
                    </div>
                </div>
开发者ID:Toesmash,项目名称:git-techpoint,代码行数:31,代码来源:index.php

示例13: tarihOku2

            ?>
</td>
                      <td nowrap="nowrap" <?php 
            echo "style=\"background-color: {$row_color};\"";
            ?>
><?php 
            echo tarihOku2($row_eoUsers['calismaTarihi']);
            ?>
</td>
                    </tr>
                    <?php 
        } while ($row_eoUsers = mysql_fetch_assoc($eoUsers));
        ?>
                    <tr>
                      <td colspan="6" class="tabloAlt"><?php 
        printf($metin[189], Sec2Time2(round(getStats(9))));
        ?>
</td>
                    </tr>
                  </table>
                  <?php 
        if ($totalRows_eoUsers > $maxRows_eoUsers) {
            ?>
                  <table border="0" align="center" cellpadding="3" cellspacing="0" bgcolor="#CCCCCC" >
                    <tr>
                      <td><div align="center"> <a href="<?php 
            printf("%s?pageNum_eoUsers=%d%s&amp;yonU=dur", $currentPage, 0, $queryString_eoUsers);
            ?>
"><img src="img/page-first.gif" border="0" alt="first" /></a> </div></td>
                      <td><div align="center"> <a href="<?php 
            printf("%s?pageNum_eoUsers=%d%s&amp;yonU=dur", $currentPage, max(0, $pageNum_eoUsers - 1), $queryString_eoUsers);
开发者ID:ergun805,项目名称:eOgr,代码行数:31,代码来源:dataWorkList.php

示例14: strtolower

              <div>&nbsp;</div>
            </div>
            <div class="Post-cr">
              <div>&nbsp;</div>
            </div>
            <div class="Post-cc"></div>
            <div class="Post-body">
              <div class="Post-inner">
                <div class="PostContent">
                  <div class="tekKolon"> <h3><?php 
    echo $metin[584];
    ?>
 :</h3>
                    <?php 
    echo "<strong><a href='profil.php?kim=" . $uID . "' rel='facebox'><span style='text-transform: capitalize;'>" . strtolower(kullGercekAdi($uID)) . "</span></a></strong><br/>";
    echo getStats(12, $uID);
    ?>
                  </div>
                </div>
                <div class="cleared"></div>
              </div>
            </div>
          </div>
          <?php 
}
?>
          <?php 
$dersID = temizle(isset($_GET["kurs"]) ? $_GET["kurs"] : "");
$uID = temizle(isset($_GET["user"]) ? $_GET["user"] : "");
if (!empty($dersID)) {
    ?>
开发者ID:ergun805,项目名称:eOgr,代码行数:31,代码来源:kursDetay.php

示例15: Array

<td id=rightarrow class=arrow></td>
</table>
<div>
<a href="about.php#bigquery">Write your own custom queries!</a>
</div>
</center>

<script type="text/javascript">
// HTML strings for each image
var gaSnippets = new Array();

<?php 
$gLabel = latestLabel();
require_once "stats.inc";
require_once "charts.inc";
$hStats = getStats($gLabel, "All", curDevice());
?>
gaSnippets.push("<?php 
echo bytesContentTypeChart($hStats);
?>
");
gaSnippets.push("<?php 
echo responseSizes($hStats);
?>
");
gaSnippets.push("<?php 
echo percentGoogleLibrariesAPI($hStats);
?>
");
gaSnippets.push("<?php 
echo percentFlash($hStats);
开发者ID:shanshanyang,项目名称:httparchive,代码行数:31,代码来源:index.php


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