diff --git a/wms/cont/sign_list.php b/wms/cont/sign_list.php index 9b111a85..db39721b 100644 --- a/wms/cont/sign_list.php +++ b/wms/cont/sign_list.php @@ -76,9 +76,9 @@ status, f_return_content('payment_kind',payment_kind ) payment_kind FROM $table where 1=1 $where ORDER BY vol_no"; $data = mysqli_query($link, $sql); -echo '
';
-print_r($sql);
-echo '
'; +// echo '
';
+// print_r($sql);
+// echo '
'; ?> diff --git a/wms/contract/api/postContractData.php b/wms/contract/api/postContractData.php index f1f347e9..16feeaf0 100644 --- a/wms/contract/api/postContractData.php +++ b/wms/contract/api/postContractData.php @@ -354,6 +354,8 @@ function T8insert($data, $facilityno) $contract_end_date = !empty($data['contract_end_date']) ? $data['contract_end_date'] : null; $num = !empty($data['num']) ? $data['num'] : null; // 電梯數量 $elevators = !empty($data['elevators']) ? json_decode($data['elevators'], true) : []; //電梯 + $area = !empty($_POST['area']) ? $_POST['area'] : null; //縣市 Ex. A->台北 , B-> ..。 + $user_id = !empty($_POST['user_id']) ? $_POST['user_id'] : null; @@ -368,141 +370,143 @@ function T8insert($data, $facilityno) $createTime = str_replace("-", '', $date); $beginDate = str_replace("-", '', $contract_begin_date); $endDate = str_replace("-", '', $contract_end_date); - // if (empty($result)) { - // 若 客戶資料為空,新增一筆到 comCustomer - // 新增客戶資料 - $sql = "INSERT INTO comBusinessPartner(BizPartnerId,BizPartnerName,BusinessAttr,WorkTelNo,BizToDate,TaxNo,EnterpriseName,ContactAddress,EMail,CreatorId,CreateTime,BizPartnerTypeId) - VALUES(:BizPartnerId,:BizPartnerName,1,:WorkTelNo,99999999,:TaxNo,:EnterpriseName,:ContactAddress,:EMail,:CreatorId,:CreateTime,'10')"; - $stmt = $connT8->prepare($sql); - $stmt->bindParam(':BizPartnerId', $contractno); - $stmt->bindParam(':BizPartnerName', $partyA); - $stmt->bindParam(':WorkTelNo', $phone); - $stmt->bindParam(':TaxNo', $vat); - $stmt->bindParam(':EnterpriseName', $customer); //企業名稱 - $stmt->bindParam(':ContactAddress', $partyAaddress); - $stmt->bindParam(':EMail', $email); - $stmt->bindParam(':CreatorId', $user_id); - $stmt->bindParam(':CreateTime', $createTime); + if (empty($result)) { + // 若 客戶資料為空,新增一筆到 comCustomer + // 新增客戶資料 + $sql = "INSERT INTO comBusinessPartner + (BizPartnerId,BizPartnerName,BusinessAttr,CountryId,WorkTelNo,BizToDate,TaxNo,EnterpriseName,ContactAddress,EMail,CreatorId,CreateTime,BizPartnerTypeId) + VALUES(:BizPartnerId,:BizPartnerName,1,'TW',:WorkTelNo,99999999,:TaxNo,:EnterpriseName,:ContactAddress,:EMail,:CreatorId,:CreateTime,'10')"; + $stmt = $connT8->prepare($sql); + $stmt->bindParam(':BizPartnerId', $contractno); + $stmt->bindParam(':BizPartnerName', $partyA); + $stmt->bindParam(':WorkTelNo', $phone); + $stmt->bindParam(':TaxNo', $vat); + $stmt->bindParam(':EnterpriseName', $customer); //企業名稱 + $stmt->bindParam(':ContactAddress', $partyAaddress); + $stmt->bindParam(':EMail', $email); + $stmt->bindParam(':CreatorId', $user_id); + $stmt->bindParam(':CreateTime', $createTime); - $stmt->execute(); + $stmt->execute(); - $sql = "INSERT INTO comCustomer(OrgId,BizPartnerTypeId,BizPartnerId,PersonId,CreatorId,IsInUsed,InvoiceAddress,CreateTime) - VALUES('1000','10',:BizPartnerId,:PersonId,:CreatorId,1,:InvoiceAddress,:CreateTime)"; - $stmt = $connT8->prepare($sql); + $sql = "INSERT INTO comCustomer(OrgId,BizPartnerTypeId,CurrId,BizPartnerId,PersonId,CreatorId,IsInUsed,InvoiceAddress,CreateTime) + VALUES('1000','10','TWD',:BizPartnerId,:PersonId,:CreatorId,1,:InvoiceAddress,:CreateTime)"; + $stmt = $connT8->prepare($sql); - $stmt->bindParam(':BizPartnerId', $contractno); - $stmt->bindParam(':PersonId', $salesman); - $stmt->bindParam(':CreatorId', $user_id); - $stmt->bindParam(':InvoiceAddress', $address); - $stmt->bindParam(':CreateTime', $createTime); + $stmt->bindParam(':BizPartnerId', $contractno); + $stmt->bindParam(':PersonId', $salesman); + $stmt->bindParam(':CreatorId', $user_id); + $stmt->bindParam(':InvoiceAddress', $address); + $stmt->bindParam(':CreateTime', $createTime); - $stmt->execute(); + $stmt->execute(); + } else { + // // 若客戶資料不為空,更新該客戶資訊。 + $sql = "UPDATE comCustomer SET + PersonId=:PersonId, + InvoiceAddress=:InvoiceAddress, + LastOperatorId=:LastOperatorId, + LastOperateTime=:LastOperateTime + WHERE BizPartnerId=:BizPartnerId + "; + $stmt = $connT8->prepare($sql); + $stmt->bindParam(':PersonId', $salesman); + $stmt->bindParam(':InvoiceAddress', $address); + $stmt->bindParam(':LastOperatorId', $user_id); + $stmt->bindParam(':LastOperateTime', $createTime); + $stmt->bindParam(':BizPartnerId', $contractno); + $stmt->execute(); - // $sql = "INSERT INTO comBusinessPartner(BizPartnerId,BizPartnerName,WorkTelNo,TaxNo,EnterpriseName,ContactAddress,EMail,CreatorId,CreateTime)VALUES(:BizPartnerId,:BizPartnerName,:WorkTelNo,:TaxNo,:EnterpriseName,:ContactAddress,:EMail,:CreatorId,:CreateTime)"; - // $stmt = $connT8->prepare($sql); - // $stmt->bindParam(':BizPartnerId', $contractno); - // $stmt->bindParam(':BizPartnerName', $partyA); - // $stmt->bindParam(':WorkTelNo', $phone); - // $stmt->bindParam(':TaxNo', $vat); - // $stmt->bindParam(':EnterpriseName', $customer); //企業名稱 - // $stmt->bindParam(':ContactAddress', $partyAaddress); - // $stmt->bindParam(':EMail', $email); - // $stmt->bindParam(':CreatorId', $user_id); - // $stmt->bindParam(':CreateTime', $createTime); - - // $stmt->execute(); - // } else { - // // 若客戶資料不為空,更新該客戶資訊。 - // $sql = "UPDATE comCustomer SET - // PersonId=:PersonId, - // InvoiceAddress=:InvoiceAddress, - // LastOperatorId=:LastOperatorId, - // LastOperateTime=:LastOperateTime, - // WHERE BizPartnerId=:BizPartnerId - // "; - // $stmt = $connT8->prepare($sql); - // $stmt->bindParam(':PersonId', $salesman); - // $stmt->bindParam(':InvoiceAddress', $address); - // $stmt->bindParam(':LastOperatorId', $user_id); - // $stmt->bindParam(':LastOperateTime', $createTime); - // $stmt->bindParam(':BizPartnerId', $contractno); - // $stmt->execute(); - - - // $sql = "UPDATE comBusinessPartner SET - // BizPartnerName=:BizPartnerName, - // WorkTelNo=:WorkTelNo, - // TaxNo=:TaxNo, - // EnterpriseName=:EnterpriseName, - // ContractAddress=:ContractAddress, - // EMail=:EMail, - // LastOperatorId=:LastOperatorId, - // LastOperateTime=:LastOperateTime - // WHERE BizPartnerId = :BizPartnerId - // "; - // $stmt = $connT8->prepare($sql); - // $stmt->bindParam(':BizPartnerName', $partyA); - // $stmt->bindParam(':WorkTelNo', $phone); - // $stmt->bindParam(':TaxNo', $vat); - // $stmt->bindParam(':EnterpriseName', $customer); - // $stmt->bindParam(':ContractAddress', $partyAaddress); - // $stmt->bindParam(':EMail', $email); - // $stmt->bindParam(':LastOperatorId', $user_id); - // $stmt->bindParam(':LastOperateTime', $createTime); - // $stmt->bindParam(':BizPartnerId', $contractno); - // $stmt->execute(); - // } + $sql = "UPDATE comBusinessPartner SET + BizPartnerName=:BizPartnerName, + WorkTelNo=:WorkTelNo, + TaxNo=:TaxNo, + EnterpriseName=:EnterpriseName, + ContactAddress=:ContactAddress, + EMail=:EMail, + LastOperatorId=:LastOperatorId, + LastOperateTime=:LastOperateTime + WHERE BizPartnerId = :BizPartnerId + "; + $stmt = $connT8->prepare($sql); + $stmt->bindParam(':BizPartnerName', $partyA); + $stmt->bindParam(':WorkTelNo', $phone); + $stmt->bindParam(':TaxNo', $vat); + $stmt->bindParam(':EnterpriseName', $customer); + $stmt->bindParam(':ContactAddress', $partyAaddress); + $stmt->bindParam(':EMail', $email); + $stmt->bindParam(':LastOperatorId', $user_id); + $stmt->bindParam(':LastOperateTime', $createTime); + $stmt->bindParam(':BizPartnerId', $contractno); + $stmt->execute(); + } + // echo '
';
+    // print_r($elevators['maintainance']);
+    // echo '
'; + foreach ($elevators as $index => $elevator) { + $type[] = $elevator['maintainance']; + if ($type[$index] == 'A') { + $type = 'C3'; + } else if ($type[$index] == 'B') { + $type = 'C4'; + } else if ($type[$index] == 'C') { + $type = 'C5'; + } + } + // echo '
';
+    // print_r($type);
+    // echo '
'; // //新增於 comProject。合約 table - // $sql = "INSERT INTO comProject(ProjectId,ProjectName,TypeId,ValidityFromDate,ValidityToDate,CreateTime,CreatorId,IsInUsed) VALUES(:ProjectId,:ProjectName,:TypeId,:ValidityFromDate,ValidityToDate,:CreateTime,:CreatorId,1)"; - // $stmt = $connT8->prepare($sql); - // $stmt->bindParam(':ProjectId', $contractno); - // $stmt->bindParam(':ProjectName', $customer); - // $stmt->bindParam(':TypeId', $elevators['maintainance']); - // $stmt->bindParam(':ValidityFromDate', $beginDate); - // $stmt->bindParam(':ValidityToDate', $endDate); - // $stmt->bindParam(':CreateTime', $createTime); - // $stmt->bindParam(':CreatorId', $user_id); - // $stmt->execute(); + $sql = "INSERT INTO comProject(ProjectId,ProjectName,TypeId,ValidityFromDate,ValidityToDate,CreateTime,CreatorId,IsInUsed) + VALUES(:ProjectId,:ProjectName,:TypeId,:ValidityFromDate,:ValidityToDate,:CreateTime,:CreatorId,1)"; + $stmt = $connT8->prepare($sql); + $stmt->bindParam(':ProjectId', $contractno); + $stmt->bindParam(':ProjectName', $customer); + $stmt->bindParam(':TypeId', $type); + $stmt->bindParam(':ValidityFromDate', $beginDate); + $stmt->bindParam(':ValidityToDate', $endDate); + $stmt->bindParam(':CreateTime', $createTime); + $stmt->bindParam(':CreatorId', $user_id); + $stmt->execute(); // // 新增電梯數 - // foreach ($elevators as $index => $elevator) { - // echo '
';
-    // print_r($elevator);
-    // echo '
'; - // if ($elevator['maintainance'] == 'A') { - // $elevator['maintainance'] = 'C3'; - // } else if ($elevator['maintainance'] == 'B') { - // $elevator['maintainance'] = 'C4'; - // } else if ($elevator['maintainance'] == 'C') { - // $elevator['maintainance'] = 'C5'; - // } - // $sql = "INSERT INTO comMaterial(MaterialId,MaterialCategoryId,CreatorId,CreateTime) VALUES (:MaterialId,'E',:CreatorId,:CreateTime)"; - // $stmt = $connT8->prepare($sql); - // $stmt->bindParam(':MaterialId', $facilityno[$index]); - // $stmt->bindParam(':CreatorId', $user_id); - // $stmt->bindParam(':CreateTime', $createTime); - // $stmt->execute(); - // /// 還沒修完 - - // $sql = "INSERT INTO comMaterialGroup(MaterialId,MaterialName,MaterialCategoryId,UnitId,CreatorId,CreateTime) VALUES (:MaterialId,:MaterialName,'E','SET',:CreatorId,:CreateTime)"; - // $stmt = $connT8->prepare($sql); - // $stmt->bindParam(':MaterialId', $facilityno[$index]); - // $stmt->bindParam(':MaterialName', $customer); - // $stmt->bindParam(':CreatorId', $user_id); - // $stmt->bindParam(':CreateTime', $createTime); - // $stmt->execute(); - // /// 還沒修完 - - // $sql = "INSERT INTO comMaterialPurchases(MaterialId,CurrId,SUnitId,TaxId,CreatorId,CreateTime) VALUES (:MaterialId,'TWD','SET','ST005',:CreatorId,:CreateTime)"; - // $stmt = $connT8->prepare($sql); - // $stmt->bindParam(':MaterialId', $facilityno[$index]); - // $stmt->bindParam(':CreatorId', $user_id); - // $stmt->bindParam(':CreateTime', $createTime); - // $stmt->execute(); - + foreach ($elevators as $index => $elevator) { + echo '
';
+        print_r($elevator);
+        echo '
'; + + $sql = "INSERT INTO comMaterial + (MaterialId,MaterialCategoryId,CreatorId,CreateTime) + VALUES (:MaterialId,'E',:CreatorId,:CreateTime)"; + $stmt = $connT8->prepare($sql); + $stmt->bindParam(':MaterialId', $facilityno[$index]); + $stmt->bindParam(':CreatorId', $user_id); + $stmt->bindParam(':CreateTime', $createTime); + $stmt->execute(); + /// 還沒修完 + + $sql = "INSERT INTO comMaterialGroup + (MaterialTypeId,MaterialId,MaterialName,MaterialCategoryId,UnitId,CreatorId,CreateTime) + VALUES ('10',:MaterialId,:MaterialName,'E','SET',:CreatorId,:CreateTime)"; + $stmt = $connT8->prepare($sql); + $stmt->bindParam(':MaterialId', $facilityno[$index]); + $stmt->bindParam(':MaterialName', $customer); + $stmt->bindParam(':CreatorId', $user_id); + $stmt->bindParam(':CreateTime', $createTime); + $stmt->execute(); + /// 還沒修完 + + $sql = "INSERT INTO comMaterialPurchases + (MaterialId,CurrId,SUnitId,TaxId,CreatorId,CreateTime) + VALUES (:MaterialId,'TWD','SET','ST005',:CreatorId,:CreateTime)"; + $stmt = $connT8->prepare($sql); + $stmt->bindParam(':MaterialId', $facilityno[$index]); + $stmt->bindParam(':CreatorId', $user_id); + $stmt->bindParam(':CreateTime', $createTime); + $stmt->execute(); + } $connT8->commit(); - // } } diff --git a/wms/mkt/price_normal-index.php b/wms/mkt/price_normal-index.php index 2cd73546..daa4ef37 100644 --- a/wms/mkt/price_normal-index.php +++ b/wms/mkt/price_normal-index.php @@ -1,832 +1,821 @@ - - - - -
- -

