internal ".$db." - ".$val[0]." - ";
//print_r($row );
if ($row !== false) {
foreach ($row as $field => $value) {
$con['C_NAME'][$i] = '';
$con['DTN'][$i] = urlencode($db . "." . $val[0]);
$con['DCN'][$i] = urlencode($field);
$con['STN'][$i] = urlencode($value['foreign_db'] . "." . $value['foreign_table']);
$con['SCN'][$i] = urlencode($value['foreign_field']);
$i++;
}
}
$row = PMA_getForeigners($db,$val[0],'','innodb');
//echo "
INNO ";
//print_r($row );
if ($row !== false) {
foreach ($row as $field => $value) {
$con['C_NAME'][$i] = '';
$con['DTN'][$i] = urlencode($db.".".$val[0]);
$con['DCN'][$i] = urlencode($field);
$con['STN'][$i] = urlencode($value['foreign_db'].".".$value['foreign_table']);
$con['SCN'][$i] = urlencode($value['foreign_field']);
$i++;
}
}
}
$ti = 0;
$script_contr = "";
return $script_contr;
}
function get_pk_or_unique_keys() {
global $db;
require_once('./libraries/tbl_indexes.lib.php');
PMA_DBI_select_db($db);
$tables_pk_or_unique_keys = array();
for( $I=0; $I $one_index) {
$column_name = $one_index[1]['Column_name'];
if (isset($indexes_info[$key_name]) && $indexes_info[$key_name]['Non_unique'] == 0) {
$tables_pk_or_unique_keys[$GLOBALS['PMD']['OWNER'][$I] . '.' .$GLOBALS['PMD']['TABLE_NAME_SMALL'][$I] . '.' . $column_name] = 1;
}
}
}
}
return $tables_pk_or_unique_keys;
}
function get_all_keys() {
global $db;
require_once('./libraries/tbl_indexes.lib.php');
PMA_DBI_select_db($db);
$tables_all_keys = array();
for( $I=0; $I var j_tabs = new Array();\n";
for ( $i=0; $i < sizeof( $GLOBALS['PMD']['TABLE_NAME'] ); $i++ ) {
$script_tabs .= "j_tabs['".$GLOBALS['PMD_URL']['TABLE_NAME'][$i]."'] = '".$GLOBALS['PMD']['TABLE_TYPE'][$i]."';\n";
}
$script_tabs .= "";
return $script_tabs;
}
function get_tab_pos() {
$stmt = PMA_query_as_cu("SELECT * FROM " . PMA_backquote($GLOBALS['cfgRelation']['designer_coords']), FALSE, PMA_DBI_QUERY_STORE);
if ( $stmt ) // exist table repository
{
while ($t_p = PMA_DBI_fetch_array($stmt, MYSQL_ASSOC)) {
$t_name = $t_p['db_name'] . '.' . $t_p['table_name'];
$tab_pos[ $t_name ]['X'] = $t_p['x'];
$tab_pos[ $t_name ]['Y'] = $t_p['y'];
$tab_pos[ $t_name ]['V'] = $t_p['v'];
$tab_pos[ $t_name ]['H'] = $t_p['h'];
}
}
return isset($tab_pos) ? $tab_pos : NULL;
}
function get_owners() {
$m = array();
$j = 0;
for ( $i=0; $i < sizeof( $GLOBALS['PMD']["OWNER"] ); $i++ ) {
if( ! in_array($GLOBALS['PMD']["OWNER"][$i],$m)) {
$m[$j++] = $GLOBALS['PMD']["OWNER"][$i];
}
}
return $m;
}
get_tabs();
?>