MySQL操作程序四十八(mscs_engine.pl,主機項目檢索)

返回


沒有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)
返回
藁城市| 连城县| 安溪县| 苍南县| 双流县| 石家庄市| 宜黄县| 晋江市| 尉氏县| 盱眙县| 肇源县| 贡山| 金平| 泸水县| 高台县| 易门县| 江陵县| 高平市| 福泉市| 莫力| 万年县| 六枝特区| 柏乡县| 定襄县| 弋阳县| 宜黄县| 邵阳市| 蓬溪县| 云南省| 镇康县| 井陉县| 房产| 南丰县| 云浮市| 聂拉木县| 阳西县| 青田县| 常熟市| 桐庐县| 积石山| 丘北县|