MySQL操作程序二十九(零件单位/图号选择功能)

返回


mscshowpartsone.pl的追加 # 显示DWG图号 @loop1 = (); $t{DWG} = $self->dbh->selectrow_array("SELECT DWG FROM main_type1 WHERE id = $t{tid}"); @{ $t{DWGs} } = split(/=/,$t{DWG}); $t{selected} = $t{loops}{"dwg_id"}; for $n ( 0 .. $#{ $t{DWGs} } ) { $t{ns} = $n + 1; if ($t{ns} == $t{selected}) { $t{list1} = '<option value="' . $t{ns} . '" selected>' . $t{DWGs}[$n] . '</option>' } else { $t{list1} = '<option value="' . $t{ns} . '">' . $t{DWGs}[$n] . '</option>' } my %row = ( list => $t{list1} ); push(@loop1, \%row); } $t{template}->param(LOOP1 => \@loop1); # 单位的LOOP显示 @loop = (); @{ $t{units} } = qw/PCS SET BOX ROLL PAIR CAN DOZ KGS MTR SHT TUBE PKT/; $t{selected} = $t{loops}{"Nuid"}; for $n ( 0 .. $#{ $t{units} } ) { $t{ns} = $n + 1; if ($t{ns} == $t{selected}) { $t{list1} = '<option value="' . $t{ns} . '" selected>' . $t{units}[$n] . '</option>' } else { $t{list1} = '<option value="' . $t{ns} . '">' . $t{units}[$n] . '</option>' } my %row = ( list => $t{list1} ); push(@loop, \%row); } $t{template}->param(LOOP => \@loop); mscparst2.htm 新 <tr><td>dwg_id</td><td> <select name="dwg_id" size=1> <TMPL_LOOP NAME="LOOP1"> <TMPL_VAR NAME="list"> </TMPL_LOOP> </select> <TMPL_VAR NAME="dwg_id"> </td></tr> <tr><td>Nuid</td><td> <select name="Nuid" size=1> <TMPL_LOOP NAME="LOOP"> <TMPL_VAR NAME="list"> </TMPL_LOOP> </select> <TMPL_VAR NAME="Nuid"> </td></tr> 旧 <tr><td>dwg_id</td><td><input type=text size=100 name=dwg_id value="<TMPL_VAR NAME="dwg_id">"></td></tr> <input type="hidden" name="dwg_id" value="<TMPL_VAR NAME="dwg_id">"> <tr><td>Nuid</td><td><input type=text size=100 name=Nuid value="<TMPL_VAR NAME="Nuid">"></td></tr> <input type="hidden" name="Nuid" value="<TMPL_VAR NAME="Nuid">">
返回