#!/usr/bin/perl
#-------------------
#program-ID:pet41.cgi
#auther :murakami
#date :2002/1/22
#-------------------
use CGI;
use DBI;
#-------
$username="egi";
$dbh = DBI->connect("dbi:Pg:dbname=egi",$username)
or die "Cannot connect: " , $DBI->errstr;
print "Content-Type: text/html\n\n";
$iSelect = "Select bangou, animal, type from pet_list order by bangou";
$sth = $dbh->prepare($iSelect)
or die "Cannot prepare: ", $dbh->errstr();
$sth->execute() or die "Cannot execute: ", $sth->errstr();
#--------------
print "<html>\n";
print "<head><title>select</title>\n";
print "<META HTTP-EQUIV=\"Cntent-Type\" CONTENT=\"text/html;charset=EUC-JP\">\n";
print "</head>\n";
print "<body bgcolor =LINEN>\n";
print "<center>\n";
print "<h4>\n";
print "ペット図鑑テーブルの管理 <hr>\n";
print "訂正する番号をクリックして下さい。\n";
print "<p>\n";
print "<table border = 1 bgcolor =POWDERBLUE>\n";
print "<tr bgcolor =SKYBLUE>";
print "<th>番号";
print "<th>動物種";
print "<th>種類";
print "</tr>\n";
print "<br>\n";
while(@row = $sth->fetchrow_array() ){
print "<tr>";
print "<td><a href=./pet42.cgi?ibangou=$row[0]>$row[0]</a></td>";
print "<td>$row[1]</td>";
print "<td>$row[2]</td>";
print "</tr>\n";
}
print "</table>\n";
print "<p>\n";
print "<a href=\"./pet43.cgi\">新規追加 </A>\n";
print "<p>\n";
print "<a href=http://myouga.cs.ube-c.ac.jp/~egi/pet/index.html>もどる</a>\n";
print "</center>\n";
print "</body>\n";
print "</html>\n";