awstats_index.php.master 1.96 KB
Newer Older
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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>AWAstats Statistics</title>
<script>
function load_content(url)
{
    var iframe = document.getElementById("content");
    iframe.src = url;
}
</script>
</head>
<body>
<?php
$aw['aw_jump_text'] = 'Jump to previous stats: ';
$aw['aw_renamed_index'] = 'awsindex.html';

if ($handle = opendir('.'))
{
        while(false !== ($file = readdir($handle)))
        {
                if (substr($file,0,1) != "." && is_dir($file))
                {
                        $awprev[] = $file;
                }
        }

        $month = date("m")+1-1;

        if (date("d") == 1)
        {
                        $month = date("m")-1;
        }

        $year = date("Y");

        if (date("m") == 1)
        {
                        $year = date("Y")-1;
                        $month = "12";
        }

        $awprev[] = $year."-".$month;
        closedir($handle);
}

echo '<div style="width: 97%; margin-left: 4px; height: 20px; background-color: #FFFFFF; position: fixed; padding: 7px; border: 2px solid #cccccc;><div align="left"><font color="#000000" size="2" face="Verdana, Arial, Helvetica,  sans-serif">' .$aw["aw_jump_text"]. '</font </div>';

echo "<select name='awdate' onchange=\"load_content(this.value)\">";
rsort($awprev);

foreach ($awprev as $key => $value)
{
        if($key == 0)
        {
                echo "<option selected=\"selected\" value=\"".$aw['aw_renamed_index']."\"> $value</option>";
        }
        else
        {
                echo "<option value='$value/".$aw['aw_renamed_index']."'> $value</option>";
        }
}

echo '</select></div><iframe src="'.$aw['aw_renamed_index'].'" frameborder="0" scrolling="Yes" width="100%" height="100%" style="margin-top:25px" id="content"></iframe>';

?>
</body>
</html>