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});
}
同一张单子不能输入相同的TYPE!
同一张单子不能输入相同的TYPE!
mode:mscs_engine1
enq1_id=>
TYPE编号==>
返回