コード例 #1
0
<?php

// Inialize session
session_start();
// Load config
include '../../../config.php';
// Get user count
$userCount = getUserCount();
// Return info
echo $userCount;
function getUserCount()
{
    // Load user info
    $userData = mysql_query("SELECT * FROM users");
    // Get user count and return it
    return mysql_num_rows($userData);
}
コード例 #2
0
<header class="intro">
	<div class="intro-body">
	<div class="container">
	<div class="row">
		<div class="col-md-8 col-md-offset-2"> <br />
			<br />
			<br />
			<br />
			<div class="panel panel-default" style= "color: #333;">
				<div class="panel-heading"> <strong>User Info</strong> <a href="../index.php" style="float: right; margin-top: -4px;" class="btn btn-danger btn-sm">Logout</a></div>
				<div class="panel-body" style=" text-align: left">
					<div class "row">
						<div class="col-md-2" style="margin-bottom: 5px"> <strong>Name:</strong> Admin<br/>
							<?php 
echo '
								<strong>Users: </strong>' . getUserCount() . '<br /> 
								<strong>Paid: </strong>' . getPaidCount() . '<br />
								<strong>Teams: </strong>' . getTotalTeamCount() . '<br />' . '</div>';
?>
							<div class="col-md-10" style=""> <strong>Philip better get a free t-shirt</strong>
								<table class="table table-hover table-condensed">
									<tr>
										<th>Name</th>
										<th>Phone</th>
										<th>Email</th>
										<th>Team</th>
										<th>Size</th>
										<th>Paid?</th>
									</tr>
									<?php 
$result = getAllUsers();
コード例 #3
0
ファイル: api.php プロジェクト: ColeGreenlee/PHPMon
                $time = ", " . $time;
            }
            if ($days > 0) {
                $time = $days[0] . " D" . $time;
            }
        } else {
            $time = false;
        }
    } else {
        $time = false;
    }
    return $time;
}
function getUserCount()
{
    return exec("cat /etc/passwd | wc -l");
}
$finalResponse = json_encode(array("CPU_Usage" => getCPUUsage(), "RAM_Usage" => getRAMUsage(), "Uptime" => getUptime(), "Free_Disk_Space" => getFreeDiskSpace(), "ConnectionCount" => getConnectionCount(), "UserCount" => getUserCount()));
switch ($clientRequest) {
    case "status":
        echo $finalResponse;
        break;
    default:
        echo "No Request Given!";
        break;
}
?>



