awstats按日报表日历界面

| 暂无评论 | 暂无引用通告

--> 脚本:perl_calendar.pl
使用模块:HTML::Calendar::Simple
安装模块:
cpan HTML::Calendar::Simple
如手动,需安装以下两个包:
Date-Simple
HTML-Calendar-Simple
将其存放在cgi目录中添加可执行权限

#!/usr/bin/perl -w
#Script Name: perl_calendar.pl
#author: supersun@gmail.com
#url: http://supersun.biz
use strict;

use HTML::Calendar::Simple;
use CGI qw/:all/;

my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst)=localtime;
my $awstats_path="/awstats/awstats.pl";
print header(-charset=>'gbk');
if(param('host')){
        $year+=1900;
        $mon++;
        my $host=param("host");
        my $link_tag=1;

        print start_html("awstats for $host");
        print h1({-align=>"center"},"awstats for $host"),hr({-align=>"center"});

        print "<table border='1' align='center'>\n";
        print "<tr>\n";
        foreach my $month (01..12)
        {
                print "<tr>\n" if($month =~ /5|9/);
                print "<td valign='top'>";
                my $cal = HTML::Calendar::Simple->new({ 'month' => $month, 'year'  => $year});

                foreach my $day (1..31){
                        my $location=$awstats_path."?config=$host&databasebreak=day&day=$day&month=$month";
                        if($month eq $mon && $day eq $mday ){
                                $link_tag=0;
                                $cal->daily_info({'day'      => $day, 'pin_up'=>'now'});
                        }
                        if( $link_tag eq 1){
                                $cal->daily_info({'day'      => $day, 'day_link' => $location});
                        }else{
                                $cal->daily_info({'day'      => $day });
                        }
                }
                my $html = $cal->calendar_month;

                print $html;
                print "</td>\n";
                print "</tr>\n" if($month =~ /4|8/ );

        }
        print "</tr></table>\n";
}else{
        print "You must input a host: ",start_form,"Host: ",textfield('host'),submit,end_form;
}
print end_html;
界面如下:
perl_calander.jpg的缩略图
使用awstats按日分析参考:
http://www.chedong.com/blog/archives/001293.html


暂无引用通告

发送引用通告网址: http://supersun.info/mt/mt-tb.cgi/929
如果您想引用这篇日记到您的Blog,请复制上面的链接,放置到您发表文章时的相应界面中。

发表评论

最新资源

  • IMG_1437.JPG
  • line.png
  • bar.png
  • perl_calander.jpg

关于此日记

此日记由 supersun 发表于 2009年3月31日 17:59

此Blog上的上一篇日记FTP传输模式binary和ASCII的区别

此Blog上的下一篇日记使用Perl进行web制表

首页归档页可以看到最新的日记和所有日记。