diff --git a/design.inc.php b/design.inc.php index e0b3da84..a87f49f6 100644 --- a/design.inc.php +++ b/design.inc.php @@ -9,7 +9,7 @@ function page_header($title, $error = "", $breadcrumb = array(), $title2 = "") { -<?php echo $title . (strlen($title2) ? ": " . htmlspecialchars($title2) : "") . " - " . lang('phpMinAdmin') . " 1.7.1-dev"; ?> +<?php echo $title . (strlen($title2) ? ": " . htmlspecialchars($title2) : "") . " - " . lang('phpMinAdmin') . " 1.8.0-dev"; ?> diff --git a/dump.inc.php b/dump.inc.php index 2ca198b7..6c011690 100644 --- a/dump.inc.php +++ b/dump.inc.php @@ -33,21 +33,24 @@ if ($_POST) { } if ($style && $_POST["format"] != "csv") { echo "USE " . idf_escape($db) . ";\n\n"; + $out = ""; if ($mysql->server_info >= 5) { - $out = ""; foreach (array("FUNCTION", "PROCEDURE") as $routine) { $result = $mysql->query("SHOW $routine STATUS WHERE Db = '" . $mysql->escape_string($db) . "'"); while ($row = $result->fetch_assoc()) { - if (!$out) { - echo "DELIMITER ;;\n\n"; - $out = "DELIMITER ;\n\n"; - } - echo $mysql->result($mysql->query("SHOW CREATE $routine " . idf_escape($row["Name"])), 2) . ";;\n\n"; + $out .= $mysql->result($mysql->query("SHOW CREATE $routine " . idf_escape($row["Name"])), 2) . ";;\n\n"; } $result->free(); } - echo $out; } + if ($mysql->server_info >= 5.1) { + $result = $mysql->query("SHOW EVENTS"); + while ($row = $result->fetch_assoc()) { + $out .= $mysql->result($mysql->query("SHOW CREATE EVENT " . idf_escape($row["Name"])), 1) . ";;\n\n"; + } + $result->free(); + } + echo ($out ? "DELIMITER ;;\n\n$out" . "DELIMITER ;\n\n" : ""); } if (($style || strlen($_GET["db"])) && (array_filter($_POST["tables"]) || array_filter($_POST["data"]))) { diff --git a/event.inc.php b/event.inc.php new file mode 100644 index 00000000..ba443ab7 --- /dev/null +++ b/event.inc.php @@ -0,0 +1,41 @@ +query("DROP EVENT " . idf_escape($_GET["event"]))) { + 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"]) . "'"); + 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.'))); + } + } + $error = $mysql->error; +} +page_header((strlen($_GET["event"]) ? lang('Alter event') . ": " . htmlspecialchars($_GET["event"]) : lang('Create event')), $error); + +$row = array(); +if ($_POST) { + $row = $_POST; +} elseif (strlen($_GET["event"])) { + $result = $mysql->query("SELECT * FROM information_schema.EVENTS WHERE EVENT_SCHEMA = '" . $mysql->escape_string($_GET["db"]) . "' AND EVENT_NAME = '" . $mysql->escape_string($_GET["event"]) . "'"); + $row = $result->fetch_assoc(); + $result->free(); +} +?> + +
+ + + + +
" maxlength="64" />
" />
" />
+

+

+ + + +

+
diff --git a/index.php b/index.php index d8aef432..e28b7cff 100644 --- a/index.php +++ b/index.php @@ -105,6 +105,8 @@ if (isset($_GET["download"])) { include "./foreign.inc.php"; } elseif (isset($_GET["createv"])) { include "./createv.inc.php"; + } elseif (isset($_GET["event"])) { + include "./event.inc.php"; } elseif (isset($_GET["procedure"])) { include "./procedure.inc.php"; } elseif (isset($_GET["trigger"])) { @@ -138,6 +140,24 @@ if (isset($_GET["download"])) { $result->free(); echo '

' . lang('Create procedure') . ' ' . lang('Create function') . "

\n"; } + if ($mysql->server_info >= 5.1) { + echo "

" . lang('Events') . "

\n"; + $result = $mysql->query("SHOW EVENTS"); + if ($result->num_rows) { + echo "\n"; + echo "\n"; + while ($row = $result->fetch_assoc()) { + echo ""; + echo '"; + echo ""; + echo ""; + echo "\n"; + } + echo "
" . lang('Name') . "" . lang('Schedule') . "" . lang('Start') . "" . lang('End') . "
' . htmlspecialchars($row["Name"]) . "" . ($row["Execute at"] ? lang('At given time') . "" . $row["Execute at"] : lang('Every') . " " . $row["Interval value"] . " " . $row["Interval field"] . "$row[Starts]") . "$row[Ends]
\n"; + } + $result->free(); + echo '

' . lang('Create event') . "

\n"; + } } } page_footer(); diff --git a/lang/cs.inc.php b/lang/cs.inc.php index 68fbdd5e..b7ac0a62 100644 --- a/lang/cs.inc.php +++ b/lang/cs.inc.php @@ -174,4 +174,15 @@ $translations = array( 'Data' => 'Data', 'Export selected' => 'Exportovat označené', 'Export result' => 'Exportovat výsledek', + 'Event has been dropped.' => 'Událost byla odstraněna.', + 'Event has been altered.' => 'Událost byla změněna.', + 'Event has been created.' => 'Událost byla vytvořena.', + 'Alter event' => 'Pozměnit událost', + 'Create event' => 'Vytvořit událost', + 'At given time' => 'V daný čas', + 'Every' => 'Každých', + 'Events' => 'Události', + 'Schedule' => 'Plán', + 'Start' => 'Začátek', + 'End' => 'Konec', );