database_tables.phtml
9.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
<?php for ($i = 0; $i < count($GLOBALS['PMD']["TABLE_NAME"]); $i++) :
$t_n = $GLOBALS['PMD']["TABLE_NAME"][$i];
$t_n_url = $GLOBALS['PMD_URL']["TABLE_NAME"][$i]; ?>
<input name="t_x[<?php echo $t_n_url; ?>]" type="hidden" id="t_x_<?php echo $t_n_url; ?>_" />
<input name="t_y[<?php echo $t_n_url; ?>]" type="hidden" id="t_y_<?php echo $t_n_url; ?>_" />
<input name="t_v[<?php echo $t_n_url; ?>]" type="hidden" id="t_v_<?php echo $t_n_url; ?>_" />
<input name="t_h[<?php echo $t_n_url; ?>]" type="hidden" id="t_h_<?php echo $t_n_url; ?>_" />
<!-- Why should we put styles here?! -->
<table id="<?php echo $t_n_url; ?>"
cellpadding="0"
cellspacing="0"
class="pmd_tab"
style="position:absolute; left:<?php echo (isset($tab_pos[$t_n]) ? $tab_pos[$t_n]["X"] : rand(20, 700)); ?>px; top:<?php echo (isset($tab_pos[$t_n]) ? $tab_pos[$t_n]["Y"] : rand(20, 550)); ?>px; display:<?php echo (isset($tab_pos[$t_n]) || $display_page == -1) ? 'block;' : 'none';?>; z-index: 1;">
<thead>
<tr class="header">
<?php if (isset($_REQUEST['query'])) : ?>
<td class="select_all">
<input class="select_all_1"
type="checkbox"
style="margin: 0;"
value="select_all_<?php echo htmlspecialchars($t_n_url); ?>"
id="select_all_<?php echo htmlspecialchars($t_n_url); ?>"
title="select all"
pmd_url_table_name="<?php echo htmlspecialchars($t_n_url); ?>"
pmd_out_owner="<?php echo htmlspecialchars($GLOBALS['PMD_OUT']['OWNER'][$i]); ?>">
</td>
<?php endif; ?>
<td class="small_tab"
title="<?php echo __('Show/hide columns'); ?>"
id="id_hide_tbody_<?php echo $t_n_url; ?>"
table_name="<?php echo htmlspecialchars($t_n_url); ?>"
onmouseover="this.className='small_tab2';"
onmouseout="this.className='small_tab';" ><?php echo (! isset($tab_pos[$t_n]) || ! empty($tab_pos[$t_n]["V"])) ? 'v' : '>'; ?>
</td>
<td class="small_tab_pref small_tab_pref_1"
table_name_small="<?php echo $GLOBALS['PMD_URL']["TABLE_NAME_SMALL"][$i]; ?>"
onmouseover="this.className='small_tab_pref2 small_tab_pref_1';"
onmouseout="this.className='small_tab_pref small_tab_pref_1';" >
<img src="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/exec_small.png'); ?>"
title="<?php echo __('See table structure'); ?>" />
</td>
<td id="id_zag_<?php echo htmlspecialchars($t_n_url); ?>"
class="tab_zag nowrap tab_zag_noquery"
onmousedown="cur_click=document.getElementById('<?php echo $t_n_url; ?>');"
table_name="<?php echo htmlspecialchars($t_n_url); ?>"
query_set="<?php echo isset($_REQUEST['query']) ? 1 : 0 ; ?>" >
<span class="owner">
<?php echo $GLOBALS['PMD_OUT']["OWNER"][$i]; ?>
</span>
<?php echo $GLOBALS['PMD_OUT']['TABLE_NAME_SMALL'][$i]; ?>
</td>
<?php if (isset($_REQUEST['query'])) : ?>
<td class="tab_zag tab_zag_query"
id="id_zag_<?php echo htmlspecialchars($t_n_url); ?>_2"
table_name="<?php echo htmlspecialchars($t_n_url); ?>"
onmousedown="cur_click=document.getElementById('<?php echo htmlspecialchars($t_n_url); ?>');">
</td>
<?php endif; ?>
</tr>
</thead>
<tbody id="id_tbody_<?php echo $t_n_url; ?>" style="<?php echo (isset($tab_pos[$t_n]) && empty($tab_pos[$t_n]["V"])) ? 'display: none' : ''; ?>">
<?php $display_field = PMA_getDisplayField(
$_GET['db'],
$GLOBALS['PMD']["TABLE_NAME_SMALL"][$i]
);
for ($j = 0, $id_cnt = count($tab_column[$t_n]["COLUMN_ID"]); $j < $id_cnt; $j++) :
$tmpColumn = $t_n . "." . $tab_column[$t_n]["COLUMN_NAME"][$j];
$click_field_param = array(
$GLOBALS['PMD_URL']["TABLE_NAME_SMALL"][$i],
urlencode($tab_column[$t_n]["COLUMN_NAME"][$j])
);
if (!PMA_Util::isForeignKeySupported($GLOBALS['PMD']['TABLE_TYPE'][$i])) {
$click_field_param[] = isset($tables_pk_or_unique_keys[$tmpColumn]) ? 1 : 0;
} else {
// if foreign keys are supported, it's not necessary that the
// index is a primary key
$click_field_param[] = isset($tables_all_keys[$tmpColumn]) ? 1 : 0;
}
?>
<tr id="id_tr_<?php echo $GLOBALS['PMD_URL']["TABLE_NAME_SMALL"][$i]; ?>.<?php echo urlencode($tab_column[$t_n]["COLUMN_NAME"][$j]); ?>"
<?php echo ($display_field == $tab_column[$t_n]["COLUMN_NAME"][$j]) ? 'class="tab_field_3"' : 'class="tab_field"'; ?>
onmouseover="old_class = this.className; this.className = 'tab_field_2';"
onmouseout="this.className = old_class;"
click_field_param="<?php echo implode($click_field_param, ','); ?>">
<?php if (isset($_REQUEST['query'])) : ?>
<td class="select_all">
<input class="select_all_store_col"
value="<?php echo htmlspecialchars($t_n_url) . urlencode($tab_column[$t_n]["COLUMN_NAME"][$j]); ?>"
type="checkbox"
id="select_<?php echo htmlspecialchars($t_n_url); ?>._<?php echo urlencode($tab_column[$t_n]["COLUMN_NAME"][$j]); ?>"
style="margin: 0;"
title="select_<?php echo urlencode($tab_column[$t_n]["COLUMN_NAME"][$j]); ?>"
store_column_param="<?php echo urlencode($GLOBALS['PMD_OUT']["TABLE_NAME_SMALL"][$i]); ?>,<?php echo htmlspecialchars($GLOBALS['PMD_OUT']["OWNER"][$i]); ?>,<?php echo urlencode($tab_column[$t_n]["COLUMN_NAME"][$j]); ?>">
</td>
<?php endif; ?>
<td width="10px" colspan="3" id="<?php echo $t_n_url; ?>.<?php echo urlencode($tab_column[$t_n]["COLUMN_NAME"][$j]); ?>">
<div class="nowrap">
<?php if (isset($tables_pk_or_unique_keys[$t_n . "." . $tab_column[$t_n]["COLUMN_NAME"][$j]])) : ?>
<img src="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/FieldKey_small.png'); ?>" alt="*" />
<?php else :
$type = 'pmd/Field_small';
if (strstr($tab_column[$t_n]["TYPE"][$j], 'char')
|| strstr($tab_column[$t_n]["TYPE"][$j], 'text')
) {
$type .= '_char';
} elseif (strstr($tab_column[$t_n]["TYPE"][$j], 'int')
|| strstr($tab_column[$t_n]["TYPE"][$j], 'float')
|| strstr($tab_column[$t_n]["TYPE"][$j], 'double')
|| strstr($tab_column[$t_n]["TYPE"][$j], 'decimal')
) {
$type .= '_int';
} elseif (strstr($tab_column[$t_n]["TYPE"][$j], 'date')
|| strstr($tab_column[$t_n]["TYPE"][$j], 'time')
|| strstr($tab_column[$t_n]["TYPE"][$j], 'year')
) {
$type .= '_date';
}
?>
<img src="<?php echo $_SESSION['PMA_Theme']->getImgPath($type); ?>.png" alt="*" />
<?php endif; ?>
<?php echo htmlspecialchars(
$tab_column[$t_n]["COLUMN_NAME"][$j] . " : "
. $tab_column[$t_n]["TYPE"][$j],
ENT_QUOTES
); ?>
</div>
</td>
<?php if (isset($_REQUEST['query'])) : ?>
<td class="small_tab_pref small_tab_pref_click_opt"
onmouseover="this.className='small_tab_pref2 small_tab_pref_click_opt'"
onmouseout="this.className='small_tab_pref small_tab_pref_click_opt'"
Click_option_param="pmd_optionse,<?php echo urlencode($tab_column[$t_n]['COLUMN_NAME'][$j]); ?>,<?php echo $GLOBALS['PMD_OUT']['TABLE_NAME_SMALL'][$i]; ?>" >
<img src="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/exec_small.png'); ?>" title="options" />
</td>
<?php endif; ?>
</tr>
<?php endfor; ?>
</tbody>
</table>
<?php endfor; ?>