#!/usr/bin/perl #----------------------- # program-ID:pet32.cgi # auther :t-egi # date :2002/1/22 #----------------------- use CGI; use DBI; $query =new CGI; $tOid = $query->param('ibango'); print "Content-Type: text/html\n\n"; #-------- $username="egi"; if($tOid){ $dbh = DBI->connect("dbi:Pg:dbname=egi",$username) or die "Cannot connect: " , $DBI=errstr; $iSelect = "Select banngo, name, petname, type, sex, owner, birthday, photo, comment from pet_info where banngo=?"; $sth = $dbh->prepare($iSelect) or die "Cannot prepare: ", $dbh->errstr(); $sth->execute($tOid) or die "Cannot execute: " , $sth->errstr(); } #-------- print "<HTML>\n"; print "<HEAD><TITLE>select</TITLE>\n"; print "<META HTTP-EQUIV=\"Content-Type\" text/html;charset=x-euc-jp\">\n"; print "</HEAD>\n"; print "<BODY bgcolor = LINEN>\n"; print "<H5>\n"; print "<center>"; print "ペット情報テーブルの管理<br><hr>\n"; print "<I>更新画面</I>\n"; print "<FORM ACTION=\"./pet34.cgi\" METHOD=\"post\">"; print "<TABLE BORDER = 1 bgcolor = \"#98FBBB\">\n"; if($tOid){ @row = $sth->fetchrow_array(); } print "<TR><TH>番号</TH><TD><INPUT TYPE=TEXT SIZE=4 NAME=ibango VALUE=\"$row[0]\" </TD></TR>\n"; print "<TR><TH>名前</TH><TD><INPUT TYPE=TEXT SIZE=15 NAME=iname VALUE=\"$row[1]\" </TD></TR>\n"; print "<TR><TH>愛称</TH><TD><INPUT TYPE=TEXT SIZE=20 NAME=ipetname VALUE=\"$row[2]\" </TD></TR>\n"; print "<TR><TH>種類</TH><TD><INPUT TYPE=TEXT SIZE=4 NAME=itype VALUE=\"$row[3]\" </TD></TR>\n"; print "<TR><TH>性別</TH><TD><INPUT TYPE=TEXT SIZE=4 NAME=isex VALUE=\"$row[4]\" </TD></TR>\n"; print "<TR><TH>飼い主名</TH><TD><INPUT TYPE=TEXT SIZE=20 NAME=iowner VALUE=\"$row[5]\" </TD></TR>\n"; print "<TR><TH>生年月日</TH><TD><INPUT TYPE=TEXT SIZE=10 NAME=ibirthday VALUE=\"$row[6]\" </TD></TR>\n"; print "<TR><TH>写真</TH><TD><INPUT TYPE=TEXT SIZE=15 NAME=iphoto VALUE=\"$row[7]\" </TD></TR>\n"; print "<TR><TH>飼い主のコメント</TH><TD><INPUT TYPE=TEXT SIZE=120 NAME=icomment VALUE=\"$row[8]\" </TD></TR>\n"; print "</TABLE>\n"; print "<INPUT TYPE=\"HIDDEN\" NAME=\"ibango\" VALUE=".$tOid.">"; if ($tOid){ print "<P><INPUT TYPE=\"submit\" NAME=UPDATE VALUE=\"更新\">\n"; print "<INPUT TYPE=\"submit\" NAME=DELETE VALUE=\"抹消\">\n"; } else{ print "<P><INPUT TYPE=\"submit\" NAME=INSERT VALUE=\"追加\">\n"; } print "</FORM>"; print "<A HREF=./pet31.cgi>戻る</A>"; print "</CENTER>\n"; print "</BODY>\n"; print "</HTML>\n";