数据库DWG输入程序与界面
戻る
DWG输入(mscenq1_dwg1.pl)
sub mscenq1_dwg1 {
my $self = shift;
my(%t,@rec,@loop,$n);
# Get CGI query object
$t{q} = $self->query();
$t{NE1} = $t{q}->param("NE1");
$t{enq1_id} = $t{q}->param("enq1_id");
$t{main_type1id} = $t{q}->param("main_type1id");
$t{name1} = $t{q}->param("name1");
$t{dwg1} = $t{q}->param("dwg1");
$t{dwg2} = $t{q}->param("dwg2");
$t{template} = $self->load_tmpl('mscenq1_dwg1.htm') || die "error loading tmpl";
# 如果有dwg1,就采用dwg1
$t{DWG1} = $self->dbh->selectrow_array("SELECT DWG FROM main_type1 WHERE id = $t{main_type1id}");
@{ $t{DWGs} } = split(/=/,$t{DWG1});
$t{DWG0_id} = $#{ $t{DWGs} } + 2;
if ( $t{dwg1} ) {
$t{template}->param(DWG0 => $t{dwg1});
# 把输入的数据写入DB中
$t{DWG1} .= '=' . $t{dwg1};
$t{sql} = 'UPDATE main_type1 SET DWG = "';
$t{sql} .= $t{DWG1} . '" WHERE id = ' . $t{main_type1id};
$t{DO} = $self->dbh->do($t{sql});
} else {
$t{template}->param(DWG0 => $t{dwg2});
for $n ( 0 .. $#{ $t{DWGs} } ) {
if ( $t{DWGs}[$n] eq $t{dwg2} ) {
$t{DWG0_id} = $n + 1;
last;
}
}
}
$t{template}->param(DWG0_id => $t{DWG0_id});
$t{template}->param(dwg1 => $t{dwg1});
$t{template}->param(dwg2 => $t{dwg2});
$t{template}->param(NE1 => $t{NE1});
$t{template}->param(enq1_id => $t{enq1_id});
$t{template}->param(main_type1id => $t{main_type1id});
$t{template}->param(name1 => $t{name1});
$t{template}->param(pro => "mscenq1_dwg1.pl");
return $t{template}->output;
}
1;
mscenq1_dwg1.htm
enq1_dwg1(DWG输入或选择)
enq1_dwg1(DWG输入或选择)
mode:modeenq1_dwg1
main_type1id=>,主机名=
enq1_id=>,NE1=>
pro=>
dwg1==>
dwg2==>
DWG0_id==>
DWG0==>
戻る