// ############################################################
// # StatIt MySQL #
// ############################################################
// # by Helge Orthmann #
// # Contact: otter@otterware.de #
// # Homepage: http://www.otterware.de #
// ############################################################
// # Leave this header in this file ! #
// ############################################################
$ver = "V 3.0a"; // Don't change this one ;-) #
// ############################################################
$mysqlhost = "localhost";
$mysqldb = "duwgati_data";
$mysqllogin = "duwgati_admin";
$mysqlpassword = "a9&7v~j^)!";
// ################################################################################
// Every statistic (different domains) have an unique id number (from 1 to 99999) #
// You can change the settings for every statistic (not $tzone, $showlist) #
// For every different website (domain) you have to add the array values #
// ################################################################################
$tzone = "+1"; // change timezone of your server (e.g. +3 or -4)! No spaces between + or - and hour!!
$showlist = "on"; // show list of your other statistics ("on" or "off")?
// Default world map & corresponding bars. Colors of bars & continents should match
$worldmap = "pics/continents.gif"; // continent map
$afrbar = "pics/afr.gif"; // bar graphic africa
$antbar = "pics/ant.gif"; // bar graphic antarctica
$asibar = "pics/asi.gif"; // bar graphic asia
$eurbar = "pics/eur.gif"; // bar graphic europe
$nambar = "pics/nam.gif"; // bar graphic north america
$ocebar = "pics/oce.gif"; // bar graphic australia & oceania
$sambar = "pics/sam.gif"; // bar graphic south america
$nabar = "pics/bar.gif"; // bar graphic for unresolved continents
// Cumulative Counter
$list[1] = "on"; // if "on" set statistics that shown in list ("on" or "off")
$showlang[1] = "off"; // show other languages in statistic ("on" or "off")?
$showratio[1] = "on"; // show Java Script Ratio ("on" or "off")?
$auth[1] = "off"; // HTTP auth "on" or "off" (works only with PHP Apache module)
$login[1] = "admin"; // if $auth "on" set login and password
$password[1] = "master";
$statname[1] = "Site Totals"; // name for statistic (e.g. your domainname)
$language[1] = "english"; // default language
$css[1] = "../css/mainpage.css"; // css-style file
$bargraphic[1] = "pics/bar.gif"; // bar graphic (default color)
$barwidth[1] = "200"; // max width of the bars
$barheight[1] = "10"; // height of the bars
$showip[1] = "on"; // want to show IP address in statistic ("on" or "off")?
$nummax[1] = "30"; // Number of results shown in statistic
$numlast[1] = "50"; // Number of last visitors shown in statistic
$blockreload[1] = "on"; // reload blocker ("on" or "off")?
$blockreloadtime[1] = "1800"; // if reload blocking set to "on" set the time to block IPs (seconds)
$blockserver[1] = ""; // place the server from which clicks will not be counted. Sseparate servers with comma's , !!
$blockip[1] = "212.187.126.204";// place IPs you want not be counted. Separate the IP's with comma's , !!
$timeformat[1] = "d.m. H:i"; // time format for last visitors (PHP)
$timeformat1[1] = "d.m.Y"; // time format for top day
$timeformat2[1] = "m.Y"; // time format for top month
$counthost[1] = "on"; // count hostnames ("on" or "off")?
// de Counter
$list[2] = "on"; // if "on" set statistics that shown in list ("on" or "off")
$showlang[2] = "off"; // show other languages in statistic ("on" or "off")?
$showratio[2] = "on"; // show Java Script Ratio ("on" or "off")?
$auth[2] = "off"; // HTTP auth "on" or "off" (works only with PHP Apache module)
$login[2] = "admin"; // if $auth "on" set login and password
$password[2] = "master";
$statname[2] = "German Version"; // name for statistic (e.g. your domainname)
$language[2] = "english"; // default language
$css[2] = "../css/mainpage.css"; // css-style file
$bargraphic[2] = "pics/bar.gif"; // bar graphic (default color)
$barwidth[2] = "200"; // max width of the bars
$barheight[2] = "10"; // height of the bars
$showip[2] = "on"; // want to show IP address in statistic ("on" or "off")?
$nummax[2] = "30"; // Number of results shown in statistic
$numlast[2] = "50"; // Number of last visitors shown in statistic
$blockreload[2] = "on"; // reload blocker ("on" or "off")?
$blockreloadtime[2] = "1800"; // if reload blocking set to "on" set the time to block IPs (seconds)
$blockserver[2] = ""; // place the server from which clicks will not be counted. Sseparate servers with comma's , !!
$blockip[2] = "212.187.126.204";// place IPs you want not be counted. Separate the IP's with comma's , !!
$timeformat[2] = "d.m. H:i"; // time format for last visitors (PHP)
$timeformat1[2] = "d.m.Y"; // time format for top day
$timeformat2[2] = "m.Y"; // time format for top month
$counthost[2] = "on"; // count hostnames ("on" or "off")?
// fr Counter
$list[3] = "on"; // if "on" set statistics that shown in list ("on" or "off")
$showlang[3] = "off"; // show other languages in statistic ("on" or "off")?
$showratio[3] = "on"; // show Java Script Ratio ("on" or "off")?
$auth[3] = "off"; // HTTP auth "on" or "off" (works only with PHP Apache module)
$login[3] = "admin"; // if $auth "on" set login and password
$password[3] = "master";
$statname[3] = "French Version"; // name for statistic (e.g. your domainname)
$language[3] = "english"; // default language
$css[3] = "../css/mainpage.css"; // css-style file
$bargraphic[3] = "pics/bar.gif"; // bar graphic (default color)
$barwidth[3] = "200"; // max width of the bars
$barheight[3] = "10"; // height of the bars
$showip[3] = "on"; // want to show IP address in statistic ("on" or "off")?
$nummax[3] = "30"; // Number of results shown in statistic
$numlast[3] = "50"; // Number of last visitors shown in statistic
$blockreload[3] = "on"; // reload blocker ("on" or "off")?
$blockreloadtime[3] = "1800"; // if reload blocking set to "on" set the time to block IPs (seconds)
$blockserver[3] = ""; // place the server from which clicks will not be counted. Sseparate servers with comma's , !!
$blockip[3] = "212.187.126.204";// place IPs you want not be counted. Separate the IP's with comma's , !!
$timeformat[3] = "d.m. H:i"; // time format for last visitors (PHP)
$timeformat1[3] = "d.m.Y"; // time format for top day
$timeformat2[3] = "m.Y"; // time format for top month
$counthost[3] = "on"; // count hostnames ("on" or "off")?
// nl Counter
$list[4] = "on"; // if "on" set statistics that shown in list ("on" or "off")
$showlang[4] = "off"; // show other languages in statistic ("on" or "off")?
$showratio[4] = "on"; // show Java Script Ratio ("on" or "off")?
$auth[4] = "off"; // HTTP auth "on" or "off" (works only with PHP Apache module)
$login[4] = "admin"; // if $auth "on" set login and password
$password[4] = "master";
$statname[4] = "Dutch Version"; // name for statistic (e.g. your domainname)
$language[4] = "english"; // default language
$css[4] = "../css/mainpage.css"; // css-style file
$bargraphic[4] = "pics/bar.gif"; // bar graphic
$barwidth[4] = "200"; // max width of the bars
$barheight[4] = "10"; // height of the bars
$showip[4] = "on"; // want to show IP address in statistic ("on" or "off")?
$nummax[4] = "30"; // Number of results shown in statistic
$numlast[4] = "50"; // Number of last visitors shown in statistic
$blockreload[4] = "on"; // reload blocker ("on" or "off")?
$blockreloadtime[4] = "1800"; // if reload blocking set to "on" set the time to block IPs (seconds)
$blockserver[4] = ""; // place the server from which clicks will not be counted. Sseparate servers with comma's , !!
$blockip[4] = "212.187.126.204";// place IPs you want not be counted. Separate the IP's with comma's , !!
$timeformat[4] = "d.m. H:i"; // time format for last visitors (PHP)
$timeformat1[4] = "d.m.Y"; // time format for top day
$timeformat2[4] = "m.Y"; // time format for top month
$counthost[4] = "on"; // count hostnames ("on" or "off")?
// sp Counter
$list[5] = "on"; // if "on" set statistics that shown in list ("on" or "off")
$showlang[5] = "off"; // show other languages in statistic ("on" or "off")?
$showratio[5] = "on"; // show Java Script Ratio ("on" or "off")?
$auth[5] = "off"; // HTTP auth "on" or "off" (works only with PHP Apache module)
$login[5] = "admin"; // if $auth "on" set login and password
$password[5] = "master";
$statname[5] = "Spanish Version"; // name for statistic (e.g. your domainname)
$language[5] = "english"; // default language
$css[5] = "../css/mainpage.css"; // css-style file
$bargraphic[5] = "pics/bar.gif"; // bar graphic
$barwidth[5] = "200"; // max width of the bars
$barheight[5] = "10"; // height of the bars
$showip[5] = "on"; // want to show IP address in statistic ("on" or "off")?
$nummax[5] = "30"; // Number of results shown in statistic
$numlast[5] = "50"; // Number of last visitors shown in statistic
$blockreload[5] = "on"; // reload blocker ("on" or "off")?
$blockreloadtime[5] = "1800"; // if reload blocking set to "on" set the time to block IPs (seconds)
$blockserver[5] = ""; // place the server from which clicks will not be counted. Sseparate servers with comma's , !!
$blockip[5] = "212.187.126.204";// place IPs you want not be counted. Separate the IP's with comma's , !!
$timeformat[5] = "d.m. H:i"; // time format for last visitors (PHP)
$timeformat1[5] = "d.m.Y"; // time format for top day
$timeformat2[5] = "m.Y"; // time format for top month
$counthost[5] = "on"; // count hostnames ("on" or "off")?
// tr Counter
$list[6] = "on"; // if "on" set statistics that shown in list ("on" or "off")
$showlang[6] = "off"; // show other languages in statistic ("on" or "off")?
$showratio[6] = "on"; // show Java Script Ratio ("on" or "off")?
$auth[6] = "off"; // HTTP auth "on" or "off" (works only with PHP Apache module)
$login[6] = "admin"; // if $auth "on" set login and password
$password[6] = "master";
$statname[6] = "Turkish Version";// name for statistic (e.g. your domainname)
$language[6] = "english"; // default language
$css[6] = "../css/mainpage.css"; // css-style file
$bargraphic[6] = "pics/bar.gif"; // bar graphic
$barwidth[6] = "200"; // max width of the bars
$barheight[6] = "10"; // height of the bars
$showip[6] = "on"; // want to show IP address in statistic ("on" or "off")?
$nummax[6] = "30"; // Number of results shown in statistic
$numlast[6] = "50"; // Number of last visitors shown in statistic
$blockreload[6] = "on"; // reload blocker ("on" or "off")?
$blockreloadtime[6] = "1800"; // if reload blocking set to "on" set the time to block IPs (seconds)
$blockserver[6] = ""; // place the server from which clicks will not be counted. Sseparate servers with comma's , !!
$blockip[6] = "212.187.126.204";// place IPs you want not be counted. Separate the IP's with comma's , !!
$timeformat[6] = "d.m. H:i"; // time format for last visitors (PHP)
$timeformat1[6] = "d.m.Y"; // time format for top day
$timeformat2[6] = "m.Y"; // time format for top month
$counthost[6] = "on"; // count hostnames ("on" or "off")?
// uk Counter
$list[7] = "on"; // if "on" set statistics that shown in list ("on" or "off")
$showlang[7] = "off"; // show other languages in statistic ("on" or "off")?
$showratio[7] = "on"; // show Java Script Ratio ("on" or "off")?
$auth[7] = "off"; // HTTP auth "on" or "off" (works only with PHP Apache module)
$login[7] = "admin"; // if $auth "on" set login and password
$password[7] = "master";
$statname[7] = "English Version";// name for statistic (e.g. your domainname)
$language[7] = "english"; // default language
$css[7] = "../css/mainpage.css"; // css-style file
$bargraphic[7] = "pics/bar.gif"; // bar graphic
$barwidth[7] = "200"; // max width of the bars
$barheight[7] = "10"; // height of the bars
$showip[7] = "on"; // want to show IP address in statistic ("on" or "off")?
$nummax[7] = "30"; // Number of results shown in statistic
$numlast[7] = "50"; // Number of last visitors shown in statistic
$blockreload[7] = "on"; // reload blocker ("on" or "off")?
$blockreloadtime[7] = "1800"; // if reload blocking set to "on" set the time to block IPs (seconds)
$blockserver[7] = ""; // place the server from which clicks will not be counted. Sseparate servers with comma's , !!
$blockip[7] = "212.187.126.204";// place IPs you want not be counted. Separate the IP's with comma's , !!
$timeformat[7] = "d.m. H:i"; // time format for last visitors (PHP)
$timeformat1[7] = "d.m.Y"; // time format for top day
$timeformat2[7] = "m.Y"; // time format for top month
$counthost[7] = "on"; // count hostnames ("on" or "off")?
// Cumulative Counter
$list[8] = "on"; // if "on" set statistics that shown in list ("on" or "off")
$showlang[8] = "off"; // show other languages in statistic ("on" or "off")?
$showratio[8] = "on"; // show Java Script Ratio ("on" or "off")?
$auth[8] = "off"; // HTTP auth "on" or "off" (works only with PHP Apache module)
$login[8] = "admin"; // if $auth "on" set login and password
$password[8] = "master";
$statname[8] = "TV Guide"; // name for statistic (e.g. your domainname)
$language[8] = "english"; // default language
$css[8] = "../css/mainpage.css"; // css-style file
$bargraphic[8] = "pics/bar.gif"; // bar graphic (default color)
$barwidth[8] = "200"; // max width of the bars
$barheight[8] = "10"; // height of the bars
$showip[8] = "on"; // want to show IP address in statistic ("on" or "off")?
$nummax[8] = "30"; // Number of results shown in statistic
$numlast[8] = "50"; // Number of last visitors shown in statistic
$blockreload[8] = "on"; // reload blocker ("on" or "off")?
$blockreloadtime[8] = "1800"; // if reload blocking set to "on" set the time to block IPs (seconds)
$blockserver[8] = ""; // place the server from which clicks will not be counted. Sseparate servers with comma's , !!
$blockip[8] = ""; // place IPs you want not be counted. Separate the IP's with comma's , !!
$timeformat[8] = "d.m. H:i"; // time format for last visitors (PHP)
$timeformat1[8] = "d.m.Y"; // time format for top day
$timeformat2[8] = "m.Y"; // time format for top month
$counthost[8] = "on"; // count hostnames ("on" or "off")?
?>
require "config.php";
if(!isset($auth[$id])){
echo "You have to set the variables in config with a correct ID!";
exit;
}
if ($auth[$id] == "on"){
if ( (!isset($PHP_AUTH_USER)) || !(($PHP_AUTH_USER == $login[$id]) && ($PHP_AUTH_PW == $password[$id])) ){
header("WWW-Authenticate: Basic entrer=\"Form2txt admin\"");
header("HTTP/1.0 401 Unauthorized");
echo "Unauthorized access...";
exit;
}
}
error_reporting (4);
$mysql = mysql_connect ("$mysqlhost", "$mysqllogin", "$mysqlpassword") or die ("
Sorry, can't connect to database server, try again later!
");
mysql_select_db ("$mysqldb")or die ("
Sorry, can't find database '$mysqldb', check your configuration!
");
$SQLTEST = mysql_query("SELECT * FROM st_stat WHERE ID='$id'");
if(mysql_num_rows($SQLTEST)=="0"){
echo "The ID $id does not exist, or is empty!";
exit;
}
if($lang=="" || $showlang[$id]=="off") $lang = $language[$id];
require "language/$lang.inc";
// The function show_date_time is used for:
// top hour
// top day
// top work day
// top month
function show_date_time($title,$output,$table,$field,$max_wert,$min,$max,$add,$art,$bedingung){
global $l17,$id,$barwidth,$barheight,$bargraphic;
?>
| echo $title ?> |
% |
echo $l17 ?> |
$SQL1 = mysql_query("SELECT SUM(hits) FROM $table $bedingung");
$SUM = mysql_fetch_row($SQL1);
$SQL = mysql_query("SELECT * FROM $table $bedingung ORDER BY $field ASC");
while($WERTE = mysql_fetch_array($SQL)) $hit[$WERTE[$field]]=$WERTE[hits];
for ($i = $min; $i <= $max; $i++){
$k = $i + $add;
if($max_wert!=""){
if($art=="2" || $art=="3") $proz = 100 * $hit[$k] / $SUM[0]; else $proz = 100 * $hit[$i] / $SUM[0];
$proz = sprintf ("%01.2f", $proz);
if($art=="2" || $art=="3") $width = $barwidth[$id] * $hit[$k] / $max_wert; else $width = $barwidth[$id] * $hit[$i] / $max_wert;
}
?>
| if($art=="1" || $art=="2") echo "$output[$i]"; else echo "$k$output"; ?> |
echo $proz ?> |
echo $l17 ?>, echo $proz ?> %" width=" echo $width ?>" height=" echo $barheight[$id] ?>"> if($art=="2" || $art=="3") echo $hit[$k]; else echo $hit[$i] ?> |
}
?>
}
// The function visitor_details is used for:
// top screen size
// top colors
// top browser
// top system
// top referer domains
// top tld
// top hostname
// top query
// top searchengine
// top site
function visitor_details($title,$table,$field,$max_wert,$bedingung){
global $l17,$barwidth,$barheight,$nummax,$id,$bargraphic;
?>
| |
echo $title ?> |
% |
echo $l17 ?> |
$SQL1 = mysql_query("SELECT SUM(hits) FROM $table $bedingung ORDER BY hits DESC");
$SUM = mysql_fetch_row($SQL1);
$SQL = mysql_query("SELECT * FROM $table $bedingung ORDER BY hits DESC");
$num=1;
while($WERTE = mysql_fetch_array($SQL)){
if($table=="st_tld"){
$SQL33 = mysql_query("SELECT description FROM st_listdomains WHERE domain='$WERTE[tld]'");
if(mysql_num_rows($SQL33)>"0"){
$DESC = mysql_fetch_array($SQL33);
$desc = $DESC[description];
}else $desc = "?";$DESC = mysql_fetch_array($SQL33);
}
if($max_wert!=""){
$proz = 100 * $WERTE[hits] / $SUM[0];
$proz = sprintf ("%01.2f", $proz);
$width = $barwidth[$id] * $WERTE[hits] / $max_wert;
}
?>
| echo $num ?>. |
if($table=="st_referer" || $table=="st_search") echo "$WERTE[$field]"; else echo $WERTE[$field] ?> if($table=="st_tld") echo " ($desc)"; ?> |
echo $proz ?> |
echo $WERTE[hits] ?> |
// Break after $nummax is reached
if($num >= $nummax[$id]) break;
$num++;
}
?>
}
// The function continents is used for:
function continents($title,$ausgabe){
global $l17,$barwidth,$barheight,$nummax,$id,$l60,$l61,$l62,$l63,$l64,$l65,$l66,$l67,$bargraphic,$worldmap,$afrbar,$antbar,$asibar,$eurbar,$nambar,$ocebar,$sambar,$nabar;
if($ausgabe=="1"){
?>
| |
echo $title ?> |
% |
echo $l17 ?> |
}
$SQL1 = mysql_query("SELECT SUM(hits) FROM st_tld WHERE ID='$id'");
$SUM1 = mysql_fetch_row($SQL1);
$SQL1 = mysql_query("SELECT SUM(hits) FROM st_tld WHERE kontinent='EUR' AND ID='$id'");
$SUM = mysql_fetch_row($SQL1);
$WERTE[$l60]=$SUM[0];
$SQL1 = mysql_query("SELECT SUM(hits) FROM st_tld WHERE kontinent='AFR' AND ID='$id'");
$SUM = mysql_fetch_row($SQL1);
$WERTE[$l62]=$SUM[0];
$SQL1 = mysql_query("SELECT SUM(hits) FROM st_tld WHERE kontinent='ASI' AND ID='$id'");
$SUM = mysql_fetch_row($SQL1);
$WERTE[$l63]=$SUM[0];
$SQL1 = mysql_query("SELECT SUM(hits) FROM st_tld WHERE kontinent='NAM' AND ID='$id'");
$SUM = mysql_fetch_row($SQL1);
$WERTE[$l61]=$SUM[0];
$SQL1 = mysql_query("SELECT SUM(hits) FROM st_tld WHERE kontinent='SAM' AND ID='$id'");
$SUM = mysql_fetch_row($SQL1);
$WERTE[$l65]=$SUM[0];
$SQL1 = mysql_query("SELECT SUM(hits) FROM st_tld WHERE kontinent='OZE' AND ID='$id'");
$SUM = mysql_fetch_row($SQL1);
$WERTE[$l64]=$SUM[0];
$SQL1 = mysql_query("SELECT SUM(hits) FROM st_tld WHERE kontinent='ANT' AND ID='$id'");
$SUM = mysql_fetch_row($SQL1);
$WERTE[$l66]=$SUM[0];
$SQL1 = mysql_query("SELECT SUM(hits) FROM st_tld WHERE kontinent='UNB' AND ID='$id'");
$SUM = mysql_fetch_row($SQL1);
$WERTE[$l67]=$SUM[0];
arsort($WERTE);
$num=1;
$max_wert[0]=max($WERTE);
$max_wert[1]=key($WERTE);
if($ausgabe=="1"){
while(list($key,$val)=each($WERTE)){
$proz = 100 * $val / $SUM1[0];
$proz = sprintf ("%01.2f", $proz);
$width = $barwidth[$id] * $val / $max_wert[0];
?>
| echo $num ?>. |
echo $key ?> |
echo $proz ?> |
echo $val ?> |
// Break after $nummax is reached
if($num >= $nummax[$id]) break;
$num++;
}
?>
| Total number of hits: echo $totval ?> |
 |
}
else return $max_wert;
}
function ausgabe1($table,$field,$text){
global $l17,$tld,$barwidth,$barheight,$l79,$nummax,$id,$bargraphic;
$summe = 0;
$SQL = mysql_query("SELECT * FROM $table WHERE ID='$id'");
if(mysql_num_rows($SQL) > 0){
$treffer=0;
$vergleich[0]="?";
while($WERTE = mysql_fetch_array($SQL)){
$teile2 = explode (" ", $WERTE[$field]);
while(list($key,$val)=each($vergleich)){
if($val == $teile2[0]){
$treffer=1;
break;
}
}
if($treffer=="0"){
$vergleich[count($vergleich)]=$teile2[0];
}
else {
$treffer=0;
}
reset($vergleich);
}
$SQL = mysql_query("SELECT * FROM $table WHERE ID='$id'");
while($WERTE = mysql_fetch_array($SQL)){
$teile2 = explode (" ", $WERTE[$field]);
while(list($key,$val)=each($vergleich)){
if($val == $teile2[0]){
$neu[$teile2[0]] = $neu[$teile2[0]] + $WERTE[hits];
$summe = $summe + $WERTE[hits];
}
}
reset($vergleich);
}
arsort($neu);
$biggestp = max($neu);
?>
| |
echo $text ?> |
% |
echo $l17 ?> |
$num=1;
while(list($key,$val)=each($neu)){
$proz = 100 * $val / $summe;
$width = $barwidth[$id] * $val / $biggestp;
$proz = sprintf ("%01.2f", $proz);
?>
| echo $num ?>. |
echo $key ?> |
echo $proz ?> |
echo $val ?> |
// Break after $nummax is reached
if($num >= $nummax[$id]) {
break;
}
$num++;
}
?>
}
}
function go_back(){
?>
}
function get_prozent($max,$wert){
if($max!=""){
$proz = 100 * $wert / $max;
$proz = sprintf ("%01.2f", $proz);
}
return $proz;
}
function get_max($table,$field,$bedingung){
global $id;
// returns max hits(0) and field(1)
$SQL = mysql_query("SELECT MAX(hits) FROM $table $bedingung");
$MAXH = mysql_fetch_row($SQL);
$erg[0] = $MAXH[0];
$SQL1 = mysql_query("SELECT $field FROM $table WHERE hits='$erg[0]' AND ID='$id'");
$MAXV = mysql_fetch_row($SQL1);
$erg[1] = $MAXV[0];
return $erg;
}
$monat = array($l40,$l41,$l42,$l43,$l44,$l45,$l46,$l47,$l48,$l49,$l50,$l51);
$wochentag = array($l19,$l20,$l21,$l22,$l23,$l24,$l25);
// Date
eregi("([+-])([0-9]{1,2})",$tzone,$regs1);
if($regs1[1]=="+") $tstamp = time()+$regs1[2]*3600;
else if($regs1[1]=="-") $tstamp = time()-$regs1[2]*3600;
$month1 = date("n",$tstamp);
$day1 = date("j",$tstamp);
$hour1 = date("G",$tstamp);
$wday = date("w",$tstamp);
$day2 = date("d",$tstamp);
$month2 = date("m",$tstamp);
$year = date("Y",$tstamp);
$minute = date("i",$tstamp);
$lastmonth = date ("n", mktime(0,0,0,date("n")-1,1,date("Y")));
$akts = date("n.Y",$tstamp);
$aktmonth = $monat[$lastmonth];
$daysmonth = date("t",$tstamp);
// Max Values
$maxres = get_max("st_resolution","resolution","WHERE ID='$id'");
$maxcol = get_max("st_colors","colors","WHERE ID='$id'");
$maxbrowser = get_max("st_browser","browser","WHERE ID='$id'");
$maxsystem = get_max("st_system","system","WHERE ID='$id'");
$maxref = get_max("st_referer","referer","WHERE ID='$id'");
$maxtld = get_max("st_tld","tld","WHERE ID='$id'");
$maxsite = get_max("st_site","site","WHERE ID='$id'");
if($mo!="" & $ye!="") $maxsitemonth = get_max("st_site","site","WHERE month='$mo' AND year='$ye' AND ID='$id'");
else $maxsitemonth = get_max("st_site","site","WHERE month='$month1' AND year='$year' AND ID='$id'");
$maxhour = get_max("st_hour","hour","WHERE ID='$id'");
$maxday = get_max("st_day","day","WHERE ID='$id'");
if($ye!="") $maxmonth = get_max("st_month","month","WHERE ID='$id' AND year='$ye'");
else $maxmonth = get_max("st_month","month","WHERE ID='$id' AND year='$year'");
$maxwdays = get_max("st_wday","wday","WHERE ID='$id'");
$maxwdays[1] = $wochentag[$maxwdays[1]];
$maxsearch = get_max("st_search","search","WHERE ID='$id'");
$maxquery = get_max("st_query","query","WHERE ID='$id'");
/*$maxrobots = get_max("st_robots","robots","WHERE ID='$id'");*/
if($counthost[$id]=="on") $maxhost = get_max("st_host","host","WHERE ID='$id'");
$maxkont = continents($l59,"0");
// Today
$SQL = mysql_query("SELECT hits FROM st_day WHERE day='$day1' AND ID='$id'");
$today = mysql_fetch_row($SQL);
// ======================= START =========================
// Here the construction of the default page layout starts
if($show == "referer"){
visitor_details($l9,"st_referer","referer",$maxref[0],"WHERE ID='$id'");
go_back();
}
elseif($show == "tld"){
visitor_details($l58,"st_tld","tld",$maxtld[0],"WHERE ID='$id'");
go_back();
}
elseif($show == "sites"){
if(isset($mo) && isset($ye)){
visitor_details("$l54 $mo.$ye","st_site","site",$maxsitemonth[0],"WHERE month='$mo' AND year='$ye' AND ID='$id'");
$SQLSI = mysql_query("SELECT DISTINCT month,year FROM st_site WHERE ID='$id' AND month<>'$mo' AND year<>'$ye' ORDER BY month,year");
}
else{
visitor_details("$l54 $akts","st_site","site",$maxsitemonth[0],"WHERE month='$month1' AND year='$year' AND ID='$id'");
$SQLSI = mysql_query("SELECT DISTINCT month,year FROM st_site WHERE ID='$id' AND month<>'$month1' AND year<>'$year' ORDER BY month,year");
}
if(mysql_num_rows($SQLSI)>"0"){
?>
}
go_back();
}
elseif($show == "browser"){
visitor_details($l7,"st_browser","browser",$maxbrowser[0],"WHERE ID='$id'");
ausgabe1("st_browser","browser",$l7);
go_back();
}
elseif($show == "system"){
visitor_details($l8,"st_system","system",$maxsystem[0],"WHERE ID='$id'");
ausgabe1("st_system","system",$l8);
go_back();
}
elseif($show == "resolution"){
visitor_details($l26,"st_resolution","resolution",$maxres[0],"WHERE ID='$id'");
go_back();
}
elseif($show == "colors"){
visitor_details($l27,"st_colors","colors",$maxcol[0],"WHERE ID='$id'");
go_back();
}
elseif($show == "query"){
visitor_details($l75,"st_query","query",$maxquery[0],"WHERE ID='$id'");
go_back();
}
elseif($show == "search"){
visitor_details($l74,"st_search","search",$maxsearch[0],"WHERE ID='$id'");
go_back();
}
elseif($show == "hours"){
show_date_time($l11," $l39","st_hour","hour",$maxhour[0],"0","23","0","0","WHERE ID='$id'");
go_back();
}
elseif($show == "days"){
show_date_time($l10,". $aktmonth","st_day","day",$maxday[0],"0",$day1-1,"1","3","WHERE ID='$id'");
go_back();
}
elseif($show == "month"){
if(isset($ye)){
show_date_time("$l13 $ye",$monat,"st_month","month",$maxmonth[0],"0","11","1","2","WHERE ID='$id' AND year='$ye'");
$SQLSM = mysql_query("SELECT DISTINCT year FROM st_month WHERE ID='$id' AND year<>'$ye' ORDER BY year");
}else{
show_date_time("$l13 $year",$monat,"st_month","month",$maxmonth[0],"0","11","1","2","WHERE ID='$id' AND year='$year'");
$SQLSM = mysql_query("SELECT DISTINCT year FROM st_month WHERE ID='$id' AND year<>'$year' ORDER BY year");
}
if(mysql_num_rows($SQLSM)>"0"){
?>
}
go_back();
}
elseif($show == "wday"){
show_date_time($l12,$wochentag,"st_wday","wday",$maxwdays[0],"0","6","0","1","WHERE ID='$id'");
go_back();
}
elseif($show == "host"){
visitor_details($l5,"st_host","host",$maxhost[0],"WHERE ID='$id'");
go_back();
}
elseif($show == "kont"){
continents($l59,"1");
go_back();
}
elseif($show == "bots"){
visitor_details($l85,"st_robots","robots",$maxrobots[0],"WHERE ID='$id'");
go_back();
}
else {
// log ##############################################
// yesterday
if($day1=="1") $gesttag="-";
else{
$gestern = $day1 - 1;
$SQL1 = mysql_query("SELECT hits FROM st_day WHERE day='$gestern' AND ID='$id'");
$gest = mysql_fetch_row($SQL1);
if($gest[0]) $gesttag = $gest[0];
else $gesttag = "-";
}
// Month
$SQL2 = mysql_query("SELECT hits FROM st_month WHERE month='$month1' AND ID='$id'");
$month=mysql_fetch_row($SQL2);
// total, Top Month, Top Day
$SQL3 = mysql_query("SELECT * FROM st_stat WHERE ID='$id'");
$STAT = mysql_fetch_array($SQL3);
// Java Script Ratio
$prozjavascript = 100 * $STAT[javascript] / $STAT[total];
$prozjavascript = sprintf ("%01.2f", $prozjavascript);
$proznojavascript = 100 * $STAT[nojavascript] / $STAT[total];
$proznojavascript = sprintf ("%01.2f", $proznojavascript);
// Monthly Average
$SQL4 = mysql_query("SELECT count(*) FROM st_day WHERE ID='$id'");
$count=mysql_fetch_row($SQL4);
if($count[0]) $aver = $month[0] / $count[0];
else $aver = 0;
$aver = ceil($aver);
// Probability
$frac = 0;
$SQL7 = mysql_query("SELECT SUM(hits) FROM st_hour WHERE ID='$id'");
$total1=mysql_fetch_row($SQL7);
$SQL8 = mysql_query("SELECT SUM(hits) FROM st_hour WHERE hour<'$hour1' AND ID='$id'");
$frac=mysql_fetch_row($SQL8);
$SQL9 = mysql_query("SELECT hits FROM st_hour WHERE hour='$hour1' AND ID='$id'");
$now=mysql_fetch_row($SQL9);
$frac = $frac[0] + ( $now[0] * $minute ) / 60;
if($today[0]=="") $today[0]="0";
if($frac!=0) $evt = ( $today[0] * $total1[0] ) / $frac;
else $evt=0;
$evt = ceil($evt);
// Default Start Page Tables
?>
| echo $l1 . " " ?> |
echo $l17 ?> |
| echo $l33 ?> |
echo $maxhour[1] ?> echo $l39 ?> |
echo $maxhour[0] ?> |
| echo $l72 ?> |
echo $STAT[topday] ?> |
echo $STAT[tophitsd] ?> |
| echo $l32 ?> |
echo $maxwdays[1] ?> |
echo $maxwdays[0] ?> |
| echo $l31 ?> |
echo $STAT[topmonth] ?> |
echo $STAT[tophitsm] ?> |
| echo $l36 ?> |
echo $maxres[1] ?> |
echo $maxres[0] ?> |
| echo $l37 ?> |
echo $maxcol[1] ?> bit |
echo $maxcol[0] ?> |
| echo $l34 ?> |
echo $maxbrowser[1] ?> |
echo $maxbrowser[0] ?> |
| echo $l35 ?> |
echo $maxsystem[1] ?> |
echo $maxsystem[0] ?> |
| echo $l15 ?> |
echo $maxref[1] ?> |
echo $maxref[0] ?> |
$SQL33 = mysql_query("SELECT description FROM st_listdomains WHERE domain='$maxtld[1]'");
if(mysql_num_rows($SQL33)>"0"){
$DESC = mysql_fetch_array($SQL33);
$desc = $DESC[description];
}else $desc = "?";
?>
| echo $l69 ?> |
echo "$maxtld[1] ($desc)"; ?> |
echo $maxtld[0] ?> |
| echo $l70 ?> |
echo $maxkont[1] ?> |
echo $maxkont[0] ?> |
if($counthost[$id]=="on"){
?>
| echo $l83 ?> |
echo $maxhost[1] ?> |
echo $maxhost[0] ?> |
}
?>
| echo $l76 ?> |
echo $maxquery[1] ?> |
echo $maxquery[0] ?> |
| echo $l81 ?> |
echo $maxsearch[1] ?> |
echo $maxsearch[0] ?> |
if($maxsite[0]>"0"){
?>
| echo $l71 ?> |
echo $maxsite[1] ?> |
echo $maxsite[0] ?> |
}
?>
| echo $l3 ?> |
if($showip[$id]=="on") echo "$l4 | \n"; ?>
echo $l5 ?> |
echo $l6 ?> |
echo $l7 ?> |
echo $l8 ?> |
echo $l9 ?> |
$SQL11 = mysql_query("SELECT * FROM st_last WHERE ID='$id' ORDER BY time DESC");
while($LAST = mysql_fetch_array($SQL11)){
$zeitp = date ("$timeformat[$id]",$LAST[time]);
?>
| echo $zeitp ?> |
if($showip[$id]=="on") echo "$LAST[IP] | \n"; ?>
echo $LAST[hostname] ?> |
echo $LAST[language] ?> |
echo $LAST[browser] ?> |
echo $LAST[system] ?> |
if($LAST[link]=="1") echo "$LAST[referer]"; else echo $LAST[referer] ?> |
}
?>
}
mysql_close ($mysql);
error_reporting (2);
?>