= "5.1") : date_default_timezone_set('Europe/Berlin'); endif; // Check HTTP-Parameters // getSecHttpVars("1",array("f_act", "statusMessage", "importFile", "executeImportProcess", "deactivateMenu", "objType", "objId")); $f_act = $HTTP_POST_VARS["f_act"]; if ($f_act) == "" : $f_act = $HTTP_GET_VARS["f_act"]; endif; $statusMessage = $HTTP_POST_VARS["statusMessage"]; if ($statusMessage) == "" : $statusMessage = $HTTP_GET_VARS["statusMessage"]; endif; $importFile = $HTTP_POST_VARS["importFile"]; if ($importFile) == "" : $importFile = $HTTP_GET_VARS["importFile"]; endif; $executeImportProcess = $HTTP_POST_VARS["executeImportProcess"]; if ($executeImportProcess) == "" : $executeImportProcess = $HTTP_GET_VARS["executeImportProcess"]; endif; */ // ***************************************************************************** function get_url ($request_url) { $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $request_url); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $response = curl_exec($ch); curl_close($ch); return $response; } function create_url ($req) { global $rfcProt,$rfcUrl; $request_url = $rfcProt . $rfcUrl ."?operation=".urlencode($req); return $request_url; } getLanguage(__FILE__); $deactivateMenuStatic = "1"; $pageTitel = getLngt("IMPORT ITCS"); include_once ("../admin/menu.php"); include_once ("../include/html.inc.php"); getCurrentScript(__FILE__); // Check for authentication access // $usrAccessArray["hq"] = "1"; // authCheckForAccess($hq_id, $usr_id, $emp_id, "1", $customerId, $cscIdRoot, $cscIdActual); // if (!(authCheckEmployeeRights($emp_id, "22"))) : gotoReferer("1"); endif; // $empHasAdminRights = false; // $empIdRootAdmin = getEmpIdOfRootAdmin($userTypeName); // if ($empIdRootAdmin != "" && $emp_id == $empIdRootAdmin) : $empHasAdminRights = true; // endif; $debug = false; // if ($empIdRootAdmin == $emp_id) : // $debug = true; // endif; if ($f_act != "executeImport" || $executeImportProcess != "1") : $executeImportProcess = ""; endif; // Execute import after check run $showExecutionProcessButton = true; $outText = ""; $closeWindow = "0"; $delimiter = ";"; $fire = true; // Customer and headquarters references have to exist /* $hqId = ""; $csEid = ""; $objType = trim($objType); $objId = trim($objId); if ($objType == "CS" && is_numeric($objId)) : $csId = getFieldValueFromId("phoenix.customer", "cs_id", $objId, "cs_id"); endif; if ($csId != "") : $hqId = getFieldValueFromId("phoenix.customer", "cs_id", $csId, "hq_id"); $csEid = getFieldValueFromId("phoenix.customer", "cs_id", $csId, "cs_eid"); endif; if ($debug) : echo "f_act : " . $f_act . "
"; echo "objType : " . $objType . "
"; echo "objId : " . $objId . "
"; echo "hqId : " . $hqId . "
"; echo "csId : " . $csId . "
"; echo "
"; endif; */ // Current file to be imported $importFile = urldecode($importFile); $posLastSlash = strripos($importFile, "/"); $posLastSlash++; $pathname = substr($importFile, 0, $posLastSlash); $filename = substr($importFile, $posLastSlash); $outText = "" . getLngt("IMPORTDATEI:") . " " . $filename . "

"; if ($importFile != "") : // Create internal representation $srvpArray = array(); $zoneArray = array(); if (file_exists($importFile)) : $currentTime = getDateTime("0"); // ******************** // * IMPORT FILE xxxx * // ******************** if (!(strpos($filename, "import_ITCS_") === false)) : if ($executeImportProcess) : // Init $rfcProt = "https://"; $rfcUrl = "app.assecutor.de/cgi-bin/vudi_itc.test/"; $op = "import"; $auth = "local"; $type = "csv"; $data = importDataset($importFile); $dataLen = count($data); for ($j = 0; $j < $dataLen; $j++) { $xml_ = "" . $data[$j] . ""; $request_url = create_url($xml_); $response = get_url($request_url); echo $response; echo "
"; $response = json_decode($response); } endif; endif; else : $statusMessage .= getLngt("Die angegebene Datei existiert nicht!"); endif; else : $statusMessage .= getLngt("Es wurde keine Datei spezifiziert!"); endif; ?> <?php echo $pageTitel ?>