Translated using Weblate (Slovenian)
[phpmyadmin.git] / pmd_general.php
blob61f2621f8f1dfcb71e383615b63ac970ad0736bb
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 * phpMyAdmin designer general code
6 * @package PhpMyAdmin-Designer
7 */
9 /**
12 require_once 'libraries/common.inc.php';
13 require_once 'libraries/pmd_common.php';
15 $script_display_field = PMA_getTablesInfo();
16 $tab_column = PMA_getColumnsInfo();
17 $script_tables = PMA_getScriptTabs();
18 $tables_pk_or_unique_keys = PMA_getPKOrUniqueKeys();
19 $tables_all_keys = PMA_getAllKeys();
20 $display_page = -1;
22 $response = PMA_Response::getInstance();
24 if (isset($_REQUEST['dialog'])) {
26 include_once 'libraries/designer.lib.php';
27 if ($_REQUEST['dialog'] == 'edit') {
28 $html = PMA_getHtmlForEditOrDeletePages($GLOBALS['db'], 'edit');
29 } else if ($_REQUEST['dialog'] == 'delete') {
30 $html = PMA_getHtmlForEditOrDeletePages($GLOBALS['db'], 'delete');
31 } else if ($_REQUEST['dialog'] == 'save_as') {
32 $html = PMA_getHtmlForPageSaveAs($GLOBALS['db']);
33 } else if ($_REQUEST['dialog'] == 'export') {
34 $html = PMA_getHtmlForSchemaExport($GLOBALS['db'], $_REQUEST['selected_page']);
37 $response->addHTML($html);
38 return;
41 if (isset($_REQUEST['operation'])) {
43 if ($_REQUEST['operation'] == 'delete') {
44 $result = PMA_deletePage($_REQUEST['selected_page']);
45 if ($result) {
46 $response->isSuccess(true);
47 } else {
48 $response->isSuccess(false);
50 } elseif ($_REQUEST['operation'] == 'save') {
51 if ($_REQUEST['save_page'] == 'same') {
52 $page = $_REQUEST['selected_page'];
53 } elseif ($_REQUEST['save_page'] == 'new') {
54 $page = PMA_createNewPage($_REQUEST['selected_value'], $GLOBALS['db']);
55 $response->addJSON('id', $page);
57 if (PMA_saveTablePositions($page)) {
58 $response->isSuccess(true);
59 } else {
60 $response->isSuccess(false);
63 return;
64 } else {
65 if (! empty($_REQUEST['page'])) {
66 $display_page = $_REQUEST['page'];
67 } else {
68 $display_page = PMA_getFirstPage($_REQUEST['db']);
72 $tab_pos = PMA_getTablePositions($display_page);
73 $selected_page = PMA_getPageName($display_page);
74 $script_contr = PMA_getScriptContr();
76 $params = array('lang' => $GLOBALS['lang']);
77 if (isset($_GET['db'])) {
78 $params['db'] = $_GET['db'];
81 $response = PMA_Response::getInstance();
82 $response->getFooter()->setMinimal();
83 $header = $response->getHeader();
84 $header->setBodyId('pmd_body');
85 $scripts = $header->getScripts();
86 $scripts->addFile('jquery/jquery.fullscreen.js');
87 $scripts->addFile('pmd/ajax.js');
88 $scripts->addFile('pmd/history.js');
89 $scripts->addFile('pmd/move.js');
90 $scripts->addFile('pmd/iecanvas.js', true);
91 $scripts->addFile('pmd/init.js');
93 require 'libraries/db_common.inc.php';
94 require 'libraries/db_info.inc.php';
96 // Embed some data into HTML, later it will be read
97 // by pmd/init.js and converted to JS variables.
98 echo '<div id="script_server" class="hide">';
99 echo htmlspecialchars($GLOBALS['server']);
100 echo '</div>';
101 echo '<div id="script_db" class="hide">';
102 echo htmlspecialchars($_GET['db']);
103 echo '</div>';
104 echo '<div id="script_token" class="hide">';
105 echo htmlspecialchars($_GET['token']);
106 echo '</div>';
107 echo '<div id="script_tables" class="hide">';
108 echo htmlspecialchars(json_encode($script_tables));
109 echo '</div>';
110 echo '<div id="script_contr" class="hide">';
111 echo htmlspecialchars(json_encode($script_contr));
112 echo '</div>';
113 echo '<div id="script_display_field" class="hide">';
114 echo htmlspecialchars(json_encode($script_display_field));
115 echo '</div>';
116 echo '<div id="script_display_page" class="hide">';
117 echo htmlspecialchars($display_page);
118 echo '</div>';
121 <div class="pmd_header" id="top_menu">
122 <a href="#" onclick="Show_left_menu(document.getElementById('key_Show_left_menu')); return false"
123 class="M_butt first" target="_self">
124 <img id='key_Show_left_menu'
125 title="<?php echo __('Show/Hide left menu'); ?>" alt="v"
126 src="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/downarrow2_m.png'); ?>" />
127 </a>
128 <a href="#" id="enterFullscreen" onclick="Enter_fullscreen(); return false"
129 class="M_butt" target="_self">
130 <img title="<?php echo __('View in fullscreen') ?>" alt=""
131 src="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/viewInFullscreen.png'); ?>" />
132 </a>
133 <a href="#" id="exitFullscreen" onclick="Exit_fullscreen(); return false"
134 class="M_butt hide" target="_self">
135 <img title="<?php echo __('Exit fullscreen') ?>" alt=""
136 src="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/exitFullscreen.png'); ?>" />
137 </a>
138 <img class="M_bord"
139 src="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/bord.png'); ?>"
140 alt="" />
141 <a href="#" onclick="New(); return false" class="M_butt" target="_self">
142 <img title="<?php echo __('New page') ?>" alt=""
143 src="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/page_add.png'); ?>" />
144 </a>
145 <a href="#" onclick="Edit_pages(); return false" class="M_butt ajax" target="_self">
146 <img title="<?php echo __('Open page') ?>" alt=""
147 src="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/page_edit.png'); ?>" />
148 </a>
149 <a href="#" onclick="Save3(); return false" class="M_butt" target="_self">
150 <img title="<?php echo __('Save position') ?>" alt=""
151 src="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/save.png'); ?>" />
152 </a>
153 <a href="#" onclick="Save_as(); return false" class="M_butt ajax" target="_self">
154 <img title="<?php echo __('Save positions as') ?>" alt=""
155 src="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/save_as.png'); ?>" />
156 </a>
157 <a href="#" onclick="Delete_pages(); return false" class="M_butt ajax" target="_self">
158 <img title="<?php echo __('Delete pages') ?>" alt=""
159 src="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/page_delete.png'); ?>" />
160 </a>
161 <img class="M_bord" src="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/bord.png'); ?>" alt="" />
162 <a href="#" onclick="Start_table_new(); return false"
163 class="M_butt" target="_self">
164 <img title="<?php echo __('Create table')?>" alt=""
165 src="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/table.png'); ?>" />
166 </a>
167 <a href="#" onclick="Start_relation(); return false" class="M_butt"
168 id="rel_button" target="_self">
169 <img title="<?php echo __('Create relation') ?>" alt=""
170 src="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/relation.png'); ?>" />
171 </a>
172 <a href="#" onclick="Start_display_field(); return false"
173 class="M_butt" id="display_field_button" target="_self">
174 <img title="<?php echo __('Choose column to display') ?>" alt=""
175 src="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/display_field.png'); ?>" />
176 </a>
177 <a href="#" onclick="location.reload(); return false" class="M_butt"
178 target="_self">
179 <img title="<?php echo __('Reload'); ?>" alt=""
180 src="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/reload.png'); ?>" />
181 </a>
182 <a href="<?php echo PMA_Util::getDocuLink('faq', 'faq6-31') ?>"
183 target="documentation" class="M_butt" target="_self">
184 <img title="<?php echo __('Help'); ?>" alt=""
185 src="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/help.png'); ?>" />
186 </a>
187 <img class="M_bord"
188 src="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/bord.png'); ?>"
189 alt="" />
190 <a href="#" onclick="Angular_direct(); return false"
191 class="M_butt" id="angular_direct_button" target="_self">
192 <img title="<?php echo __('Angular links') . ' / ' . __('Direct links'); ?>" alt=""
193 src="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/ang_direct.png'); ?>" />
194 </a>
195 <a href="#" onclick="Grid(); return false" class="M_butt" id="grid_button"
196 target="_self">
197 <img title="<?php echo __('Snap to grid') ?>"
198 src="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/grid.png'); ?>" alt="" />
199 </a>
200 <img class="M_bord" src="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/bord.png'); ?>" alt="" />
201 <a href="#" onclick="Small_tab_all(document.getElementById('key_SB_all')); return false"
202 class="M_butt" target="_self">
203 <img id='key_SB_all' title="<?php echo __('Small/Big All'); ?>" alt="v"
204 src="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/downarrow1.png'); ?>" />
205 </a>
206 <a href="#" onclick="Small_tab_invert(); return false" class="M_butt"
207 target="_self" >
208 <img title="<?php echo __('Toggle small/big'); ?>" alt="key"
209 src="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/bottom.png'); ?>" />
210 </a>
211 <a href="#" onclick="Relation_lines_invert(); return false"
212 class="M_butt" target="_self" >
213 <img title="<?php echo __('Toggle relation lines'); ?>" alt="key"
214 src="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/toggle_lines.png'); ?>" />
215 </a>
216 <img class="M_bord" src="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/bord.png'); ?>" alt="" />
217 <span id="page_name"><?php echo htmlspecialchars($selected_page) ?></span>
218 <img class="M_bord" src="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/bord.png'); ?>" alt="" />
219 <a href="#" onclick="Export_pages(); return false"
220 class="M_butt" target="_self" >
221 <img title="<?php echo __('Export schema'); ?>" alt="key"
222 src="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/export.png'); ?>" />
223 </a>
224 <img class="M_bord" src="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/bord.png'); ?>" alt="" />
225 <?php
226 if (isset($_REQUEST['query'])) {
227 echo '<a href="#" onclick="build_query(\'SQL Query on Database\', 0)" onmousedown="return false;"
228 class="M_butt" target="_self">';
229 echo '<img src="'
230 . $_SESSION['PMA_Theme']->getImgPath('pmd/query_builder.png')
231 . '" alt="key" width="20" height="20" title="';
232 echo __('Build Query');
233 echo '"/></a>';
236 <a href="#" onclick="Top_menu_right(document.getElementById('key_Left_Right')); return false"
237 class="M_butt last" target="_self">
238 <img src="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/2rightarrow_m.png'); ?>"
239 id="key_Left_Right" alt=">" title="<?php echo __('Move Menu'); ?>" />
240 </a>
241 </div>
243 <div id="canvas_outer">
244 <form action="" method="post" name="form1">
245 <div id="osn_tab">
246 <canvas class="pmd" id="canvas" width="100" height="100"
247 onclick="Canvas_click(this)"></canvas>
248 </div>
249 <div id="layer_menu" style="display:none;">
250 <div class="center" style="padding-top:5px;">
251 <a href="#"
252 onclick="Hide_tab_all(document.getElementById('key_HS_all')); return false" class="M_butt" target="_self">
253 <img title="<?php echo __('Hide/Show all'); ?>" alt="v"
254 src="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/downarrow1.png'); ?>" id='key_HS_all' /></a>
255 <a href="#"
256 onclick="No_have_constr(document.getElementById('key_HS')); return false" class="M_butt" target="_self">
257 <img title="<?php echo __('Hide/Show Tables with no relation'); ?>" alt="v"
258 src="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/downarrow2.png'); ?>" id='key_HS' /></a>
259 </div>
261 <div id="id_scroll_tab" class="scroll_tab">
262 <table width="100%" style="padding-left: 3px;">
263 <?php
264 $name_cnt = count($GLOBALS['PMD']['TABLE_NAME']);
265 for ($i = 0; $i < $name_cnt; $i++) {
267 echo '<tr><td title="' . __('Structure') . '" width="1px" '
268 . 'onmouseover="this.className=\'L_butt2_2\'" '
269 . 'onmouseout="this.className=\'L_butt2_1\'" class="L_butt2_1">';
270 echo '<img '
271 . 'onclick="Start_tab_upd(\''
272 . $GLOBALS['PMD_URL']["TABLE_NAME_SMALL"][$i] . '\');" '
273 . 'src="' . $_SESSION['PMA_Theme']->getImgPath('pmd/exec.png')
274 . '" alt="" />';
275 echo '</td>';
276 echo '<td width="1px">';
277 echo '<input onclick="VisibleTab(this,\''
278 . $GLOBALS['PMD_URL']["TABLE_NAME"][$i] . '\')" '
279 . 'title="' . __('Hide') . '" '
280 . 'id="check_vis_' . $GLOBALS['PMD_URL']["TABLE_NAME"][$i] . '" '
281 . 'style="margin:0px;" type="checkbox" '
282 . 'value="' . $GLOBALS['PMD_URL']["TABLE_NAME"][$i] . '"';
283 if ((isset($tab_pos[$GLOBALS['PMD']["TABLE_NAME"][$i]])
284 && $tab_pos[$GLOBALS['PMD']["TABLE_NAME"][$i]]["H"])
285 || $display_page == -1
287 echo 'checked="checked"';
289 echo '/></td>';
290 echo '<td class="pmd_Tabs" onmouseover="this.className=\'pmd_Tabs2\'" '
291 . 'onmouseout="this.className=\'pmd_Tabs\'" ' . 'onclick="Select_tab(\''
292 . $GLOBALS['PMD_URL']["TABLE_NAME"][$i] . '\');">';
293 echo $GLOBALS['PMD_OUT']["TABLE_NAME"][$i];
294 echo '</td>';
295 echo '</tr>';
297 echo '</table>';
298 echo '</div>';
300 echo '<div class="center">';
301 echo __('Number of tables:') . ' ' . $name_cnt;
302 echo '</div>';
303 echo '<div class="floatright">';
304 echo '<div id="layer_menu_sizer" onmousedown="layer_menu_cur_click=1">';
305 echo '</div>';
306 echo '</div>';
307 echo '</div>';
309 for ($i = 0; $i < count($GLOBALS['PMD']["TABLE_NAME"]); $i++) {
310 $t_n = $GLOBALS['PMD']["TABLE_NAME"][$i];
311 $t_n_url = $GLOBALS['PMD_URL']["TABLE_NAME"][$i];
313 echo '<input name="t_x[' . $t_n_url . ']" type="hidden" id="t_x_'
314 . $t_n_url . '_" />'
315 . '<input name="t_y[' . $t_n_url . ']" type="hidden" id="t_y_'
316 . $t_n_url . '_" />'
317 . '<input name="t_v[' . $t_n_url . ']" type="hidden" id="t_v_'
318 . $t_n_url . '_" />'
319 . '<input name="t_h[' . $t_n_url . ']" type="hidden" id="t_h_'
320 . $t_n_url . '_" />';
322 <table id="<?php echo $t_n_url ?>" cellpadding="0" cellspacing="0" class="pmd_tab"
323 style="position: absolute;
324 left: <?php
325 echo isset($tab_pos[$t_n]) ? $tab_pos[$t_n]["X"] : rand(20, 700); ?>px;
326 top: <?php
327 echo isset($tab_pos[$t_n]) ? $tab_pos[$t_n]["Y"] : rand(20, 550); ?>px;
328 display: <?php
329 echo (isset($tab_pos[$t_n]) || $display_page == -1) ? "block" : "none"; ?>;
330 z-index: 1;">
331 <thead>
332 <tr>
333 <?php
334 if (isset($_REQUEST['query'])) {
335 echo '<td class="select_all">';
336 echo '<input type="checkbox" value="select_all_'
337 . htmlspecialchars($t_n_url) . '" style="margin: 0px;" ';
338 echo 'id="select_all_' . htmlspecialchars($t_n_url) . '" title="select all" ';
339 echo 'onclick="Select_all(\'' . htmlspecialchars($t_n_url) . '\',\''
340 . htmlspecialchars($GLOBALS['PMD_OUT']["OWNER"][$i]) . '\')"></td>';
343 <td class="small_tab" onmouseover="this.className='small_tab2';"
344 onmouseout="this.className='small_tab';"
345 id="id_hide_tbody_<?php echo $t_n_url ?>"
346 onclick="Small_tab('<?php echo $t_n_url ?>', 1)"><?php
347 // no space alloawd here, between tags and content !!!
348 // JavaScript function does require this
349 if (! isset($tab_pos[$t_n]) || ! empty($tab_pos[$t_n]["V"])) {
350 echo 'v';
351 } else {
352 echo '&gt;';
354 ?></td>
355 <td class="small_tab_pref" onmouseover="this.className='small_tab_pref2';"
356 onmouseout="this.className='small_tab_pref';"
357 onclick="Start_tab_upd('<?php echo $GLOBALS['PMD_URL']["TABLE_NAME_SMALL"][$i]; ?>');">
358 <img src="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/exec_small.png'); ?>" alt="" /></td>
359 <td id="id_zag_<?php echo $t_n_url ?>" class="tab_zag nowrap"
360 onmousedown="cur_click=document.getElementById('<?php echo $t_n_url ?>');"/
361 onmouseover="Table_onover('<?php echo $t_n_url ?>',0,<?php echo (isset($_REQUEST['query'])? 1 : 0 )?> )"
362 onmouseout="Table_onover('<?php echo $t_n_url ?>',1,<?php echo (isset($_REQUEST['query']) ? 1 : 0 )?>)">
363 <span class='owner'>
364 <?php echo $GLOBALS['PMD_OUT']["OWNER"][$i]; ?>.
365 </span>
366 <?php echo $GLOBALS['PMD_OUT']["TABLE_NAME_SMALL"][$i]; ?>
367 </td>
368 <?php
369 if (isset($_REQUEST['query'])) {
370 echo '<td class="tab_zag" onmouseover="Table_onover(\''
371 . htmlspecialchars($t_n_url) . '\',0,1)" id="id_zag_'
372 . htmlspecialchars($t_n_url) . '_2"';
373 echo 'onmousedown="cur_click=document.getElementById(\''
374 . htmlspecialchars($t_n_url) . '\');"';
375 echo 'onmouseout="Table_onover(\'' . htmlspecialchars($t_n_url) . '\',1,1)">';
378 </tr>
379 </thead>
380 <tbody id="id_tbody_<?php echo $t_n_url ?>"
381 <?php
382 if (isset($tab_pos[$t_n]) && empty($tab_pos[$t_n]["V"])) {
383 echo 'style="display: none;"';
385 echo '>';
386 $display_field = PMA_getDisplayField(
387 $_GET['db'],
388 $GLOBALS['PMD']["TABLE_NAME_SMALL"][$i]
390 for (
391 $j = 0, $id_cnt = count($tab_column[$t_n]["COLUMN_ID"]);
392 $j < $id_cnt;
393 $j++
395 echo '<tr id="id_tr_'
396 . $GLOBALS['PMD_URL']["TABLE_NAME_SMALL"][$i] . '.'
397 . urlencode($tab_column[$t_n]["COLUMN_NAME"][$j]) . '"';
398 if ($display_field == $tab_column[$t_n]["COLUMN_NAME"][$j]) {
399 echo ' class="tab_field_3" ';
400 } else {
401 echo ' class="tab_field" ';
404 onmouseover="old_class = this.className; this.className = 'tab_field_2';"
405 onmouseout="this.className = old_class;"
406 onmousedown="Click_field('<?php
407 echo $GLOBALS['PMD_URL']["TABLE_NAME_SMALL"][$i] . "','"
408 . urlencode($tab_column[$t_n]["COLUMN_NAME"][$j]) . "',";
409 $tmpColumn = $t_n . "." . $tab_column[$t_n]["COLUMN_NAME"][$j];
410 if (!PMA_Util::isForeignKeySupported($GLOBALS['PMD']['TABLE_TYPE'][$i])) {
411 echo (isset($tables_pk_or_unique_keys[$tmpColumn]) ? 1 : 0);
412 } else {
413 // if foreign keys are supported, it's not necessary that the
414 // index is a primary key
415 echo (isset($tables_all_keys[$tmpColumn]) ? 1 : 0);
417 ?>)">
418 <?php
419 if (isset($_REQUEST['query'])) {
420 echo '<td class="select_all">';
421 echo '<input value="' . htmlspecialchars($t_n_url)
422 . urlencode($tab_column[$t_n]["COLUMN_NAME"][$j]) . '"';
423 echo 'type="checkbox" id="select_' . htmlspecialchars($t_n_url) . '._'
424 . urlencode($tab_column[$t_n]["COLUMN_NAME"][$j]) . '" ';
425 echo 'style="margin: 0px;" title="select_'
426 . urlencode($tab_column[$t_n]["COLUMN_NAME"][$j]) . '" ';
427 echo 'onclick="store_column(\''
428 . urlencode($GLOBALS['PMD_OUT']["TABLE_NAME_SMALL"][$i]) . '\',\''
429 . htmlspecialchars($GLOBALS['PMD_OUT']["OWNER"][$i]) . '\',\''
430 . urlencode($tab_column[$t_n]["COLUMN_NAME"][$j]) . '\')"></td>';
432 <td width="10px" colspan="3"
433 id="<?php echo $t_n_url
434 . "."
435 . urlencode($tab_column[$t_n]["COLUMN_NAME"][$j]) ?>">
436 <div class="nowrap">
437 <?php
438 if (isset($tables_pk_or_unique_keys[$t_n . "." . $tab_column[$t_n]["COLUMN_NAME"][$j]])) {
440 <img src="<?php echo $_SESSION['PMA_Theme']->getImgPath(); ?>pmd/FieldKey_small.png"
441 alt="*" />
442 <?php
443 } else {
445 <img src="<?php echo $_SESSION['PMA_Theme']->getImgPath(); ?>pmd/Field_small<?php
446 if (strstr($tab_column[$t_n]["TYPE"][$j], 'char')
447 || strstr($tab_column[$t_n]["TYPE"][$j], 'text')
449 echo '_char';
450 } elseif (strstr($tab_column[$t_n]["TYPE"][$j], 'int')
451 || strstr($tab_column[$t_n]["TYPE"][$j], 'float')
452 || strstr($tab_column[$t_n]["TYPE"][$j], 'double')
453 || strstr($tab_column[$t_n]["TYPE"][$j], 'decimal')
455 echo '_int';
456 } elseif (strstr($tab_column[$t_n]["TYPE"][$j], 'date')
457 || strstr($tab_column[$t_n]["TYPE"][$j], 'time')
458 || strstr($tab_column[$t_n]["TYPE"][$j], 'year')
460 echo '_date';
462 ?>.png" alt="*" />
463 <?php
465 echo htmlspecialchars(
466 $tab_column[$t_n]["COLUMN_NAME"][$j] . " : "
467 . $tab_column[$t_n]["TYPE"][$j],
468 ENT_QUOTES
470 echo "</div>\n</td>\n";
471 if (isset($_REQUEST['query'])) {
472 /*$temp = $GLOBALS['PMD_OUT']["OWNER"][$i] . '.'
473 . $GLOBALS['PMD_OUT']["TABLE_NAME_SMALL"][$i];*/
474 echo '<td class="small_tab_pref" '
475 . 'onmouseover="this.className=\'small_tab_pref2\';"';
476 echo 'onmouseout="this.className=\'small_tab_pref\';"';
477 echo 'onclick="Click_option(\'pmd_optionse\',\''
478 . urlencode($tab_column[$t_n]["COLUMN_NAME"][$j]) . '\',\''
479 . $GLOBALS['PMD_OUT']["TABLE_NAME_SMALL"][$i] . '\')" >';
480 echo '<img src="'
481 . $_SESSION['PMA_Theme']->getImgPath('pmd/exec_small.png')
482 . '" title="options" alt="" /></td> ';
484 echo "</tr>\n";
486 echo "</tbody>\n</table>\n";
489 </form>
490 </div>
491 <div id="pmd_hint"></div>
493 <table id="layer_new_relation" style="display:none;"
494 width="5%" cellpadding="0" cellspacing="0">
495 <tbody>
496 <tr>
497 <td class="frams1" width="10px"></td>
498 <td class="frams5" width="99%" ></td>
499 <td class="frams2" width="10px"><div class="bor"></div></td>
500 </tr>
501 <tr>
502 <td class="frams8"></td>
503 <td class="input_tab">
504 <table width="168" class="center" cellpadding="2" cellspacing="0">
505 <thead>
506 <tr>
507 <td colspan="2" class="center nowrap">
508 <strong><?php echo __('Create relation'); ?></strong>
509 </td>
510 </tr>
511 </thead>
512 <tbody id="foreign_relation">
513 <tr>
514 <td colspan="2" class="center nowrap"><strong>FOREIGN KEY</strong></td>
515 </tr>
516 <tr>
517 <td width="58" class="nowrap">on delete</td>
518 <td width="102"><select name="on_delete" id="on_delete">
519 <option value="nix" selected="selected">--</option>
520 <option value="CASCADE">CASCADE</option>
521 <option value="SET NULL">SET NULL</option>
522 <option value="NO ACTION">NO ACTION</option>
523 <option value="RESTRICT">RESTRICT</option>
524 </select>
525 </td>
526 </tr>
527 <tr>
528 <td class="nowrap">on update</td>
529 <td><select name="on_update" id="on_update">
530 <option value="nix" selected="selected">--</option>
531 <option value="CASCADE">CASCADE</option>
532 <option value="SET NULL">SET NULL</option>
533 <option value="NO ACTION">NO ACTION</option>
534 <option value="RESTRICT">RESTRICT</option>
535 </select>
536 </td>
537 </tr>
538 </tbody>
539 <tbody>
540 <tr>
541 <td colspan="2" class="center nowrap">
542 <input type="button" class="butt" name="Button"
543 value="<?php echo __('OK'); ?>" onclick="New_relation()" />
544 <input type="button" class="butt" name="Button"
545 value="<?php echo __('Cancel'); ?>"
546 onclick="document.getElementById('layer_new_relation').style.display = 'none';" />
547 </td>
548 </tr>
549 </tbody>
550 </table>
551 </td>
552 <td class="frams6"></td>
553 </tr>
554 <tr>
555 <td class="frams4"><div class="bor"></div></td>
556 <td class="frams7"></td>
557 <td class="frams3"></td>
558 </tr>
559 </tbody>
560 </table>
562 <table id="layer_upd_relation" style="display:none;"
563 width="5%" cellpadding="0" cellspacing="0">
564 <tbody>
565 <tr>
566 <td class="frams1" width="10px"></td>
567 <td class="frams5" width="99%"></td>
568 <td class="frams2" width="10px"><div class="bor"></div></td>
569 </tr>
570 <tr>
571 <td class="frams8"></td>
572 <td class="input_tab">
573 <table width="100%" class="center" cellpadding="2" cellspacing="0">
574 <tr>
575 <td colspan="3" class="center nowrap">
576 <strong><?php echo __('Delete relation'); ?></strong>
577 </td>
578 </tr>
579 <tr>
580 <td colspan="3" class="center nowrap">
581 <input name="Button" type="button" class="butt"
582 onclick="Upd_relation()" value="<?php echo __('Delete'); ?>" />
583 <input type="button" class="butt" name="Button"
584 value="<?php echo __('Cancel'); ?>"
585 onclick="document.getElementById('layer_upd_relation').style.display = 'none'; Re_load();" />
586 </td>
587 </tr>
588 </table></td>
589 <td class="frams6"></td>
590 </tr>
591 <tr>
592 <td class="frams4"><div class="bor"></div></td>
593 <td class="frams7"></td>
594 <td class="frams3"></td>
595 </tr>
596 </tbody>
597 </table>
599 <table id="pmd_optionse" style="display:none;"
600 width="5%" cellpadding="0" cellspacing="0">
601 <tbody>
602 <tr>
603 <td class="frams1" width="10px"></td>
604 <td class="frams5" width="99%" ></td>
605 <td class="frams2" width="10px"><div class="bor"></div></td>
606 </tr>
607 <tr>
608 <td class="frams8"></td>
609 <td class="input_tab">
610 <table width="168" class="center" cellpadding="2" cellspacing="0">
611 <thead>
612 <tr>
613 <td colspan="2" rowspan="2" id="option_col_name"
614 class="center nowrap">
615 </td>
616 </tr>
617 </thead>
618 <tbody id="where">
619 <tr><td class="center nowrap"><b>WHERE</b></td></tr>
620 <tr>
621 <td width="58" class="nowrap"><?php echo __('Relation operator'); ?></td>
622 <td width="102"><select name="rel_opt" id="rel_opt">
623 <option value="--" selected="selected"> -- </option>
624 <option value="="> = </option>
625 <option value="&gt;"> &gt; </option>
626 <option value="&lt;"> &lt; </option>
627 <option value="&gt;="> &gt;= </option>
628 <option value="&lt;="> &lt;= </option>
629 <option value="NOT"> NOT </option>
630 <option value="IN"> IN </option>
631 <option value="EXCEPT"> <?php echo __('Except'); ?> </option>
632 <option value="NOT IN"> NOT IN </option>
633 </select>
634 </td>
635 </tr>
636 <tr>
637 <td class="nowrap"><?php echo __('Value'); ?>/<br /><?php echo __('subquery'); ?></td>
638 <td><textarea id="Query" value="" cols="18"></textarea>
639 </td>
640 </tr>
641 <tr><td class="center nowrap"><b><?php echo __('Rename to'); ?></b></td></tr>
642 <tr>
643 <td width="58" class="nowrap"><?php echo __('New name'); ?></td>
644 <td width="102"><input type="text" value="" id="new_name"/></td>
645 </tr>
646 <tr><td class="center nowrap"><b><?php echo __('Aggregate'); ?></b></td></tr>
647 <tr>
648 <td width="58" class="nowrap"><?php echo __('Operator'); ?></td>
649 <td width="102"><select name="operator" id="operator">
650 <option value="---" selected="selected">---</option>
651 <option value="sum" > SUM </option>
652 <option value="min"> MIN </option>
653 <option value="max"> MAX </option>
654 <option value="avg"> AVG </option>
655 <option value="count"> COUNT </option>
656 </select>
657 </td></tr>
658 <tr>
659 <td width="58" class="center nowrap"><b>GROUP BY</b></td>
660 <td><input type="checkbox" value="groupby" id="groupby"/></td>
661 </tr>
662 <tr>
663 <td width="58" class="center nowrap"><b>ORDER BY</b></td>
664 <td><input type="checkbox" value="orderby" id="orderby"/></td>
665 </tr>
666 <tr><td class="center nowrap"><b>HAVING</b></td></tr>
667 <tr>
668 <td width="58" class="nowrap"><?php echo __('Operator'); ?></td>
669 <td width="102"><select name="h_operator" id="h_operator">
670 <option value="---" selected="selected">---</option>
671 <option value="None" > <?php echo __('None'); ?> </option>
672 <option value="sum" > SUM </option>
673 <option value="min"> MIN </option>
674 <option value="max"> MAX </option>
675 <option value="avg"> AVG </option>
676 <option value="count"> COUNT </option>
677 </select>
678 </td></tr>
679 <tr>
680 <td width="58" class="nowrap"><?php echo __('Relation operator'); ?></td>
681 <td width="102"><select name="h_rel_opt" id="h_rel_opt">
682 <option value="--" selected="selected"> -- </option>
683 <option value="="> = </option>
684 <option value="&gt;"> &gt; </option>
685 <option value="&lt;"> &lt; </option>
686 <option value="&gt;="> &gt;= </option>
687 <option value="&lt;="> &lt;= </option>
688 <option value="NOT"> NOT </option>
689 <option value="IN"> IN </option>
690 <option value="EXCEPT"> <?php echo __('Except'); ?> </option>
691 <option value="NOT IN"> NOT IN </option>
692 </select>
693 </td>
694 </tr>
695 <tr>
696 <td width="58" class="nowrap">
697 <?php echo __('Value'); ?>/<br/>
698 <?php echo __('subquery'); ?>
699 </td>
700 <td width="102">
701 <textarea id="having" value="" cols="18"></textarea>
702 </td>
703 </tr>
704 </tbody>
705 <tbody>
706 <tr>
707 <td colspan="2" class="center nowrap">
708 <input type="button" class="butt" name="Button"
709 value="<?php echo __('OK'); ?>" onclick="add_object()" />
710 <input type="button" class="butt" name="Button"
711 value="<?php echo __('Cancel'); ?>"
712 onclick="Close_option()" />
713 </td>
714 </tr>
715 </tbody>
716 </table>
717 </td>
718 <td class="frams6"></td>
719 </tr>
720 <tr>
721 <td class="frams4"><div class="bor"></div></td>
722 <td class="frams7"></td>
723 <td class="frams3"></td>
724 </tr>
725 </tbody>
726 </table>
728 <table id="query_rename_to" style="display:none;"
729 width="5%" cellpadding="0" cellspacing="0">
730 <tbody>
731 <tr>
732 <td class="frams1" width="10px"></td>
733 <td class="frams5" width="99%" ></td>
734 <td class="frams2" width="10px"><div class="bor"></div></td>
735 </tr>
736 <tr>
737 <td class="frams8"></td>
738 <td class="input_tab">
739 <table width="168" class="center" cellpadding="2" cellspacing="0">
740 <thead>
741 <tr>
742 <td colspan="2" class="center nowrap">
743 <strong><?php echo __('Rename to'); ?></strong>
744 </td>
745 </tr>
746 </thead>
747 <tbody id="rename_to">
748 <tr>
749 <td width="58" class="nowrap"><?php echo __('New name'); ?></td>
750 <td width="102">
751 <input type="text" value="" id="e_rename"/>
752 </td>
753 </tr>
754 </tbody>
755 <tbody>
756 <tr>
757 <td colspan="2" class="center nowrap">
758 <input type="button" class="butt" name="Button"
759 value="<?php echo __('OK'); ?>" onclick="edit('Rename')" />
760 <input type="button" class="butt" name="Button"
761 value="<?php echo __('Cancel'); ?>"
762 onclick="document.getElementById('query_rename_to').style.display = 'none';" />
763 </td>
764 </tr>
765 </tbody>
766 </table>
767 </td>
768 <td class="frams6"></td>
769 </tr>
770 <tr>
771 <td class="frams4"><div class="bor"></div></td>
772 <td class="frams7"></td>
773 <td class="frams3"></td>
774 </tr>
775 </tbody>
776 </table>
778 <table id="query_having" style="display:none;"
779 width="5%" cellpadding="0" cellspacing="0">
780 <tbody>
781 <tr>
782 <td class="frams1" width="10px"></td>
783 <td class="frams5" width="99%" ></td>
784 <td class="frams2" width="10px"><div class="bor"></div></td>
785 </tr>
786 <tr>
787 <td class="frams8"></td>
788 <td class="input_tab">
789 <table width="168" class="center" cellpadding="2" cellspacing="0">
790 <thead>
791 <tr>
792 <td colspan="2" class="center nowrap"><strong>HAVING</strong></td>
793 </tr>
794 </thead>
795 <tbody id="rename_to">
796 <tr>
797 <td width="58" class="nowrap"><?php echo __('Operator'); ?></td>
798 <td width="102"><select name="hoperator" id="hoperator">
799 <option value="---" selected="selected">---</option>
800 <option value="None" > None </option>
801 <option value="sum" > SUM </option>
802 <option value="min"> MIN </option>
803 <option value="max"> MAX </option>
804 <option value="avg"> AVG </option>
805 <option value="count"> COUNT </option>
806 </select>
807 </td></tr>
808 <tr>
809 <tr>
810 <td width="58" class="nowrap"><?php echo __('Operator'); ?></td>
811 <td width="102"><select name="hrel_opt" id="hrel_opt">
812 <option value="--" selected="selected"> -- </option>
813 <option value="="> = </option>
814 <option value="&gt;"> &gt; </option>
815 <option value="&lt;"> &lt; </option>
816 <option value="&gt;="> &gt;= </option>
817 <option value="&lt;="> &lt;= </option>
818 <option value="NOT"> NOT </option>
819 <option value="IN"> IN </option>
820 <option value="EXCEPT"> <?php echo __('Except'); ?> </option>
821 <option value="NOT IN"> NOT IN </option>
822 </select>
823 </td>
824 </tr>
825 <tr>
826 <td class="nowrap"><?php echo __('Value'); ?>/<br /><?php echo __('subquery'); ?></td>
827 <td><textarea id="hQuery" value="" cols="18"></textarea>
828 </td>
829 </tr>
830 </tbody>
831 <tbody>
832 <tr>
833 <td colspan="2" class="center nowrap">
834 <input type="button" class="butt" name="Button"
835 value="<?php echo __('OK'); ?>" onclick="edit('Having')" />
836 <input type="button" class="butt" name="Button"
837 value="<?php echo __('Cancel'); ?>"
838 onclick="document.getElementById('query_having').style.display = 'none';" />
839 </td>
840 </tr>
841 </tbody>
842 </table>
843 </td>
844 <td class="frams6"></td>
845 </tr>
846 <tr>
847 <td class="frams4"><div class="bor"></div></td>
848 <td class="frams7"></td>
849 <td class="frams3"></td>
850 </tr>
851 </tbody>
852 </table>
854 <table id="query_Aggregate" style="display:none;"
855 width="5%" cellpadding="0" cellspacing="0">
856 <tbody>
857 <tr>
858 <td class="frams1" width="10px"></td>
859 <td class="frams5" width="99%" ></td>
860 <td class="frams2" width="10px"><div class="bor"></div></td>
861 </tr>
862 <tr>
863 <td class="frams8"></td>
864 <td class="input_tab">
865 <table width="168" class="center" cellpadding="2" cellspacing="0">
866 <thead>
867 <tr>
868 <td colspan="2" class="center nowrap">
869 <strong><?php echo __('Aggregate'); ?></strong>
870 </td>
871 </tr>
872 </thead>
873 <tbody>
874 <tr>
875 <td width="58" class="nowrap"><?php echo __('Operator'); ?></td>
876 <td width="102">
877 <select name="operator" id="e_operator">
878 <option value="---" selected="selected">---</option>
879 <option value="sum" > SUM </option>
880 <option value="min"> MIN </option>
881 <option value="max"> MAX </option>
882 <option value="avg"> AVG </option>
883 <option value="avg"> COUNT </option>
884 </select>
885 </td></tr>
886 </tbody>
887 <tbody>
888 <tr>
889 <td colspan="2" class="center nowrap">
890 <input type="button" class="butt" name="Button"
891 value="<?php echo __('OK'); ?>" onclick="edit('Aggregate')" />
892 <input type="button" class="butt" name="Button"
893 value="<?php echo __('Cancel'); ?>"
894 onclick="document.getElementById('query_Aggregate').style.display = 'none';" />
895 </td>
896 </tr>
897 </tbody>
898 </table>
899 </td>
900 <td class="frams6"></td>
901 </tr>
902 <tr>
903 <td class="frams4"><div class="bor"></div></td>
904 <td class="frams7"></td>
905 <td class="frams3"></td>
906 </tr>
907 </tbody>
908 </table>
910 <table id="query_where" style="display:none;"
911 width="5%" cellpadding="0" cellspacing="0">
912 <tbody>
913 <tr>
914 <td class="frams1" width="10px"></td>
915 <td class="frams5" width="99%" ></td>
916 <td class="frams2" width="10px"><div class="bor"></div></td>
917 </tr>
918 <tr>
919 <td class="frams8"></td>
920 <td class="input_tab">
921 <table width="168" class="center" cellpadding="2" cellspacing="0">
922 <thead>
923 <tr>
924 <td colspan="2" class="center nowrap"><strong>WHERE</strong></td>
925 </tr>
926 </thead>
927 <tbody id="rename_to">
928 <tr>
929 <td width="58" class="nowrap"><?php echo __('Operator'); ?></td>
930 <td width="102"><select name="erel_opt" id="erel_opt">
931 <option value="--" selected="selected"> -- </option>
932 <option value="=" > = </option>
933 <option value="&gt;"> &gt; </option>
934 <option value="&lt;"> &lt; </option>
935 <option value="&gt;="> &gt;= </option>
936 <option value="&lt;="> &lt;= </option>
937 <option value="NOT"> NOT </option>
938 <option value="IN"> IN </option>
939 <option value="EXCEPT"> <?php echo __('Except'); ?> </option>
940 <option value="NOT IN"> NOT IN </option>
941 </select>
942 </td>
943 </tr>
944 <tr>
945 <td class="nowrap"><?php echo __('Value'); ?>/<br /><?php echo __('subquery'); ?></td>
946 <td><textarea id="eQuery" value="" cols="18"></textarea>
947 </td>
948 </tr>
949 </tbody>
950 <tbody>
951 <tr>
952 <td colspan="2" class="center nowrap">
953 <input type="button" class="butt" name="Button"
954 value="<?php echo __('OK'); ?>" onclick="edit('Where')" />
955 <input type="button" class="butt" name="Button"
956 value="<?php echo __('Cancel'); ?>"
957 onclick="document.getElementById('query_where').style.display = 'none';" />
958 </td>
959 </tr>
960 </tbody>
961 </table>
962 </td>
963 <td class="frams6"></td>
964 </tr>
965 <tr>
966 <td class="frams4"><div class="bor"></div></td>
967 <td class="frams7"></td>
968 <td class="frams3"></td>
969 </tr>
970 </tbody>
971 </table>
973 <?php
974 if (! empty($_REQUEST['query'])) {
975 echo '<div class="panel">';
976 echo '<div style="clear:both;"></div>';
977 echo '<div id="ab"></div>';
978 echo '<div style="clear:both;"></div>';
979 echo '</div>';
980 echo '<a class="trigger" href="#">' . __('Active options') . '</a>';
981 echo '<div id="filter"></div>';
982 echo '<div id="box">';
983 echo '<span id="boxtitle"></span>';
984 echo '<form method="post" action="db_qbe.php">';
985 echo '<textarea cols="80" name="sql_query" id="textSqlquery"'
986 . ' rows="15"></textarea><div id="tblfooter">';
987 echo ' <input type="submit" name="submit_sql" class="btn" />';
988 echo ' <input type="button" name="cancel" value="'
989 . __('Cancel') . '" onclick="closebox()" class="btn" />';
990 echo PMA_URL_getHiddenInputs($_GET['db']);
991 echo '</div></p>';
992 echo '</form></div>';
994 } ?>
997 <!-- cache images -->
998 <?php
999 echo '<img src="'
1000 . $_SESSION['PMA_Theme']->getImgPath('pmd/2leftarrow_m.png')
1001 . '" width="0" height="0" alt="" />'
1002 . '<img src="'
1003 . $_SESSION['PMA_Theme']->getImgPath('pmd/rightarrow1.png')
1004 . '" width="0" height="0" alt="" />'
1005 . '<img src="'
1006 . $_SESSION['PMA_Theme']->getImgPath('pmd/rightarrow2.png')
1007 . '" width="0" height="0" alt="" />'
1008 . '<img src="'
1009 . $_SESSION['PMA_Theme']->getImgPath('pmd/uparrow2_m.png')
1010 . '" width="0" height="0" alt="" />'
1011 . '<div id="PMA_disable_floating_menubar"></div>';