function central_information(){
	$t=$_GET["t"];
	$page=CurrentPageName();
	$tpl=new templates();	
	$users=new usersMenus();
	$TRPTEXT=null;
	$sock=new sockets();
	$processes=unserialize(base64_decode($sock->getFrameWork("squidstats.php?processes-queue=yes")));
	$DisableArticaProxyStatistics=$sock->GET_INFO("DisableArticaProxyStatistics");
	if(!is_numeric($DisableArticaProxyStatistics)){$DisableArticaProxyStatistics=0;}
	$APP_SQUIDDB_INSTALLED=trim($sock->getFrameWork("squid.php?IS_APP_SQUIDDB_INSTALLED=yes"));
	
	if(is_array($processes)){
		$TRP[]="<table style='width:99%' class=form>";
		while (list ($index, $ligne) = each ($processes) ){
			$TTL=$ligne["TTL"];
			$PID=$ligne["PID"];
			$day=$ligne["day"];
			
		
			$TRP[]="<tr>
				<td width=1%><img src='img/preloader.gif'></td>
				<td style='font-weight:bold'>{processing} $day PID:$PID {since} $TTL</td>
				</tr>";
			
		}
		$TRP[]="</table>";
		$TRPTEXT=@implode("\n", $TRP);
	}
	//database-connect-settings-32.png

		$squiddb=Paragraphe32('mysql_statistics_engine','mysql_statistics_engine_params'
				,"blur()","database-connect-settings-32-grey.png");	
	
	if($users->PROXYTINY_APPLIANCE){$squiddb=null;}
		
	
	
	if(!$users->PROXYTINY_APPLIANCE){
	//$tr[]=Paragraphe32("old_statistics_interface", "old_statistics_interface_text", "SquidQuickLinksStatistics();", "status_statistics-22.png");

	
	
	
	if(!$users->PROXYTINY_APPLIANCE){
		
		$tr[]=Paragraphe32('remote_statistics_server','remote_statistics_server_text',"javascript:Loadjs('squid.stats-appliance.php',true)",'syslog-32-client.png');
		

		if($DisableArticaProxyStatistics==0){
			$tr[]=Paragraphe32('import_squid_logs','import_squid_logs_explain',"Loadjs('squid.logs.import.php',true)",'32-import.png');
		}

		
		$tr[]=Paragraphe32('APP_ARTICADB','APP_ARTICADB_TEXT',"Loadjs('squid.categories.php?onlyDB=yes',true)",'32-categories.png');

	
	if($DisableArticaProxyStatistics==0){
			
		$tr[]=table_heures_enretard();
		$tr[]=Paragraphe32('remote_mysql_server','remote_mysqlsquidserver_text',"Loadjs('squid.remote-mysql.php',true)","artica-meta-32.png");
		$tr[]=Paragraphe32('restore_purged_statistics','restore_purged_statistics_explain',"Loadjs('squid.artica.statistics.restore.php',true)","32-import.png");		
		
		}
		
		
		$tr[]=Paragraphe32('source_logs','source_logs_squid_text'
				,"Loadjs('squid.logrotate.php',true)","32-logs.png");		
		
		$tr[]=Paragraphe32('enable_disable_statistics','ARTICA_STATISTICS_TEXT'
				,"Loadjs('squid.artica.statistics.php',true)","statistics-32.png");
		
		
		
	}
	
	if(!$users->CORP_LICENSE){$more_features="<div class=text-info style='font-size:16px;'>{squid_stats_nolicence_explain}</div>";}
	
	
	if($DisableArticaProxyStatistics==1){
		$more_features="<div class=text-info style='font-size:16px;'>{squid_stats_disabled_explain}</div>";
		
	}
	
	
	
	}
		
	
		//
	$tr[]=Paragraphe32('APP_SARG','APP_SARG_TXT',"Loadjs('sarg.php',true)","sarg-logo-32.png");
	$tr[]=Paragraphe32('APP_SARG_HOWTO','APP_SARG_HOWTO_TXT',
		"s_PopUpFull('http://proxy-appliance.org/index.php?cID=203',1024,768,'Statistics');","help-32.png");
	
	
	if($users->URLSNARF_INSTALLED){
		//$tr[]=Paragraphe32('APP_URLSNARF','APP_URLSNARF_TEXT',"Loadjs('urlsnarf.php')","website-32.png");
	}
	
	
	$table=CompileTr2($tr,true);	
	
	$garphs="<div id='graph1-$t' style='height:250px'><center style='margin:50px'><img src='img/wait-clock.gif'></center></div>
	<div style='text-align:right'>". imgtootltip("refresh-24.png","{refresh}","Loadjs('$page?graphique_heure=yes&container=graph1-$t');")."</div>";
	
	$garphsjs="Loadjs('$page?graphique_heure=yes&container=graph1-$t');";
	
	if($sock->SQUID_LOCAL_STATS_DISABLED()){
		$garphs=$tpl->_ENGINE_parse_body(FATAL_WARNING_SHOW_128("{artica_statistics_disabled}"));
		$garphsjs=null;
		
	}
	
	$EnableSquidRemoteMySQL=$sock->GET_INFO("EnableSquidRemoteMySQL");
	if(!is_numeric($EnableSquidRemoteMySQL)){$EnableSquidRemoteMySQL=0;}
	if($EnableSquidRemoteMySQL==1){
		$garphs="<div id='graph1-$t' style='height:250px'><center style='margin:50px'><img src='img/wait-clock.gif'></center></div>
		<div style='text-align:right'>". imgtootltip("refresh-24.png","{refresh}","Loadjs('$page?graphique_heure=yes&container=graph1-$t');")."</div>";
		
		$garphsjs="Loadjs('$page?graphique_heure=yes&container=graph1-$t');";
		$more_features=null;}
	
	$html="
	<div style='font-size:22px;margin-bottom:15px'>{SQUID_STATS}</div>
	$garphs
	$TRPTEXT
	$more_features
	
	<center>
	<div style='margin-top:15px;width:80%'>$table</div>
	</center>
	<script>
		LoadAjax('info-gene-$t','squid.traffic.statistics.php?squid-status-stats=yes',true);
		$garphsjs
	</script>
	";
	

	echo $tpl->_ENGINE_parse_body($html);
	
}
Exemplo n.º 2
0
function tools()
{
    //if(isset($_SESSION[__FILE__][__FUNCTION__])){echo $_SESSION[__FILE__][__FUNCTION__];return;}
    $tpl = new templates();
    $q = new mysql_squid_builder();
    $page = CurrentPageName();
    $users = new usersMenus();
    $tr[] = table_heures_enretard();
    $tr[] = Paragraphe32('remote_mysql_server', 'remote_mysqlsquidserver_text', "Loadjs('squid.remote-mysql.php',true)", "artica-meta-32.png");
    $tr[] = Paragraphe32('restore_purged_statistics', 'restore_purged_statistics_explain', "Loadjs('squid.artica.statistics.restore.php',true)", "32-import.png");
    $tr[] = Paragraphe32('enable_disable_statistics', 'ARTICA_STATISTICS_TEXT', "Loadjs('squid.artica.statistics.php',true)", "statistics-32.png");
    $html = "\n\t\t<div class=BodyContent>" . CompileTr4($tr) . "</div>\n\t\t\t\n\t";
    $html = $tpl->_ENGINE_parse_body($html);
    $_SESSION[__FILE__][__FUNCTION__] = $html;
    echo $html;
}