コード例 #1
0
ファイル: VTEntity.php プロジェクト: cin-system/cinrepo
 public function getCrmId($idString, $fieldInstance = null)
 {
     ${"GLOBALS"}["iclxxkvi"] = "idString";
     ${"GLOBALS"}["elwxxhb"] = "idString";
     ${"GLOBALS"}["flcpttn"] = "fieldInstance";
     $bcwmvce = "idString";
     if (strpos(${${"GLOBALS"}["iclxxkvi"]}, "x") !== false) {
         ${"GLOBALS"}["pvhcesfd"] = "idString";
         ${${"GLOBALS"}["fvqttrwn"]} = explode("x", ${${"GLOBALS"}["pvhcesfd"]});
         $ywoinxvis = "idParts";
         return ${$ywoinxvis}[1];
     }
     if (strpos(${$bcwmvce}, "@") !== false) {
         ${"GLOBALS"}["xxrpwv"] = "id";
         $whtnmlla = "id";
         ${${"GLOBALS"}["xxrpwv"]} = explode("@", ${${"GLOBALS"}["lwtxyxejo"]});
         return ${$whtnmlla}[0];
     }
     if (is_numeric(${${"GLOBALS"}["lwtxyxejo"]})) {
         return ${${"GLOBALS"}["lwtxyxejo"]};
     }
     if (${${"GLOBALS"}["flcpttn"]} !== null && !empty(${${"GLOBALS"}["elwxxhb"]})) {
         ${"GLOBALS"}["jldxotsaj"] = "sql";
         $cvyqpfjbxe = "idString";
         global $adb;
         $vwhjwakpqy = "result";
         ${"GLOBALS"}["xcpfhjni"] = "modules";
         ${${"GLOBALS"}["mdffogqqo"]} = \VtUtils::getModuleForReference($fieldInstance->getTabId(), $fieldInstance->getFieldName(), $fieldInstance->getUIType());
         ${${"GLOBALS"}["jldxotsaj"]} = "SELECT * FROM vtiger_crmentity WHERE setype IN (\"" . implode("\",\"", ${${"GLOBALS"}["xcpfhjni"]}) . "\") AND label = ?";
         ${${"GLOBALS"}["orgnykvnkpk"]} = $adb->pquery(${${"GLOBALS"}["clnussj"]}, array(${$cvyqpfjbxe}));
         if ($adb->num_rows(${$vwhjwakpqy}) > 0) {
             return $adb->query_result(${${"GLOBALS"}["orgnykvnkpk"]}, 0, "crmid");
         }
     }
     return false;
 }