電梯標準價查詢

-
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
小機房MAE100單位:萬元
                 標準價(±1S) 1、1.0最低到5停;5停以下以5停計。
- 2、1.5及1.75最低到8停;8停以下以8停計。
- 3、1.5變為1.75---》+5.4萬/台;加減1停同1.5。
- 4、經理權限為發佈價之80%、業務部協理權限為75%。
MAE100-6*7-CO6089.04.0
MAE100-8*7-CO6089.14.0
MAE100-9*7-CO6089.74.0
MAE100-10*7-CO6090.44.0
MAE100-11*7-CO6092.04.0
MAE100-12*7-CO6095.64.0
MAE100-13*7-CO6098.04.1
MAE100-15*7-CO6098.54.1
MAE100-17*7-CO60133.65.1
MAE100-20*7-CO60153.25.4
MAE100-24*7-CO60158.45.4
 
                 標準價(±1S) 規格標準價
MAE100-8*10-CO90101.54.0MAE100-8*10-CO105106.3
MAE100-9*10-CO90102.14.0MAE100-9*10-CO105107.4
MAE100-10*10-CO90103.04.0MAE100-10*10-CO105108.6
MAE100-11*10-CO90108.44.0MAE100-11*10-CO105114.0
MAE100-12*10-CO90110.04.0MAE100-12*10-CO105115.5
MAE100-13*10-CO90112.24.1MAE100-13*10-CO105117.8
MAE100-15*10-CO90113.44.1MAE100-15*10-CO105119.0
MAE100-17*10-CO90151.15.1MAE100-17*10-CO105156.7
MAE100-20*10-CO90173.05.4MAE100-20*10-CO105178.6
MAE100-24*10-CO90192.05.4MAE100-24*10-CO105198.0
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
無機房MAM200單位:萬元
                 標準價(±1S) 1、1.0最低到5停;5停以下以5停計。