コード例 #4
0
ファイル: refresh.php プロジェクト: NeilCrosby/biggeekdayout
    require_once $class_name . '.php';
}
#$url = "http://upcoming.yahoo.com/ajax/event_page_all_attendees.php?event_id=".UPCOMING_EVENT;
#$data = simplexml_load_file( $url );
$url = "http://lanyrd.com/2011/" . LANYRD_EVENT . "/";
$doc = getDataFromFeed($url);
$xpath = new DOMXPath($doc);
$attend = $xpath->query("//div[contains(@class, 'attendees-placeholder')]");
$watch = $xpath->query("//div[contains(@class, 'trackers-placeholder')]");
$attend = getHtmlUserList($doc, 'attendees');
$watch = getHtmlUserList($doc, 'trackers');
$ical = "http://lanyrd.com/2011/big-geek-day-out-the-great-western-lego-show/big-geek-day-out-the-great-western-lego-show.ics";
$sign_up = $url;
$attend_num = getUserCount($doc, 'attendees');
$attend_num = $attend_num ? " ({$attend_num})" : '';
$watch_num = getUserCount($doc, 'trackers');
$watch_num = $watch_num ? " ({$watch_num})" : '';
$flickr = '';
//getFlickrHtml(FLICKR_API_KEY, FLICKR_SEARCH);
mb_internal_encoding("UTF-8");
$template = getTemplate();
$template = str_replace(array('###attend###', '###watch###', '###ical###', '###sign-up###', '###attend-num###', '###watch-num###', '###flickr###'), array($attend, $watch, $ical, $sign_up, $attend_num, $watch_num, $flickr), $template);
saveOutput($template);
$server = 80 == $_SERVER['SERVER_PORT'] ? $_SERVER['SERVER_NAME'] : $_SERVER['SERVER_NAME'] . ':' . $_SERVER['SERVER_PORT'];
if (!isset($_GET['no_redirect'])) {
    header("Location: http://{$server}/");
}
exit;
function getTemplate()
{
    return file_get_contents($_SERVER['DOCUMENT_ROOT'] . FILE_TEMPLATE);
コード例 #5
0
ファイル: template.php プロジェクト: andyongithub/joyplus-cms
 function base()
 {
     global $mac;
     $this->html = replaceStr($this->html, "{joyplus:url}", app_siteurl);
     $this->html = replaceStr($this->html, "{joyplus:path}", app_installdir);
     $this->html = replaceStr($this->html, "{joyplus:templatepath}", app_installdir . "template/" . app_templatedir . "/");
     $this->html = replaceStr($this->html, "{joyplus:name}", app_sitename);
     $this->html = replaceStr($this->html, "{joyplus:keywords}", app_keywords);
     $this->html = replaceStr($this->html, "{joyplus:description}", app_description);
     $this->html = replaceStr($this->html, "{joyplus:icp}", app_icp);
     $this->html = replaceStr($this->html, "{joyplus:qq}", app_qq);
     $this->html = replaceStr($this->html, "{joyplus:email}", app_email);
     $this->html = replaceStr($this->html, "{joyplus:curvodtypeid}", $mac["vodtypeid"]);
     $this->html = replaceStr($this->html, "{joyplus:curvodtypepid}", $mac["vodtypepid"]);
     $this->html = replaceStr($this->html, "{joyplus:curvodtopicid}", $mac["vodtopicid"]);
     $this->html = replaceStr($this->html, "{joyplus:curarttypeid}", $mac["arttypeid"]);
     $this->html = replaceStr($this->html, "{joyplus:curarttypepid}", $mac["arttypepid"]);
     $this->html = replaceStr($this->html, "{joyplus:curarttopicid}", $mac["arttopicid"]);
     $this->html = replaceStr($this->html, "{joyplus:userid}", $_SESSION["userid"]);
     $this->html = replaceStr($this->html, "{joyplus:username}", $_SESSION["username"]);
     $this->html = replaceStr($this->html, "{joyplus:desktop}", "<a href=\"javascript:void(0)\" onclick=\"desktop('');return false;\"/>保存到桌面</a>");
     $this->html = replaceStr($this->html, "{joyplus:gbooklink}", app_installdir . "gbook.php");
     $this->html = replaceStr($this->html, "{joyplus:searchlink}", app_installdir . "search.php");
     $this->html = replaceStr($this->html, "{joyplus:indexlink}", $this->getIndexLink());
     $this->html = replaceStr($this->html, "{joyplus:artindexlink}", $this->getArtIndexLink());
     $this->html = replaceStr($this->html, "{joyplus:vodmaplink}", $this->getMapLink());
     $this->html = replaceStr($this->html, "{joyplus:artmaplink}", $this->getArtMapLink());
     $this->html = replaceStr($this->html, "{joyplus:vodtopiclink}", $this->getTopicIndexLink("vod", true));
     $this->html = replaceStr($this->html, "{joyplus:arttopiclink}", $this->getTopicIndexLink("art", true));
     $this->html = replaceStr($this->html, "{joyplus:visits}", "<script src=\"" . app_installdir . "js/tj.js\"></script>");
     if (indexOf($this->html, "{joyplus:vodallcount}")) {
         $this->html = replaceStr($this->html, "{joyplus:vodallcount}", getVodCount("all"));
     }
     if (indexOf($this->html, "{joyplus:voddaycount}")) {
         $this->html = replaceStr($this->html, "{joyplus:voddaycount}", getVodCount("day"));
     }
     if (indexOf($this->html, "{joyplus:artallcount}")) {
         $this->html = replaceStr($this->html, "{joyplus:artallcount}", getArtCount("all"));
     }
     if (indexOf($this->html, "{joyplus:artdaycount}")) {
         $this->html = replaceStr($this->html, "{joyplus:artdaycount}", getArtCount("day"));
     }
     if (indexOf($this->html, "{joyplus:usercount}")) {
         $this->html = replaceStr($this->html, "{joyplus:usercount}", getUserCount("all"));
     }
     if (indexOf($this->html, "{joyplus:userdaycount}")) {
         $this->html = replaceStr($this->html, "{joyplus:userdaycount}", getUserCount("day"));
     }
 }