主机分组名/设计图名的输入程序

戻る

mscengine_data.pl,输入开始画面程序

sub mscengine_data { my $self = shift; my(%t,$template,$n,@arr,@arr1,@loop); # Get CGI query object $t{q} = $self->query(); # データ転送 $t{id} = $t{q}->param("id"); $t{name} = $t{q}->param("name"); $t{series} = $t{q}->param("series"); # TABLEデータを取り出す ($t{gname_id},$t{maker_id}) = $self->dbh->selectrow_array("SELECT gname_id, maker_id FROM main_type1 WHERE id = $t{id}"); if ( $t{gname_id} ne 'NULL' ) { ($t{gname},$t{gmemo}) = $self->dbh->selectrow_array("SELECT name, memo FROM main_name1 WHERE id = $t{gname_id}"); } if ( $t{maker_id} ne 'NULL' ) { ($t{maker},$t{makers}) = $self->dbh->selectrow_array("SELECT name, memo FROM main_maker1 WHERE id = $t{maker_id}"); } # HTMLファイルに出力 $t{html} = $t{q}->param("tmpl"); $t{html} = $t{html} . '.htm'; $template = $self->load_tmpl("$t{html}") || die "error loading tmpl"; $template->param(id => $t{id}); $template->param(gname_id => $t{gname_id}); $template->param(maker_id => $t{maker_id}); $template->param(gname => $t{gname}); $template->param(gmemo => $t{gmemo}); $template->param(maker => $t{maker}); $template->param(makers => $t{makers}); $template->param(name => $t{name}); $template->param(series => $t{series}); return $template->output; } 1;

mscengine_data.htm,输入开始画面

<HTML> <HEAD> <META http-equiv="Content-Type" content="text/html; charset=UTF-8"> <TITLE>主機データ入力</TITLE> <style type="text/css"> body { background: lightcyan; color:black; margin-left:2em;margin-right:2em;} </style> </HEAD> <BODY> <center> <h2>主機データ入力</h2></center> mode:mscengine_data <form action="" method="post"> <input type="submit" value="主機タイプ(main_type1)とパーツデータへ戻る"><p> <input type="hidden" name="tmpl" value="msc261"> <input type="hidden" name="table" value="main_type1"> <input type="hidden" name="items" value="id,name,series,memo"> <input type="hidden" name="rm" value="modeshowall"> </form> <hr color="#003366"> <center> <form action="" method="post"> <input type="submit" value="パーツ入力"><p> <input type="hidden" name="tmpl" value="mscparts_start"> <input type="hidden" name="id" value="<TMPL_VAR NAME="id">"> <input type="hidden" name="name" value="<TMPL_VAR NAME="name">"> <input type="hidden" name="series" value="<TMPL_VAR NAME="series">"> <input type="hidden" name="partsname" value="END"> <input type="hidden" name="partscode" value="END"> <input type="hidden" name="rm" value="modeparts_start"> </form> </center> id=><TMPL_VAR NAME="id">,主機タイプ=><TMPL_VAR NAME="name">,series=><TMPL_VAR NAME="series"><br> <center> <table width=85% align="center" border=1 cellpadding=5> <tr bgcolor=white align="center"> <th width=10%>ID</th> <th width=40%>Main Ship Equipment</th> <th width=40%>memo</th> <th width=10%>選択</th> </tr> <tr bgcolor=cyan> <td><TMPL_VAR NAME="gname_id"></td> <td><TMPL_VAR NAME="gname"></td> <td><TMPL_VAR NAME="gmemo"></td> <td> <form action="" method="post"> <input type="submit" value="選択"><p> <input type="hidden" name="tmpl" value="mscengine_nm"> <input type="hidden" name="table" value="main_name1"> <input type="hidden" name="title" value="name"> <input type="hidden" name="item" value="gname_id"> <input type="hidden" name="id" value="<TMPL_VAR NAME="id">"> <input type="hidden" name="name" value="<TMPL_VAR NAME="name">"> <input type="hidden" name="series" value="<TMPL_VAR NAME="series">"> <input type="hidden" name="rm" value="modeengine_nm"> </form> </td> </tr> </table> </center> <br> <table> <tr bgcolor="white"> <table width=85% align="center" border=1 cellpadding=5> <tr bgcolor=white align="center"> <th width=10%>ID</th> <th width=40%>Main Marine Manufacturer</th> <th width=40%>memo</th> <th width=10%>選択</th> </tr> <tr bgcolor=cyan> <td><TMPL_VAR NAME="maker_id"></td> <td><TMPL_VAR NAME="maker"></td> <td><TMPL_VAR NAME="makers"></td> <td> <form action="" method="post"> <input type="submit" value="選択"><p> <input type="hidden" name="tmpl" value="mscengine_nm"> <input type="hidden" name="table" value="main_maker1"> <input type="hidden" name="title" value="maker"> <input type="hidden" name="item" value="maker_id"> <input type="hidden" name="id" value="<TMPL_VAR NAME="id">"> <input type="hidden" name="name" value="<TMPL_VAR NAME="name">"> <input type="hidden" name="series" value="<TMPL_VAR NAME="series">"> <input type="hidden" name="rm" value="modeengine_nm"> </form> </td> </tr> </table> </center> <hr color="#003366"> <h4><TMPL_VAR NAME="DWG"></h4> <form action="" method="post"> <input type="submit" value="DWG追加"><p> <input type="hidden" name="tmpl" value="mscengine_dwg"> <input type="hidden" name="item" value="DWG"> <input type="hidden" name="id" value="<TMPL_VAR NAME="id">"> <input type="hidden" name="name" value="<TMPL_VAR NAME="name">"> <input type="hidden" name="series" value="<TMPL_VAR NAME="series">"> <input type="hidden" name="rm" value="modeengine_gd_add"> </form> <h4><TMPL_VAR NAME="GR"></h4> <form action="" method="post"> <input type="submit" value="GR追加"><p> <input type="hidden" name="tmpl" value="mscengine_gr"> <input type="hidden" name="item" value="GR"> <input type="hidden" name="id" value="<TMPL_VAR NAME="id">"> <input type="hidden" name="name" value="<TMPL_VAR NAME="name">"> <input type="hidden" name="series" value="<TMPL_VAR NAME="series">"> <input type="hidden" name="rm" value="modeengine_gd_add"> </form> <hr color="#003366"> </BODY> </HTML>

mscengine_gd_add.pl,GR/DWG管理开始画面程序

sub mscengine_gd_add { my $self = shift; my(%t,@loop,$n); # Get CGI query object $t{q} = $self->query(); $t{html} = $t{q}->param("tmpl"); $t{item} = $t{q}->param("item"); $t{id} = $t{q}->param("id"); $t{name} = $t{q}->param("name"); $t{series} = $t{q}->param("series"); # 零件表格名 $t{ptable} = sprintf("%06d",$t{id}); $t{ptable} = 'a' . $t{ptable}; # 現在のGR/DWGを読む $t{GR} = $self->dbh->selectrow_array("SELECT $t{item} FROM main_type1 WHERE id = $t{id}"); @{ $t{GRs} } = split(/==/,$t{GR}); @loop = (); for $n ( 1 .. $#{ $t{GRs} } ) { my %row = ( id => $t{id}, name => $t{name}, series => $t{series}, NO => $n, ptable => $t{ptable}, content => $t{GRs}[$n] ); push(@loop, \%row); } $t{html} = $t{html} . '.htm'; $t{template} = $self->load_tmpl("$t{html}") || die "error loading tmpl"; $t{template}->param(id => $t{id}); $t{template}->param(name => $t{name}); $t{template}->param(series => $t{series}); $t{template}->param(GRLOOP => \@loop); return $t{template}->output; } 1;

mscengine_gr.htm,GR管理画面

<HTML> <HEAD> <META http-equiv="Content-Type" content="text/html; charset=UTF-8"> <TITLE>主機テーブルのGROUPの追加と修正</TITLE> <style type="text/css"> body { background: lightcyan; color:black; margin-left:2em;margin-right:2em;} </style> </HEAD> <BODY> <center> <h2>主機テーブルのGROUPの追加と修正</h2></center> mode:mscengine_gr <form action="" method="post"> <input type="submit" value="主機データ追加へ戻る"><p> <input type="hidden" name="tmpl" value="mscengine_data"> <input type="hidden" name="id" value="<TMPL_VAR NAME="id">"> <input type="hidden" name="name" value="<TMPL_VAR NAME="name">"> <input type="hidden" name="series" value="<TMPL_VAR NAME="series">"> <input type="hidden" name="rm" value="modeengine_data"> </form> <hr color="#003366"> id==><TMPL_VAR NAME="id">,name==><TMPL_VAR NAME="name">,series==><TMPL_VAR NAME="series"><br> <table> <tr bgcolor=white> <th>NO</th> <th>name</th> <th>GR修正</th> <th>パーツのGR選択</th> </tr> <TMPL_LOOP NAME="GRLOOP"> <tr bgcolor=cyan> <td><TMPL_VAR NAME="NO"></td> <td><TMPL_VAR NAME="content"></td> <td> <form action="" method="post"> <input type="submit" value="GR修正"><p> <input type="hidden" name="tmpl" value="mscengine_gd_add2"> <input type="hidden" name="id" value="<TMPL_VAR NAME="id">"> <input type="hidden" name="NO" value="<TMPL_VAR NAME="NO">"> <input type="hidden" name="name" value="<TMPL_VAR NAME="name">"> <input type="hidden" name="series" value="<TMPL_VAR NAME="series">"> <input type="hidden" name="item" value="GR"> <input type="hidden" name="content" value="<TMPL_VAR NAME="content">"> <input type="hidden" name="rm" value="modeengine_gd_add2"> </form> </td> <td> <form action="" method="post"> <input type="submit" value="パーツのGR選択"><p> <input type="hidden" name="tmpl" value="mscparts_gd"> <input type="hidden" name="id" value="<TMPL_VAR NAME="id">"> <input type="hidden" name="NO" value="<TMPL_VAR NAME="NO">"> <input type="hidden" name="item" value="GR"> <input type="hidden" name="content" value="<TMPL_VAR NAME="content">"> <input type="hidden" name="name" value="<TMPL_VAR NAME="name">"> <input type="hidden" name="series" value="<TMPL_VAR NAME="series">"> <input type="hidden" name="table" value="<TMPL_VAR NAME="ptable">"> <input type="hidden" name="rm" value="modeparts_gd"> </form> </td> <tr> </TMPL_LOOP> </table> <form action="" method="post"> <textarea name="group" cols="60" rows="10" wrap="hard"> </textarea><br> <input type="submit" value="GR追加"><p> <input type="hidden" name="tmpl" value="mscengine_gd_add3"> <input type="hidden" name="table" value="main_type1"> <input type="hidden" name="item" value="GR"> <input type="hidden" name="id" value="<TMPL_VAR NAME="id">"> <input type="hidden" name="name" value="<TMPL_VAR NAME="name">"> <input type="hidden" name="series" value="<TMPL_VAR NAME="series">"> <input type="hidden" name="rm" value="modeengine_gd_add3"> </form> </BODY> </HTML>

mscengine_dwg.htm,DWG管理画面

<HTML> <HEAD> <META http-equiv="Content-Type" content="text/html; charset=UTF-8"> <TITLE>主機テーブルのDWGの追加と修正</TITLE> <style type="text/css"> body { background:lightcyan; color:black; margin-left:2em;margin-right:2em;} </style> </HEAD> <BODY> <center> <h2>主機テーブルのDWGの追加と修正</h2></center> mode:mscengine_dwg <form action="" method="post"> <input type="submit" value="主機データ追加へ戻る"><p> <input type="hidden" name="tmpl" value="mscengine_data"> <input type="hidden" name="id" value="<TMPL_VAR NAME="id">"> <input type="hidden" name="name" value="<TMPL_VAR NAME="name">"> <input type="hidden" name="series" value="<TMPL_VAR NAME="series">"> <input type="hidden" name="rm" value="modeengine_data"> </form> <hr color="#003366"> id==><TMPL_VAR NAME="id">,name==><TMPL_VAR NAME="name">,series==><TMPL_VAR NAME="series"><br> <table> <tr bgcolor=white> <th>NO</th> <th>name</th> <th>DWG修正</th> <th>パーツのDWG選択</th> </tr> <TMPL_LOOP NAME="GRLOOP"> <tr bgcolor=cyan> <td><TMPL_VAR NAME="NO"></td> <td><TMPL_VAR NAME="content"></td> <td> <form action="" method="post"> <input type="submit" value="DWG修正"><p> <input type="hidden" name="tmpl" value="mscengine_gd_add2"> <input type="hidden" name="id" value="<TMPL_VAR NAME="id">"> <input type="hidden" name="NO" value="<TMPL_VAR NAME="NO">"> <input type="hidden" name="name" value="<TMPL_VAR NAME="name">"> <input type="hidden" name="series" value="<TMPL_VAR NAME="series">"> <input type="hidden" name="item" value="DWG"> <input type="hidden" name="content" value="<TMPL_VAR NAME="content">"> <input type="hidden" name="rm" value="modeengine_gd_add2"> </form> </td> <td> <form action="" method="post"> <input type="submit" value="パーツのDWG選択"><p> <input type="hidden" name="tmpl" value="mscparts_gd"> <input type="hidden" name="id" value="<TMPL_VAR NAME="id">"> <input type="hidden" name="NO" value="<TMPL_VAR NAME="NO">"> <input type="hidden" name="item" value="DWG"> <input type="hidden" name="content" value="<TMPL_VAR NAME="content">"> <input type="hidden" name="name" value="<TMPL_VAR NAME="name">"> <input type="hidden" name="series" value="<TMPL_VAR NAME="series">"> <input type="hidden" name="table" value="<TMPL_VAR NAME="ptable">"> <input type="hidden" name="rm" value="modeparts_gd"> </form> </td> <tr> </TMPL_LOOP> </table> <form action="" method="post"> <textarea name="group" cols="60" rows="10" wrap="hard"> </textarea><br> <input type="submit" value="DWG追加"><p> <input type="hidden" name="tmpl" value="mscengine_gd_add3"> <input type="hidden" name="item" value="DWG"> <input type="hidden" name="id" value="<TMPL_VAR NAME="id">"> <input type="hidden" name="name" value="<TMPL_VAR NAME="name">"> <input type="hidden" name="series" value="<TMPL_VAR NAME="series">"> <input type="hidden" name="rm" value="modeengine_gd_add3"> </form> </BODY> </HTML>

mscengine_gd_add3.pl,GR/DWG追加程序

sub mscengine_gd_add3 { my $self = shift; my(%t,@loop,$n); # Get CGI query object $t{q} = $self->query(); $t{id} = $t{q}->param("id"); $t{group} = $t{q}->param("group"); $t{html} = $t{q}->param("tmpl"); $t{item} = $t{q}->param("item"); $t{name} = $t{q}->param("name"); $t{series} = $t{q}->param("series"); if ( $t{item} eq 'GR' ) { $t{tmpl0} = 'mscengine_gr'; } else { $t{tmpl0} = 'mscengine_dwg'; } $t{html} = $t{html} . '.htm'; $t{template} = $self->load_tmpl("$t{html}") || die "error loading tmpl"; @{ $t{GRs} } = split(/\n/,$t{group}); $t{GR} = ''; for $n ( 0 .. $#{ $t{GRs} } ) { $t{GR} .= '==' . $t{GRs}[$n]; } # 更新GR/DWG $t{sql} = 'UPDATE main_type1 set ' . $t{item} . ' = "'; $t{sql} .= $t{GR} . '" where id = ' . $t{id}; $t{DO} = $self->dbh->do($t{sql}); $t{template}->param(id => $t{id}); $t{template}->param(name => $t{name}); $t{template}->param(series => $t{series}); $t{template}->param(DO => $t{DO}); $t{template}->param(sql => $t{sql}); $t{template}->param(item => $t{item}); $t{template}->param(tmpl0 => $t{tmpl0}); return $t{template}->output; } 1;

mscengine_gd_add3.htm,GR/DWG追加画面

<HTML> <HEAD> <META http-equiv="Content-Type" content="text/html; charset=UTF-8"> <TITLE>主機テーブル項目追加</TITLE> <style type="text/css"> body { background: lightcyan; color:black; margin-left:2em;margin-right:2em;} </style> </HEAD> <BODY> <center> <h2>主機<TMPL_VAR NAME="item">追加</h2></center> mode:modeengine_gd_add3 <form action="" method="post"> <input type="submit" value="<TMPL_VAR NAME="item">画面へ戻る"><p> <input type="hidden" name="tmpl" value="<TMPL_VAR NAME="tmpl0">"> <input type="hidden" name="item" value="<TMPL_VAR NAME="item">"> <input type="hidden" name="id" value="<TMPL_VAR NAME="id">"> <input type="hidden" name="name" value="<TMPL_VAR NAME="name">"> <input type="hidden" name="series" value="<TMPL_VAR NAME="series">"> <input type="hidden" name="rm" value="modeengine_gd_add"> </form> <hr color="#003366"> id==><TMPL_VAR NAME="id"><br> name==><TMPL_VAR NAME="name"><br> series==><TMPL_VAR NAME="series"><br> DO==><TMPL_VAR NAME="DO"><br> sql==><TMPL_VAR NAME="sql"><br> item==><TMPL_VAR NAME="item"><br> tmpl0==><TMPL_VAR NAME="tmpl0"><br> </BODY> </HTML>

mscengine_gd_add2.pl,GR/DWG修改开始程序

sub mscengine_gd_add2 { my $self = shift; my(%t,@loop,$n); # Get CGI query object $t{q} = $self->query(); $t{html} = $t{q}->param("tmpl"); $t{html} = $t{html} . '.htm'; $t{template} = $self->load_tmpl("$t{html}") || die "error loading tmpl"; $t{id} = $t{q}->param("id"); $t{NO} = $t{q}->param("NO"); $t{item} = $t{q}->param("item"); $t{content} = $t{q}->param("content"); $t{name} = $t{q}->param("name"); $t{series} = $t{q}->param("series"); if ( $t{item} eq 'GR' ) { $t{tmpl0} = 'mscengine_gr'; } else { $t{tmpl0} = 'mscengine_dwg'; } # 現在のGR/DWGを読む # $t{GR} = $self->dbh->selectrow_array("SELECT $t{item} FROM main_type1 WHERE id = $t{id}"); # @{ $t{GRs} } = split(/==/,$t{GR}); # @loop = (); # for $n ( 1 .. $#{ $t{GRs} } ) { # if ( $n == $t{NO} ) { # $t{GR1} = $t{GRs}[$n]; # } # } $t{template}->param(id => $t{id}); $t{template}->param(name => $t{name}); $t{template}->param(series => $t{series}); $t{template}->param(NO => $t{NO}); $t{template}->param(item => $t{item}); $t{template}->param(content => $t{content}); $t{template}->param(tmpl0 => $t{tmpl0}); return $t{template}->output; } 1;

mscengine_gd_add2.htm,GR/DWG修改开始画面

<HTML> <HEAD> <META http-equiv="Content-Type" content="text/html; charset=UTF-8"> <TITLE>主機<TMPL_VAR NAME="item">修正</TITLE> <style type="text/css"> body { background: lightcyan; color:black; margin-left:2em;margin-right:2em;} </style> </HEAD> <BODY> <center> <h2>主機<TMPL_VAR NAME="item">修正</h2></center> mode:modeengine_gd_add2 <form action="" method="post"> <input type="submit" value="主機<TMPL_VAR NAME="item">へ戻る"><p> <input type="hidden" name="tmpl" value="<TMPL_VAR NAME="tmpl0">"> <input type="hidden" name="item" value="<TMPL_VAR NAME="item">"> <input type="hidden" name="id" value="<TMPL_VAR NAME="id">"> <input type="hidden" name="name" value="<TMPL_VAR NAME="name">"> <input type="hidden" name="series" value="<TMPL_VAR NAME="series">"> <input type="hidden" name="rm" value="modeengine_gd_add"> </form> <hr color="#003366"> id==><TMPL_VAR NAME="id">,name==><TMPL_VAR NAME="name">,series==><TMPL_VAR NAME="series"><br> <form action="" method="post"> <table> <tr><td>ID</td><td><TMPL_VAR NAME="id"></td></tr> <input type="hidden" name="id" value="<TMPL_VAR NAME="id">"> <tr><td>name</td><td><input type=text size=100 name="content" value="<TMPL_VAR NAME="content">"></td></tr> <input type="hidden" name="content" value=""> </table> <input type="submit" value="决定"><br> 按下决定后,完成修改。 <input type="hidden" name="tmpl" value="mscengine_gd_add21"> <input type="hidden" name="id" value="<TMPL_VAR NAME="id">"> <input type="hidden" name="NO" value="<TMPL_VAR NAME="NO">"> <input type="hidden" name="item" value="<TMPL_VAR NAME="item">"> <input type="hidden" name="content" value="<TMPL_VAR NAME="content">"> <input type="hidden" name="name" value="<TMPL_VAR NAME="name">"> <input type="hidden" name="series" value="<TMPL_VAR NAME="series">"> <input type="hidden" name="rm" value="modeengine_gd_add21"> </form> </BODY> </HTML>

mscengine_gd_add21.pl,GR/DWG修改实施程序

sub mscengine_gd_add21 { my $self = shift; my(%t,@loop,$n); # Get CGI query object $t{q} = $self->query(); $t{html} = $t{q}->param("tmpl"); $t{html} = $t{html} . '.htm'; $t{template} = $self->load_tmpl("$t{html}") || die "error loading tmpl"; $t{id} = $t{q}->param("id"); $t{NO} = $t{q}->param("NO"); $t{item} = $t{q}->param("item"); $t{content} = $t{q}->param("content"); $t{name} = $t{q}->param("name"); $t{series} = $t{q}->param("series"); if ( $t{item} eq 'GR' ) { $t{tmpl0} = 'mscengine_gr'; } else { $t{tmpl0} = 'mscengine_dwg'; } # 現在のGR/DWGを読む $t{GR} = $self->dbh->selectrow_array("SELECT $t{item} FROM main_type1 WHERE id = $t{id}"); @{ $t{GRs} } = split(/==/,$t{GR}); $t{GR} = ''; for $n ( 1 .. $#{ $t{GRs} } ) { if ( $n == $t{NO} ) { $t{GR1} = $t{content}; } else { $t{GR1} = $t{GRs}[$n]; } $t{GR} .= '==' . $t{GR1}; } # 更新GR $t{sql} = 'UPDATE main_type1 set ' . $t{item} . ' = "'; $t{sql} .= $t{GR} . '" where id = ' . $t{id}; $t{DO} = $self->dbh->do($t{sql}); $t{template}->param(id => $t{id}); $t{template}->param(name => $t{name}); $t{template}->param(series => $t{series}); $t{template}->param(DO => $t{DO}); $t{template}->param(sql => $t{sql}); $t{template}->param(item => $t{item}); $t{template}->param(tmpl0 => $t{tmpl0}); return $t{template}->output; } 1;

mscengine_gd_add21.htm,GR/DWG修改实施完成画面

<HTML> <HEAD> <META http-equiv="Content-Type" content="text/html; charset=UTF-8"> <TITLE>主機<TMPL_VAR NAME="item">修正実施</TITLE> <style type="text/css"> body { background: lightcyan; color:black; margin-left:2em;margin-right:2em;} </style> </HEAD> <BODY> <center> <h2>主機<TMPL_VAR NAME="item">修正実施</h2></center> mode:modeengine_gd_add21 <form action="" method="post"> <input type="submit" value="主機<TMPL_VAR NAME="item">へ戻る"><p> <input type="hidden" name="tmpl" value="<TMPL_VAR NAME="tmpl0">"> <input type="hidden" name="item" value="<TMPL_VAR NAME="item">"> <input type="hidden" name="id" value="<TMPL_VAR NAME="id">"> <input type="hidden" name="name" value="<TMPL_VAR NAME="name">"> <input type="hidden" name="series" value="<TMPL_VAR NAME="series">"> <input type="hidden" name="rm" value="modeengine_gd_add"> </form> <hr color="#003366"> id==><TMPL_VAR NAME="id">,name==><TMPL_VAR NAME="name">,series==><TMPL_VAR NAME="series"><br> DO==><TMPL_VAR NAME="DO"><br> sql==><TMPL_VAR NAME="sql"><br> </BODY> </HTML>

mscparts_gd.pl,GR/DWG的Parts选择开始画面程序

sub mscparts_gd { my $self = shift; my(%t,@loop,$n,@rec); # Get CGI query object $t{q} = $self->query(); $t{html} = $t{q}->param("tmpl"); $t{html} = $t{html} . '.htm'; $t{template} = $self->load_tmpl("$t{html}") || die "error loading tmpl"; $t{id} = $t{q}->param("id"); $t{GNO} = $t{q}->param("NO"); $t{table} = $t{q}->param("table"); $t{item} = $t{q}->param("item"); $t{content} = $t{q}->param("content"); $t{name} = $t{q}->param("name"); $t{series} = $t{q}->param("series"); # パーツテーブルを読む $t{sth} = $self->dbh->prepare("SELECT id,name,code,group_id,dwg_id FROM $t{table}"); $t{sth}->execute; while ( @rec = $t{sth}->fetchrow_array ) { $t{NO} = 'ss' . $rec[0]; my %row = ( NO => $t{NO}, id => $rec[0], name => $rec[1], code => $rec[2], group_id => $rec[3], dwg_id => $rec[4] ); push(@loop, \%row); } $t{sth}->finish; if ( $t{item} eq 'GR' ) { $t{tmpl0} = 'mscengine_gr'; } else { $t{tmpl0} = 'mscengine_dwg'; } $t{template}->param(LOOP => \@loop); $t{template}->param(id => $t{id}); $t{template}->param(name => $t{name}); $t{template}->param(series => $t{series}); $t{template}->param(GNO => $t{GNO}); $t{template}->param(table => $t{table}); $t{template}->param(item => $t{item}); $t{template}->param(tmpl0 => $t{tmpl0}); $t{template}->param(content => $t{content}); return $t{template}->output; } 1;

mscparts_gd.htm,GR/DWG的Parts选择开始画面

<HTML> <HEAD> <META http-equiv="Content-Type" content="text/html; charset=UTF-8"> <TITLE>Partsの<TMPL_VAR NAME="item">選択</TITLE> <style type="text/css"> body { background: lightcyan; color:black; margin-left:2em;margin-right:2em;} </style> </HEAD> <BODY> <center> <h2>Partsの<TMPL_VAR NAME="item">選択</h2></center> mode:modeparts_gd <form action="" method="post"> <input type="submit" value="<TMPL_VAR NAME="item">の追加と修正へ戻る"><p> <input type="hidden" name="tmpl" value="<TMPL_VAR NAME="tmpl0">"> <input type="hidden" name="table" value="main_type1"> <input type="hidden" name="item" value="<TMPL_VAR NAME="item">"> <input type="hidden" name="id" value="<TMPL_VAR NAME="id">"> <input type="hidden" name="name" value="<TMPL_VAR NAME="name">"> <input type="hidden" name="series" value="<TMPL_VAR NAME="series">"> <input type="hidden" name="rm" value="modeengine_gd_add"> </form> <hr color="#003366"> id=><TMPL_VAR NAME="id">,name=><TMPL_VAR NAME="name">,series=><TMPL_VAR NAME="series"><br> table=><TMPL_VAR NAME="table"><br> <h3><TMPL_VAR NAME="item">=><TMPL_VAR NAME="content">=<TMPL_VAR NAME="GNO"></h3> <table> <tr bgcolor="white"> <th> チェックボックス </th> <th>ID</th> <th>name</th> <th>code</th> <th>group_id</th> <th>dwg_id</th> </tr> <form action="" method="post"> <TMPL_LOOP NAME="LOOP"> <tr bgcolor=cyan> <td> <INPUT TYPE="checkbox" NAME="<TMPL_VAR NAME="NO">"> </td> <td><TMPL_VAR NAME="id"></td> <td><TMPL_VAR NAME="name"></td> <td><TMPL_VAR NAME="code"></td> <td><TMPL_VAR NAME="group_id"></td> <td><TMPL_VAR NAME="dwg_id"></td> </tr> </TMPL_LOOP> </table> <input type="submit" value="確定"><p> <input type="hidden" name="table" value="<TMPL_VAR NAME="table">"> <input type="hidden" name="id" value="<TMPL_VAR NAME="id">"> <input type="hidden" name="GNO" value="<TMPL_VAR NAME="GNO">"> <input type="hidden" name="item" value="<TMPL_VAR NAME="item">"> <input type="hidden" name="name" value="<TMPL_VAR NAME="name">"> <input type="hidden" name="series" value="<TMPL_VAR NAME="series">"> <input type="hidden" name="tmpl" value="mscparts_gd1"> <input type="hidden" name="rm" value="modeparts_gd1"> </form> </BODY> </HTML>

mscparts_gd1.pl,GR/DWG的Parts选择实施画面程序

sub mscparts_gd1 { my $self = shift; my(%t,@loop,$n,@rec); # Get CGI query object $t{q} = $self->query(); $t{html} = $t{q}->param("tmpl"); $t{item} = $t{q}->param("item"); $t{name} = $t{q}->param("name"); $t{series} = $t{q}->param("series"); $t{GNO} = $t{q}->param("GNO"); $t{html} = $t{html} . '.htm'; $t{template} = $self->load_tmpl("$t{html}") || die "error loading tmpl"; $t{id} = $t{q}->param("id"); $t{table} = $t{q}->param("table"); # パーツ数を取得 $t{sth} = $self->dbh->prepare("SELECT id FROM $t{table}"); $t{sth}->execute; $t{s} = ''; while ( @rec = $t{sth}->fetchrow_array ) { $t{NO} = 'ss' . $rec[0]; $t{s1} = $t{q}->param($t{NO}); push(@{ $t{slist} },$t{s1}); } $t{sth}->finish; if ( $t{item} eq 'GR' ) { $t{item1} = 'group_id'; } else { $t{item1} = 'dwg_id'; } # GR/DWGを書く for $n ( 0 .. $#{ $t{slist} } ) { $t{id1} = $n + 1; if ( $t{slist}[$n] eq 'on' ) { $t{sql} = 'UPDATE ' . $t{table} . ' set ' . $t{item1} . ' = "'; $t{sql} .= $t{GNO} . '" where id = ' . $t{id1}; $t{DO} = $self->dbh->do($t{sql}); } } if ( $t{item} eq 'GR' ) { $t{tmpl0} = 'mscengine_gr'; } else { $t{tmpl0} = 'mscengine_dwg'; } $t{template}->param(id => $t{id}); $t{template}->param(item => $t{item}); $t{template}->param(name => $t{name}); $t{template}->param(series => $t{series}); $t{template}->param(GNO => $t{GNO}); $t{template}->param(DO => $t{DO}); $t{template}->param(tmpl0 => $t{tmpl0}); return $t{template}->output; } 1;

mscparts_gd1.htm,GR/DWG的Parts选择实施完成画面

<HTML> <HEAD> <META http-equiv="Content-Type" content="text/html; charset=UTF-8"> <TITLE><TMPL_VAR NAME="item">選択完了</TITLE> <style type="text/css"> body { background: lightcyan; color:black; margin-left:2em;margin-right:2em;} </style> </HEAD> <BODY> <center> <h2><TMPL_VAR NAME="item">選択完了</h2></center> mode:modeparts_gd1 <form action="" method="post"> <input type="submit" value="<TMPL_VAR NAME="item">の追加と修正へ戻る"><p> <input type="hidden" name="tmpl" value="<TMPL_VAR NAME="tmpl0">"> <input type="hidden" name="table" value="main_type1"> <input type="hidden" name="item" value="<TMPL_VAR NAME="item">"> <input type="hidden" name="id" value="<TMPL_VAR NAME="id">"> <input type="hidden" name="name" value="<TMPL_VAR NAME="name">"> <input type="hidden" name="series" value="<TMPL_VAR NAME="series">"> <input type="hidden" name="rm" value="modeengine_gd_add"> </form> <hr color="#003366"> id==><TMPL_VAR NAME="id">,name==><TMPL_VAR NAME="name">,series==><TMPL_VAR NAME="series"><br> GNO==><TMPL_VAR NAME="GNO"><br> DO==><TMPL_VAR NAME="DO"><br> </BODY> </HTML>
戻る