87 lines
2.1 KiB
PHP
87 lines
2.1 KiB
PHP
<?php
|
|
/* vim: set expandtab sw=4 ts=4 sts=4: */
|
|
/**
|
|
*
|
|
* @version $Id$
|
|
* @package phpMyAdmin
|
|
*/
|
|
|
|
/**
|
|
* This class is inherited by all schema classes
|
|
* It contains those methods which are common in them
|
|
*
|
|
* @name
|
|
* @author Muhammad Adnan <hiddenpearls@gmail.com>
|
|
* @copyright
|
|
* @license
|
|
*/
|
|
|
|
class PMA_Export_Relation_Schema
|
|
{
|
|
private $_pageTitle; // Title of the page
|
|
private $_autoLayoutType; // Internal or Foreign Key Relations;
|
|
protected $same_wide;
|
|
|
|
public function setPageTitle($title)
|
|
{
|
|
$this->_pageTitle=$title;
|
|
}
|
|
|
|
public function setExportType($type)
|
|
{
|
|
$this->_pageTitle=$title;
|
|
}
|
|
|
|
public function setSameWidthTables($width)
|
|
{
|
|
$this->same_wide=$width;
|
|
}
|
|
|
|
public function getAllTables($db,$page_number)
|
|
{
|
|
global $cfgRelation;
|
|
// Get All tables
|
|
$tab_sql = 'SELECT table_name FROM ' . PMA_backquote($GLOBALS['cfgRelation']['db']) . '.' . PMA_backquote($cfgRelation['table_coords'])
|
|
. ' WHERE db_name = \'' . PMA_sqlAddslashes($db) . '\''
|
|
. ' AND pdf_page_number = ' . $page_number;
|
|
// echo $tab_sql;
|
|
$tab_rs = PMA_query_as_controluser($tab_sql, null, PMA_DBI_QUERY_STORE);
|
|
if (!$tab_rs || !PMA_DBI_num_rows($tab_rs) > 0) {
|
|
$this->_die('',__('No tables'));
|
|
} while ($curr_table = @PMA_DBI_fetch_assoc($tab_rs)) {
|
|
$alltables[] = PMA_sqlAddslashes($curr_table['table_name']);
|
|
}
|
|
return $alltables;
|
|
}
|
|
|
|
public function initTable()
|
|
{
|
|
|
|
}
|
|
|
|
|
|
/**
|
|
* Displays an error message
|
|
*/
|
|
function _die($type = '',$error_message = '')
|
|
{
|
|
global $db;
|
|
|
|
require_once './libraries/header.inc.php';
|
|
|
|
echo "<p><strong> {$type} " . __("SCHEMA ERROR") . "</strong></p>" . "\n";
|
|
if (!empty($error_message)) {
|
|
$error_message = htmlspecialchars($error_message);
|
|
}
|
|
echo '<p>' . "\n";
|
|
echo ' ' . $error_message . "\n";
|
|
echo '</p>' . "\n";
|
|
|
|
echo '<a href="export_relation_schema.php?' . PMA_generate_common_url($db)
|
|
. '">' . __('Back') . '</a>';
|
|
echo "\n";
|
|
|
|
require_once './libraries/footer.inc.php';
|
|
} // end of the "PMA_PDF_die()" function
|
|
}
|
|
?>
|