数据库DWG输入程序与界面

戻る

DWG输入(mscenq1_dwg1.pl)

sub mscenq1_dwg1 { my $self = shift; my(%t,@rec,@loop,$n); # Get CGI query object $t{q} = $self->query(); $t{NE1} = $t{q}->param("NE1"); $t{enq1_id} = $t{q}->param("enq1_id"); $t{main_type1id} = $t{q}->param("main_type1id"); $t{name1} = $t{q}->param("name1"); $t{dwg1} = $t{q}->param("dwg1"); $t{dwg2} = $t{q}->param("dwg2"); $t{template} = $self->load_tmpl('mscenq1_dwg1.htm') || die "error loading tmpl"; # 如果有dwg1,就采用dwg1 $t{DWG1} = $self->dbh->selectrow_array("SELECT DWG FROM main_type1 WHERE id = $t{main_type1id}"); @{ $t{DWGs} } = split(/=/,$t{DWG1}); $t{DWG0_id} = $#{ $t{DWGs} } + 2; if ( $t{dwg1} ) { $t{template}->param(DWG0 => $t{dwg1}); # 把输入的数据写入DB中 $t{DWG1} .= '=' . $t{dwg1}; $t{sql} = 'UPDATE main_type1 SET DWG = "'; $t{sql} .= $t{DWG1} . '" WHERE id = ' . $t{main_type1id}; $t{DO} = $self->dbh->do($t{sql}); } else { $t{template}->param(DWG0 => $t{dwg2}); for $n ( 0 .. $#{ $t{DWGs} } ) { if ( $t{DWGs}[$n] eq $t{dwg2} ) { $t{DWG0_id} = $n + 1; last; } } } $t{template}->param(DWG0_id => $t{DWG0_id}); $t{template}->param(dwg1 => $t{dwg1}); $t{template}->param(dwg2 => $t{dwg2}); $t{template}->param(NE1 => $t{NE1}); $t{template}->param(enq1_id => $t{enq1_id}); $t{template}->param(main_type1id => $t{main_type1id}); $t{template}->param(name1 => $t{name1}); $t{template}->param(pro => "mscenq1_dwg1.pl"); return $t{template}->output; } 1;

mscenq1_dwg1.htm

<HTML> <HEAD> <META http-equiv="Content-Type" content="text/html; charset=UTF-8"> <TITLE>enq1_dwg1(DWG输入或选择)</TITLE> <style type="text/css"> body { background: lightcyan; color:black; margin-left:2em;margin-right:2em;} </style> </HEAD> <BODY> <center> <h2>enq1_dwg1(DWG输入或选择)</h2></center> mode:modeenq1_dwg1 <form action="" method="post"> <input type="submit" value="mscenq1_parts1へ戻る"><p> <input type="hidden" name="id" value="<TMPL_VAR NAME="enq1_id">"> <input type="hidden" name="NE1" value="<TMPL_VAR NAME="NE1">"> <input type="hidden" name="enq1_id" value="<TMPL_VAR NAME="enq1_id">"> <input type="hidden" name="main_type1id" value="<TMPL_VAR NAME="main_type1id">"> <input type="hidden" name="name1" value="<TMPL_VAR NAME="name1">"> <input type="hidden" name="DWG0" value="<TMPL_VAR NAME="DWG0">"> <input type="hidden" name="DWG0_id" value="<TMPL_VAR NAME="DWG0_id">"> <input type="hidden" name="partsname" value="END"> <input type="hidden" name="partscode" value="END"> <input type="hidden" name="partsqty" value="END"> <input type="hidden" name="rm" value="modeenq1_parts1"> </form> <hr color="#003366"> main_type1id=><TMPL_VAR NAME="main_type1id">,主机名=<TMPL_VAR NAME="name1"><br> enq1_id=><TMPL_VAR NAME="enq1_id">,NE1=><TMPL_VAR NAME="NE1"><br> pro=><TMPL_VAR NAME="pro"><br> dwg1==><TMPL_VAR NAME="dwg1"><br> dwg2==><TMPL_VAR NAME="dwg2"><br> DWG0_id==><TMPL_VAR NAME="DWG0_id"><br> DWG0==><TMPL_VAR NAME="DWG0"><br> <hr color="#003366"> </BODY> </HTML>
戻る