home *** CD-ROM | disk | FTP | other *** search
/ Cricao de Sites - 650 Layouts Prontos / WebMasters.iso / Servidores / xampp-win32-1.6.7-installer.exe / phpMyAdmin / libraries / tbl_triggers.lib.php < prev    next >
Encoding:
PHP Script  |  2008-06-23  |  1.9 KB  |  53 lines

  1. <?php
  2. /* vim: set expandtab sw=4 ts=4 sts=4: */
  3. /**
  4.  *
  5.  * @version $Id: tbl_triggers.lib.php 11326 2008-06-17 21:32:48Z lem9 $
  6.  */
  7. if (! defined('PHPMYADMIN')) {
  8.     exit;
  9. }
  10.  
  11. $url_query .= '&goto=tbl_structure.php';
  12.  
  13. $triggers = PMA_DBI_get_triggers($db, $table);
  14.  
  15. if ($triggers) {
  16.     echo '<div id="tabletriggers">' . "\n";
  17.     echo '<table class="data">' . "\n";
  18.     echo ' <caption class="tblHeaders">' . $strTriggers . '</caption>'  . "\n";
  19.     echo sprintf('<tr>
  20.                           <th>%s</th>
  21.                           <th> </th>
  22.                           <th> </th>
  23.                           <th>%s</th>
  24.                           <th>%s</th>
  25.                     </tr>',
  26.               $strName,
  27.               $strTime,
  28.               $strEvent);
  29.     $ct=0;
  30.     $delimiter = '//';
  31.     foreach ($triggers as $trigger) {
  32.         $drop_and_create = $trigger['drop'] . $delimiter . "\n" . $trigger['create'] . "\n";
  33.  
  34.         echo sprintf('<tr class="%s">
  35.                               <td><b>%s</b></td>
  36.                               <td>%s</td>
  37.                               <td>%s</td>
  38.                               <td>%s</td>
  39.                               <td>%s</td>
  40.                          </tr>',
  41.                          ($ct%2 == 0) ? 'even' : 'odd',
  42.                          $trigger['name'],
  43.                          '<a href="tbl_sql.php?' . $url_query . '&sql_query=' . urlencode($drop_and_create) . '&show_query=1&delimiter=' . urlencode($delimiter) . '">' . $titles['Change'] . '</a>',
  44.                          '<a href="sql.php?' . $url_query . '&sql_query=' . urlencode($trigger['drop']) . '" onclick="return confirmLink(this, \'' . PMA_jsFormat($trigger['drop'], false) . '\')">' . $titles['Drop'] . '</a>',
  45.                          $trigger['action_timing'],
  46.                          $trigger['event_manipulation']);
  47.         $ct++;
  48.     }
  49.     echo '</table>';
  50.     echo '</div>' . "\n";
  51. }
  52. ?>
  53.