- 2、1.5及1.75最低到8停;8停以下以8停計。
- 3、1.5變為1.75---》+5.4萬/台;加減1停同1.5。
- 4、營業員權限為發佈價之73%
MAM200-8*7-CO60117.54.5
MAM200-9*7-CO60118.74.5
MAM200-10*7-CO60120.14.5
MAM200-11*7-CO60121.24.5
MAM200-12*7-CO60122.54.5
MAM200-13*7-CO60123.84.5
MAM200-15*7-CO60124.94.5
MAM200-17*7-CO60187.46.4
MAM200-20*7-CO60204.86.4
MAM200-24*7-CO60208.56.4
MAM200-8*10-CO90133.44.9MAM200-8*10-CO105139.1
MAM200-9*10-CO90134.54.9MAM200-9*10-CO105140.2
MAM200-10*10-CO90135.84.9MAM200-10*10-CO105141.5
MAM200-11*10-CO90137.14.9MAM200-11*10-CO105142.8
MAM200-12*10-CO90138.24.9MAM200-12*10-CO105143.9
MAM200-13*10-CO90140.04.9MAM200-13*10-CO105145.7
MAM200-15*10-CO90141.24.9MAM200-15*10-CO105146.9
MAM200-17*10-CO90202.86.5MAM200-17*10-CO105208.5
MAM200-20*10-CO90220.26.5MAM200-20*10-CO105225.9
MAM200-24*10-CO90223.96.5MAM200-24*10-CO105229.6
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
小電梯MAH100單位:萬元
                 標準價(±1S) 
MAH100-6*5-2S4573.22.5
MAH100-8*5-2S4583.22.5
   
   
   
   
註:
- 1、最低到3停;2停以3停計。
- 2、經理權限為發佈價之80%、業務部協理權限為75%。
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
高速梯單位:萬元
                 標準價(±1S) 
MAE100-12*20-CO120180.0 5.0
MAE100-13*20-CO120181.3 5.0
MAE100-15*20-CO120182.7 5.0
MAE100-17*20-CO120217.1 6.3
MAE100-20*20-CO120225.6 6.4
MAE100-24*20-CO120240.2 6.5
MAE100-12*20-CO150223.0 6.1
MAE100-13*20-CO150224.1 6.1
MAE100-15*20-CO150225.4 6.1
MAE100-17*20-CO150239.9 6.5
MAE100-20*20-CO150244.3 6.5
MAE100-24*20-CO150253.3 6.5
註:
1、2.0及2.5最低到15停;15停以下以15停計。
2、P-12(含)以下以P-13計。
3、經理權限為發佈價之80%、業務部協理權限為75%。
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
小機房貨梯單位:萬元
                 標準價(±1S) 
MAF100-750*3-2S45114.3 5.8
MAF100-750*3-2S60115.5 5.8
MAF100-1000*3-2S45136.4 8.7
MAF100-1000*3-2S60138.5 8.7
MAF100-1500*3-2S45171.4 9.7
MAF100-1500*3-2S60175.5 9.7
MAF100-2000*3-2S45195.3 10.0
MAF100-2000*3-2S60198.5 10.0
MAF100-2500*3-2S45286.3 15.1
MAF100-2500*3-2S60288.3 15.1
MAF100-3000*3-2S45307.7 16.3
MAF100-3000*3-2S60309.5 16.3
MAF100-3500*3-2S45365.5 18.2
MAF100-3500*3-2S60368.5 18.2
MAF100-4000*3-2S45407.5 20.5
MAF100-4000*3-2S60409.5 20.5
MAF100-5000*3-2S45520.5 25.5
MAF100-5000*3-2S60525.8 25.5
註:
1、最低為2停
2、經理權限為發佈價之80%、業務部協理權限為75%。
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
平台梯單位:萬元
                 標準價提升高度標準備註
