= '" . $zipcodeFrom . "' AND" . " srvp.srvp_plz <= '" . $zipcodeTo . "' AND" . " srvp.srvp_valid = '1' " . " ORDER BY " . $orderByClause . " LIMIT 0," . $maxEnitriesToBeDisplayed; else : // Use traveltime of table "serviceplztraveltime" (CLASSIC mode) $sqlquery = "SELECT srvp.srvp_id, srvp.srvp_plz, srvpt.srvpt_traveltime AS srvp_traveltime" . " FROM serviceplz AS srvp LEFT JOIN serviceplztraveltime AS srvpt ON srvp.srvp_id = srvpt.srvp_id AND srvpt.hq_id = '" . $hq_id . "'" . " WHERE srvp.srvp_plz >= '" . $zipcodeFrom . "' AND" . " srvp.srvp_plz <= '" . $zipcodeTo . "' AND" . " srvp.srvp_valid = '1'" . " ORDER BY " . $orderByClause . " LIMIT 0," . $maxEnitriesToBeDisplayed; endif; // echo $sqlquery; die(); $result = $db->query($sqlquery); if (DB::isError($result)) die ("$PHP_SELF: " . $result->getMessage()); while ($row = $result->fetch_assoc()): $zipcodeArray[] = $row["srvp_plz"]; $travelTimeArray[] = $row["srvp_traveltime"]; endwhile; $result->free(); endif; endif; $lenZipcodeArray = count($zipcodeArray); // ************************* // *** BEGIN STORING ******* // ************************* // Storing prices and discounts if requested // Using the results of the statements before!!! if ($f_act != "" && $f_act == "save") : if ($zipcodeFrom == "" || $zipcodeTo == "") : $statusMessage = "Bitte geben Sie einen Bereich an!"; else : if ($parMaskZipcodeCheckSyntax != "1" && (!is_numeric($zipcodeFrom) || !is_numeric($zipcodeTo))) : $statusMessage = "Bitte geben Sie eine gültige PLZ für den Bereich an!"; else : // Set the current timestamp to store the data // $currentTime = getDateTime("0"); TA("B"); for ($j = 0; $j < $lenZipcodeArray; $j++) : // Get current input-type-text-field with minutes list ($newValueToBeStored) = getHttpVars(array("f_". $zipcodeArray[$j])); // Check the value to be numeric if ($newValueToBeStored == "" || !is_numeric($newValueToBeStored)) : $newValueToBeStored = "0"; endif; // Set default traveltime if value equals to 0 if ($newValueToBeStored == "0") : $newValueToBeStored = LATEST_TAKETIME_IN_MINUTES; endif; // Update traveltime if ($modeFlag == "1") : // BWV mode updateStmt("serviceplz", "srvp_plz", $zipcodeArray[$j], array("srvp_traveltime", $newValueToBeStored)); else : // CLASSIC mode $srvpId = getFieldValueFromId("serviceplz", "srvp_plz", $zipcodeArray[$j], "srvp_id"); if (existsEntry("serviceplztraveltime",array("srvp_id",$srvpId, "hq_id", $hq_id))) : updateStmt("serviceplztraveltime", "srvp_id", $srvpId, array("srvpt_traveltime", $newValueToBeStored), "hq_id = '" . $hq_id . "'"); else : insertStmt("serviceplztraveltime", array("srvp_id", $srvpId, "hq_id", $hq_id, "srvpt_traveltime", $newValueToBeStored)); endif; endif; // Override $travelTimeArray[] $travelTimeArray[$j] = $newValueToBeStored; endfor; TA("C"); TA("E"); endif; endif; endif; // ************************* // *** END STORING ********* // ************************* // Table-header $serviceOutput = "