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