#!/usr/bin/perl
require '/var/www/vhosts/aosemi.com/private/info.dat';
require './admin/cgi_lib/temp.pl';
use CGI;
use lib './admin/cgi_lib/lib';
use Jcode;
use Encode;
use utf8;
use DBI;
use Time::Local;
use CGI::Carp qw(fatalsToBrowser);
$in = new CGI;
#POSTエラー
if($ENV{'REQUEST_METHOD'} eq 'POST'){
print "Content-type:text/plain;\n\nerror";
exit;
}
#データ初期化
$html='';
my $current=time;
#データベース接続
my $db = DBI->connect("dbi:SQLite:dbname=$db_name","","", {});
$db->do("set names utf8");
my $sth = $db->prepare("SELECT * FROM news ORDER BY CAST(news_date AS SIGNED) DESC");
$sth->execute();
while($row=$sth->fetchrow_hashref()){
my $news_date=$row->{'news_date'};
my ($sec,$min,$hour,$mday,$mon,$year,$wday) = localtime($news_date);
$mon++;
$year = $year + 1900;
my $news_comment=&getData($row->{'news_comment'});
my $new_icon='';
if($news_date >= $current-(60*60*24*30)){
$new_icon='
';
}
$html.=<<"diSEMBOWELMENT";