Online PHP and Javascript Decoder decode hidden script to uncover its real functionality



 namespace App\Http\Controllers; use App\Commission; use App\Issue; use App\WireProperties; use App\Wires; use App\Wiring; use App\PropertyNames; use App\Setting; use App\UserSettings; use Archive7z\Archive7z; use PDO; class CommissionController extends Controller { const B8cC2 = "eepdz"; const XeeS9 = "2.6s.10395"; const g1PZ1 = 3; const fIrlz = "application/x-7z-compressed"; protected $supportedFileExtensions = array("epdz", "xls", "xlsx", "xlsm"); protected $excelMimeTypes = array("vnd.ms-excel", "vnd.openxmlformats-officedocument.spreadsheetml", "msexcel", "x-msexcel", "x-ms-excel", "x-excel", "xls", "x-xls", "octet-stream"); protected $request; protected static $wireLengthUnitMap = array(1 => "mm", 2 => "cm", 3 => "dm", 4 => "m", 5 => "Meter", 6 => "km", 7 => "Inch", 8 => "''", 9 => "In", 10 => "ft", 11 => "feet", 12 => "foot", 13 => "yd", 14 => "yard"); protected static $meterConverter = array("mm" => 1000, "cm" => 100, "dm" => 10, "m" => 1, "Meter" => 1, "km" => 0.001, "Inch" => 39.37, "''" => 39.37, "In" => 39.37, "ft" => 3.281, "feet" => 3.281, "foot" => 3.281, "yd" => 1.094, "yard" => 1.094); private static $xlsColumnNames = array(0 => array("name" => "No.", "type" => "Integer", "mandatory" => true, "dbPropertyName" => "id", "maxLength" => 4), 1 => array("name" => "Colour", "type" => "string", "mandatory" => false, "dbPropertyName" => "color", "maxLength" => 10), 2 => array("name" => "Cross section", "type" => "string", "mandatory" => false, "dbPropertyName" => "crossSection", "maxLength" => 6), 3 => array("name" => "Source", "type" => "string", "mandatory" => true, "dbPropertyName" => "source/id"), 4 => array("name" => "Target", "type" => "string", "mandatory" => true, "dbPropertyName" => "target/id"), 5 => array("name" => "Length", "type" => "string", "mandatory" => false, "dbPropertyName" => "length", "maxLength" => 10), 6 => array("name" => "Wire termination processing (source)", "type" => "string", "mandatory" => false, "dbPropertyName" => "source/termination"), 7 => array("name" => "Wire termination processing (target)", "type" => "string", "mandatory" => false, "dbPropertyName" => "target/termination"), 8 => array("name" => "Routing direction (source)", "type" => "string", "mandatory" => false, "dbPropertyName" => "source/direction"), 9 => array("name" => "Routing direction (target)", "type" => "string", "mandatory" => false, "dbPropertyName" => "target/direction"), 10 => array("name" => "Bundle number", "type" => "Integer", "mandatory" => false, "dbPropertyName" => "bundle", "maxLength" => 20), 11 => array("name" => "Sequence No.", "type" => "Integer", "mandatory" => false, "dbPropertyName" => "sequence", "maxLength" => 8), 12 => array("name" => "Routing track", "type" => "string", "mandatory" => false, "dbPropertyName" => "routing"), 13 => array("name" => "Designation", "type" => "string", "mandatory" => false, "dbPropertyName" => "designation"), 14 => array("name" => "Comment", "type" => "string", "mandatory" => false, "dbPropertyName" => "comment"), 15 => array("name" => "Wire Type", "type" => "string", "mandatory" => false, "dbPropertyName" => "type"), 16 => array("name" => "Chain ID", "type" => "Integer", "mandatory" => false, "dbPropertyName" => "daisyChainGroupId"), 17 => array("name" => "Chain Order", "type" => "Integer", "mandatory" => false, "dbPropertyName" => "daisyChainItemId")); public function index() { goto GdUUs; iPl3A: $djtJb->name = str_limit($djtJb->name, 20); goto xUUZP; aXGDb: hbuQ2: goto qsgWR; WYQay: bgFsy: goto IB2t9; GdUUs: $BQ77M = $this->request->filesDirectory; goto ksRtt; a6_IW: GU5zB: goto GncJL; ksRtt: $F7b3y = \App\Commission::with(array("wirings" => function ($M42qd) { $M42qd->select("id", "is_finished", "commission_id", "created_at", "updated_at"); }))->orderBy("commissions.updated_at", "desc")->get(array("commissions.name", "commissions.id", "commissions.created_at", "commissions.updated_at", "commissions.commission_location")); goto TJnzo; qsgWR: if (count($rhCuR)) { goto GU5zB; } goto C31y7; QN1LK: goto Z0YLr; goto a6_IW; C31y7: $djtJb = null; goto QN1LK; GncJL: $djtJb = clone end($rhCuR); goto iPl3A; TJnzo: $rhCuR = array(); goto VytKd; Svg3E: foreach ($F7b3y as $EgTqZ) { goto Laoqm; oVxK6: MmR31: goto kA8MI; Rw3Ux: BCl3y: goto aKM9h; l6Kpe: $EgTqZ["hasFinishedWirings"] = false; goto rPBuZ; aKM9h: $lgQ33 = str_replace(array("/", "\"), DIRECTORY_SEPARATOR, $EgTqZ->commission_location); goto spRKj; gEKqN: $EgTqZ["allFinished"] = true; goto l6Kpe; Laoqm: if (!(count($EgTqZ["wirings"]) == 0)) { goto SP9CJ; } goto BxVjW; rPBuZ: foreach ($EgTqZ["wirings"] as $q9pX9) { goto Xxgb3; DBKZ6: $q9pX9["status"] = $q9pX9->status(); goto lJ62X; lJ62X: PmP8V: goto I4YPr; c8Vll: goto USVPR; goto gRPTc; oWN8s: USVPR: goto DBKZ6; Xxgb3: if ($q9pX9["is_finished"] == 0) { goto sbZn3; } goto HVW1K; HVW1K: $EgTqZ["hasFinishedWirings"] = true; goto c8Vll; gRPTc: sbZn3: goto MkqbR; MkqbR: $EgTqZ["allFinished"] = false; goto oWN8s; I4YPr: } goto Rw3Ux; niuwy: goto IyFeH; goto oVxK6; tZ_ww: $EgTqZ->updated_at = $IMqWM; goto JbH0c; kA8MI: $IMqWM = $EgTqZ->updated_at->diffForHumans(); goto sP6sp; BxVjW: goto IyFeH; goto L6ry_; spRKj: if (!(realpath($lgQ33) != realpath($BQ77M) && !$this->request->serviceMode)) { goto MmR31; } goto niuwy; JbH0c: $rhCuR[] = $EgTqZ; goto RsrDo; RsrDo: IyFeH: goto nUNSN; sP6sp: $EgTqZ = (object) $EgTqZ->toArray(); goto tZ_ww; L6ry_: SP9CJ: goto gEKqN; nUNSN: } goto aXGDb; VytKd: if (!$F7b3y) { goto bgFsy; } goto Svg3E; IB2t9: return $this->returnResponse(array("data" => array("commissions" => $rhCuR, "lastCommission" => $djtJb))); goto c9cpu; xUUZP: Z0YLr: goto WYQay; c9cpu: } public function listCommisionFiles() { goto cB6tR; ccuVS: return $this->returnResponse(array("data" => $KpWKa)); goto sj7Jt; uaZyS: $KpWKa = $this->getFiles($this->request->filesDirectory, $uMAsS); goto ccuVS; G0PzA: Zj9aE: goto uaZyS; cB6tR: switch ($this->request->epdzFile) { case "-1": $uMAsS = $this->supportedFileExtensions; goto Zj9aE; case '': $uMAsS = array("xls", "xlsx", "xlsm"); goto Zj9aE; case "1": $uMAsS = array("epdz"); goto Zj9aE; default: $uMAsS = $this->supportedFileExtensions; } goto LXDSy; LXDSy: b0vMp: goto G0PzA; sj7Jt: } public function listImportFiles() { $KpWKa = $this->getFiles($this->request->filesDirectory, array(self::B8cC2)); return $this->returnResponse(array("data" => $KpWKa)); } public function getFiles($T_Bzd, $Md19h) { goto jr3KW; qEd8G: $KpWKa = scandir("wfio://" . $y8fnx); goto gGsNc; akDRL: $KpWKa = array_filter($KpWKa); goto vKHnF; jr3KW: $y8fnx = $T_Bzd; goto qEd8G; VKmiL: return $KpWKa; goto mGQyN; gGsNc: foreach ($KpWKa as $IbXf_ => $o2ub2) { goto paBQK; wlnNk: yWFKX: goto NC3iV; GemI9: $eCNUp = iconv("cp52", "utf-8", $eCNUp); goto Ssaas; paBQK: if (in_array(pathinfo($o2ub2, PATHINFO_EXTENSION), $Md19h)) { goto YJd_s; } goto ytxGL; Ssaas: y7sJ7: goto IfTnm; LKQYu: $eCNUp = basename($o2ub2); goto TaLQV; S5u4X: UsvWT: goto GemI9; ytxGL: $KpWKa[$IbXf_] = null; goto qPPE1; LTIlb: YJd_s: goto LKQYu; LB3WJ: kK1lP: goto wlnNk; TJenq: goto y7sJ7; goto S5u4X; CLdPA: $eCNUp = iconv(mb_detect_encoding($eCNUp, mb_detect_order(), true), "utf-8", $eCNUp); goto TJenq; IfTnm: $KpWKa[$IbXf_] = $eCNUp; goto LB3WJ; qPPE1: goto kK1lP; goto LTIlb; TaLQV: if (mb_detect_encoding($eCNUp, mb_detect_order(), true) === false) { goto UsvWT; } goto CLdPA; NC3iV: } goto EyLFo; vKHnF: asort($KpWKa); goto MRDbs; EyLFo: zrTcf: goto akDRL; MRDbs: $KpWKa = (array) array_values($KpWKa); goto VKmiL; mGQyN: } public function listAll() { goto YFC9o; YFC9o: if (isset($this->request->fileName)) { goto RPgXS; } goto bGHNX; mivTl: r3iXR: goto N0Qmc; nXxvX: $BQ77M = str_replace(array("/", "\"), DIRECTORY_SEPARATOR, $DGqAX->value); goto eDAhB; eDAhB: goto r3iXR; goto m1G3z; SajSM: $rhCuR = array(); goto TOj0s; N0Qmc: switch (DIRECTORY_SEPARATOR) { case "\": $U2nVl = str_replace(array("\", "/"), "/", $BQ77M); goto mAYUH; case "/": $U2nVl = str_replace(array("\", "/"), "\", $BQ77M); } goto H4kow; m1G3z: RPgXS: goto AR1q5; U7tqV: $F7b3y = \App\Commission::where("commission_location", $BQ77M)->orWhere("commission_location", $U2nVl)->orderBy("updated_at", "desc")->get(array("name", "id", "created_at", "updated_at", "commission_location")); goto SajSM; H4kow: pdL5Q: goto oIHyK; AR1q5: $BQ77M = str_replace(array("/", "\"), DIRECTORY_SEPARATOR, pathinfo($this->request->fileName)["dirname"]); goto mivTl; bGHNX: $DGqAX = Setting::where("key", "filesDirectory")->first(); goto nXxvX; dKfrk: return $this->returnResponse(array("data" => array("commissions" => $rhCuR))); goto Wlypw; aB3zW: keDYe: goto dKfrk; oIHyK: mAYUH: goto U7tqV; TOj0s: foreach ($F7b3y as $EgTqZ) { goto MK4Yk; EzM8J: ge8wx: goto QgpNU; pFWMs: OSGRs: goto UkLN7; QgpNU: $IMqWM = $EgTqZ->updated_at->diffForHumans(); goto YEAkC; YEAkC: $EgTqZ = (object) $EgTqZ->toArray(); goto NWCp6; eqDaB: $rhCuR[] = $EgTqZ; goto pFWMs; TepX7: goto OSGRs; goto EzM8J; H7HLs: if (!(isset($this->request->fileName) && $EgTqZ->name != pathinfo($this->request->fileName)["filename"] || $lgQ33 != $BQ77M)) { goto ge8wx; } goto TepX7; MK4Yk: $lgQ33 = str_replace(array("/", "\"), DIRECTORY_SEPARATOR, $EgTqZ->commission_location); goto H7HLs; NWCp6: $EgTqZ->updated_at = $IMqWM; goto eqDaB; UkLN7: } goto aB3zW; Wlypw: } public function show(string $ck_NZ) : \Illuminate\Http\JsonResponse { $FyGE0 = $this->getAllPhrases($ck_NZ); return $this->returnResponse(array("data" => $FyGE0)); } public function barcode() { goto ki1H1; BdemN: return $this->returnResponse(array("error" => trans("phrases.barcode_does_not_match_any_known_data"))); goto EkaF5; UJ7p1: $QnyPw = $TVTHs->getInstance($QnyPw->id); goto k0dAq; z439s: $TVTHs = new WiringController(); goto LlE3h; ki1H1: $fFwn7 = $this->request->barcode; goto Vn6Iq; Vn6Iq: $EgTqZ = Commission::where("barcode", $fFwn7)->first(); goto P94pG; EkaF5: bKE3G: goto z439s; P94pG: if ($EgTqZ) { goto bKE3G; } goto BdemN; LlE3h: $QnyPw = $TVTHs->create($EgTqZ->id); goto UJ7p1; k0dAq: return $this->returnResponse(array("data" => $QnyPw)); goto Kt4sA; Kt4sA: } public function delete() : \Illuminate\Http\JsonResponse { goto USbZu; ZfyKi: oDIMN: goto Mkkpn; yQzrp: \DB::commit(); goto wd3IB; USbZu: \DB::beginTransaction(); goto ThGiH; wd3IB: return $this->returnResponse(array("data" => "ok")); goto ns9jn; u_trN: foreach ($TEYlP as $q9pX9) { goto dZuxv; z5QrZ: if (!$j3u1K) { goto gNEl0; } goto DFqz4; dZuxv: $j3u1K = WiringController::usersWorkingOnWiring($q9pX9["id"]); goto z5QrZ; Fi3hI: gNEl0: goto HiRDd; HiRDd: jLLqN: goto EKHLc; DFqz4: return $this->returnResponse(array("error" => trans("phrases.there_are_users_working_on_this_project"))); goto Fi3hI; EKHLc: } goto ZfyKi; Mkkpn: $EgTqZ = Commission::where("id", "=", $ncehY)->delete(); goto yQzrp; BNCA6: $TEYlP = Wiring::where("commission_id", "=", $ncehY)->get()->toArray(); goto u_trN; ThGiH: $ncehY = $this->request->commissionId; goto BNCA6; ns9jn: } public function loadCommissionFile() { goto l32mW; ijMaq: ePzTn: goto ZlzyX; l32mW: if (substr($this->request->filesDirectory, -1) == "/") { goto NepwN; } goto vm3ux; vm3ux: return $this->parseFile($this->request->filesDirectory . "/" . $this->request->fileName); goto dcKTd; dcKTd: goto ePzTn; goto zQJrY; Cutpi: return $this->parseFile($this->request->filesDirectory . $this->request->fileName); goto ijMaq; zQJrY: NepwN: goto Cutpi; ZlzyX: } public function load() : \Illuminate\Http\JsonResponse { goto QuZDJ; poC8i: return $this->returnResponse(array("data" => $vaym2)); goto zfFqq; QuZDJ: if ($this->checkEplanLicense()) { goto vVDRU; } goto NMsXB; NMsXB: return $this->returnResponse(array("data" => "fail")); goto Bc0Ky; Bc0Ky: vVDRU: goto pTTVW; OOcRr: $vaym2->type = $EgTqZ->type; goto FUCqj; FUCqj: $vaym2->{"3d_file"} = $EgTqZ->{"3d_file"}; goto y2xgB; yzyFc: $vaym2 = new \stdClass(); goto l4r4J; kHS0F: $vaym2->version = $EgTqZ->version; goto OOcRr; y2xgB: $vaym2->wiringId = 1; goto poC8i; am7M5: $EgTqZ = \App\Commission::where("id", $ncehY)->first(); goto yzyFc; pTTVW: $ncehY = $this->request->commissionId; goto am7M5; l4r4J: $vaym2->name = $EgTqZ->name; goto kHS0F; zfFqq: } public function parseFile($Oua98) : \Illuminate\Http\JsonResponse { goto ahN0N; K8dZl: if ($EgTqZ["commissionType"] == "epdz" && isset($EgTqZ["3d_file"]) && $EgTqZ["3d_file"]) { goto Bonyn; } goto eVz3t; oWlaN: EW5zX: goto zwV5F; AiMVE: goto tcV8w; goto hVi4X; NrsDB: $VYI52 = $EgTqZ["wires"]; goto uzB79; kkvp7: switch ($SG3rz) { case "epdz": goto XocFX; MTFu_: return $EgTqZ; goto tPzcy; T0Djk: A42CJ: goto t574M; iUFzf: if (!is_a($EgTqZ, "Illuminate\Http\JsonResponse")) { goto k8nxE; } goto MTFu_; xAC70: if (!(is_array($EgTqZ) && isset($EgTqZ["error"]))) { goto A42CJ; } goto skBY8; KyrlO: goto R9pii; goto lpJ7Q; XocFX: $EgTqZ = $this->parseEpdzCommission($GucLq, $Hjjy3); goto iUFzf; tPzcy: k8nxE: goto xAC70; skBY8: return $this->returnResponse(array("error" => $EgTqZ["error"])); goto T0Djk; t574M: $EgTqZ = $EgTqZ["commission"]; goto KyrlO; lpJ7Q: case self::B8cC2: goto QXcKb; udBcG: return $this->returnResponse(array("data" => $q9pX9)); goto GfKPB; YlbL0: $ruSLh = Wiring::where("commission_id", $EgTqZ->id)->firstOrFail()->toArray(); goto E_SDc; QXcKb: $EgTqZ = $this->parseImportFile($Hjjy3); goto knqvy; g7EaY: $YxSxK = new WiringController(); goto YlbL0; oZQCs: return $this->returnResponse(array("error" => trans("phrases.file_already_imported"))); goto QpMQq; knqvy: if ($EgTqZ) { goto ndfyU; } goto oZQCs; E_SDc: $q9pX9 = $YxSxK->getInstance($ruSLh["id"]); goto udBcG; QpMQq: ndfyU: goto g7EaY; GfKPB: case "xls": case "xlsx": case "xlsm": goto ezeiP; s7XHr: goto R9pii; goto gTWW_; J6mpq: $EgTqZ = $y3Y4n["commission"]; goto HCxes; EW333: K8jl6: goto J6mpq; HCxes: $EgTqZ["wires"] = $TVTHs->prepareDataForNewWiring($EgTqZ["wires"]); goto L_K1d; STJUl: return $this->returnResponse(array("error" => $HD6kH)); goto tNc4X; tNc4X: goto Z03kk; goto EW333; HWPVb: if (count($y3Y4n["error"]) == 0) { goto K8jl6; } goto hMqzn; hMqzn: $HD6kH = $y3Y4n["error"]; goto STJUl; L_K1d: Z03kk: goto s7XHr; ezeiP: $y3Y4n = $this->parseXlsCommission($GucLq); goto HWPVb; gTWW_: default: return $this->returnResponse(array("error" => trans("phrases.unsupported_file"))); } goto oWlaN; V3Sbv: tcV8w: goto RGEX9; d3RUX: $EgTqZ["commission_location"] = dirname($Oua98); goto K8dZl; L31eK: WfxPG: goto ijBPy; RGEX9: $ncehY = $this->saveCommissionData($EgTqZ); goto jam12; ijBPy: $GucLq = $Oua98; goto pdAdm; hVi4X: Bonyn: goto tEAB1; wugjb: $TVTHs = new WiringController(); goto kkvp7; HdbBs: return $this->returnResponse(array("data" => $QnyPw)); goto xV6wy; ahN0N: if ($this->checkEplanLicense()) { goto WfxPG; } goto QUnPq; tEAB1: $zK_6p = $EgTqZ["3d_file"]; goto V3Sbv; QUnPq: return $this->returnResponse(array("data" => "fail")); goto L31eK; zwV5F: R9pii: goto hDydg; eVz3t: $zK_6p = null; goto AiMVE; otLwD: try { $SG3rz = $this->validateCommissionFileFormat($Hjjy3); } catch (\Exception $zkXBC) { return $this->returnResponse(array("error" => $zkXBC->getMessage())); } goto wugjb; Xw3oP: $QnyPw = $TVTHs->getInstance($QnyPw->id); goto c3FoG; uzB79: $EgTqZ["wires"] = null; goto d3RUX; jam12: $QnyPw = $TVTHs->create($ncehY, $VYI52, $zK_6p); goto Xw3oP; c3FoG: $this->saveCommissionProperties($VYI52, $ncehY); goto HdbBs; pdAdm: $Hjjy3 = $this->copyFileToUTFEncoding($GucLq); goto otLwD; hDydg: $EgTqZ["commissionType"] = $SG3rz; goto NrsDB; xV6wy: } public function update() : \Illuminate\Http\JsonResponse { goto tSrww; JKgYg: try { $SG3rz = $this->validateCommissionFileFormat($GucLq); } catch (\Exception $zkXBC) { return $this->returnResponse(array("error" => $zkXBC->getMessage())); } goto j2jq_; tSrww: $GucLq = $this->request->file("commission_file"); goto FahwW; RsI60: kT_dQ: goto I5AeA; FahwW: $ncehY = $this->request->get("commissionId"); goto JKgYg; Pb2Xt: try { $this->updateCommissionData($RInT9, $al68Y); } catch (\Exception $zkXBC) { dd($zkXBC); } goto EqMsV; I5AeA: WJ0bz: goto Pb2Xt; j2jq_: switch ($SG3rz) { case "epdz": goto Ix9tY; gznyp: KtIyM: goto gZsjo; mcCvw: if (isset($al68Y["commission"])) { goto KtIyM; } goto gKHML; Nrlfs: goto WJ0bz; goto WYh4r; gZsjo: $RInT9 = Commission::find((int) $ncehY); goto Nrlfs; gKHML: return $this->returnResponse(array("error" => trans("phrases.loaded_commission_is_not_a_correct_commission_file_update_cancelled"))); goto gznyp; Ix9tY: $al68Y = $this->parseEpdzCommission($GucLq, $GucLq, true); goto mcCvw; WYh4r: case "xls": goto WJ0bz; default: return $this->returnResponse(array("error" => trans("phrases.update_process_does_not_apply_to_this_file_format_update_cancelled"))); } goto RsI60; EqMsV: return $this->returnResponse(array("data" => "commission_updated")); goto VWeT6; VWeT6: } public function updateCommissionData($RInT9, $al68Y) { $RInT9->version = $al68Y["commission"]["version"]; $RInT9->{"3d_file"} = $al68Y["commission"]["3d_file"]; } public function searchMyCoolArray($MeOse, $M2Do7, $okShd) { goto oYJEr; fS1qy: return $kniFl; goto yVWfn; o7k7N: ggtyE: goto w2sZW; KtYWH: if (!is_array($MeOse)) { goto K0xLq; } goto UfyBr; u8HTI: K0xLq: goto fS1qy; UfyBr: if (!(isset($MeOse[$M2Do7]) && $MeOse[$M2Do7] == $okShd)) { goto ggtyE; } goto egoV0; w2sZW: foreach ($MeOse as $sAUpL) { $kniFl = array_merge($kniFl, $this->searchMyCoolArray($sAUpL, $M2Do7, $okShd)); ciOor: } goto gvAsZ; gvAsZ: tt34x: goto u8HTI; egoV0: $kniFl[] = $MeOse; goto o7k7N; oYJEr: $kniFl = array(); goto KtYWH; yVWfn: } public function saveCommissionData($EgTqZ) : int { goto RXNpm; BANpX: $al68Y->commission_location = $EgTqZ["commission_location"]; goto Qjgm3; Svmts: upkAA: goto anuy5; brbht: PZH9m: goto bi5EF; anuy5: return $al68Y->id; goto BTFdO; WLbVz: $al68Y->barcode = ''; goto BANpX; XjY9Z: if (!($EgTqZ["commissionType"] == "epdz" && isset($EgTqZ["3d_file"]) && $EgTqZ["3d_file"])) { goto upkAA; } goto i4gAI; yI2Yy: Gn3s9: goto cTaAh; wq5cH: $al68Y->wirings = 0; goto MVn21; OPAli: $al68Y = new Commission(); goto GjjFA; RXNpm: if ($this->commissionAlreadyExists($EgTqZ)) { goto Gn3s9; } goto OPAli; i4gAI: $al68Y->{"3d_file"} = 1; goto KVkwI; GjjFA: $al68Y->name = $EgTqZ["name"]; goto wPPE8; H5opY: return $EgTqZ->id; goto brbht; KVkwI: $al68Y->save(); goto Svmts; OQs8X: $al68Y->save(); goto XjY9Z; wPPE8: $al68Y->version = isset($EgTqZ["version"]) ? $EgTqZ["version"] : 0; goto wq5cH; BTFdO: goto PZH9m; goto yI2Yy; Qjgm3: $al68Y->{"has_daisy_chain"} = $EgTqZ["has_daisy_chain"]; goto OQs8X; cTaAh: $EgTqZ = $this->getCommissionByNameAndLocation($EgTqZ); goto H5opY; MVn21: $al68Y->type = "single"; goto WLbVz; bi5EF: } public function saveCommissionProperties($VYI52, $ncehY) { goto JQn33; I0W3g: $WOaPW = PropertyNames::all(); goto swScu; pOozO: \DB::beginTransaction(); goto ns2cU; z2LMV: \DB::table("wire_properties")->insert($enyN3); goto G6Ore; ns2cU: foreach ($VYI52 as $Sk78U => $VO97w) { goto LfJ8v; JIGFy: j8opB: goto gVCHY; nWkCq: $gX2f_->commission_id = $ncehY; goto m4qdZ; m4qdZ: $gX2f_->wire_id = $Sk78U; goto aUEtM; CPy91: JkAOT: goto JIGFy; gaNxS: if (!($WrDTg % 10 == 0)) { goto JkAOT; } goto N8fai; lFifv: foreach ($VO97w as $sNq4T => $LnGvk) { goto FDZGK; VCP9G: $MXqTP->value = json_encode($LnGvk); goto F0Y7E; n2Mvb: $MXqTP->value = $LnGvk; goto DOh9x; VAFIy: ST6qj: goto VCP9G; F0Y7E: gXUWx: goto DhhSV; gysQ2: $MXqTP = new WireProperties(); goto gqRBb; DOh9x: goto gXUWx; goto VAFIy; DhhSV: $enyN3[] = $MXqTP->attributesToArray(); goto JyxZo; JyxZo: g4v6C: goto at875; FDZGK: if (!isset($lX2Wi[$sNq4T])) { goto g4v6C; } goto gysQ2; gO_8T: if (is_array($LnGvk)) { goto ST6qj; } goto n2Mvb; gqRBb: $MXqTP->wire_id = $gX2f_->id; goto gWvU1; at875: GvB8T: goto hS7R5; gWvU1: $MXqTP->property_id = $lX2Wi[$sNq4T]; goto gO_8T; hS7R5: } goto wn76O; YTMNd: $enyN3 = array(); goto CPy91; N8fai: \DB::table("wire_properties")->insert($enyN3); goto YTMNd; LfJ8v: $gX2f_ = new Wires(); goto nWkCq; dZuQi: $WrDTg++; goto gaNxS; wn76O: krspR: goto dZuQi; aUEtM: $gX2f_->save(); goto lFifv; gVCHY: } goto gKzK8; I4CeV: $enyN3 = array(); goto pOozO; gKzK8: ADcUc: goto z2LMV; Ep1ly: jNvnV: goto pSkqb; swScu: foreach ($WOaPW as $dyj2B) { $lX2Wi[$dyj2B->name] = $dyj2B->id; jlo8Q: } goto Ep1ly; DvdFx: return true; goto ZfY3e; JQn33: Wires::where("commission_id", "=", $ncehY)->delete(); goto I0W3g; G6Ore: \DB::commit(); goto DvdFx; pSkqb: $WrDTg = 0; goto I4CeV; ZfY3e: } public function commissionAlreadyExists($EgTqZ) { goto UV7oJ; UV7oJ: if ($this->getCommissionByNameAndLocation($EgTqZ)) { goto qMYua; } goto IVO2y; BWfF7: goto BcMD3; goto zRMzU; IVO2y: return false; goto BWfF7; nR3qz: return true; goto vAQ6f; zRMzU: qMYua: goto nR3qz; vAQ6f: BcMD3: goto dhJIP; dhJIP: } private function getCommissionByNameAndLocation($EgTqZ) { goto aBI8y; yP1CC: $DGqAX = Setting::where("key", "filesDirectory")->first(); goto Q60_c; VzS4l: $D1_f7 = $EgTqZ["commission"]["name"]; goto KpnNi; h4F59: K9nMe: goto XefdD; KpnNi: goto eLMys; goto KRsiR; jvwL1: CGfVT: goto w_j47; g69hb: eLMys: goto Xvo_N; Xvo_N: if (isset($EgTqZ["commission_location"])) { goto CGfVT; } goto yP1CC; Q60_c: $BQ77M = str_replace(array("/", "\"), DIRECTORY_SEPARATOR, $DGqAX->value); goto Ou8SD; kd0n8: $D1_f7 = $EgTqZ["name"]; goto g69hb; XefdD: return false; goto P6XXk; Ou8SD: goto d4n28; goto jvwL1; aBI8y: if (isset($EgTqZ["name"])) { goto h0BTg; } goto VzS4l; BWoER: $F7b3y = Commission::where(array("name" => $EgTqZ["name"]))->get(); goto xIiv6; KRsiR: h0BTg: goto kd0n8; xIiv6: foreach ($F7b3y as $EgTqZ) { goto ImJhd; EQVUy: Y6dSa: goto hGLGB; Hg0wq: gpjWg: goto EQVUy; WTWQI: return $EgTqZ; goto Hg0wq; ImJhd: $lgQ33 = str_replace(array("/", "\"), DIRECTORY_SEPARATOR, $EgTqZ->commission_location); goto R5iup; R5iup: if (!(realpath($lgQ33) == realpath($BQ77M))) { goto gpjWg; } goto WTWQI; hGLGB: } goto h4F59; w_j47: $BQ77M = str_replace(array("/", "\"), DIRECTORY_SEPARATOR, $EgTqZ["commission_location"]); goto xBV4M; xBV4M: d4n28: goto BWoER; P6XXk: } protected function getAllCommissions() { return Commission::all(); } public function validateCommissionFileFormat($GucLq) { goto w2M4u; ZIVjQ: return $MLMTb; goto HNAfa; G0iY7: if ($O9l92) { goto nEuXO; } goto ZIVjQ; LhcY9: yw1MD: goto BtIZd; YB2DH: h_u_r: goto gnjhx; w2M4u: $Hjjy3 = $GucLq; goto Fj4HM; fThWg: throw new \Exception(trans("phrases.unsupported_file")); goto LhcY9; pkMQp: $MLMTb = \File::extension($Hjjy3); goto U7vhl; gnjhx: K8HaC: goto G0iY7; RtHyp: switch ($MLMTb) { case "epdz": case self::B8cC2: $O9l92 = $LyyDr != self::fIrlz; goto K8HaC; case "xls": case "xlsx": case "xlsm": goto YdRfZ; o0uvU: foreach ($this->excelMimeTypes as $qmLta) { goto lAA9e; qqVAJ: $O9l92 = false; goto N0Hj2; nF4jq: nYjdq: goto g9aHS; lAA9e: if (!(strpos($LyyDr, $qmLta) !== false)) { goto JM3Se; } goto qqVAJ; I1_xG: JM3Se: goto nF4jq; N0Hj2: goto U259F; goto I1_xG; g9aHS: } goto I9IO4; GS0QU: goto K8HaC; goto S9pXS; I9IO4: U259F: goto GS0QU; YdRfZ: $O9l92 = true; goto o0uvU; S9pXS: } goto YB2DH; AwlQI: nEuXO: goto fThWg; U7vhl: $O9l92 = true; goto RtHyp; Fj4HM: $LyyDr = mime_content_type($Hjjy3); goto pkMQp; HNAfa: goto yw1MD; goto AwlQI; BtIZd: } protected function parseRollCommission($GucLq) { } protected function parseCsvCommission($GucLq) { } public function parseXlsCommission($GucLq) { goto pIIHt; O7PXs: $VYI52 = $this->readExcelSheet($ipVmy); goto CgErm; EJmIL: $x_Itf = $this->copyFileToUTFEncoding($GucLq); goto GdCFa; SrS6u: $ipVmy = $Cgesn->getActiveSheet(); goto O7PXs; pIIHt: $EgTqZ = array(); goto EJmIL; GdCFa: $Cgesn = \Excel::load($x_Itf, function ($Cgesn) use(&$EgTqZ) { }); goto Dnd1f; nBfh6: ujoZn: goto a1605; CgErm: $DQerj = array(); goto uaAB_; a1605: return array("commission" => $EgTqZ, "error" => $DQerj); goto Eb9zm; Dnd1f: $EgTqZ["name"] = str_replace(array(".xlsx", ".xls", ".xlsm"), '', \File::name(basename($GucLq))); goto F9S46; uaAB_: foreach ($VYI52 as $ikVkW => $VO97w) { goto iPYIA; puA_v: $EgTqZ["wires"][$dsy6O]["daisyChain"] = $EgTqZ["wires"][$dsy6O]["daisyChainGroupId"] . "/" . $EgTqZ["wires"][$dsy6O]["daisyChainItemId"]; goto JbRGW; JiWGM: $EgTqZ["wires"][$dsy6O]["daisyChain"] = ''; goto x7J54; jCgX4: VRh7J: goto ucXgc; uaekK: miZhn: goto puA_v; JbRGW: $EgTqZ["has_daisy_chain"] = 1; goto jCgX4; ucXgc: mBLPP: goto rexYH; IckxD: if (isset($EgTqZ["wires"][$dsy6O]["daisyChainGroupId"])) { goto miZhn; } goto JiWGM; x7J54: goto VRh7J; goto uaekK; iPYIA: foreach ($VO97w as $IbXf_ => $okShd) { goto s0U4j; uMzAH: $DQerj[] = $this->setErrorValue($ikVkW + 2, trans("phrases.mandatory_column"), $IbXf_, '', trans("phrases.not_empty")); goto Xht6W; q6fw4: if (is_numeric($dsy6O)) { goto Lcwzz; } goto VYa2D; wR8Ez: $dsy6O = $okShd; goto yihlC; RQHWD: goto I24s4; goto OfmD8; hAWL2: FhpvH: goto t49J5; e6jED: $EgTqZ["wires"][$dsy6O][$HoDof[0]][$HoDof[1]] = $okShd; goto RQHWD; hBEOU: WzBgG: goto N_ZgC; IToGn: $DQerj[] = $this->setErrorValue($ikVkW + 2, trans("phrases.value_too_long"), $IbXf_, $okShd, "<=" . self::$xlsColumnNames[$IbXf_]["maxLength"]); goto GJJ6t; nBA9x: I24s4: goto hBEOU; OfmD8: jlUPN: goto CA5sC; t49J5: if ($this->isProperColumnLength($IbXf_, $okShd)) { goto mZcn9; } goto IToGn; GJJ6t: mZcn9: goto D7Wko; kmN1y: $DQerj[] = $this->setErrorValue($ikVkW + 2, trans("phrases.wrong_column_type"), $IbXf_, $okShd, self::$xlsColumnNames[$IbXf_]["type"]); goto hAWL2; D7Wko: if (!($IbXf_ == 0)) { goto mLADK; } goto wR8Ez; c7JPP: $HoDof = explode("/", self::$xlsColumnNames[$IbXf_]["dbPropertyName"]); goto e6jED; axOy7: Lcwzz: goto uql6W; VYa2D: goto eQRGe; goto axOy7; CA5sC: $EgTqZ["wires"][$dsy6O][self::$xlsColumnNames[$IbXf_]["dbPropertyName"]] = $okShd == null ? '' : $okShd; goto nBA9x; s0U4j: if ($this->isColumnMandatoryNotEmpty($IbXf_, $okShd)) { goto XHQgI; } goto uMzAH; yihlC: mLADK: goto q6fw4; uql6W: if (strpos(self::$xlsColumnNames[$IbXf_]["dbPropertyName"], "/") === false) { goto jlUPN; } goto c7JPP; RWk58: if ($this->isColumnTypeCorrect($IbXf_, $okShd)) { goto FhpvH; } goto kmN1y; Xht6W: XHQgI: goto RWk58; N_ZgC: } goto jFMKs; jFMKs: eQRGe: goto IckxD; rexYH: } goto nBfh6; F9S46: $EgTqZ["has_daisy_chain"] = 0; goto SrS6u; Eb9zm: } private function setErrorValue($JPx58, $VG9ec, $PkqYT, $okShd = '', $gyqHx = '') { goto ieK8k; JWstK: $HD6kH["column"] = self::$xlsColumnNames[$PkqYT]["name"] . "(" . ($PkqYT + 1) . ")"; goto obsow; ieK8k: $HD6kH["row"] = $JPx58; goto Zw6XJ; obsow: $HD6kH["value"] = $okShd; goto v7MsT; v7MsT: $HD6kH["expectedValue"] = $gyqHx; goto ueqib; Zw6XJ: $HD6kH["message"] = $VG9ec; goto JWstK; ueqib: return $HD6kH; goto PYzgx; PYzgx: } private function isProperColumnLength($aOH2d, $okShd) { goto yExcj; yExcj: if (!(isset(self::$xlsColumnNames[$aOH2d]["maxLength"]) && strlen($okShd) > self::$xlsColumnNames[$aOH2d]["maxLength"])) { goto kAYDz; } goto UvgWe; UvgWe: return false; goto jZgq0; jZgq0: kAYDz: goto MKwyB; MKwyB: return true; goto IytzW; IytzW: } private function isColumnTypeCorrect($aOH2d, $okShd) { goto aRr34; qn5ot: return true; goto Mt_LC; aRr34: if (self::$xlsColumnNames[$aOH2d]["type"] == "Integer" && $okShd != '') { goto XWGT6; } goto qn5ot; j49TE: XWGT6: goto jSfXV; Mt_LC: goto LYiXM; goto j49TE; IkOUH: LYiXM: goto ZaBZm; jSfXV: return is_numeric($okShd); goto IkOUH; ZaBZm: } private function isColumnMandatoryNotEmpty($aOH2d, $okShd) { goto yjoE2; yjoE2: if (self::$xlsColumnNames[$aOH2d]["mandatory"]) { goto K4Y2U; } goto WMFTB; WMFTB: return true; goto oDEQe; A8lgQ: d6sUq: goto sTFEt; dsru8: return trim(str_replace(array("
", "
"), " ", $okShd)) != ''; goto A8lgQ; oDEQe: goto d6sUq; goto qosyP; qosyP: K4Y2U: goto dsru8; sTFEt: } private function readExcelSheet($ipVmy) { goto DzlNz; xvnrc: if (!($WrDTg < 18)) { goto x8NzU; } goto wpfPG; sTEhT: goto smHdg; goto AUzQU; lO1tb: tfLJm: goto dGSPj; crMhl: $oV5Iy = count($eV0ph) - 1; goto KSu0_; vU4kz: $AJzp2 = true; goto AHYRU; bp1k6: if (!(array_search($oV5Iy, $wBQhV) !== false)) { goto ZDIp_; } goto ZVTVA; BVg_f: TgqkD: goto RXVrO; U5SET: goto bQhPN; goto DS7qD; DzlNz: $eV0ph = array(); goto fQ9m9; KSu0_: bQhPN: goto bp1k6; owM26: jZkA_: goto lO1tb; qk2Xt: return $eV0ph; goto fv0Am; ZVTVA: unset($eV0ph[$oV5Iy]); goto CydHv; YYS1o: plpFS: goto JGC7H; wpfPG: $eV0ph[$B9TEt - 2][$WrDTg] = $ipVmy->getCellByColumnAndRow($WrDTg, $B9TEt)->getValue(); goto SBC3S; Mmp_h: KK2jd: goto qk2Xt; shXV9: $WrDTg++; goto sTEhT; JGC7H: if (!count($wBQhV)) { goto KK2jd; } goto crMhl; eVBXA: smHdg: goto xvnrc; DS7qD: ZDIp_: goto Mmp_h; dGSPj: $B9TEt++; goto LM1Lm; fQ9m9: $wBQhV = array(); goto BOgbY; slSxD: $wBQhV[] = $B9TEt - 2; goto AX_5T; AX_5T: if (!count($wBQhV == 3)) { goto fh9nm; } goto NezBR; KtFtG: $AJzp2 = false; goto BVg_f; VroKT: if (!($B9TEt <= $ipVmy->getHighestRow())) { goto plpFS; } goto vU4kz; CydHv: $oV5Iy--; goto U5SET; T6ONm: fh9nm: goto owM26; OlyeY: wBtcG: goto VroKT; LM1Lm: goto wBtcG; goto YYS1o; BOgbY: $B9TEt = 2; goto OlyeY; RXVrO: SSwWS: goto shXV9; AUzQU: x8NzU: goto yEDjF; SBC3S: if (!($eV0ph[$B9TEt - 2][$WrDTg] != '')) { goto TgqkD; } goto KtFtG; AHYRU: $WrDTg = 0; goto eVBXA; NezBR: goto plpFS; goto T6ONm; yEDjF: if (!$AJzp2) { goto jZkA_; } goto slSxD; fv0Am: } public function export() { goto iK9hK; uz7wp: $mfC2d->addEntry($this->getCachePath() . "\export"); goto tLbHD; w3yrV: $GZ8gd = $this->getCachePath() . "/" . substr(str_shuffle(str_repeat("23456789abcdefghijklmnopqrstuvwxyz", 5)), 0, 5) .  . pathinfo($GucLq, PATHINFO_EXTENSION); goto Oe1WV; F3AOz: $EgTqZ = \App\Commission::find($ncehY); goto FcogF; vloEE: $GucLq = $this->getExportCommissionFilename($EgTqZ->name); goto WIy00; tLbHD: $XjpMx = $this->getCachePath() . "\app\3d\" . $ruSLh . "\"; goto MsnWl; MsnWl: $KpWKa = \File::files($XjpMx); goto kegmE; txHdm: $this->deleteCommissionData($ncehY); goto F3AOz; rzt66: \DB::disconnect("export"); goto no53n; kegmE: foreach ($KpWKa as $o2ub2) { goto N7cMm; EOxzm: Os50Y: goto pB764; fQwul: l1Kl9: goto EOxzm; N7cMm: if (!(pathinfo($o2ub2, PATHINFO_EXTENSION) == "E3d")) { goto l1Kl9; } goto cBenx; cBenx: $mfC2d->addEntry($o2ub2); goto fQwul; pB764: } goto loKbd; FcogF: $lgQ33 = $this->request->filesDirectory; goto vloEE; loKbd: CrxLD: goto rzt66; WIy00: $TMOWG = $lgQ33 . "/" . $GucLq; goto w3yrV; aWIDe: return $this->returnResponse(array("data" => "ok")); goto Nq0lu; pUIeN: \File::delete($this->getCachePath() . "\export.sqlite", $this->getCachePath() . "\export"); goto aWIDe; Jhvr8: copy(storage_path() . "\database.sqlite", $this->getCachePath() . "\export.sqlite"); goto Ulpn7; r6J6J: $ruSLh = $this->request->wiringId; goto Jhvr8; Oe1WV: $mfC2d = new Archive7z($GZ8gd, dirname(base_path()) . "/7z/7za.exe"); goto eGV6I; Ulpn7: $this->connectToExportDatabase(); goto txHdm; iK9hK: $ncehY = $this->request->commissionId; goto r6J6J; eGV6I: copy("wfio://" . $this->getCachePath() . "\export.sqlite", "wfio://" . $this->getCachePath() . "\export"); goto uz7wp; no53n: rename("wfio://" . $GZ8gd, "wfio://" . $TMOWG); goto pUIeN; Nq0lu: } private function getExportCommissionFilename($D1_f7) { $oCOwn = preg_replace("/_ex[0-9]{6}_[0-9]{4}/", '', $D1_f7); return $oCOwn . "_ex" . date("ymd_His") .  . self::B8cC2; } private function connectToExportDatabase() { \Config::set("database.connections.export.database", $this->getCachePath() . "\export.sqlite"); } private function deleteCommissionData($ncehY) { goto cZPx7; EckHp: \App\CommissionExport::where("id", "<>", $ncehY)->delete(); goto dKxMO; dKxMO: $JBuhb = \App\CommissionExport::where("id", "=", $ncehY); goto eeuvV; wqQzd: $CZVYT = str_replace(array("/", "\"), DIRECTORY_SEPARATOR, $t5znx->value); goto EckHp; cZPx7: $t5znx = Setting::where("key", "importDirectory")->first(); goto wqQzd; eeuvV: $JBuhb->update(array("name" => preg_replace("/_ex[0-9]{6}_[0-9]{4}/", '', $JBuhb->get()->toArray()[0]["name"]) . "_ex" . date("ymd_Hi"), "wirings" => 1, "commission_location" => $CZVYT)); goto cvyO4; cvyO4: } public function import() { goto BJAHu; BJAHu: $fP_C9 = $this->request->importDirectory; goto LQZya; LQZya: $Hjjy3 = $this->request->importFileName; goto QJ6Dd; QJ6Dd: return $this->parseFile($fP_C9 . $Hjjy3); goto DkV3p; DkV3p: } private function parseImportFile($wfxTU) { goto IyQ8Y; t832z: if (file_exists($kCkiX)) { goto OzxAw; } goto Qv4Z4; zOwqo: \File::deleteDirectory($dhFMW); goto ok0ml; Nf8fg: $xrLQJ = \App\CommissionExport::first(); goto WBg2F; CbRzJ: $al68Y->type = $xrLQJ->type; goto TDHyn; VBpg6: if ($JZR_o) { goto iq3b3; } goto ep4EC; S0Oel: $OoedR->save(); goto WMQc_; WMQc_: $kCkiX = $this->getCachePath() . "/app{d/" . $OoedR->id; goto PD3N0; hEfNy: nDGZ6: goto viT8R; WBg2F: $JZR_o = false; goto dsM5e; ZuGTO: $OoedR->is_finished = $aIktD->is_finished; goto NATzC; ok0ml: return !$JZR_o ? $al68Y : false; goto VO08w; SW7mB: $bBu5W->setOutputDirectory($dhFMW); goto UCFtz; phiOy: $OoedR->e3d_files_location = $kCkiX; goto I4uZQ; r7Fjm: r0COT: goto SiFz2; j0qv9: Yg69v: goto BYOJm; BYOJm: \Config::set("database.connections.export.database", $this->getCachePath() . "/export.sqlite"); goto VBpg6; CsiEE: $di0WF = \App\WiresExport::all(); goto yULKJ; UCFtz: foreach ($iDceh as $jo15I) { $jo15I->extract(); ENKND: } goto r7Fjm; PNF1O: \DB::commit(); goto j0qv9; yULKJ: foreach ($di0WF->toArray() as $Z9l7m) { goto FIJiE; kLlLQ: wAsWT: goto ahpMr; yuO0A: foreach ($Q8sTo as $DG8CE) { goto U6vSX; SVM4u: $CHCFf->wire_id = $gX2f_->id; goto vKifz; wepvJ: $CHCFf->save(); goto R9kRd; JrwXS: $CHCFf->value = $DG8CE["value"]; goto wepvJ; U6vSX: $CHCFf = new WireProperties(); goto SVM4u; R9kRd: NDpMO: goto Ds1Oe; vKifz: $CHCFf->property_id = $DG8CE["property_id"]; goto JrwXS; Ds1Oe: } goto WyfQO; FIJiE: $gX2f_ = new Wires(); goto VWQac; bVuRj: if (!$Z9l7m["wiring_id"]) { goto x1FmM; } goto UScNC; VWQac: if (!$Z9l7m["commission_id"]) { goto mBTyF; } goto WU_rh; UScNC: $gX2f_->wiring_id = $OoedR->id; goto y436i; WU_rh: $gX2f_->commission_id = $al68Y->id; goto UGRIe; H31Gr: $gX2f_->wire_id = $Z9l7m["wire_id"]; goto tSRrU; WyfQO: NBGol: goto kLlLQ; y436i: x1FmM: goto H31Gr; g0mG7: $Q8sTo = \App\WirePropertiesExport::where("wire_id", $Z9l7m["id"])->get()->toArray(); goto yuO0A; UGRIe: mBTyF: goto bVuRj; tSRrU: $gX2f_->save(); goto g0mG7; ahpMr: } goto hEfNy; IyQ8Y: $bBu5W = new Archive7z($wfxTU, dirname(base_path()) . "/7z/7za.exe"); goto nuN_3; viT8R: $okECm = \DB::connection("export"); goto NwCYY; nGx9Q: OzxAw: goto hNxmj; hNxmj: iq3b3: goto LaPPB; hQaFR: $OoedR->commission_id = $al68Y->id; goto YdCeL; VIuoO: foreach ($iCyZ0 as $WrDTg) { goto JHn_2; HtqSl: EhGjl: goto iUgyk; z6taF: $XpQSv->commission_id = $al68Y->id; goto DMVye; ZvITd: $XpQSv->save(); goto HtqSl; JHn_2: $XpQSv = new Issue((array) $WrDTg); goto z6taF; DMVye: $XpQSv->wiring_id = $OoedR->id; goto ZvITd; iUgyk: } goto wIGsS; ep4EC: $al68Y->e3d_files_location = $kCkiX; goto I4lMX; SiFz2: \Config::set("database.connections.export.database", $dhFMW . "export"); goto Nf8fg; ez3NZ: if (file_exists($dhFMW)) { goto Z80fl; } goto JcM6Y; tUi1t: B8FL2: goto M9pDp; JcM6Y: \File::makeDirectory($dhFMW, 511, true); goto k4l2Z; pIf25: $al68Y->{"commission_location"} = $xrLQJ->commission_location; goto ioq6W; dsM5e: if (!$this->commissionAlreadyExists($xrLQJ)) { goto faTo8; } goto x17f2; yat7A: $iDceh = $bBu5W->getEntries(); goto SW7mB; ZJsLI: H71P9: goto CsiEE; xJmfH: $aIktD = \App\WiringExport::first(); goto hQaFR; OA3kR: \DB::beginTransaction(); goto qRjLN; BQ6wR: $al68Y->{"has_daisy_chain"} = $xrLQJ->{"has_daisy_chain"}; goto foAs0; GC5EG: $OoedR = new Wiring(); goto xJmfH; ioq6W: $al68Y->save(); goto GC5EG; I4lMX: $al68Y->save(); goto t832z; M9pDp: \DB::disconnect("export"); goto zOwqo; rNczr: $al68Y->version = $xrLQJ->version; goto Nno3p; k4l2Z: Z80fl: goto yat7A; NATzC: $OoedR->wiring_mode = $aIktD->wiring_mode; goto S0Oel; egrKl: $BQ77M = str_replace(array("/", "\"), DIRECTORY_SEPARATOR, $DGqAX->value); goto pIf25; NwCYY: $iCyZ0 = $okECm->table("issues")->get(); goto VIuoO; YdCeL: $OoedR->updates_count = $aIktD->updates_count; goto ZuGTO; Nno3p: $al68Y->{"3d_file"} = $xrLQJ->{"3d_file"}; goto BQ6wR; H3z1E: goto Yg69v; goto VWklr; nuN_3: $AlZMs = "import_" . str_random(16); goto Jap36; wIGsS: YPzKI: goto PNF1O; soDp9: $al68Y->name = $xrLQJ->name; goto rNczr; qRjLN: $al68Y = new Commission(); goto CbRzJ; BQqaM: foreach ($KpWKa as $o2ub2) { goto vejxm; xe38I: JB4t2: goto S8s2h; vejxm: if (!(pathinfo($o2ub2, PATHINFO_EXTENSION) == "E3d" && !$JZR_o)) { goto hN_pA; } goto NrprA; Byd0Z: hN_pA: goto xe38I; NrprA: copy($o2ub2, $kCkiX . "/" . pathinfo($o2ub2, PATHINFO_BASENAME)); goto Byd0Z; S8s2h: } goto tUi1t; Jap36: $dhFMW = $this->getCachePath() . DIRECTORY_SEPARATOR . "framework" . DIRECTORY_SEPARATOR . "cache" . DIRECTORY_SEPARATOR . "commission" . DIRECTORY_SEPARATOR . $AlZMs . DIRECTORY_SEPARATOR; goto ez3NZ; I4uZQ: $OoedR->save(); goto ZJsLI; Qv4Z4: \File::makeDirectory($kCkiX, 511, true); goto nGx9Q; x17f2: $JZR_o = true; goto H3z1E; VWklr: faTo8: goto OA3kR; foAs0: $DGqAX = Setting::where("key", "filesDirectory")->first(); goto egrKl; LaPPB: $KpWKa = \File::files($dhFMW); goto BQqaM; TDHyn: $al68Y->wirings = 1; goto soDp9; PD3N0: if (!$xrLQJ->{"3d_file"}) { goto H71P9; } goto phiOy; VO08w: } public function parseEpdzCommission($GucLq, $Uv4hs, bool $xeY99 = false) { goto sD3Rs; BDj04: $EgTqZ["version"] = count($d4yok->first()) > 0 ? $d4yok->first()->value : ''; goto S82Td; aOvVW: if (!(version_compare($okECm->table("manifest")->first()->schemaversion, self::XeeS9) < 0)) { goto m1HSw; } goto FdUUQ; kkyUv: $XjpMx = $this->getCachePath() . DIRECTORY_SEPARATOR . "framework" . DIRECTORY_SEPARATOR . "cache" . DIRECTORY_SEPARATOR . "commission" . DIRECTORY_SEPARATOR . $AlZMs . DIRECTORY_SEPARATOR; goto ym6QI; gIWFV: \Config::set("database.connections.manifest.database", $XjpMx . "manifest.db"); goto Thbi0; L67gb: \File::makeDirectory($XjpMx, 511, true); goto J_v0n; aAKRW: foreach ($iDceh as $o2ub2) { goto dHEeJ; NCcoo: AIQBz: goto AjuQ3; AjuQ3: iphE_: goto D7wuf; dHEeJ: foreach ($jZtXA as $zkXBC) { goto yim26; qondI: s7H8u: goto TpiFY; YVkBi: akai6: goto HyL1y; yim26: if (!(strripos($o2ub2->getPath(), $zkXBC) > 0)) { goto GhhGI; } goto agM7s; ZlU1b: if (isset($EgTqZ["3d_file"][$x5vg6])) { goto akai6; } goto Qr0DF; Qr0DF: $EgTqZ["3d_file"][$x5vg6] = $S00r8->getContent($o2ub2->getPath()); goto YVkBi; agM7s: $x5vg6 = $xeY99 ? str_replace(".E3d", $SBTb1, $zkXBC) : $zkXBC; goto ZlU1b; HyL1y: GhhGI: goto qondI; TpiFY: } goto NCcoo; D7wuf: } goto DVgpb; paRlG: if (!isset($EgTqZ["wires"]) || count($EgTqZ["wires"]) == 0) { goto Vax2D; } goto U6zX9; M6gi6: $HD6kH = trans("phrases.epdz_no_connections"); goto iA0JJ; hKGTm: \File::deleteDirectory($XjpMx); goto yxpMV; PrAZe: $d4yok = $okECm->table("property")->where("packageid", 1)->where("propid", 10023); goto BDj04; FdUUQ: return array("error" => trans("phrases.this_version_of_epdz_format_is_no_longer_supported")); goto Vv0eS; NBkhC: $EgTqZ["3d_file"] = array(); goto a7iTG; TMzB7: return $HD6kH ? array("error" => $HD6kH) : array("commission" => $EgTqZ); goto pwreJ; S82Td: $EgTqZ["has_daisy_chain"] = 0; goto Sd2a3; H0qu4: $iDceh = $S00r8->getEntries(); goto NBkhC; L8cga:  = $xeY99 ? "_" . date("U") : ''; goto gIWFV; TajCT: goto ctDYY; goto WuA_t; r3WDZ: ctDYY: goto H0qu4; oDAsz: c18DL: goto r3WDZ; nPG5F: $jZtXA = array(); goto jP430; U6zX9: if ($EgTqZ["has_daisy_chain"] == 1) { goto hWsQR; } goto TajCT; tBf62: $S00r8->setOutputDirectory($XjpMx); goto K3lnZ; Sd2a3: $VYI52 = $okECm->table("property")->whereIn("property.value", array("4/1|", "4/1/9"))->join("mergedconnection_package", "property.packageid", "=", "mergedconnection_package.packageid")->get(); goto nPG5F; LjC9S: $S00r8 = new Archive7z($Uv4hs, dirname(base_path()) . "/7zza.exe"); goto ihHaz; a7iTG: chdir($this->getCachePath()); goto aAKRW; J_v0n: J3DFO: goto tBf62; ihHaz: $AlZMs = str_random(16); goto kkyUv; qw6Qd: foreach ($EgTqZ["wires"] as &$VO97w) { goto j07ex; mlYNT: if ($VO97w["daisyChainId"] != 0) { goto iTJVv; } goto dbo0B; dbo0B: $VO97w["daisyChain"] = ''; goto LZCR2; CS6gU: iTJVv: goto qmE3z; qmE3z: $VO97w["daisyChain"] = $VO97w["daisyChainId"] . "/" . $VO97w["daisyChainOrderId"]; goto n0LEG; j07ex: if (!(isset($VO97w["daisyChainId"]) && isset($VO97w["daisyChainOrderId"]))) { goto eHaAs; } goto mlYNT; Q8i3g: eHaAs: goto IDs2X; IDs2X: U8wQN: goto lAi3w; LZCR2: goto E6UaY; goto CS6gU; n0LEG: E6UaY: goto Q8i3g; lAi3w: } goto oDAsz; K3lnZ: try { $S00r8->extractEntry("manifest.db"); } catch (\Exception $zkXBC) { dd($zkXBC); } goto L8cga; iA0JJ: goto ctDYY; goto uDbrY; yWFlP: $EgTqZ["name"] = str_replace(array(".epdz"), '', basename($GucLq)); goto PrAZe; Vv0eS: m1HSw: goto yWFlP; DVgpb: aife0: goto GtcLq; IIVg3: D4Qod: goto paRlG; sD3Rs: $HD6kH = false; goto LjC9S; Rhnrz: $okECm->setFetchMode(PDO::FETCH_OBJ); goto aOvVW; Thbi0: $okECm = \DB::connection("manifest"); goto Rhnrz; uDbrY: hWsQR: goto qw6Qd; ym6QI: if (file_exists($XjpMx)) { goto J3DFO; } goto L67gb; yxpMV: @unlink($XjpMx . "manifest.db"); goto X14xG; WuA_t: Vax2D: goto M6gi6; X14xG: @rmdir($XjpMx); goto TMzB7; jP430: foreach ($VYI52 as $VO97w) { goto ccvwN; zkpez: $EgTqZ["wires"][$OZczL[0]->packageid] = $gX2f_; goto sAIAy; OpvIa: foreach ($OZczL as $JPx58) { goto Q7xx2; FtDxr: $gX2f_["installationSpaceName"] = $okECm->table("property")->where(array("packageid" => $KBPR1, "propid" => 36454))->first()->value; goto xQveI; gtw02: WBf23: goto WFfMo; LSKHO: $gX2f_["e3dFile"] = $xeY99 ? str_replace(".E3d", $SBTb1, $glIHu->locator) : str_replace(".E3d", '', $glIHu->locator); goto FtDxr; FX0X1: switch ($JPx58->propid) { case "318": $gX2f_["source"]["x"] = $JPx58->value; goto Y2AaF; case "319": $gX2f_["source"]["y"] = $JPx58->value; goto Y2AaF; case "310": $gX2f_["source"]["z"] = $JPx58->value; goto Y2AaF; case "351": $gX2f_["target"]["x"] = $JPx58->value; goto Y2AaF; case "352": $gX2f_["target"]["y"] = $JPx58->value; goto Y2AaF; case "31153": $gX2f_["target"]["z"] = $JPx58->value; goto Y2AaF; case "019": $gX2f_["source"]["id"] = $JPx58->value; goto Y2AaF; case "320": $gX2f_["target"]["id"] = $JPx58->value; goto Y2AaF; case "311": $gX2f_["source"]["termination"] = $JPx58->value; goto Y2AaF; case "312": $gX2f_["target"]["termination"] = $JPx58->value; goto Y2AaF; case "114": $gX2f_["source"]["direction"] = $JPx58->value; goto Y2AaF; case "311": $gX2f_["target"]["direction"] = $JPx58->value; goto Y2AaF; case "31004": $gX2f_["color"] = $JPx58->value; goto Y2AaF; case "31092": $gX2f_["bundle"] = preg_replace("/[^0-9,.]/", '', $JPx58->value); goto Y2AaF; case "0": $gX2f_["routing"] = $JPx58->value; goto Y2AaF; case "311": $gX2f_["designation"] = $JPx58->value; goto Y2AaF; case "048": $gX2f_["type"] = $JPx58->value; goto Y2AaF; case "245": $gX2f_["comment"] = $JPx58->value; goto Y2AaF; case "31077": $gX2f_["daisyChain"] = $JPx58->value; goto Y2AaF; case null: goto ap9Ks; ZZK8N: goto MYF5W; goto iAfS_; ap9Ks: if ($JPx58->propname == "connection3did") { goto CnCu4; } goto HCKU2; E_XHB: CnCu4: goto MIZ7W; MIZ7W: $gX2f_["previewId"] = $JPx58->value; goto ZZK8N; IKPkk: goto MYF5W; goto L_Cbz; L_Cbz: BT9n6: goto kmlVK; HCKU2: if ($JPx58->propname == "daisychainid") { goto QP9KY; } goto HsP1M; xQt3U: goto Y2AaF; goto i0xHb; kmwF1: $EgTqZ["has_daisy_chain"] = 1; goto Pyg93; HsP1M: if ($JPx58->propname == "daisyChainorderid") { goto BT9n6; } goto Ze79s; iAfS_: QP9KY: goto qfqr0; kmlVK: $gX2f_["daisyChainOrderId"] = $JPx58->value; goto ERzlA; pNxz1: $gX2f_["daisyChainId"] = $JPx58->value; goto IKPkk; Pyg93: Nk7Xs: goto pNxz1; ERzlA: MYF5W: goto xQt3U; qfqr0: if (!($EgTqZ["has_daisy_chain"] == 0)) { goto Nk7Xs; } goto kmwF1; Ze79s: goto MYF5W; goto E_XHB; i0xHb: default: goto Y2AaF; } goto HEu48; HEu48: T1QeW: goto J7acY; vgvCQ: r_Pvs: goto FX0X1; k2xle: $oqSWy = $JPx58->value; goto mbRGu; TGIdB: $glIHu = $okECm->table("item")->where(array("packageid" => $KBPR1, "type" => "installationspacee3d"))->first(); goto LSKHO; J7acY: Y2AaF: goto gtw02; Q7xx2: if (!(is_null($JPx58->propid) && $JPx58->propname == "connection3dinstallationspaceoid")) { goto r_Pvs; } goto k2xle; xQveI: $jZtXA[] = $glIHu->locator; goto vgvCQ; mbRGu: $KBPR1 = $okECm->table("property")->where(array("value" => $oqSWy, "propid" => 2000))->first()->packageid; goto TGIdB; WFfMo: } goto KXuTJ; N_xN4: $EgTqZ["wires"][$JPx58->packageid]["id"] = $JPx58->packageid; goto LrUBJ; cSNcA: if (!isset($EgTqZ["wires"][$JPx58->packageid]["source"]) || !isset($EgTqZ["wires"][$JPx58->packageid]["target"])) { goto d8cUa; } goto N_xN4; nBjE5: if (!(!isset($gX2f_["source"]["id"]) || !isset($gX2f_["target"]["id"]))) { goto TLRG0; } goto wMnld; LrUBJ: goto n2QkE; goto DkiUn; FD1_K: $gX2f_["crossSection"] = $this->getWireCrossSection($OZczL); goto KL8Xu; qgbv1: goto GI8_w; goto UP1OK; XM83u: $gX2f_ = array("length" => '', "crossSection" => '', "color" => '', "bundle" => '', "routing" => '', "designation" => '', "type" => ''); goto OpvIa; ccvwN: $OZczL = $okECm->table("property")->where("property.packageid", $VO97w->packageid)->orderBy("propid", "asc")->get(); goto ud7U5; c37tV: n2QkE: goto rvdxW; kjKrU: qCZCM: goto XM83u; KXuTJ: Odc1T: goto dsKIp; sB0LE: TLRG0: goto Mp4b1; Mp4b1: $gX2f_["length"] = $this->getWireLength($OZczL); goto FD1_K; KL8Xu: if (!$OZczL[0]->packageid) { goto MqKRk; } goto zkpez; sAIAy: MqKRk: goto cSNcA; JhssO: goto GI8_w; goto kjKrU; ud7U5: if ($OZczL) { goto qCZCM; } goto JhssO; UP1OK: k_8Wj: goto nBjE5; rvdxW: GI8_w: goto h49qs; DkiUn: d8cUa: goto r5fck; r5fck: unset($EgTqZ["wires"][$JPx58->packageid]); goto c37tV; dsKIp: if (!(!isset($gX2f_["previewId"]) || strpos($gX2f_["previewId"], "166/") !== 0)) { goto k_8Wj; } goto qgbv1; wMnld: $HD6kH = trans("phrases.mandatory_column") . " " . trans("phrases.source") . "/" . trans("phrases.target"); goto sB0LE; h49qs: } goto IIVg3; GtcLq: $okECm->disconnect(); goto hKGTm; pwreJ: } private function getWireLength($enyN3) { goto k80BU; Vy_JL: vOW2b: goto IjcFb; GaXfK: $n1_rk = null; goto iM5cF; P4SY1: if (is_null($n1_rk)) { goto vOW2b; } goto Fqb12; IjcFb: return ''; goto hixVj; k80BU: $imXIY = 0; goto GaXfK; Fqb12: $fuBBf = self::$wireLengthUnitMap[$n1_rk]; goto nlCd6; MZlTs: sTvLD: goto P4SY1; WdimR: ZQwXs: goto Vy_JL; kJ8K4: return round($imXIY * self::$meterConverter[$fuBBf], self::g1PZ1) . " " . $fuBBf; goto WdimR; nlCd6: if (!isset(self::$meterConverter[$fuBBf])) { goto ZQwXs; } goto kJ8K4; iM5cF: foreach ($enyN3 as $iKwah) { goto waFiD; T0ZBm: return $iKwah->value; goto pZZTS; BfImD: nQt1O: goto YTOIV; C1qOW: umFDC: goto uSYKh; waFiD: if (!($iKwah->propid == "0" && strlen($iKwah->value) > 0)) { goto vonp_; } goto T0ZBm; PPfLz: if (!($iKwah->propid == "3")) { goto nQt1O; } goto HgLPY; PkV6g: $n1_rk = $iKwah->value; goto C1qOW; uSYKh: dUr_H: goto V9HSz; YTOIV: if (!($iKwah->propid == "31001")) { goto umFDC; } goto PkV6g; pZZTS: vonp_: goto PPfLz; HgLPY: $imXIY = $iKwah->value; goto BfImD; V9HSz: } goto MZlTs; hixVj: } private function getWireCrossSection($enyN3) { goto nN8Sv; OOGUe: return ''; goto EAa41; nN8Sv: $fr07D = 0; goto HPsia; WpO_U: Zo7Uj: goto y21y9; bD7IO: return $fr07D . " " . $IfrxK; goto J52wQ; J52wQ: EEinQ: goto OOGUe; sw_a2: foreach ($enyN3 as $iKwah) { goto qZ8zi; qZ8zi: if (!($iKwah->propid == "310" && strlen($iKwah->value) > 0)) { goto Dc1am; } goto jm_8F; FY0A8: t4uP2: goto Y4bT2; QPQay: orAf6: goto uclre; TQvGk: Dc1am: goto sg7xS; FeQwK: $IfrxK = preg_replace("/(q?)mmB?)$/", "mm²", $iKwah->value); goto FY0A8; jm_8F: return preg_replace("/(q?)mmB?)$/", "mm²", $iKwah->value); goto TQvGk; yeeBH: $fr07D = $iKwah->value; goto QPQay; Y4bT2: lDcKT: goto RpYHN; sg7xS: if (!($iKwah->propid == "312")) { goto orAf6; } goto yeeBH; uclre: if (!($iKwah->propid == "060")) { goto t4uP2; } goto FeQwK; RpYHN: } goto WpO_U; HPsia: $IfrxK = null; goto sw_a2; y21y9: if (!(!is_null($IfrxK) && $fr07D != 0)) { goto EEinQ; } goto bD7IO; EAa41: } public function copyFileToUTFEncoding($GucLq) { goto qmCbT; FbOAj: $x_Itf = $WJhpF; goto yhoxM; rHvsC: $WJhpF = $this->getCachePath() . "/app/" . substr(str_shuffle(str_repeat("234789abcdefghijklmnopqrstuvwxyz", 5)), 0, 5) .  . pathinfo($WJhpF, PATHINFO_EXTENSION); goto yOQ2F; lUiDW: nl4KA: goto rHvsC; WSOuV: if ($WJhpF != $GucLq) { goto nl4KA; } goto Yt48j; vEhvE: copy("wfio://" . $GucLq, "wfio://" . $WJhpF); goto FbOAj; YYLXO: goto Cxx01; goto lUiDW; yhoxM: Cxx01: goto sCb94; yOQ2F: $SCI38 = tempnam("/path/to/storage/directory", ''); goto vEhvE; sCb94: return $x_Itf; goto B13KK; qmCbT: $WJhpF = iconv("UTF-8", "ASCII//TRANSLIT//IGNORE", $GucLq); goto WSOuV; Yt48j: $x_Itf = $GucLq; goto YYLXO; B13KK: } }



© 2020 Quttera Ltd. All rights reserved.