Events (MySQL 5.1)

git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@473 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
jakubvrana
2008-09-01 16:49:38 +00:00
parent 7022ab930f
commit ff97ef97ba
5 changed files with 83 additions and 8 deletions

View File

@@ -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 '<p><a href="' . htmlspecialchars($SELF) . 'procedure=">' . lang('Create procedure') . '</a> <a href="' . htmlspecialchars($SELF) . 'function=">' . lang('Create function') . "</a></p>\n";
}
if ($mysql->server_info >= 5.1) {
echo "<h3>" . lang('Events') . "</h3>\n";
$result = $mysql->query("SHOW EVENTS");
if ($result->num_rows) {
echo "<table border='0' cellspacing='0' cellpadding='2'>\n";
echo "<thead><tr><th>" . lang('Name') . "</th><td>" . lang('Schedule') . "</td><td>" . lang('Start') . "</td><td>" . lang('End') . "</td></tr></thead>\n";
while ($row = $result->fetch_assoc()) {
echo "<tr>";
echo '<th><a href="' . htmlspecialchars($SELF) . 'event=' . urlencode($row["Name"]) . '">' . htmlspecialchars($row["Name"]) . "</a></th>";
echo "<td>" . ($row["Execute at"] ? lang('At given time') . "</td><td>" . $row["Execute at"] : lang('Every') . " " . $row["Interval value"] . " " . $row["Interval field"] . "</td><td>$row[Starts]") . "</td>";
echo "<td>$row[Ends]</td>";
echo "</tr>\n";
}
echo "</table>\n";
}
$result->free();
echo '<p><a href="' . htmlspecialchars($SELF) . 'event=">' . lang('Create event') . "</a></p>\n";
}
}
}
page_footer();