diff --git a/event.inc.php b/event.inc.php index ba443ab7..9a0dba7f 100644 --- a/event.inc.php +++ b/event.inc.php @@ -7,7 +7,7 @@ if ($_POST && !$error) { redirect(substr($SELF, 0, -1), lang('Event has been dropped.')); } } elseif (in_array($_POST["INTERVAL_FIELD"], $intervals)) { - $schedule = " ON SCHEDULE " . ($_POST["INTERVAL_VALUE"] ? "EVERY '" . $mysql->escape_string($_POST["INTERVAL_VALUE"]) . "' $_POST[INTERVAL_FIELD]" : "AT '" . $mysql->escape_string($_POST["EXECUTE_AT"]) . "'"); + $schedule = " ON SCHEDULE " . ($_POST["INTERVAL_VALUE"] ? "EVERY '" . $mysql->escape_string($_POST["INTERVAL_VALUE"]) . "' $_POST[INTERVAL_FIELD]" . ($_POST["STARTS"] ? " STARTS '" . $mysql->escape_string($_POST["STARTS"]) . "'" : "") . ($_POST["ENDS"] ? " ENDS '" . $mysql->escape_string($_POST["ENDS"]) . "'" : "") : "AT '" . $mysql->escape_string($_POST["STARTS"]) . "'"); if ($mysql->query((strlen($_GET["event"]) ? "ALTER EVENT " . idf_escape($_GET["event"]) . $schedule . ($_GET["event"] != $_POST["EVENT_NAME"] ? " RENAME TO " . idf_escape($_POST["EVENT_NAME"]) : "") : "CREATE EVENT " . idf_escape($_POST["EVENT_NAME"]) . $schedule) . " DO $_POST[EVENT_DEFINITION]")) { redirect(substr($SELF, 0, -1), (strlen($_GET["event"]) ? lang('Event has been altered.') : lang('Event has been created.'))); } @@ -29,7 +29,8 @@ if ($_POST) {