MAP100-280*2-CO0978.5 3.0 岩板;L型開門另加3萬元/台
MAP100-280*3-CO0986.5 6.0 岩板;L型開門另加3萬元/台
MAP100-280*4-CO0994.5 9.0 岩板;L型開門另加3萬元/台
MAP100-280*5-CO09102.5 12.0 岩板;L型開門另加3萬元/台
MAP100-280*2-CO0980.2 3.0 人造皮革;L型開門另加3萬元/台
MAP100-280*3-CO0988.5 6.0 人造皮革;L型開門另加3萬元/台
MAP100-280*4-CO0996.5 9.0 人造皮革;L型開門另加3萬元/台
MAP100-280*5-CO09104.5 12.0 人造皮革;L型開門另加3萬元/台
MAP100-320*2-CO0982.0 3.0 岩板;L型開門另加3萬元/台
MAP100-320*3-CO0990.0 6.0 岩板;L型開門另加3萬元/台
MAP100-320*4-CO0998.0 9.0 岩板;L型開門另加3萬元/台
MAP100-320*5-CO09106.0 12.0 岩板;L型開門另加3萬元/台
MAP100-320*2-CO0984.0 3.0 人造皮革;L型開門另加3萬元/台
MAP100-320*3-CO0992.0 6.0 人造皮革;L型開門另加3萬元/台
MAP100-320*4-CO09100.0 9.0 人造皮革;L型開門另加3萬元/台
MAP100-320*5-CO09108.0 12.0 人造皮革;L型開門另加3萬元/台
    
    
註:
1、最低為2停。
2、標準價格為自動門。
3、經理權限為發佈價之80%、業務部協理權限為75%。
-
-
-
-
- - - - - - + + + +
+ +
+

電梯標準價查詢

+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
小機房MAE100單位:萬元
  +                 + 標準價(±1S) 1、1.5及1.75最低到5停,5停以下以5停計。
+ 2、處長權限為發佈價之80%。
+
MAE100-6*7-CO6090.14.0
MAE100-8*7-CO6090.14.0
MAE100-9*7-CO6090.44.0
MAE100-10*7-CO6091.94.0
MAE100-11*7-CO6092.04.0
MAE100-12*7-CO6095.24.0
MAE100-13*7-CO6097.84.1
MAE100-15*7-CO6098.34.1
MAE100-17*7-CO60130.64.5
MAE100-20*7-CO60150.24.9
MAE100-24*7-CO60155.44.9
 
  +                 + 標準價(±1S) 規格標準價
MAE100-8*10-CO90102.14.0MAE100-8*10-CO105106.3
MAE100-9*10-CO90102.64.0MAE100-9*10-CO105107.4
MAE100-10*10-CO90108.04.0MAE100-10*10-CO105108.6
MAE100-11*10-CO90108.44.0MAE100-11*10-CO105114.0
MAE100-12*10-CO90110.04.0MAE100-12*10-CO105115.3
MAE100-13*10-CO90112.24.1MAE100-13*10-CO105117.5
MAE100-15*10-CO90113.44.1MAE100-15*10-CO105118.8
MAE100-17*10-CO90148.14.5MAE100-17*10-CO105152.7
MAE100-20*10-CO90170.04.9MAE100-20*10-CO105173.6
MAE100-24*10-CO90188.04.9MAE100-24*10-CO105193.0
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
無機房MAM200單位:萬元
                 標準價(±1S) 1、1.5及1.75停最低到5停;5停以下以5停計。
+ 2、處長權限為發布價之80%。
+
MAM200-8*7-CO60111.94.5
MAM200-9*7-CO60112.74.5
MAM200-10*7-CO60114.34.5
MAM200-11*7-CO60115.44.5
MAM200-12*7-CO60116.64.5
MAM200-13*7-CO60117.84.5
MAM200-15*7-CO60118.94.5
MAM200-17*7-CO60178.35.7
MAM200-20*7-CO60194.85.7
MAM200-24*7-CO60198.35.7
MAM200-8*10-CO90127.74.9MAM200-8*10-CO105131.6
MAM200-9*10-CO90128.74.9MAM200-9*10-CO105132.7
MAM200-10*10-CO90130.04.9MAM200-10*10-CO105133.9
MAM200-11*10-CO90131.24.9MAM200-11*10-CO105135.1
MAM200-12*10-CO90132.34.9MAM200-12*10-CO105136.2
MAM200-13*10-CO90134.04.9MAM200-13*10-CO105137.9
MAM200-15*10-CO90135.14.9MAM200-15*10-CO105139.0
MAM200-17*10-CO90196.65.9MAM200-17*10-CO105199.5
MAM200-20*10-CO90213.25.9MAM200-20*10-CO105223.9
MAM200-24*10-CO90216.75.9MAM200-24*10-CO105227.6
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ 小電梯 + MAH100單位:萬元
                 標準價(±1S) 
MAH100-6*5-2S4573.22.5
MAH100-8*5-2S4583.22.5
   
   
   
   
註:
+ + 1、處長權限為發布價之80%。
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
高速梯單位:萬元
                 標準價(±1S) 
MAE100-12*20-CO120190.0 4.8
MAE100-13*20-CO120191.3 4.8
MAE100-15*20-CO120192.7 4.8
MAE100-17*20-CO120215.1 5.8
MAE100-20*20-CO120223.6 5.9
MAE100-24*20-CO120238.2 6.0
MAE100-12*20-CO150216.0 5.7
MAE100-13*20-CO150224.1 5.7
MAE100-15*20-CO150225.4 5.7
MAE100-17*20-CO150236.9 6.0
MAE100-20*20-CO150241.3 6.0
MAE100-24*20-CO150250.3 6.0
註:
1、2.0及2.5最低到15停;15停以下以15停計
2、處長權限為發布價之80%。
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
小機房貨梯單位:萬元
                 標準價(±1S) 
MAF100-1000*3-2S45116.0 5.3
MAF100-1000*3-2S60117.8 5.3
MAF100-1500*3-2S45145.7 9.8
MAF100-1500*3-2S60149.2 9.8
MAF100-2000*3-2S45166.0 10.0
MAF100-2000*3-2S60168.7 10.0
MAF100-2500*3-4PCO45243.3 14.2
MAF100-2500*3-4PCO60245.0 14.2
MAF100-3000*3-4PCO45261.5 15.2
MAF100-3000*3-4PCO60263.0 15.2
MAF100-3500*3-4PCO45310.6 18.2
MAF100-3500*3-4PCO60313.2 18.2
MAF100-4000*3-6PCO45346.4 20.5
MAF100-4000*3-6PCO60348.1 20.5
MAF100-5000*3-6PCO45442.5 24.0
MAF100-5000*3-6PCO60447.0 24.0
註:
1、最低為2停
2、處長權限為發佈價之80%。
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
平台梯單位:萬元
                 標準價提升高度標準備註
