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

  1. <?php
  2. /* $Id: tbl_properties_links.php,v 2.2 2003/11/26 22:52:24 rabus Exp $ */
  3. // vim: expandtab sw=4 ts=4 sts=4:
  4.  
  5.  
  6. /**
  7.  * Sets error reporting level
  8.  */
  9. // (removed to avoid path disclosure, not sure about why this was here)
  10. // error_reporting(E_ALL);
  11.  
  12.  
  13. // Check parameters
  14.  
  15. require_once('./libraries/common.lib.php');
  16.  
  17. PMA_checkParameters(array('db'));
  18.  
  19. /**
  20.  * Count amount of navigation tabs
  21.  */
  22. $db_details_links_count_tabs = 0;
  23.  
  24.  
  25. /**
  26.  * Prepares links
  27.  */
  28. require_once('./libraries/bookmark.lib.php');
  29. $book_sql_query = PMA_queryBookmarks($db, $cfg['Bookmark'], '\'' . PMA_sqlAddslashes($table) . '\'', 'label');
  30.  
  31. if ($table_info_num_rows > 0) {
  32.     $lnk2    = 'sql.php';
  33.     $arg2    = $url_query
  34.              . '&sql_query=' . (isset($book_sql_query) && $book_sql_query != FALSE ? urlencode($book_sql_query) : urlencode('SELECT * FROM ' . PMA_backquote($table)))
  35.              . '&pos=0';
  36.     $lnk4    = 'tbl_select.php';
  37.     $arg4    = $url_query;
  38.     $ln6_stt = (PMA_MYSQL_INT_VERSION >= 40000)
  39.              ? 'TRUNCATE TABLE '
  40.              : 'DELETE FROM ';
  41.     $lnk6    = 'sql.php';
  42.     $arg6    = $url_query . '&sql_query='
  43.              . urlencode($ln6_stt . PMA_backquote($table))
  44.              .  '&zero_rows='
  45.              .  urlencode(sprintf($strTableHasBeenEmptied, htmlspecialchars($table)));
  46.     $att6    = 'class="drop" onclick="return confirmLink(this, \'' . $ln6_stt . PMA_jsFormat($table) . '\')"';
  47. } else {
  48.     $lnk2    = '';
  49.     $arg2    = '';
  50.     $lnk4    = '';
  51.     $arg4    = '';
  52.     $lnk6    = '';
  53.     $arg6    = '';
  54.     $att6    = '';
  55. }
  56.  
  57. $arg7 = $url_query . '&reload=1&purge=1&sql_query=' . urlencode('DROP TABLE ' . PMA_backquote($table) ) . '&zero_rows=' . urlencode(sprintf($strTableHasBeenDropped, htmlspecialchars($table)));
  58. $att7 = 'class="drop" onclick="return confirmLink(this, \'DROP TABLE ' . PMA_jsFormat($table) . '\')"';
  59.  
  60.  
  61. /**
  62.  * Displays links
  63.  */
  64.  
  65. if ($cfg['LightTabs']) {
  66.     echo ' ';
  67. } else {
  68.     echo '<table border="0" cellspacing="0" cellpadding="3" width="100%" class="tabs">' . "\n"
  69.        . '    <tr>' . "\n"
  70.        . '        <td width="8"> </td>';
  71. }
  72.  
  73. echo PMA_printTab($strStructure, 'tbl_properties_structure.php', $url_query)
  74.    . PMA_printTab($strBrowse, $lnk2, $arg2)
  75.    . PMA_printTab($strSQL, 'tbl_properties.php', $url_query)
  76.    . PMA_printTab($strSearch, $lnk4, $arg4)
  77.    . PMA_printTab($strInsert, 'tbl_change.php', $url_query)
  78.    . PMA_printTab($strExport, 'tbl_properties_export.php', $url_query . '&single_table=true')
  79.    . PMA_printTab($strOperations, 'tbl_properties_operations.php', $url_query)
  80.    . PMA_printTab($strEmpty, $lnk6, $arg6, $att6)
  81.    . PMA_printTab($strDrop, 'sql.php', $arg7, $att7)
  82.    . "\n";
  83.  
  84. if (!$cfg['LightTabs']) {
  85.     echo '</tr></table>';
  86. } else {
  87.     echo '<br />';
  88. }
  89.  
  90. ?><br />
  91.