bug #2356433 [display] HeaderFlipType "fake" problems
[phpmyadmin/crack.git] / libraries / db_events.inc.php
blob4b8e40fbb1234f7297ecfde3f07a9bcc9f4541da
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
5 * @version $Id$
6 */
7 if (! defined('PHPMYADMIN')) {
8 exit;
11 $url_query .= '&amp;goto=db_structure.php';
13 $events = PMA_DBI_fetch_result('SELECT EVENT_NAME, EVENT_TYPE FROM information_schema.EVENTS WHERE EVENT_SCHEMA= \'' . PMA_sqlAddslashes($db,true) . '\';');
15 if ($events) {
16 PMA_generate_slider_effect('events', $strEvents);
17 echo '<fieldset>' . "\n";
18 echo ' <legend>' . $strEvents . '</legend>' . "\n";
19 echo '<table border="0">';
20 echo sprintf('<tr>
21 <th>%s</th>
22 <th>&nbsp;</th>
23 <th>&nbsp;</th>
24 <th>%s</th>
25 </tr>',
26 $strName,
27 $strType);
28 $ct=0;
29 $delimiter = '//';
30 foreach ($events as $event) {
32 // information_schema (at least in MySQL 5.1.22) does not return
33 // the full CREATE EVENT statement in a way that could be useful for us
34 // so we rely on PMA_DBI_get_definition() which uses SHOW CREATE EVENT
36 $definition = 'DROP EVENT ' . PMA_backquote($event['EVENT_NAME']) . $delimiter . "\n"
37 . PMA_DBI_get_definition($db, 'EVENT', $event['EVENT_NAME'])
38 . "\n";
40 $sqlDrop = 'DROP EVENT ' . PMA_backquote($event['EVENT_NAME']);
41 echo sprintf('<tr class="%s">
42 <td><strong>%s</strong></td>
43 <td>%s</td>
44 <td>%s</td>
45 <td>%s</td>
46 </tr>',
47 ($ct%2 == 0) ? 'even' : 'odd',
48 $event['EVENT_NAME'],
49 ! empty($definition) ? PMA_linkOrButton('db_sql.php?' . $url_query . '&amp;sql_query=' . urlencode($definition) . '&amp;show_query=1&amp;delimiter=' . urlencode($delimiter), $titles['Structure']) : '&nbsp;',
50 '<a href="sql.php?' . $url_query . '&sql_query=' . urlencode($sqlDrop) . '" onclick="return confirmLink(this, \'' . PMA_jsFormat($sqlDrop, false) . '\')">' . $titles['Drop'] . '</a>',
51 $event['EVENT_TYPE']);
52 $ct++;
54 echo '</table>';
55 echo '</fieldset>' . "\n";
56 echo '</div>' . "\n";