home *** CD-ROM | disk | FTP | other *** search
/ PC World 2001 August / PCWorld_2001-08_cd.bin / Komunikace / phptriad / phptriadsetup2-11.exe / htdocs / phpMyAdmin / db_details.php < prev    next >
PHP Script  |  2000-08-20  |  5KB  |  122 lines

  1. <?php
  2. /* $Id: db_details.php,v 1.24 2000/07/13 15:12:48 tobias Exp $ */
  3.  
  4. if(!isset($message))
  5. {
  6.     include("header.inc.php");
  7. }
  8. else
  9. {
  10.     show_message($message);
  11. }
  12.  
  13. $tables = mysql_list_tables($db);
  14. $num_tables = @mysql_numrows($tables);
  15.  
  16. if($num_tables == 0)
  17. {
  18.     echo $strNoTablesFound;
  19. }
  20. else
  21. {
  22.     $i = 0;
  23.  
  24.     echo "<table border=$cfgBorder>\n";
  25.     echo "<th>$strTable</th>";
  26.     echo "<th colspan=6>$strAction</th>";
  27.     echo "<th>$strRecords</th>";
  28.     while($i < $num_tables)
  29.     {
  30.         $table = mysql_tablename($tables, $i);
  31.         $query = "?server=$server&db=$db&table=$table&goto=db_details.php";
  32.         $bgcolor = $cfgBgcolorOne;
  33.         $i % 2  ? 0: $bgcolor = $cfgBgcolorTwo;
  34.         ?>
  35.            <tr bgcolor="<?php echo $bgcolor;?>">
  36.  
  37.            <td class=data><b><?php echo $table;?></b></td>
  38.            <td><a href="sql.php<?php echo $query;?>&sql_query=<?php echo urlencode("SELECT * FROM $table");?>&pos=0"><?php echo $strBrowse; ?></a></td>
  39.            <td><a href="tbl_select.php<?php echo $query;?>"><?php echo $strSelect; ?></a></td>
  40.            <td><a href="tbl_change.php<?php echo $query;?>"><?php echo $strInsert; ?></a></td>
  41.            <td><a href="tbl_properties.php<?php echo $query;?>"><?php echo $strProperties; ?></a></td>
  42.            <td><a href="sql.php<?php echo $query;?>&reload=true&sql_query=<?php echo urlencode("DROP TABLE $table");?>&zero_rows=<?php echo urlencode($strTable." ".$table." ".$strHasBeenDropped);?>"><?php echo $strDrop; ?></a></td>
  43.            <td><a href="sql.php<?php echo $query;?>&sql_query=<?php echo urlencode("DELETE FROM $table");?>&zero_rows=<?php echo urlencode($strTable." ".$table." ".$strHasBeenEmptied);?>"><?php echo $strEmpty; ?></a></td>
  44.            <td align="right"> <?php count_records($db,$table) ?></td>
  45.          </tr>
  46.         <?php
  47.         $i++;
  48.     }
  49.  
  50.     echo "</table>\n";
  51. }
  52. $query = "?server=$server&db=$db&goto=db_details.php";
  53. ?>
  54. <hr>
  55. <div align="left">
  56. <ul>
  57. <li><a href="db_printview.php<?php echo $query;?>"><?php echo $strPrintView;?></a>
  58. <li>
  59. <form method="post" action="db_readdump.php" enctype="multipart/form-data">
  60. <input type="hidden" name="server" value="<?php echo $server;?>">
  61. <input type="hidden" name="pos" value="0">
  62. <input type="hidden" name="db" value="<?php echo $db;?>">
  63. <input type="hidden" name="goto" value="db_details.php?db=<?php echo $db;?>">
  64. <input type="hidden" name="zero_rows" value="<?php echo $strSuccess; ?>">
  65. <?php echo $strRunSQLQuery.$db." ".show_docu("manual_Reference.html#Select");?>:<br>
  66. <textarea name="sql_query" cols="40" rows="3" wrap="VIRTUAL" style="width: <?php
  67. echo $cfgMaxInputsize;?>"></textarea><br>
  68. <?php echo "<i>$strOr</i> $strLocationTextfile";?>:<br>
  69. <input type="file" name="sql_file"><br>
  70. <input type="submit" name="SQL" value="<?php echo $strGo; ?>">
  71. </form>
  72. <li><a href="tbl_qbe.php<?php echo $query;?>"><?php echo $strQBE;?></a>
  73. <li><form method="post" action="db_dump.php"><?php echo $strViewDumpDB;?><br>
  74. <table>
  75.     <tr>
  76.         <td>
  77.             <input type="radio" name="what" value="structure" checked><?php echo $strStrucOnly;?>
  78.         </td>
  79.         <td>
  80.             <input type="checkbox" name="drop" value="1"><?php echo $strStrucDrop;?>
  81.         </td>
  82.         <td colspan="2">
  83.             <input type="submit" value="<?php echo $strGo;?>">
  84.         </td>
  85.     </tr>
  86.     <tr>
  87.         <td>
  88.             <input type="radio" name="what" value="data"><?php echo $strStrucData;?>
  89.         </td>
  90.         <td>
  91.             <input type="checkbox" name="asfile" value="sendit"><?php echo $strSend;?>
  92.         </td>
  93.     </tr>
  94.     <tr>
  95.         <td>
  96.         </td>
  97.         <td>
  98.            <input type="checkbox" name="showcolumns" value="yes"><?php echo $strCompleteInserts; ?>
  99.         </td>
  100.     </tr>
  101. </table>
  102. <input type="hidden" name="server" value="<?php echo $server;?>">
  103. <input type="hidden" name="db" value="<?php echo $db;?>">
  104. </form>
  105. <li>
  106. <form method="post" action="tbl_create.php">
  107. <input type="hidden" name="server" value="<?php echo $server;?>">
  108. <input type="hidden" name="db" value="<?php echo $db;?>">
  109. <?php echo $strCreateNewTable.$db;?>:<br>
  110. <?php echo $strName.":"; ?> <input type="text" name="table"><br>
  111. <?php echo $strFields.":"; ?> <input type="text" name="num_fields" size=2>
  112. <input type="submit" value="<?php echo $strGo; ?>">
  113. </form>
  114.  
  115. <li>
  116. <a href="sql.php?server=<?php echo $server;?>&db=<?php echo $db;?>&sql_query=<?php echo urlencode("DROP DATABASE $db");?>&zero_rows=<?php echo urlencode($strDatabase." ".$db." ".$strHasBeenDropped);?>&goto=main.php&reload=true"><?php echo $strDropDB." ".$db;?></a> <?php print show_docu("manual_Reference.html#Drop_database");?>
  117. </ul>
  118. </div>
  119. <?php
  120.  
  121. require ("footer.inc.php");
  122. ?>