structure_table_row.phtml
7.19 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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
<tr class="<?php echo $odd_row ? 'odd' : 'even'; ?> <?php if ($table_is_view) echo 'is_view'; ?>"
id="row_tbl_<?php echo $curr; ?>">
<td class="center print_ignore">
<input type="checkbox"
name="selected_tbl[]"
class="checkall"
value="<?php echo htmlspecialchars($current_table['TABLE_NAME']); ?>"
id="checkbox_tbl_<?php echo $curr; ?>" />
</td>
<th>
<?php echo $browse_table_label . $tracking_icon; ?>
</th>
<?php if ($server_slave_status): ?>
<td class="center">
<?php echo ($ignored ? PMA_Util::getImage('s_cancel.png', __('Not replicated')) : ''); ?>
<?php echo ($do ? PMA_Util::getImage('s_success.png', __('Replicated')) : ''); ?>
</td>
<?php endif; ?>
<?php
//Favorite table anchor.
?>
<?php if ($GLOBALS['cfg']['NumFavoriteTables'] > 0): ?>
<td class="center print_ignore">
<?php echo PMA\Template::get('database/structure/favorite_anchor')->render(
array(
'db' => $db,
'current_table' => $current_table,
'titles' => $titles,
'already_favorite' => $already_favorite
)
); ?>
</td>
<?php endif; ?>
<td class="center print_ignore">
<?php echo $browse_table; ?>
</td>
<td class="center print_ignore">
<a href="tbl_structure.php<?php echo $tbl_url_query; ?>">
<?php echo $titles['Structure']; ?>
</a>
</td>
<td class="center print_ignore">
<?php echo $search_table; ?>
</td>
<?php if (!$db_is_system_schema): ?>
<td class="insert_table center print_ignore">
<a href="tbl_change.php<?php echo $tbl_url_query; ?>"><?php echo $titles['Insert']; ?></a>
</td>
<td class="center print_ignore"><?php echo $empty_table; ?></td>
<td class="center print_ignore">
<a class="ajax drop_table_anchor <?php if ($table_is_view || $current_table['ENGINE'] == null) echo 'view'; ?>"
href="sql.php<?php echo $tbl_url_query; ?>&reload=1&purge=1&sql_query=<?php echo urlencode($drop_query); ?>&message_to_show=<?php echo urlencode($drop_message); ?>" >
<?php echo $titles['Drop']; ?>
</a>
</td>
<?php endif; ?>
<?php if (isset($current_table['TABLE_ROWS']) &&
($current_table['ENGINE'] != null || $table_is_view)): ?>
<?php
// Get the row count.
$row_count = PMA_Util::formatNumber($current_table['TABLE_ROWS'], 0);
// Content to be appended into 'tbl_rows' cell.
// If row count is approximate, display it as an anchor to get real count.
?>
<td class="value tbl_rows"
data-table="<?php echo htmlspecialchars($current_table['TABLE_NAME']); ?>">
<?php if ($approx_rows): ?>
<a href="db_structure.php<?php echo PMA_URL_getCommon(
array(
'ajax_request' => true,
'db' => $GLOBALS['db'],
'table' => $current_table['TABLE_NAME'],
'real_row_count' => 'true'
)
); ?>" class="ajax real_row_count">
<bdi>
~<?php echo $row_count; ?>
</bdi>
</a>
<?php else: ?>
<?php echo $row_count; ?>
<?php endif; ?>
<?php echo $show_superscript; ?>
</td>
<?php if (!($GLOBALS['cfg']['PropertiesNumColumns'] > 1)): ?>
<td class="nowrap">
<?php if (!empty($current_table['ENGINE'])): ?>
<?php echo $current_table['ENGINE']; ?>
<?php elseif ($table_is_view): ?>
<?php echo __('View'); ?>
<?php endif; ?>
</td>
<?php if (/*overload*/mb_strlen($collation)): ?>
<td class="nowrap">
<?php echo $collation; ?>
</td>
<?php endif; ?>
<?php endif; ?>
<?php if ($is_show_stats): ?>
<td class="value tbl_size">
<a href="tbl_structure.php<?php echo $tbl_url_query ?>#showusage">
<span><?php echo $formatted_size; ?></span>
<span class="unit"><?php echo $unit; ?></span>
</a>
</td>
<td class="value tbl_overhead">
<?php echo $overhead; ?>
</td>
<?php endif; ?>
<?php if ($GLOBALS['cfg']['ShowDbStructureComment']): ?>
<?php $comment = $current_table['Comment']; ?>
<td>
<?php if (/*overload*/mb_strlen($comment) > $GLOBALS['cfg']['LimitChars']): ?>
<abbr title="<?php echo htmlspecialchars($comment); ?>">
<?php echo htmlspecialchars(
/*overload*/mb_substr(
$comment, 0, $GLOBALS['cfg']['LimitChars']
)
); ?>
...
</abbr>
<?php else: ?>
<?php echo htmlspecialchars($comment); ?>
<?php endif; ?>
</td>
<?php endif; ?>
<?php if ($GLOBALS['cfg']['ShowDbStructureCreation']): ?>
<td class="value tbl_creation">
<?php echo $create_time ? PMA_Util::localisedDate(strtotime($create_time)) : '-'; ?>
</td>
<?php endif; ?>
<?php if ($GLOBALS['cfg']['ShowDbStructureLastUpdate']): ?>
<td class="value tbl_last_update">
<?php echo $update_time ? PMA_Util::localisedDate(strtotime($update_time)) : '-'; ?>
</td>
<?php endif; ?>
<?php if ($GLOBALS['cfg']['ShowDbStructureLastCheck']): ?>
<td class="value tbl_last_check">
<?php echo $check_time ? PMA_Util::localisedDate(strtotime($check_time)) : '-'; ?>
</td>
<?php endif; ?>
<?php elseif ($table_is_view): ?>
<td class="value tbl_rows">-</td>
<td class="nowrap">
<?php echo __('View'); ?>
</td>
<td class="nowrap">---</td>
<?php if ($is_show_stats): ?>
<td class="value tbl_size">-</td>
<td class="value tbl_overhead">-</td>
<?php endif; ?>
<?php if ($GLOBALS['cfg']['ShowDbStructureComment']): ?>
<td></td>
<?php endif; ?>
<?php if ($GLOBALS['cfg']['ShowDbStructureCreation']): ?>
<td class="value tbl_creation">-</td>
<?php endif; ?>
<?php if ($GLOBALS['cfg']['ShowDbStructureLastUpdate']): ?>
<td class="value tbl_last_update">-</td>
<?php endif; ?>
<?php if ($GLOBALS['cfg']['ShowDbStructureLastCheck']): ?>
<td class="value tbl_last_check">-</td>
<?php endif; ?>
<?php else: ?>
<td colspan="<?php echo $colspan_for_structure - ($db_is_system_schema ? 6 : 9); ?>"
class="center">
<?php echo __('in use'); ?>
</td>
<?php endif; ?>
</tr>