home *** CD-ROM | disk | FTP | other *** search
/ Enter 2004 June / ENTER.ISO / files / xampp-win32-1.4.5-installer.exe / xampp / db_details_links.php < prev    next >
Encoding:
PHP Script  |  2003-11-22  |  2.1 KB  |  89 lines

  1. <?php
  2. /* $Id: db_details_links.php,v 2.1 2003/11/22 20:51:45 garvinhicking Exp $ */
  3. // vim: expandtab sw=4 ts=4 sts=4:
  4.  
  5.  
  6. /**
  7.  * Counts amount of navigation tabs
  8.  */
  9. $db_details_links_count_tabs = 0;
  10.  
  11.  
  12. /**
  13.  * If coming from a Show MySQL link on the home page,
  14.  * put something in $sub_part
  15.  */
  16. if (empty($sub_part)) {
  17.     $sub_part = '_structure';
  18. }
  19.  
  20.  
  21. /**
  22.  * Prepares links
  23.  */
  24. // Export link if there is at least one table
  25. if ($num_tables > 0) {
  26.     $lnk3 = 'db_details_export.php';
  27.     $arg3 = $url_query;
  28.     $lnk4 = 'db_search.php';
  29.     $arg4 = $url_query;
  30. }
  31. else {
  32.     $lnk3 = '';
  33.     $arg3 = '';
  34.     $lnk4 = '';
  35.     $arg4 = '';
  36. }
  37. // Drop link if allowed
  38. if (!$cfg['AllowUserDropDatabase']) {
  39.     // Check if the user is a Superuser
  40.     $links_result                 = @PMA_mysql_query('USE mysql');
  41.     $cfg['AllowUserDropDatabase'] = (!PMA_mysql_error());
  42. }
  43. if ($cfg['AllowUserDropDatabase']) {
  44.     $lnk5 = 'sql.php';
  45.     $arg5 = $url_query . '&sql_query='
  46.           . urlencode('DROP DATABASE ' . PMA_backquote($db))
  47.           . '&zero_rows='
  48.           . urlencode(sprintf($strDatabaseHasBeenDropped, htmlspecialchars(PMA_backquote($db))))
  49.           . '&goto=main.php&back=db_details' . $sub_part . '.php&reload=1&purge=1';
  50.     $att5 = 'class="drop" '
  51.           . 'onclick="return confirmLink(this, \'DROP DATABASE ' . PMA_jsFormat($db) . '\')"';
  52. }
  53. else {
  54.     $lnk5 = '';
  55. }
  56.  
  57.  
  58. /**
  59.  * Displays tab links
  60.  */
  61.  
  62. if ($cfg['LightTabs']) {
  63.     echo ' ';
  64. } else {
  65.     echo '<table border="0" cellspacing="0" cellpadding="3" width="100%" class="tabs">
  66.     <tr>
  67.         <td width="8"> </td>';
  68. }
  69.  
  70. echo PMA_printTab($strStructure, 'db_details_structure.php', $url_query);
  71. echo PMA_printTab($strSQL, 'db_details.php', $url_query . '&db_query_force=1');
  72. echo PMA_printTab($strExport, $lnk3, $arg3);
  73. echo PMA_printTab($strSearch, $lnk4, $arg4);
  74. echo PMA_printTab($strQBE, ($num_tables > 0) ? 'db_details_qbe.php' : '', $url_query);
  75.  
  76. // Displays drop link
  77. if ($lnk5) {
  78.    echo PMA_printTab($strDrop, $lnk5, $arg5, $att5);
  79. } // end if
  80. echo "\n";
  81.  
  82. if (!$cfg['LightTabs']) {
  83.     echo '</tr></table>';
  84. } else {
  85.     echo '<br />';
  86. }
  87. ?>
  88. <br />
  89.