TransformProductCode2LaserFile.php 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <?php
  2. ini_set('display_errors', 1);
  3. ini_set('display_startup_errors', 1);
  4. error_reporting(E_ALL);
  5. header('Content-Type: application/json');
  6. if(isset($_GET["ProductCodeJson"])){
  7. $productcode = json_decode($_GET["ProductCodeJson"]);
  8. }
  9. elseif (isset($_GET["ProductCode"])){
  10. $noecho=true;
  11. include "TransformProductCode.php"; //if in the same folder
  12. $productcode = json_decode(json_encode($asocarray2));
  13. }
  14. //{"Pb":"E","Sy":"A","Pk":"PZ","Ba":"KZ-S","Za":"31","Zi":"31","Of":"NI","Kf":"X1K","Pf":"KeineAngabePf","Va":"KeineAngabeVa","Sn":"SEP","Zs":"SET1"}
  15. if ($productcode->Ba == "RKZ-S" || $productcode->Ba == "RHZ-S" || $productcode->Ba == "RDZ-S"){
  16. $file ="CE_SerNr_SlotT1_RP." . $productcode->Za . ".rotiert.xml";
  17. }
  18. elseif (($productcode->Ba == "KZ-S" || $productcode->Ba == "HZ-S" || $productcode->Ba == "DZ-S") && $productcode->Pf == "FLU"){
  19. $file = "CE_SerNr_FLU_SlotT1_EP." . $productcode->Za . ".rotiert.xml";
  20. }
  21. elseif ($productcode->Ba == "KZ-S" || $productcode->Ba == "HZ-S" || $productcode->Ba == "DZ-S"){
  22. $file = "CE_SerNr_SlotT1_EP." . $productcode->Za . ".rotiert.xml";
  23. }
  24. elseif ($productcode->Pk == "HA" && $productcode->Ba == "HM24-S" ){
  25. $file = "CE_SerNr_SlotT1_HPM.xml";
  26. }
  27. elseif ($productcode->Pk == "AI" && $productcode->Ba == "AZ25-FP" ){
  28. $file = "CE_SerNr_SlotT1_AZ25-FP.rotiert.xml";
  29. }
  30. elseif ($productcode->Pk == "SKI" || $productcode->Pk == "SKA" ){
  31. $file = "CE_SerNr_SlotT1_SKA-SKI.xml";
  32. }
  33. elseif ($productcode->Ba == "SKI" || $productcode->Ba == "SKA" ){
  34. $file = "CE_SerNr_SlotT1_SKA-SKI.xml";
  35. }
  36. elseif ($productcode->Pk == "HB" ){
  37. $file = "CE_SerNr_SlotT1_" . $productcode->Ba . ".xml";
  38. }
  39. echo json_encode($file);
  40. ?>