#! /usr/bin/perl

use Jcode;
use CGI;

require "../../lib-bin/EdbTksn.pm";

	my %Conf = ();
	my @Copy = ();
	my $NextProg = "/tksn-bin/WhatsNewDetail.cgi";
	my ($i , $cnt);

	print "Content-type: text/html\n\n";

	EdbTksn::GetConf(\%Conf);

	$cnt = EdbTksn::GetCopyList(\@Copy);



	$out = <<HTML;
<html>
<head>
<title>栄華ホーム</title>
<meta http-equiv="Content-Type" content="text/html; charset=Shift_JIS">
<script language="JavaScript" src="/menu.js"></script>
<link rel="stylesheet" href="/topics.css" type="text/css">
</head>
<body onLoad="MM_preloadImages('menu_img/menu_r6_c1_f2.gif')">
<table width="100%" border="0" cellspacing="5" cellpadding="0" class="text12-3">

HTML

	for ($i = 0; $i < $cnt; $i++) {

		$Copy[$i]{'OPEN_DAY'} =~ s/\//\./g;
		$t_date = $Copy[$i]{'OPEN_DAY'};

		if($Copy[$i]{'RENT_IMG_FLAG'} == 1){
			$rent_img = "<img src=\"/img/rent.gif\">";
		}else{
			$rent_img = "";
		}
		
		if ($Copy[$i]{'LINK_FLAG'} == 0) {
			$out .= "<tr>\n<td width=\"5\" bgcolor=\"#FFCC66\">　</td>\n<td>".$t_date."　".$Copy[$i]{'COPY1'}.$rent_img."</td>\n</tr>\n";
		} elsif ($Copy[$i]{'LINK_FLAG'} == 1) {
			$out .= "<tr>\n<td width=\"5\" bgcolor=\"#FFCC66\">　</td>\n<td><a href=\"".$NextProg."?COPY_CD=".$Copy[$i]{'COPY_CD'}."\" target=\"_top\">".$t_date."　".$Copy[$i]{'COPY1'}."</a>　".$rent_img."</td>\n</tr>\n";
		} elsif ($Copy[$i]{'LINK_FLAG'} == 2) {
			$out .= "<tr>\n<td width=\"5\" bgcolor=\"#FFCC66\">　</td>\n<td><a href=\"".$Copy[$i]{'LINK_URL'}."\" target=\"_top\">".$t_date."　".$Copy[$i]{'COPY1'}."</a>　".$rent_img."</td>\n</tr>\n";
		}
	}

	$out .= <<HTML;

</table>
</body>
</html>
HTML

Jcode::convert(\$out,'sjis');
print $out;

exit;
