選擇復數(shù)個項目的界面和程序
戻る
mscparts_gd.pl
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{name} = $t{q}->param("name");
# パーツテーブルを読む
$t{sth} = $self->dbh->prepare("SELECT id, name, code 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]
);
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(GNO => $t{GNO});
$t{template}->param(table => $t{table});
$t{template}->param(item => $t{item});
$t{template}->param(tmpl0 => $t{tmpl0});
$t{template}->param(name => $t{name});
return $t{template}->output;
}
1;
mscparts_gd.htm
Partsの選択
Partsの選択
mode:modeparts_gd
id=>
table=>
=>
">
">
">
">
mscparts_gd1.pl
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{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");
# パーツ數(shù)を取得
$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(GNO => $t{GNO});
$t{template}->param(DO => $t{DO});
$t{template}->param(tmpl0 => $t{tmpl0});
return $t{template}->output;
}
1;
mscparts_gd1.htm
選択完了
選択完了
mode:modeparts_gd1
id==>
GNO==>
DO==>
戻る
墨玉县|
常山县|
左贡县|
大关县|
五华县|
新疆|
玉树县|
汤阴县|
岗巴县|
绍兴市|
德州市|
竹山县|
安溪县|
绥宁县|
商河县|
平和县|
临西县|
营山县|
远安县|
穆棱市|
锦州市|
曲周县|
霍城县|
平乡县|
安阳县|
鹿泉市|
潼南县|
厦门市|
鄯善县|
阳春市|
抚顺县|
高雄县|
沙洋县|
定安县|
通州市|
隆回县|
平果县|
子洲县|
珲春市|
小金县|
二连浩特市|