示例#1
0
function stats()
{
    $sql = "SELECT COUNT(ID) as tcount FROM fetchmail_events WHERE DATE_FORMAT(zDate,'%Y-%m-%d')=DATE_FORMAT(NOW(),'%Y-%m-%d')";
    $q = new mysql();
    $ligne = @mysql_fetch_array($q->QUERY_SQL($sql, "artica_events"));
    $hits_today = $ligne["tcount"];
    if ($hits_today == null) {
        $hits_today = 0;
    }
    $sql = "SELECT SUM(size) as tsize FROM fetchmail_events WHERE DATE_FORMAT(zDate,'%Y-%m-%d')=DATE_FORMAT(NOW(),'%Y-%m-%d')";
    $ligne = @mysql_fetch_array($q->QUERY_SQL($sql, "artica_events"));
    $size = $ligne["tsize"];
    if ($size == null) {
        $size = 0;
    }
    $size = FormatBytes($size / 1024);
    $html = "<div style='margin-bottom:5px;text-align:right'>" . imgtootltip("refresh-32.png", "{refresh}", "RefreshTab('fetchamil_events_config')") . "</div>\n\t<table style='width:100%'>\n\t<tr>\n\t\t<td valign='top'><H3>{today}:</H3><hr></td>\n\t\t<td valign='top'>\n\t\t\t<table style='width:100%'>\n\t\t\t\t<tr>\n\t\t\t\t\t<td valign='top' class=legend>{nb_fetchmails}</td>\n\t\t\t\t\t<td valing='top'><strong>{$hits_today}</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td valign='top' class=legend>{nb_fetchmails_size}</td>\n\t\t\t\t\t<td valing='top'><strong>{$size}</td>\n\t\t\t\t</tr>\t\n\t\t\t</table>\n\t\t</td>\n\t</tr>\n\t</table>\t\t\n\t<center>\n\t<img src='" . courbe_day() . "' style='margin:3px'>\t\n\t<img src='" . courbe_month() . "' style='margin:3px'>\n\t</center>\n\t";
    $tpl = new templates();
    echo $tpl->_ENGINE_parse_body($html);
}
示例#2
0
function today()
{
    $page = CurrentPageName();
    if (isset($_GET["today"])) {
        $domain = $_GET["today"];
        $graph1 = courbe_today($_GET["today"]);
        $t = "today";
    }
    if (isset($_GET["week"])) {
        $domain = $_GET["week"];
        $graph1 = courbe_week($_GET["week"]);
        $t = "week";
    }
    if (isset($_GET["month"])) {
        $domain = $_GET["month"];
        $graph1 = courbe_month($_GET["month"]);
        $t = "month";
    }
    $html = "\n\t<table style='width:100%'>\n\t<tr>\n\t\t<td valign='top'>\n\t\t\t<center><img src='{$graph1}'></center>\n\t\t\t<div id='users-table-{$t}'></div>\n\t\t</td>\n\t\t<td valign='top'>\n\t\t\t<table style='width:100%'>\n\t\t\t" . implode("\n", $GLOBALS["stats-array-{$domain}"]) . "\n\t\t\t</table>\n\t\t</td>\n\t</tr>\n\t</table>\n\t\n\t<script>\n\t\tLoadAjax('users-table-{$t}','{$page}?users-table={$domain}&t={$t}');\n\t</script>\n\t\n\t\n\t";
    echo $html;
}
示例#3
0
function today(){
	$page=CurrentPageName();
	if(isset($_GET["today"])){
		$domain=$_GET["today"];
		$graph1=courbe_today($_GET["today"]);
		$t="today";
	}
	
	if(isset($_GET["week"])){
		$domain=$_GET["week"];
		$graph1=courbe_week($_GET["week"]);
		$t="week";
	}	
	
	if(isset($_GET["month"])){
		$domain=$_GET["month"];
		$graph1=courbe_month($_GET["month"]);
		$t="month";
	}		
	
	$html="
	<table style='width:100%'>
	<tr>
		<td valign='top'>
			<center><img src='$graph1'></center>
			<div id='users-table-$t'></div>
		</td>
		<td valign='top'>
			<table style='width:100%'>
			". implode("\n",$GLOBALS["stats-array-$domain"])."
			</table>
		</td>
	</tr>
	</table>
	
	<script>
		LoadAjax('users-table-$t','$page?users-table=$domain&t=$t');
	</script>
	
	
	";
	
	echo $html;
	
}