MySQL操作程序四十八(mscs_engine.pl,主機項目檢索)
返回
mscengine_add.pl,mscengine_add.htm
- 追加ptable失敗時,需要重新回到mscengine_add的畫面重新輸入
- 沒有"name"輸入時,不應(yīng)該生成TABLE!(在mscs_engine的畫面上可以修改,可以修改)
沒有ptable,為什么要刪除?
# $t{sql} = 'DROP TABLE IF EXISTS ' . $t{ptable} . ';';
# $self->dbh->do($t{sql});
mysql> drop table a009291;
Query OK, 0 rows affected (1.20 sec)
-------------------------------------------------------
編輯mscu_engine2.htm==>參照mscs_engine.htm
copy mscenq1_parts22.htm mscu_engine2.htm
程序邏輯
1.type1id是一個的情況
a.等于'B'
b.partsid不等于'C'
2.type1id是一個以上的情況
a.最后一個partsid不等于'C'
==>允許輸入主機
生成不允許輸入時返回用的"HTML"文件
$t{NG} = 1;
# 讀enq1_id
($t{type1id1},$t{partsid1}) = $self->dbh->selectrow_array("SELECT type1id, partsid FROM enq1 WHERE id = $t{enq1_id}");
@{ $t{type1ids} } = split(/==/,$t{type1id1});
@{ $t{partsids} } = split(/==/,$t{partsid1});
if ( $#{ $t{type1ids} } == 0 ) {
if ( $t{type1ids}[0] eq 'B' ) {
$t{NG} = 0;
} else {
if ( $t{partsids}[0] ne 'C' ) {
$t{NG} = 0;
}
}
} else {
if ( $t{partsids}[$#{ $t{partsids} }] ne 'C' ) {
$t{NG} = 0;
}
}
if ( $t{NG} == 1 ) {
$t{template} = $self->load_tmpl("mscu_engine2.htm") || die "error loading tmpl";
$t{template}->param(pro => "mscs_engine.pl");
$t{template}->param(mode => $t{mode});
# $t{template}->param(mode => $t{partsids}[$#{ $t{partsids} }]);
$t{template}->param(enq1_id => $t{enq1_id});
return $t{template}->output;
}
狀態(tài)1,沒有主機,沒有零件
---------------------------------------------------------------
mysql> select * from enq1 where id = 12398\G
*************************** 1. row ***************************
id: 12398
time: 2012-01-16
ourref: C011601
owner: 1
ownerno: NULL
hullnoid: 1
type1id: B
partsid: C
QTY: C
memo: NULL
LANGUAGEid: 1
makerid: 1
enq2s: 13948
seriesid: C
tmp_pname: NULL
tmp_pcode: NULL
tmp_pqty: NULL
1 row in set (0.00 sec)
狀態(tài)2,有一臺主機,沒有零件
---------------------------------------------------------------
mysql> select * from enq1 where id = 12398\G
*************************** 1. row ***************************
id: 12398
time: 2012-01-16
ourref: C011601
owner: 1
ownerno: NULL
hullnoid: 1
type1id: 396
partsid: C
QTY: C
memo: NULL
LANGUAGEid: 1
makerid: 1
enq2s: 13948
seriesid: 1
tmp_pname: NULL
tmp_pcode: NULL
tmp_pqty: NULL
1 row in set (0.00 sec)
狀態(tài)3,有2臺主機,沒有零件 程序修改:在第一臺主機的零件沒有輸入的情況下,不允許第二臺主機的輸入!
---------------------------------------------------------------
mysql> select * from enq1 where id = 12398\G
*************************** 1. row ***************************
id: 12398
time: 2012-01-16
ourref: C011601
owner: 1
ownerno: NULL
hullnoid: 1
type1id: 396==960
partsid: C==C
QTY: C==C
memo: NULL
LANGUAGEid: 1
makerid: 1
enq2s: 13948
seriesid: 1==1
tmp_pname: NULL
tmp_pcode: NULL
tmp_pqty: NULL
1 row in set (0.00 sec)
返回
行唐县|
抚松县|
株洲市|
潢川县|
伊金霍洛旗|
兴安县|
武乡县|
光山县|
云南省|
双牌县|
闸北区|
廊坊市|
韶关市|
柯坪县|
桐城市|
卓尼县|
普兰店市|
崇信县|
嵊州市|
桐梓县|
大厂|
林西县|
阜南县|
潞西市|
隆德县|
盐山县|
安多县|
武山县|
阳曲县|
嘉定区|
黔东|
英吉沙县|
武鸣县|
白河县|
黎平县|
兴仁县|
阳东县|
云梦县|
石阡县|
临武县|
南通市|