home *** CD-ROM | disk | FTP | other *** search
/ PC World 2008 February (DVD) / PCWorld_2008-02_DVD.iso / v cisle / PHP / PHP.exe / xampp-win32-1.6.5-installer.exe / phpMyAdmin / libraries / tbl_triggers.lib.php < prev    next >
Encoding:
PHP Script  |  2007-12-20  |  1.9 KB  |  50 lines

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