[ Index ]
 

Code source de Dolibarr 2.0.1

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/htdocs/admin/system/ -> database-tables-contraintes.php (source)

   1  <?php
   2  /* Copyright (C) 2003      Rodolphe Quiedeville <rodolphe@quiedeville.org>
   3   * Copyright (C) 2004-2005 Laurent Destailleur  <eldy@users.sourceforge.net>
   4   * Copyright (C) 2004      Sebastien Di Cintio  <sdicintio@ressource-toi.org>
   5   * Copyright (C) 2004      Benoit Mortier       <benoit.mortier@opensides.be>
   6   *
   7   * This program is free software; you can redistribute it and/or modify
   8   * it under the terms of the GNU General Public License as published by
   9   * the Free Software Foundation; either version 2 of the License, or
  10   * (at your option) any later version.
  11   *
  12   * This program is distributed in the hope that it will be useful,
  13   * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15   * GNU General Public License for more details.
  16   *
  17   * You should have received a copy of the GNU General Public License
  18   * along with this program; if not, write to the Free Software
  19   * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  20   *
  21   * $Id: database-tables-contraintes.php,v 1.6 2005/07/08 20:51:19 eldy Exp $
  22   * $Source: /cvsroot/dolibarr/dolibarr/htdocs/admin/system/database-tables-contraintes.php,v $
  23   */
  24  
  25  /**
  26          \file       htdocs/admin/system/database-tables-contraintes.php
  27          \brief      Page d'info des contraintes de la base
  28          \version    $Revision: 1.6 $
  29  */
  30  
  31  require ("./pre.inc.php");
  32  include_once $dolibarr_main_document_root."/lib/".$conf->db->type.".lib.php";
  33  
  34  $langs->load("admin");
  35  
  36  
  37  if (!$user->admin)
  38  accessforbidden();
  39  
  40  
  41  llxHeader();
  42  
  43  
  44  print_titre($langs->trans("Constraints"));
  45  
  46  if ($conf->db->type == 'mysql')
  47  {
  48      $sql = "SHOW TABLE STATUS";
  49      $base=1;
  50  }
  51  
  52  if ($conf->db->type == 'pgsql')
  53  {
  54      $sql = "SELECT conname, contype FROM pg_constraint;";
  55      $base=2;
  56  }
  57  
  58  print '<br>';
  59  print '<table class="noborder">';
  60  print '<tr class="liste_titre">';
  61  
  62  if($base==1)
  63  {
  64      print '<td>'.$langs->trans("Tables").'</td>';
  65      print '<td>'.$langs->trans("Type").'</td>';
  66      print '<td>'.$langs->trans("Constraints").'</td>';
  67  }
  68  else
  69  {
  70      print '<td>'.$langs->trans("Constraints").'</td>';
  71      print '<td>'.$langs->trans("ConstraintsType").'</td>';
  72  }
  73  
  74  print "</tr>\n";
  75  
  76  
  77  $result = $db->query($sql);
  78  if ($result)
  79  {
  80      $num = $db->num_rows($result);
  81      $var=True;
  82      $i=0;
  83      while ($i < $num)
  84      {
  85          $obj = $db->fetch_object($rsult);
  86          $var=!$var;
  87          print "<tr $bc[$var]>";
  88  
  89          if ($base==1)
  90          {
  91              print '<td><a href="dbtable.php?table='.$obj->Name.'">'.$obj->Name.'</a></td>';
  92              print '<td>'.$obj->Engine.'</td>';
  93              print '<td>'.$obj->Comment.'</td>';
  94          }
  95          else
  96          {
  97              print '<td>'.$obj->conname.'</td>';
  98              print '<td>'.$obj->contype.'</td>';
  99          }
 100  
 101          print '</tr>';
 102          $i++;
 103      }
 104  }
 105  print '</table>';
 106  
 107  llxFooter('$Date: 2005/07/08 20:51:19 $ - $Revision: 1.6 $');
 108  ?>


Généré le : Mon Nov 26 12:29:37 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics