選擇人機(jī)界面的簡便化
戻る
新程序:直接按選擇鍵選擇
mscengine_nm.pl
sub mscengine_nm {
my $self = shift;
my(%t,$q,$template,$table,@rec);
# Get CGI query object
$q = $self->query();
$t{html} = $q->param("tmpl");
$t{html} = $t{html} . '.htm';
$template = $self->load_tmpl("$t{html}") || die "error loading tmpl";
$t{id} = $q->param("id");
$t{name} = $q->param("name");
$t{series} = $q->param("series");
$t{title} = $q->param("title");
$t{table} = $q->param("table");
$t{item} = $q->param("item");
$t{sth} = $self->dbh->prepare("SELECT id,name,memo FROM $t{table}");
$t{sth}->execute;
while ( @rec = $t{sth}->fetchrow_array ) {
my $row_ref = (); # この初期化はとても重要!
$$row_ref{id} = $rec[0];
$$row_ref{mname} = $rec[1];
$$row_ref{memo} = $rec[2];
$$row_ref{title} = $t{title};
$$row_ref{aid} = $t{id};
$$row_ref{name} = $t{name};
$$row_ref{series} = $t{series};
$$row_ref{item} = $t{item};
push(@loop, $row_ref);
}
$t{sth}->finish;
$template->param(THIS_LOOP => \@loop);
$template->param(aid => $t{id});
$template->param(name => $t{name});
$template->param(series => $t{series});
return $template->output;
}
1;
mscengine_nm.htm
主機(jī)の選択
主機(jī)の選択
mode:modeengine_nm
aid==>
name==>
series==>
老程序:先用radio點(diǎn)擊選出,然后在回到最上面按選擇
mscengine_nm.pl
sub mscengine_nm {
my $self = shift;
my(%t,$q,$template,$table,@rec);
# Get CGI query object
$q = $self->query();
$t{html} = $q->param("tmpl");
$t{html} = $t{html} . '.htm';
$template = $self->load_tmpl("$t{html}") || die "error loading tmpl";
$t{id} = $q->param("id");
$t{name} = $q->param("name");
$t{series} = $q->param("series");
$t{title} = $q->param("title");
$t{table} = $q->param("table");
$t{item} = $q->param("item");
$t{sth} = $self->dbh->prepare("SELECT id,name FROM $t{table}");
$t{sth}->execute;
while ( @rec = $t{sth}->fetchrow_array ) {
my $row_ref = (); # この初期化はとても重要!
$$row_ref{id} = $rec[0];
$$row_ref{Line} = $rec[1];
push(@loop, $row_ref);
}
$t{sth}->finish;
$template->param(aid => $t{id});
$template->param(name => $t{name});
$template->param(series => $t{series});
$template->param(title => $t{title});
$template->param(item => $t{item});
$template->param(THIS_LOOP => \@loop);
return $template->output;
}
1;
mscengine_nm.htm
主機(jī)の選択
主機(jī)の選択
mode:modeengine_nm
aid==>
name==>
series==>
mscengine_nm1.pl
sub mscengine_nm1 {
my $self = shift;
my(%t,$q,$template,$table,@rec);
# Get CGI query object
$q = $self->query();
$t{html} = $q->param("tmpl");
$t{html} = $t{html} . '.htm';
$template = $self->load_tmpl("$t{html}") || die "error loading tmpl";
$t{title} = $q->param("title");
$t{aid} = $q->param("aid");
$t{id} = $q->param("id");
$t{name} = $q->param("name");
$t{series} = $q->param("series");
$t{item} = $q->param("item");
$t{sql} = 'UPDATE main_type1 set ' . $t{item} . ' = "';
$t{sql} .= $t{id} . '" where id = ' . $t{aid};
$t{DO} = $self->dbh->do($t{sql});
$template->param(aid => $t{aid});
$template->param(id => $t{id});
$template->param(name => $t{name});
$template->param(series => $t{series});
$template->param(sql => $t{sql});
$template->param(DO => $t{DO});
$template->param(title => $t{title});
return $template->output;
}
1;
mscengine_nm1.htm
主機(jī)の選択確定
主機(jī)の選択確定
mode:modeengine_nm1
aid==>
id==>
name==>
series==>
sql==>
DO==>
戻る
南投市|
平乐县|
兰溪市|
基隆市|
东城区|
徐水县|
准格尔旗|
永康市|
台中县|
安阳县|
佛学|
保靖县|
承德市|
星子县|
鹤庆县|
五莲县|
龙山县|
仲巴县|
鄂托克旗|
沈丘县|
罗城|
兴城市|
德州市|
蓝田县|
黑河市|
巨野县|
郴州市|
绥江县|
吉木乃县|
遂昌县|
韶山市|
易门县|
兰州市|
留坝县|
盈江县|
定边县|
门源|
台中县|
青海省|
同德县|
奇台县|