[ PHPXref.com ] [ Generated: Sun Jul 20 19:45:58 2008 ] [ phpMSAdmin 0.14 ]
[ Index ]     [ Variables ]     [ Functions ]     [ Classes ]     [ Constants ]     [ Statistics ]

title

Body

[close]

/ -> trigger_list.php (source)

   1  <?php
   2       /*
   3       Copyright (C)
   4  
   5       This program is free software; you can redistribute it and/or modify it
   6       under the terms of the GNU General Public License as published by the Free
   7       Software Foundation; either version 2 of the License, or (at your option)
   8       any later version.
   9  
  10       This program is distributed in the hope that it will be useful, but WITHOUT
  11       ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  12       FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  13       more details.
  14  
  15       You should have received a copy of the GNU General Public License along
  16       with this program; if not, write to the Free Software Foundation, Inc.,
  17       59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  18       */
  19  ?>
  20  <?php
  21      include ('inc/header.php');
  22  
  23      mssql_select_db($_SESSION['database']);
  24  ?>
  25  
  26  <form name="form1" method="post" action="trigger_list.php">
  27  <table width="350" cellpadding="3" cellspacing="3" style="border: 1px solid">
  28      <tr>
  29          <td align="center" colspan="5" style="background: #D0DCE0">
  30              <b>Triggers</b>
  31          </td>
  32      </tr>
  33      <tr>
  34          <td style="background: #D0DCE0">&nbsp;</td>
  35          <td align="center" style="background: #D0DCE0">
  36              <b>Name</b>
  37          </td>
  38          <td align="center" colspan="2" style="background: #D0DCE0">
  39              <b>Action</b>
  40          </td>
  41      </tr>
  42      <?php
  43          $toggle = true;
  44          $colors = array('#DDDDDD','#CCCCCC');
  45  
  46          $trig_query = @mssql_query('sp_helptrigger \'' . urldecode($_GET['table']) . '\'') or die(throwSQLError('unable to retrieve list of stored procedures'));
  47          while($row = mssql_fetch_assoc($trig_query))
  48          {
  49              if($row['trigger_schema'] != '')
  50                  $fullname = ($row['trigger_schema'] . '.' . $row['trigger_name']);
  51              else
  52                  $fullname = $row['trigger_name'];
  53  
  54              if($toggle)
  55                  $bg = $colors[0];
  56              else
  57                  $bg = $colors[1];
  58  
  59              $toggle = !$toggle;
  60  
  61              echo '<tr>';
  62              echo('<td align="center" style="background: ' . $bg . '" nowrap><input type="checkbox" name="triggers[]" value="' . $fullname . '"></td>');
  63              echo('<td style="background: ' . $bg . '" nowrap>' . $row['trigger_name'] . '</td>');
  64              echo('<td align="center" style="background: ' . $bg . '" nowrap><a href="trigger_modify.php?trigger=' . urlencode($fullname) . '">Modify</a></td>');
  65              echo('<td align="center" style="background: ' . $bg . '" nowrap><a href="trigger_drop.php?trigger=' . urlencode($fullname) . '&returnto=trigger_list.php?table=' . $_GET['table'] . '">Drop</a></td>');
  66              echo '</tr>';
  67  
  68              unset($row);
  69          }
  70      ?>
  71      <tr>
  72          <td align="center" colspan="4" style="background: #D0DCE0"><a href="trigger_create.php">New Trigger</a></td>
  73      </tr>
  74  </table>
  75  </form>
  76  
  77  <?php include ('inc/footer.php'); ?>


[ Powered by PHPXref - Served by Debian GNU/Linux ]