MySQL操作程序十四(选择TYPE,mscenq1.pl中的pat="u_engine")

返回

} elsif ( $t{pat} eq 'u_engine' ) { $t{id1} = $t{q}->param("id2"); ($t{old1},$t{new1p},$t{new1q}) = $self->dbh->selectrow_array("SELECT type1id,partsid,QTY FROM enq1 WHERE id = $t{enq1_id}"); if ( $t{old1} eq 'B' ) { $t{new1} = $t{id1}; $t{new1p} = 'C'; $t{new1q} = 'C'; } else { @{ $t{olds} } = split(/==/,$t{old1}); $t{NG} = 0; for $n ( 0 .. $#{ $t{olds} } ) { $t{id1_test} = $t{olds}[$n]; if ( $t{id1_test} == $t{id1} ) { $t{NG} = 1; } } if ( $t{NG} == 1 ) { $t{template} = $self->load_tmpl("mscs_engine1.htm") || die "error loading tmpl"; $t{template}->param(id1 => $t{id1}); $t{template}->param(enq1_id => $t{enq1_id}); return $t{template}->output; } $t{new1} = $t{old1} . '==' . $t{id1}; # $t{new1p} .= '==1'; #取消这儿的加1 # $t{new1q} .= '==1'; $t{new1p} .= '==C'; $t{new1q} .= '==C'; } if ( $t{id1} != 0 ) { $t{sql} = 'UPDATE enq1 set type1id = "'; $t{sql} .= $t{new1} . '" where id = '; $t{sql} .= $t{enq1_id}; $t{DO} = $self->dbh->do($t{sql}); $t{sql} = 'UPDATE enq1 set partsid = "'; $t{sql} .= $t{new1p} . '" where id = '; $t{sql} .= $t{enq1_id}; $t{DO} = $self->dbh->do($t{sql}); $t{sql} = 'UPDATE enq1 set QTY = "'; $t{sql} .= $t{new1q} . '" where id = '; $t{sql} .= $t{enq1_id}; $t{DO} = $self->dbh->do($t{sql}); }
<HTML> <HEAD> <META http-equiv="Content-Type" content="text/html; charset=UTF-8"> <TITLE>同一张单子不能输入相同的TYPE!</TITLE> </HEAD> <BODY bgcolor="#FFFFFF"> <center> <h2>同一张单子不能输入相同的TYPE!</h2></center> <hr color="#003366"> mode:mscs_engine1 enq1_id=><TMPL_VAR NAME="enq1_id"><br> <h3>TYPE编号==><TMPL_VAR NAME="id1"></h3> <form action="" method="post"> <input type="submit" value="返回重新选择"><p> <input type="hidden" name="table" value="main_type1"> <input type="hidden" name="enq1_id" value="<TMPL_VAR NAME="enq1_id">"> <input type="hidden" name="rm" value="modes_engine"> </form> <hr color="#003366"> </BODY> </HTML>
返回