MAP100-280*2-CO0975.0 3.0 岩板;L型開門另加3萬元/台
MAP100-280*3-CO0986.5 6.0 岩板;L型開門另加3萬元/台
MAP100-280*4-CO0994.5 9.0 岩板;L型開門另加3萬元/台
MAP100-280*5-CO09102.5 12.0 岩板;L型開門另加3萬元/台
MAP100-280*2-CO0982.0 3.0 人造皮革;L型開門另加3萬元/台
MAP100-280*3-CO0990.0 6.0 人造皮革;L型開門另加3萬元/台
MAP100-280*4-CO0998.0 9.0 人造皮革;L型開門另加3萬元/台
MAP100-280*5-CO09107.0 12.0 人造皮革;L型開門另加3萬元/台
MAP100-320*2-CO0977.5 3.0 岩板;L型開門另加3萬元/台
MAP100-320*3-CO0988.5 6.0 岩板;L型開門另加3萬元/台
MAP100-320*4-CO0996.5 9.0 岩板;L型開門另加3萬元/台
MAP100-320*5-CO09106.0 12.0 岩板;L型開門另加3萬元/台
MAP100-320*2-CO0984.0 3.0 人造皮革;L型開門另加3萬元/台
MAP100-320*3-CO0992.0 6.0 人造皮革;L型開門另加3萬元/台
MAP100-320*4-CO09100.0 9.0 人造皮革;L型開門另加3萬元/台
MAP100-320*5-CO09108.0 12.0 人造皮革;L型開門另加3萬元/台
    
    
註:
1、最低為2停。
2、標準價格為自動門。
3、處長權限為發佈價之80%。
+
+
+
+
+ + + + + + \ No newline at end of file diff --git a/wms/mkt/pricereview-create.php b/wms/mkt/pricereview-create.php index 0e962cb3..6fdb6571 100644 --- a/wms/mkt/pricereview-create.php +++ b/wms/mkt/pricereview-create.php @@ -47,6 +47,7 @@ if (count($last_pr_arr) > 0) { $last_pr_arr["qty_total"] += $last_pritem_arr["A"][$row["item_no"]]["item_qty"]; } } + mysqli_free_result($res); $sql = "select * from pricereview_pay where mid = '" . $last_pr_arr["id"] . "' order by pay_kind"; @@ -143,6 +144,7 @@ while ($row = mysqli_fetch_assoc($res)) { $opt_data_arr[$row["kind"]][$row["group_name"]][$row["id"]]["unit"] = $row["unit"]; $opt_data_arr[$row["kind"]][$row["group_name"]][$row["id"]]["price"] = $row["price"]; } + mysqli_free_result($res); $option_str = ''; $option_str .= ' @@ -506,7 +508,7 @@ $option_str .= "
"; $(document).ready(function() { $('input[name=pay_scale]').each(function() { if ($(this).val() != '') { - console.log($(this).val()); + // console.log($(this).val()); $(this).closest('td').next('td').find('input[name=pay_amount]').val(commafy(($("#price_total").val().replace(/[,]+/g, "") / 100 * $(this).val()).toFixed(0))); var payAllScale = 0; var payAllAmt = 0; @@ -737,11 +739,13 @@ $option_str .= ""; var jobj = $(this); // 父視窗 $("#optionModal .modal-body td").unbind().click(function() { var pobj = $(this).closest('td').parent(); + console.log(jobj.html(pobj.find('td').eq(0).html() + ' ' + pobj.find('td').eq(1).html())); jobj.html(pobj.find('td').eq(0).html() + ' ' + pobj.find('td').eq(1).html()); jobj.closest('td').parent().find('input[name=option_unit_price]').val(pobj.find('td').eq(5).html()); jobj.closest('td').parent().find('input[name=option_price_bp]').val(commafy(pobj.find('td').eq(5).html().replace(/[,]+/g, "") * jobj.closest('td').parent().find('input[name=option_qty]').val().replace(/[,]+/g, ""))); jobj.closest('td').parent().find('input[name=op_id]').val(pobj.find('input[name=option_id]').val()); $("#optionModal").modal('hide'); + }); }); $("#optionFaciModal").on("hidden.bs.modal", function() { @@ -1817,7 +1821,7 @@ if($_SERVER["REQUEST_METHOD"] == "POST"){ ?> - + " readonly> "> diff --git a/wms/mkt/pricereview_renovate-create.php b/wms/mkt/pricereview_renovate-create.php index 379685c5..a17d3e41 100644 --- a/wms/mkt/pricereview_renovate-create.php +++ b/wms/mkt/pricereview_renovate-create.php @@ -1,2439 +1,2603 @@ -"; - echo "alert('客戶資料錯誤!');"; - echo "location.href='../crm/crmm01-index.php?function_name=customer&".$token_link."';"; - echo ""; - echo ""; - exit; -} - -// 同一卷號只限一筆價審 -$sql = "select count(*) from pricereview_main where contractno = '$vol_no' and status in ('Y1', 'YS', 'YY')"; -$res = mysqli_query($link, $sql); -$row = mysqli_fetch_row($res); -if ($row[0] > 0) { - echo ""; - exit; -} - -// 退回重填價審,帶出上次價審內容 -$last_pr_arr = $last_pritem_arr = $last_prpay_arr = []; -$sql = "select * from pricereview_main where contractno = '$vol_no' and status in ('YN', 'D') order by id limit 1"; -$res = mysqli_query($link, $sql); -if ($row = mysqli_fetch_assoc($res)) { - $last_pr_arr = $row; -} -mysqli_free_result($res); -if (count($last_pr_arr) > 0) { - $last_pr_arr["qty_total"] = $last_pr_arr["pay_all_scale"] = $last_pr_arr["pay_all_amount"] = 0; - $sql = "select * from pricereview_item where mid = '".$last_pr_arr["id"]."'"; - $res = mysqli_query($link, $sql); - while ($row = mysqli_fetch_assoc($res)) { - $last_pritem_arr[$row["item_group"]][$row["item_no"]] = $row; - if (isset($last_pritem_arr["A"][$row["item_no"]])) { - $last_pr_arr["qty_total"] += $last_pritem_arr["A"][$row["item_no"]]["item_qty"]; - } - } - mysqli_free_result($res); - - $sql ="select * from pricereview_pay where mid = '".$last_pr_arr["id"]."' order by pay_kind"; - $res = mysqli_query($link, $sql); - while ($row = mysqli_fetch_assoc($res)) { - $last_prpay_arr[$row["pay_kind"]] = $row; - $last_pr_arr["pay_all_scale"] += $last_prpay_arr[$row["pay_kind"]]["pay_scale"]; - $last_pr_arr["pay_all_amount"] += $last_prpay_arr[$row["pay_kind"]]["pay_amount"]; - } - mysqli_free_result($res); -} - -// 開門方式 -$op_arr = []; -$sql = "select code_name, content from code where field_name = 'open_kind'"; -$res = mysqli_query($link, $sql); -while ($row = mysqli_fetch_row($res)) { - $op_arr[$row[0]] = $row[1]; -} -mysqli_free_result($res); - -// 在有望客戶建的電梯項目 -$hope_elev_spec_arr = []; -$hope_elev_spec_amt = $hope_elev_spec_num = 0; -$sql = "select seq, specifications, person, weight, stop, speed, spec_num, spec_price, open from hope_project_elevator_spec where vol_no = '$vol_no' order by seq"; -$res = mysqli_query($link, $sql); -while ($row = mysqli_fetch_row($res)) { - $hope_elev_spec_arr[$row[0]]["spec"] = $row[1]; - if (preg_match("/^[G|A]/", $row[2])) { - $hope_elev_spec_arr[$row[0]]["person"] = ""; - $hope_elev_spec_arr[$row[0]]["weight"] = ""; - $hope_elev_spec_arr[$row[0]]["series"] = $row[2]; - $hope_elev_spec_arr[$row[0]]["open"] = ""; - } elseif (strlen($row[2]) == 7) { - $hope_elev_spec_arr[$row[0]]["person"] = ""; - $hope_elev_spec_arr[$row[0]]["weight"] = ""; - $hope_elev_spec_arr[$row[0]]["series"] = ""; - $hope_elev_spec_arr[$row[0]]["open"] = $row[2]; - } elseif (strlen($row[2]) >= 3) { - $hope_elev_spec_arr[$row[0]]["person"] = ""; - $hope_elev_spec_arr[$row[0]]["weight"] = $row[2]; - $hope_elev_spec_arr[$row[0]]["series"] = ""; - $hope_elev_spec_arr[$row[0]]["open"] = ""; - } else { - $hope_elev_spec_arr[$row[0]]["person"] = $row[2]; - $hope_elev_spec_arr[$row[0]]["weight"] = ""; - $hope_elev_spec_arr[$row[0]]["series"] = ""; - $hope_elev_spec_arr[$row[0]]["open"] = ""; - } - $hope_elev_spec_arr[$row[0]]["stop"] = $row[4]; - $hope_elev_spec_arr[$row[0]]["speed"] = $row[5]; - $hope_elev_spec_arr[$row[0]]["spec_num"] = $row[6]; - $hope_elev_spec_arr[$row[0]]["spec_price"] = $row[7]; - $hope_elev_spec_arr[$row[0]]["op"] = $op_arr[$row[8]]; - $hope_elev_spec_amt += $row[6]*$row[7]; - $hope_elev_spec_num += $row[6]; -} -mysqli_free_result($res); - -// 在有望客戶建的option項目 -$hope_opt_arr = []; -$h = 1; -$hope_elev_opt_amt = 0; -$sql = "select a.spec, a.price, a.id from hope_elevator_option_price a "; -$sql .= "where a.vol_no = '$vol_no'"; -$res = mysqli_query($link, $sql); -while ($row = mysqli_fetch_row($res)) { - $hope_opt_arr[$h]["seat"] = $row[0]; - $hope_opt_arr[$h]["option_price"] = $row[1]; - $hope_opt_arr[$h]["id"] = $row[2]; - $hope_opt_arr[$h]["option_num"] = 1; - $hope_elev_opt_amt += $row[1]; - $h++; -} -mysqli_free_result($res); - -if ($last_pr_arr) { - $price_total = $last_pr_arr["price_total"]; - $qty_total = $last_pr_arr["qty_total"]; -} else { - $price_total = $hope_elev_spec_amt;// + $hope_elev_opt_amt; - $qty_total = $hope_elev_spec_num; -} - -// Option Data -$opt_data_arr = []; -$opt_kind_arr = ["A" => "小電梯型錄選配加價報價", "B" => "客梯型錄選配加價報價", "C" => "550-1600kg選配業務報價", "D" => "其它"]; -$sql = "select * from option_price where status = 'Y' order by kind, id"; -$res = mysqli_query($link, $sql); -while ($row = mysqli_fetch_assoc($res)) { - $opt_data_arr[$row["kind"]][$row["group_name"]][$row["id"]]["spec"] = $row["spec"]; - $opt_data_arr[$row["kind"]][$row["group_name"]][$row["id"]]["memo"] = $row["memo"]; - $opt_data_arr[$row["kind"]][$row["group_name"]][$row["id"]]["optional"] = $row["optional"]; - $opt_data_arr[$row["kind"]][$row["group_name"]][$row["id"]]["unit"] = $row["unit"]; - $opt_data_arr[$row["kind"]][$row["group_name"]][$row["id"]]["price"] = $row["price"]; -} -mysqli_free_result($res); -$option_str = ''; -$option_str .= ' - - - - - - - - '; -foreach ($opt_data_arr as $k => $v) { - //$option_str .= ''; - foreach ($v as $k2 => $v2) { - foreach ($v2 as $k3 => $v3) { - if ($v3["optional"] == "1") $optional = "標"; - elseif ($v3["optional"] == "2") $optional = "選"; - $option_str .= ""; - $option_str .= ""; - $option_str .= ""; - $option_str .= ""; - $option_str .= ""; - $option_str .= ""; - $option_str .= ""; - $option_str .= ""; - } - } - /* - $group_nums = count($v2); - $i = 1; - foreach ($v2 as $k3 => $v3) { - if ($v3["optional"] == "1") $optional = "標"; - elseif ($v3["optional"] == "2") $optional = "選"; - $option_str .= ""; - if ($i==1) { - $option_str .= ''; - } else { - $option_str .= ''; - } - $option_str .= ""; - $option_str .= ""; - $option_str .= ""; - $option_str .= ""; - $option_str .= ""; - $option_str .= ""; - $i++; - } - } - */ -} -$option_str .= "
名稱規格備註配置單位定價
'.$opt_kind_arr[$k].'
".$k2."".$v3["spec"]."".$v3["memo"]."".$optional."".$v3["unit"]."".number_format($v3["price"])."
'.$k2.''.$k2.'".$v3["spec"]."".$v3["memo"]."".$optional."".$v3["unit"]."".number_format($v3["price"])."
"; -?> - - - -
- -
- -
- -
- - - - - - - -
-Please fill up the required field!

