1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163
|
$singlePages = array("annual" => "eSites annual evolution",
"monthly" => "eSites monthly evolution",
"weekly" => "eSites weekly evolution",
"alltimeIP" => "annual hits evolution by IPs",
"chart" => "annual hits evolution by countries") ;
if(isset($_GET["page"]) && array_key_exists($_GET["page"],$singlePages))
{
$page = $_GET["page"] ;
$pageTitle = $singlePages[$page] ;
}
else
{
header("Location: ../../index.html") ;
$get = array_keys($singlePages) ;// array_keys ( array input , mixed search_value , bool strict ) retourne les clés numériques et littérales du tableau input .
$values = array_values($singlePages) ;// retourne les valeurs du tableau input et indexe numériquement le tableau
for($i = 0 ; $i < count($get) ; $i++)// en function du nombre de clés de $singlepages
{
?>
<tr valign="top">
<td width="8" height="2"> </td>// pour créer un tableau en HTML
<td align="left" width="17" height="33" valign="middle"><img src="../../html/claf/arrow_<? if(isset($page) && $page == $get[$i]) echo "pink" ; else echo "blue" ; ?>.gif" width="14" height="14" vspace="1"></td>
<td align="left" width="115" height="33" valign="middle"><a href="single.php?page=<?=$get[$i]?>" class="leftsubmenu"><?=$values[$i]?></a></td>
</tr>
<?
}
?>
if(($page == "chart" && file_exists("../images/pieChart2004.png")) || file_exists("../$page.html"))
{
if(!file_exists("../$page.html"))
{
?>
<i>Last updated : <?=date("l d/m/Y", filemtime("../images/pieChart2004.png"))?></i><br /><br />
<img src="../images/pieChart2004.png" width="720" height="450" /><br /><br />
<?
}
else
{
<i>Last updated : <?=date("l d/m/Y", filemtime("../$page.html"))?></i><br /><br />
include("../$page.html") ;
}
}
else
{
Not yet generated
if(isset($_GET["mode"]) && in_array($_GET["mode"],array("g","f")) && isset($_GET["month"]) && in_array($_GET["month"],range(1,date("n"))))
{
$mode = $_GET["mode"] ;
$month = $_GET["month"] ;
$weekMin = date("W",mktime(0,0,0,$month,1,2004)) ;
$weekMax = date("W",mktime(0,0,0,$month+1,0,2004)) + 1 ;
$modeArray = array("f" => "Figures", "g" => "Graphics") ;
$pageTitle = $modeArray[$mode]." for ".date("F",mktime(0,0,0,$month,1,2004))." 2004 Statistics" ;
$plusWeek = "" ;
if(isset($_GET["week"]) && in_array($_GET["week"],range(1,date("W"))))
{
$week = $_GET["week"] ;
$plusWeek .= ", Week $week" ;
if(in_array($week,range($weekMin,$weekMax)))
{
$toIncludeFile = $modeArray[$mode]."Week$week-2004.html" ;
$toIncludeChart = "pieChartWeek$week-2004.png" ;
}
else
{
$toIncludeFile = $modeArray[$mode]."Month".sprintf("%02d", $month)."-2004.html" ;
$toIncludeChart = "pieChartMonth".sprintf("%02d", $month)."-2004.png" ;
}
}
else
{
$toIncludeFile = $modeArray[$mode]."Month".sprintf("%02d", $month)."-2004.html" ;
$toIncludeChart = "pieChartMonth".sprintf("%02d", $month)."-2004.png" ;
}
}
else
{
header("Location: ../../index.html") ;
}
for($i = $weekMin ; $i < $weekMax && in_array($i,range(1,date("W"))) ; $i++)
{
?>
<tr valign="top">
<td width="8" height="2"> </td>
<td align="left" width="17" height="22" valign="middle"><img src="../../html/claf/arrow_<? if(isset($week) && $i == $week) echo "pink" ; else echo "blue" ; ?>.gif" width="14" height="14" vspace="1"></td>
<td align="left" width="115" height="22" valign="middle"><a href="display.php?mode=<?=$mode?>&month=<?=$month?>&week=<?=$i?>" class="leftsubmenu">Week <?=$i?></a></td>
</tr>
<?
if($mode == "f")
{
if(file_exists("../$toIncludeFile"))
{
?>
<span class="titleH2-13softblue"><?=$pageTitle?></span><br /><br />// HTML par rapport au format
<?
if($month == date("n"))
{
if(isset($week) && $week == $weekMax)
{
?>
<i>Last updated : <?=date("l d/m/Y", filemtime("../$toIncludeFile"))?></i><br /><br />
<?
}
else
{
?>
<i>Last updated : <?=date("l d/m/Y", filemtime("../$toIncludeFile"))?></i><br /><br />
<?
}
}
?>
<?include("../$toIncludeFile")?>
<?
}
else
{
?>
Not yet generated
<?
}
}
else
{
if(file_exists("../images/$toIncludeChart"))
{
if($month == date("n"))
{
if(isset($week) && $week == $weekMax)
{
?>
<i>Last updated : <?=date("l d/m/Y", filemtime("../images/$toIncludeChart"))?></i><br /><br />
<?
}
else
{
?>
<i>Last updated : <?=date("l d/m/Y", filemtime("../images/$toIncludeChart"))?></i><br /><br />
<?
}
}
?>
<img src="../images/<?=$toIncludeChart?>" />
<?
}
else
{
?>
Not yet generated
<?
}
} |
Partager