"; - } else { - echo "

Record has added successfully

"; - } -} -*/ -?> -
" enctype="multipart/form-data"> - -
- - - - - - - - - - - - - - - - - - - - - - 0 && isset($last_pritem_arr["A"])) { - foreach ($last_pritem_arr["A"] as $k => $v) { - list($last_pritem_kind, $last_pritem_seat, $last_pritem_numberofstop, $last_pritem_speed) = explode(",", $v["note"]); - ?> - - - - - - - - - - - - - 0) { - foreach ($hope_elev_spec_arr as $k => $v) { - ?> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
整機單價
電梯人乘/載重停數速度開門方式規格單價數量複價售價
- - - - - - - - - - - - - " readonly>" readonly>">">" readonly>" required> - - - - X -
- - - - - - - - - "> - - - - - " readonly>">">" readonly>" required> - - - - X -
- - - - - - - - - - - - - - - - - - X -
小計
-
-
-
- - - - - - - - - - - - - - - - - 0 && isset($last_pritem_arr["B"])) { - foreach ($last_pritem_arr["B"] as $k => $v) { - ?> - - - - - - - - - - 0) { - foreach ($hope_opt_arr as $k => $v) { - ?> - - - - - - - - - - - - - - - - - - - - - - - - - -
OPTION加價
選配規格單價數量複價備註
所屬電梯 - - - - -
功能
- - " readonly >">" readonly> - "> - ">電梯 - X -
- - " readonly >">" readonly> - - "> - 電梯 - X -
- 點選 - " readonly >">" readonly> - - 電梯 - X -
小計
-
-
-
- - - - - - - - - - - - - - - 0 && isset($last_pritem_arr["E"])) { - foreach ($last_pritem_arr["E"] as $k => $v) { - ?> - - - - - - - - - - - - - - - - - - - - - -
除外項目
詢價單號名稱單價數量複價
">" readonly>" readonly>">">" readonly> - - X -
- X -
小計
-
-
-
- - - - - - - - - - - - - - - - - - - - 0 && isset($last_pritem_arr["D"])) { - foreach ($last_pritem_arr["D"] as $k => $v) { - list($last_pritem_seat, $last_pritem_numberofstop, $last_pritem_speed) = explode(",", $v["note"]); - ?> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
保固延長
電梯人乘/載重停數速度單價數量(月)複價備註所屬電梯功能
- - - - - - - - " readonly>">">" readonly> - - 電梯 - X -
- - - - - - - - 電梯 - X -
小計
-
-
-
- - - - - - - - - - - - - - - 0 && isset($last_pritem_arr["C"])) { - foreach ($last_pritem_arr["C"] as $k => $v) { - //list($seat, $floor) = explode(",", $v["item_spec"]); - list($seat, $floor) = array_pad(explode(",", $v["item_spec"]), 2, null); // 換個寫法,避免undefined offset - ?> - - - - - - - - - - - - - - - - - - - - - -
拆梯價格
人乘/載重樓層單價數量複價
- - - - " readonly>">" readonly> - - X -
- - - - - - X -
小計
-
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
付款辦法款別比例%金額票期
材料1、訂金">" readonly> - -
2、二次款">" readonly> - -
3、貨到工地款">" readonly> - -
4、其它">" readonly> - -
安裝5、安裝完畢款">" readonly> - -
6、驗收款">" readonly> - -
7、其它">" readonly> - -
合計" readonly>" readonly>
備註
-
- -
-
- - " readonly> -
-
- - - -
-
- - " readonly> -
-
- - " readonly> -
-
- - -
-
- - "> -
-
- - 0) { - echo number_format(($last_pr_arr["price_total"]-$last_pr_arr["price_lowest"])/$last_pr_arr["qty_total"]); - } ?>" readonly> -
-
-
- " required> -
-
-
- " required> -
-
-
- - "> -
-
- - "> -
-
- - "> -
-
- - "> -
- -
- -
- - - - - - - - - - - -
-
- - -
- - X -
- - X -

-   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- -"; + echo "alert('客戶資料錯誤!');"; + echo "location.href='../crm/crmm01-index.php?function_name=customer&" . $token_link . "';"; + echo ""; + echo ""; + exit; +} + +// 同一卷號只限一筆價審 +$sql = "select count(*) from pricereview_main where contractno = '$vol_no' and status in ('Y1', 'YS', 'YY')"; +$res = mysqli_query($link, $sql); +$row = mysqli_fetch_row($res); +if ($row[0] > 0) { + echo ""; + exit; +} + +// 退回重填價審,帶出上次價審內容 +$last_pr_arr = $last_pritem_arr = $last_prpay_arr = []; +$sql = "select * from pricereview_main where contractno = '$vol_no' and status in ('YN', 'D') order by id limit 1"; +$res = mysqli_query($link, $sql); +if ($row = mysqli_fetch_assoc($res)) { + $last_pr_arr = $row; +} +mysqli_free_result($res); +if (count($last_pr_arr) > 0) { + $last_pr_arr["qty_total"] = $last_pr_arr["pay_all_scale"] = $last_pr_arr["pay_all_amount"] = 0; + $sql = "select * from pricereview_item where mid = '" . $last_pr_arr["id"] . "'"; + $res = mysqli_query($link, $sql); + while ($row = mysqli_fetch_assoc($res)) { + $last_pritem_arr[$row["item_group"]][$row["item_no"]] = $row; + if (isset($last_pritem_arr["A"][$row["item_no"]])) { + $last_pr_arr["qty_total"] += $last_pritem_arr["A"][$row["item_no"]]["item_qty"]; + } + } + mysqli_free_result($res); + + $sql = "select * from pricereview_pay where mid = '" . $last_pr_arr["id"] . "' order by pay_kind"; + $res = mysqli_query($link, $sql); + while ($row = mysqli_fetch_assoc($res)) { + $last_prpay_arr[$row["pay_kind"]] = $row; + $last_pr_arr["pay_all_scale"] += $last_prpay_arr[$row["pay_kind"]]["pay_scale"]; + $last_pr_arr["pay_all_amount"] += $last_prpay_arr[$row["pay_kind"]]["pay_amount"]; + } + mysqli_free_result($res); +} + +// 開門方式 +$op_arr = []; +$sql = "select code_name, content from code where field_name = 'open_kind'"; +$res = mysqli_query($link, $sql); +while ($row = mysqli_fetch_row($res)) { + $op_arr[$row[0]] = $row[1]; +} +mysqli_free_result($res); + +// 在有望客戶建的電梯項目 +$hope_elev_spec_arr = []; +$hope_elev_spec_amt = $hope_elev_spec_num = 0; +$sql = "select seq, specifications, person, weight, stop, speed, spec_num, spec_price, open from hope_project_elevator_spec where vol_no = '$vol_no' order by seq"; +$res = mysqli_query($link, $sql); +while ($row = mysqli_fetch_row($res)) { + $hope_elev_spec_arr[$row[0]]["spec"] = $row[1]; + if (preg_match("/^[G|A]/", $row[2])) { + $hope_elev_spec_arr[$row[0]]["person"] = ""; + $hope_elev_spec_arr[$row[0]]["weight"] = ""; + $hope_elev_spec_arr[$row[0]]["series"] = $row[2]; + $hope_elev_spec_arr[$row[0]]["open"] = ""; + } elseif (strlen($row[2]) == 7) { + $hope_elev_spec_arr[$row[0]]["person"] = ""; + $hope_elev_spec_arr[$row[0]]["weight"] = ""; + $hope_elev_spec_arr[$row[0]]["series"] = ""; + $hope_elev_spec_arr[$row[0]]["open"] = $row[2]; + } elseif (strlen($row[2]) >= 3) { + $hope_elev_spec_arr[$row[0]]["person"] = ""; + $hope_elev_spec_arr[$row[0]]["weight"] = $row[2]; + $hope_elev_spec_arr[$row[0]]["series"] = ""; + $hope_elev_spec_arr[$row[0]]["open"] = ""; + } else { + $hope_elev_spec_arr[$row[0]]["person"] = $row[2]; + $hope_elev_spec_arr[$row[0]]["weight"] = ""; + $hope_elev_spec_arr[$row[0]]["series"] = ""; + $hope_elev_spec_arr[$row[0]]["open"] = ""; + } + $hope_elev_spec_arr[$row[0]]["stop"] = $row[4]; + $hope_elev_spec_arr[$row[0]]["speed"] = $row[5]; + $hope_elev_spec_arr[$row[0]]["spec_num"] = $row[6]; + $hope_elev_spec_arr[$row[0]]["spec_price"] = $row[7]; + $hope_elev_spec_arr[$row[0]]["op"] = $op_arr[$row[8]]; + $hope_elev_spec_amt += $row[6] * $row[7]; + $hope_elev_spec_num += $row[6]; +} +mysqli_free_result($res); + +// 在有望客戶建的option項目 +$hope_opt_arr = []; +$h = 1; +$hope_elev_opt_amt = 0; +$sql = "select a.spec, a.price, a.id from hope_elevator_option_price a "; +$sql .= "where a.vol_no = '$vol_no'"; +$res = mysqli_query($link, $sql); +while ($row = mysqli_fetch_row($res)) { + $hope_opt_arr[$h]["seat"] = $row[0]; + $hope_opt_arr[$h]["option_price"] = $row[1]; + $hope_opt_arr[$h]["id"] = $row[2]; + $hope_opt_arr[$h]["option_num"] = 1; + $hope_elev_opt_amt += $row[1]; + $h++; +} +mysqli_free_result($res); + +if ($last_pr_arr) { + $price_total = $last_pr_arr["price_total"]; + $qty_total = $last_pr_arr["qty_total"]; +} else { + $price_total = $hope_elev_spec_amt; // + $hope_elev_opt_amt; + $qty_total = $hope_elev_spec_num; +} + +// Option Data +$opt_data_arr = []; +$opt_kind_arr = ["A" => "小電梯型錄選配加價報價", "B" => "客梯型錄選配加價報價", "C" => "550-1600kg選配業務報價", "D" => "其它"]; +$sql = "select * from option_price where status = 'Y' order by kind, id"; +$res = mysqli_query($link, $sql); +while ($row = mysqli_fetch_assoc($res)) { + $opt_data_arr[$row["kind"]][$row["group_name"]][$row["id"]]["spec"] = $row["spec"]; + $opt_data_arr[$row["kind"]][$row["group_name"]][$row["id"]]["memo"] = $row["memo"]; + $opt_data_arr[$row["kind"]][$row["group_name"]][$row["id"]]["optional"] = $row["optional"]; + $opt_data_arr[$row["kind"]][$row["group_name"]][$row["id"]]["unit"] = $row["unit"]; + $opt_data_arr[$row["kind"]][$row["group_name"]][$row["id"]]["price"] = $row["price"]; +} +mysqli_free_result($res); +$option_str = ''; +$option_str .= ' + + + + + + + + '; +foreach ($opt_data_arr as $k => $v) { + //$option_str .= ''; + foreach ($v as $k2 => $v2) { + foreach ($v2 as $k3 => $v3) { + if ($v3["optional"] == "1") $optional = "標"; + elseif ($v3["optional"] == "2") $optional = "選"; + $option_str .= ""; + $option_str .= ""; + $option_str .= ""; + $option_str .= ""; + $option_str .= ""; + $option_str .= ""; + $option_str .= ""; + $option_str .= ""; + } + } + /* + $group_nums = count($v2); + $i = 1; + foreach ($v2 as $k3 => $v3) { + if ($v3["optional"] == "1") $optional = "標"; + elseif ($v3["optional"] == "2") $optional = "選"; + $option_str .= ""; + if ($i==1) { + $option_str .= ''; + } else { + $option_str .= ''; + } + $option_str .= ""; + $option_str .= ""; + $option_str .= ""; + $option_str .= ""; + $option_str .= ""; + $option_str .= ""; + $i++; + } + } + */ +} +$option_str .= "
名稱規格備註配置單位定價
'.$opt_kind_arr[$k].'
" . $k2 . "" . $v3["spec"] . "" . $v3["memo"] . "" . $optional . "" . $v3["unit"] . "" . number_format($v3["price"]) . "
'.$k2.''.$k2.'".$v3["spec"]."".$v3["memo"]."".$optional."".$v3["unit"]."".number_format($v3["price"])."
"; +?> + + + +
+ +
+ +
+ +
+ + + + + + + +
+ Please fill up the required field!

"; + } else { + echo "

Record has added successfully

"; + } +} +*/ + ?> +
" enctype="multipart/form-data"> + +
+ + + + + + + + + + + + + + + + + + + + + + 0 && isset($last_pritem_arr["A"])) { + foreach ($last_pritem_arr["A"] as $k => $v) { + list($last_pritem_kind, $last_pritem_seat, $last_pritem_numberofstop, $last_pritem_speed) = explode(",", $v["note"]); + ?> + + + + + + + + + + + + + 0) { + foreach ($hope_elev_spec_arr as $k => $v) { + ?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
整機單價
電梯人乘/載重停數速度開門方式規格單價數量複價售價
+ + + + + + + + + + + + + " readonly>" readonly>">">" readonly>" required> + + + + X +
+ + + + + + + + + "> + + + + + " readonly>">">" readonly>" required> + + + + X +
+ + + + + + + + + + + + + + + + + + X +
小計
+
+
+
+ + + + + + + + + + + + + + + + + 0 && isset($last_pritem_arr["B"])) { + foreach ($last_pritem_arr["B"] as $k => $v) { + ?> + + + + + + + + + + 0) { + foreach ($hope_opt_arr as $k => $v) { + ?> + + + + + + + + + + + + + + + + + + + + + + + + + +
OPTION加價
選配規格單價數量複價備註 +
所屬電梯 + + + + +
+
功能
+ + " readonly>">" readonly> + "> + ">電梯 + X +
+ + " readonly>">" readonly> + + "> + 電梯 + X +
+ 點選 + " readonly>">" readonly> + + 電梯 + X +
小計
+
+
+
+ + + + + + + + + + + + + + + 0 && isset($last_pritem_arr["E"])) { + foreach ($last_pritem_arr["E"] as $k => $v) { + ?> + + + + + + + + + + + + + + + + + + + + + +
除外項目
詢價單號名稱單價數量複價
">" readonly>" readonly>">">" readonly> + + X +
+ X +
小計
+
+
+
+ + + + + + + + + + + + + + + + + + + + 0 && isset($last_pritem_arr["D"])) { + foreach ($last_pritem_arr["D"] as $k => $v) { + list($last_pritem_seat, $last_pritem_numberofstop, $last_pritem_speed) = explode(",", $v["note"]); + ?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
保固延長
電梯人乘/載重停數速度單價數量(月)複價備註所屬電梯 + + 功能
+ + + + + + + + " readonly>">">" readonly> + + 電梯 + X +
+ + + + + + + + 電梯 + X +
小計
+
+
+
+ + + + + + + + + + + + + + + 0 && isset($last_pritem_arr["C"])) { + foreach ($last_pritem_arr["C"] as $k => $v) { + //list($seat, $floor) = explode(",", $v["item_spec"]); + list($seat, $floor) = array_pad(explode(",", $v["item_spec"]), 2, null); // 換個寫法,避免undefined offset + ?> + + + + + + + + + + + + + + + + + + + + + +
拆梯價格
人乘/載重樓層單價數量複價
+ + + + " readonly>">" readonly> + + X +
+ + + + + + X +
小計
+
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
付款辦法款別比例%金額票期
材料1、訂金">" readonly> + +
2、二次款">" readonly> + +
3、貨到工地款">" readonly> + +
4、其它">" readonly> + +
安裝5、安裝完畢款">" readonly> + +
6、驗收款">" readonly> + +
7、其它">" readonly> + +
合計" readonly>" readonly>
備註
+
+ +
+
+ + " readonly> +
+
+ + + +
+
+ + " readonly> +
+
+ + " readonly> +
+
+ + +
+
+ + "> +
+
+ + 0) { + echo number_format(($last_pr_arr["price_total"] - $last_pr_arr["price_lowest"]) / $last_pr_arr["qty_total"]); + } ?>" readonly> +
+
+
+ " required> +
+
+
+ " required> +
+
+
+ + "> +
+
+ + "> +
+
+ + "> +
+
+ + "> +
+ +
+ +
+ + + + + + + + + + + +
+
+ + +
+ +X +
+ +X +

+  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + \ No newline at end of file