2 /* vim: set expandtab sw=4 ts=4 sts=4: */
4 * phpMyAdmin designer general code
6 * @package PhpMyAdmin-Designer
12 require_once 'libraries/common.inc.php';
13 require_once 'libraries/pmd_common.php';
15 $script_display_field = get_tables_info();
16 $tab_column = get_columns_info();
17 $script_tables = get_script_tabs();
18 $script_contr = get_script_contr();
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']);
48 echo '<div id="script_db" class="hide">';
49 echo htmlspecialchars($_GET['db']);
51 echo '<div id="script_token" class="hide">';
52 echo htmlspecialchars($_GET['token']);
54 echo '<div id="script_tables" class="hide">';
55 echo htmlspecialchars(json_encode($script_tables));
57 echo '<div id="script_contr" class="hide">';
58 echo htmlspecialchars(json_encode($script_contr));
60 echo '<div id="script_display_field" class="hide">';
61 echo htmlspecialchars(json_encode($script_display_field));
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' title
="<?php echo __('Show/Hide left menu'); ?>" alt
="v"
69 src
="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/downarrow2_m.png'); ?>" />
71 <a href
="#" id
="enterFullscreen" onclick
="Enter_fullscreen(); return false" class="M_butt" target
="_self">
72 <img title
="<?php echo __('View in fullscreen') ?>" alt
=""
73 src
="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/viewInFullscreen.png'); ?>" />
75 <a href
="#" id
="exitFullscreen" onclick
="Exit_fullscreen(); return false" class="M_butt hide" target
="_self">
76 <img title
="<?php echo __('Exit fullscreen') ?>" alt
=""
77 src
="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/exitFullscreen.png'); ?>" />
79 <img
class="M_bord" src
="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/bord.png'); ?>" alt
="" />
80 <a href
="#" onclick
="Save2(); return false" class="M_butt" target
="_self">
81 <img title
="<?php echo __('Save position') ?>" alt
=""
82 src
="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/save.png'); ?>" />
84 <a href
="#" onclick
="Start_table_new(); return false"
85 class="M_butt" target
="_self">
86 <img title
="<?php echo __('Create table')?>" alt
=""
87 src
="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/table.png'); ?>" />
89 <a href
="#" onclick
="Start_relation(); return false" class="M_butt" id
="rel_button" target
="_self">
90 <img title
="<?php echo __('Create relation') ?>" alt
=""
91 src
="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/relation.png'); ?>" />
93 <a href
="#" onclick
="Start_display_field(); return false"
94 class="M_butt" id
="display_field_button" target
="_self">
95 <img title
="<?php echo __('Choose column to display') ?>" alt
=""
96 src
="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/display_field.png'); ?>" />
98 <a href
="#" onclick
="location.reload(); return false" class="M_butt" target
="_self">
99 <img title
="<?php echo __('Reload'); ?>" alt
=""
100 src
="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/reload.png'); ?>" />
102 <a href
="<?php echo PMA_Util::getDocuLink('faq', 'faq6-31') ?>" target
="documentation" class="M_butt" target
="_self">
103 <img title
="<?php echo __('Help'); ?>" alt
=""
104 src
="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/help.png'); ?>" />
106 <img
class="M_bord" src
="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/bord.png'); ?>" alt
="" />
107 <a href
="#" onclick
="Angular_direct(); return false"
108 class="M_butt" id
="angular_direct_button" target
="_self">
109 <img title
="<?php echo __('Angular links') . ' / ' . __('Direct links'); ?>" alt
=""
110 src
="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/ang_direct.png'); ?>" />
112 <a href
="#" onclick
="Grid(); return false" class="M_butt" id
="grid_button" target
="_self">
113 <img title
="<?php echo __('Snap to grid') ?>"
114 src
="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/grid.png'); ?>" alt
="" />
116 <img
class="M_bord" src
="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/bord.png'); ?>" alt
="" />
117 <a href
="#" onclick
="Small_tab_all(document.getElementById('key_SB_all')); return false"
118 class="M_butt" target
="_self">
119 <img id
='key_SB_all' title
="<?php echo __('Small/Big All'); ?>" alt
="v"
120 src
="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/downarrow1.png'); ?>" />
122 <a href
="#" onclick
="Small_tab_invert(); return false" class="M_butt" target
="_self" >
123 <img title
="<?php echo __('Toggle small/big'); ?>" alt
="key"
124 src
="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/bottom.png'); ?>" />
126 <a href
="#" onclick
="Relation_lines_invert(); return false" class="M_butt" target
="_self" >
127 <img title
="<?php echo __('Toggle relation lines'); ?>" alt
="key"
128 src
="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/toggle_lines.png'); ?>" />
130 <img
class="M_bord" src
="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/bord.png'); ?>" alt
="" />
131 <a href
="#" onclick
="PDF_save(); return false" class="M_butt ajax">
132 <img src
="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/pdf.png'); ?>" alt
="key"
133 width
="20" height
="20" title
="<?php echo __('Import/Export coordinates for PDF schema'); ?>" />
136 if (isset($_REQUEST['query'])) {
137 echo '<a href="#" onclick="build_query(\'SQL Query on Database\', 0)" onmousedown="return false;"
138 class="M_butt" target="_self">';
139 echo '<img src="'. $_SESSION['PMA_Theme']->getImgPath('pmd/query_builder.png') . '" alt="key" width="20" height="20" title="';
140 echo __('Build Query');
144 <a href
="#" onclick
="Top_menu_right(document.getElementById('key_Left_Right')); return false"
145 class="M_butt last" target
="_self">
146 <img src
="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/2rightarrow_m.png'); ?>"
147 id
="key_Left_Right" alt
=">" title
="<?php echo __('Move Menu'); ?>" />
151 <div id
="canvas_outer">
152 <form action
="" method
="post" name
="form1">
154 <canvas
class="pmd" id
="canvas" width
="100" height
="100" onclick
="Canvas_click(this)"></canvas
>
156 <div id
="layer_menu" style
="display:none;">
157 <div
class="center" style
="padding-top:5px;">
159 onclick
="Hide_tab_all(document.getElementById('key_HS_all')); return false" class="M_butt" target
="_self">
160 <img title
="<?php echo __('Hide/Show all'); ?>" alt
="v"
161 src
="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/downarrow1.png'); ?>" id
='key_HS_all' /></a
>
163 onclick
="No_have_constr(document.getElementById('key_HS')); return false" class="M_butt" target
="_self">
164 <img title
="<?php echo __('Hide/Show Tables with no relation'); ?>" alt
="v"
165 src
="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/downarrow2.png'); ?>" id
='key_HS' /></a
>
168 <div id
="id_scroll_tab" class="scroll_tab">
169 <table width
="100%" style
="padding-left: 3px;">
171 $name_cnt = count($GLOBALS['PMD']['TABLE_NAME']);
172 for ($i = 0; $i < $name_cnt; $i++
) {
174 echo '<tr><td title="' . __('Structure') . '" width="1px" '
175 . 'onmouseover="this.className=\'L_butt2_2\'" '
176 . 'onmouseout="this.className=\'L_butt2_1\'" class="L_butt2_1">';
178 . 'onclick="Start_tab_upd(\'' . $GLOBALS['PMD_URL']["TABLE_NAME_SMALL"][$i] . '\');" '
179 . 'src="' . $_SESSION['PMA_Theme']->getImgPath('pmd/exec.png') . '" alt="" />';
181 echo '<td width="1px">';
182 echo '<input onclick="VisibleTab(this,\'' . $GLOBALS['PMD_URL']["TABLE_NAME"][$i] . '\')" '
183 . 'title="' . __('Hide') . '" '
184 . 'id="check_vis_' . $GLOBALS['PMD_URL']["TABLE_NAME"][$i] . '" '
185 . 'style="margin:0px;" type="checkbox" '
186 . 'value="' . $GLOBALS['PMD_URL']["TABLE_NAME"][$i] . '"';
187 if (isset($tab_pos[$GLOBALS['PMD']["TABLE_NAME"][$i]])) {
188 echo $tab_pos[$GLOBALS['PMD']["TABLE_NAME"][$i]]["H"] ?
'checked="checked"' : '';
190 echo 'checked="checked"';
193 echo '<td class="pmd_Tabs" onmouseover="this.className=\'pmd_Tabs2\'" '
194 . 'onmouseout="this.className=\'pmd_Tabs\'" '
195 . 'onclick="Select_tab(\'' . $GLOBALS['PMD_URL']["TABLE_NAME"][$i] . '\');">';
196 echo $GLOBALS['PMD_OUT']["TABLE_NAME"][$i];
203 echo '<div class="center">';
204 echo __('Number of tables:') . ' ' . $name_cnt;
206 echo '<div class="floatright">';
207 echo '<div id="layer_menu_sizer" onmousedown="layer_menu_cur_click=1">';
212 for ($i = 0; $i < count($GLOBALS['PMD']["TABLE_NAME"]); $i++
) {
213 $t_n = $GLOBALS['PMD']["TABLE_NAME"][$i];
214 $t_n_url = $GLOBALS['PMD_URL']["TABLE_NAME"][$i];
217 <input name
="t_x[<?php echo $t_n_url ?>]" type
="hidden" id
="t_x_<?php echo $t_n_url ?>_" />
218 <input name
="t_y[<?php echo $t_n_url ?>]" type
="hidden" id
="t_y_<?php echo $t_n_url ?>_" />
219 <input name
="t_v[<?php echo $t_n_url ?>]" type
="hidden" id
="t_v_<?php echo $t_n_url ?>_" />
220 <input name
="t_h[<?php echo $t_n_url ?>]" type
="hidden" id
="t_h_<?php echo $t_n_url ?>_" />
222 <table id
="<?php echo $t_n_url ?>" cellpadding
="0" cellspacing
="0" class="pmd_tab"
223 style
="position: absolute;
225 echo isset($tab_pos[$t_n]) ? $tab_pos[$t_n]["X
"] : rand(20, 700); ?>px;
227 echo isset($tab_pos[$t_n]) ? $tab_pos[$t_n]["Y
"] : rand(20, 550); ?>px;
229 echo ! isset($tab_pos[$t_n]) || $tab_pos[$t_n]["H
"]
236 if (isset($_REQUEST['query'])) {
237 echo '<td class="select_all">';
238 echo '<input type="checkbox" value="select_all_'.htmlspecialchars($t_n_url).'" style="margin: 0px;" ';
239 echo 'id="select_all_'.htmlspecialchars($t_n_url).'" title="select all" ';
240 echo 'onclick="Select_all(\''. htmlspecialchars($t_n_url) .'\',\''.htmlspecialchars($GLOBALS['PMD_OUT']["OWNER"][$i]).'\')"></td>';
243 <td
class="small_tab" onmouseover
="this.className='small_tab2';"
244 onmouseout
="this.className='small_tab';"
245 id
="id_hide_tbody_<?php echo $t_n_url ?>"
246 onclick
="Small_tab('<?php echo $t_n_url ?>', 1)"><?php
247 // no space alloawd here, between tags and content !!!
248 // JavaScript function does require this
249 if (! isset($tab_pos[$t_n]) ||
! empty($tab_pos[$t_n]["V"])) {
255 <td
class="small_tab_pref" onmouseover
="this.className='small_tab_pref2';"
256 onmouseout
="this.className='small_tab_pref';"
257 onclick
="Start_tab_upd('<?php echo $GLOBALS['PMD_URL']["TABLE_NAME_SMALL
"][$i]; ?>');">
258 <img src
="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/exec_small.png'); ?>" alt
="" /></td
>
259 <td id
="id_zag_<?php echo $t_n_url ?>" class="tab_zag nowrap"
260 onmousedown
="cur_click=document.getElementById('<?php echo $t_n_url ?>');"/
261 onmouseover
="Table_onover('<?php echo $t_n_url ?>',0,<?php echo (isset($_REQUEST['query'])? 1 : 0 )?> )"
262 onmouseout
="Table_onover('<?php echo $t_n_url ?>',1,<?php echo (isset($_REQUEST['query']) ? 1 : 0 )?>)">
265 echo $GLOBALS['PMD_OUT']["OWNER"][$i];
267 echo $GLOBALS['PMD_OUT']["TABLE_NAME_SMALL"][$i];
270 if (isset($_REQUEST['query'])) {
271 echo '<td class="tab_zag" onmouseover="Table_onover(\''.htmlspecialchars($t_n_url).'\',0,1)" id="id_zag_'.htmlspecialchars($t_n_url).'_2"';
272 echo 'onmousedown="cur_click=document.getElementById(\''.htmlspecialchars($t_n_url).'\');"';
273 echo 'onmouseout="Table_onover(\''.htmlspecialchars($t_n_url).'\',1,1)">';
278 <tbody id
="id_tbody_<?php echo $t_n_url ?>"
280 if (isset($tab_pos[$t_n]) && empty($tab_pos[$t_n]["V"])) {
281 echo 'style="display: none;"';
284 $display_field = PMA_getDisplayField($_GET['db'], $GLOBALS['PMD']["TABLE_NAME_SMALL"][$i]);
285 for ($j = 0, $id_cnt = count($tab_column[$t_n]["COLUMN_ID"]); $j < $id_cnt; $j++
) {
288 echo $GLOBALS['PMD_URL']["TABLE_NAME_SMALL
"][$i] . '.'
289 . urlencode($tab_column[$t_n]["COLUMN_NAME
"][$j]) ?>"
291 if ($display_field == $tab_column[$t_n]["COLUMN_NAME"][$j]) {
292 echo ' class="tab_field_3" ';
294 echo ' class="tab_field" ';
297 onmouseover
="old_class = this.className; this.className = 'tab_field_2';"
298 onmouseout
="this.className = old_class;"
299 onmousedown
="Click_field('<?php
300 echo $GLOBALS['PMD_URL']["TABLE_NAME_SMALL
"][$i]."','".urlencode($tab_column[$t_n]["COLUMN_NAME
"][$j])."',";
301 if (!PMA_Util::isForeignKeySupported($GLOBALS['PMD
']['TABLE_TYPE
'][$i])) {
302 echo (isset($tables_pk_or_unique_keys[$t_n . "." . $tab_column[$t_n]["COLUMN_NAME"][$j]]) ? 1 : 0);
304 // if foreign keys are supported, it's not necessary that the
305 // index is a primary key
306 echo (isset($tables_all_keys[$t_n.".".$tab_column[$t_n]["COLUMN_NAME"][$j]]) ?
1 : 0);
310 if (isset($_REQUEST['query'])) {
311 echo '<td class="select_all
">';
312 echo '<input value="'.htmlspecialchars($t_n_url).urlencode($tab_column[$t_n]["COLUMN_NAME"][$j]).'"';
313 echo 'type="checkbox
" id="select_
'.htmlspecialchars($t_n_url).'._
'.urlencode($tab_column[$t_n]["COLUMN_NAME"][$j]).'" ';
314 echo 'style="margin
: 0px
;" title="select_
'.urlencode($tab_column[$t_n]["COLUMN_NAME"][$j]).'" ';
315 echo 'onclick="store_column(\''.urlencode($GLOBALS['PMD_OUT
']["TABLE_NAME_SMALL"][$i]).'\'
,\''.htmlspecialchars($GLOBALS['PMD_OUT
']["OWNER"][$i]).'\'
,\''.urlencode($tab_column[$t_n]["COLUMN_NAME"][$j]).'\'
)"></td>';
317 <td width="10px
" colspan="3"
318 id="<?php
echo $t_n_url.".".urlencode($tab_column[$t_n]["COLUMN_NAME"][$j]) ?
>">
321 if (isset($tables_pk_or_unique_keys[$t_n.".".$tab_column[$t_n]["COLUMN_NAME
"][$j]])) {
323 <img src="<?php
echo $_SESSION['PMA_Theme']->getImgPath(); ?
>pmd
/FieldKey_small
.png
"
328 <img src="<?php
echo $_SESSION['PMA_Theme']->getImgPath(); ?
>pmd
/Field_small
<?php
329 if (strstr($tab_column[$t_n]["TYPE"][$j], 'char')
330 ||
strstr($tab_column[$t_n]["TYPE"][$j], 'text')
333 } elseif (strstr($tab_column[$t_n]["TYPE"][$j], 'int')
334 ||
strstr($tab_column[$t_n]["TYPE"][$j], 'float')
335 ||
strstr($tab_column[$t_n]["TYPE"][$j], 'double')
336 ||
strstr($tab_column[$t_n]["TYPE"][$j], 'decimal')
339 } elseif (strstr($tab_column[$t_n]["TYPE"][$j], 'date')
340 ||
strstr($tab_column[$t_n]["TYPE"][$j], 'time')
341 ||
strstr($tab_column[$t_n]["TYPE"][$j], 'year')
348 echo htmlspecialchars(
349 $tab_column[$t_n]["COLUMN_NAME
"][$j] . " : " . $tab_column[$t_n]["TYPE
"][$j],
352 echo "</div
>\n</td
>\n";
353 if (isset($_REQUEST['query'])) {
354 //$temp = $GLOBALS['PMD_OUT']["OWNER
"][$i].'.'.$GLOBALS['PMD_OUT']["TABLE_NAME_SMALL
"][$i];
355 echo '<td class="small_tab_pref
" onmouseover="this
.className
=\'small_tab_pref2\'
;"';
356 echo 'onmouseout="this
.className
=\'small_tab_pref\'
;"';
357 echo 'onclick="Click_option(\'pmd_optionse\'
,\''
358 . urlencode($tab_column[$t_n]["COLUMN_NAME"][$j]) . '\'
,\''
359 . $GLOBALS['PMD_OUT
']["TABLE_NAME_SMALL"][$i].'\'
)" >';
361 . $_SESSION['PMA_Theme
']->getImgPath('pmd
/exec_small
.png
')
362 . '" title="options
" alt="" /></td> ';
366 echo "</tbody
>\n</table
>\n";
371 <div id="pmd_hint
"></div>
373 <table id="layer_new_relation
" style="display
:none
;"
374 width="5%
" cellpadding="0" cellspacing="0">
377 <td class="frams1
" width="10px
"></td>
378 <td class="frams5
" width="99%
" ></td>
379 <td class="frams2
" width="10px
"><div class="bor
"></div></td>
382 <td class="frams8
"></td>
383 <td class="input_tab
">
384 <table width="168" class="center
" cellpadding="2" cellspacing="0">
387 <td colspan="2" class="center nowrap
"><strong><?php echo __('Create relation'); ?></strong></td>
390 <tbody id="foreign_relation
">
392 <td colspan="2" class="center nowrap
"><strong>FOREIGN KEY</strong></td>
395 <td width="58" class="nowrap
">on delete</td>
396 <td width="102"><select name="on_delete
" id="on_delete
">
397 <option value="nix
" selected="selected
">--</option>
398 <option value="CASCADE
">CASCADE</option>
399 <option value="SET
NULL">SET NULL</option>
400 <option value="NO ACTION
">NO ACTION</option>
401 <option value="RESTRICT
">RESTRICT</option>
406 <td class="nowrap
">on update</td>
407 <td><select name="on_update
" id="on_update
">
408 <option value="nix
" selected="selected
">--</option>
409 <option value="CASCADE
">CASCADE</option>
410 <option value="SET
NULL">SET NULL</option>
411 <option value="NO ACTION
">NO ACTION</option>
412 <option value="RESTRICT
">RESTRICT</option>
419 <td colspan="2" class="center nowrap
">
420 <input type="button
" class="butt
" name="Button
"
421 value="<?php
echo __('OK'); ?
>" onclick="New_relation()" />
422 <input type="button
" class="butt
" name="Button
"
423 value="<?php
echo __('Cancel'); ?
>"
424 onclick="document
.getElementById('layer_new_relation').style
.display
= 'none';" />
430 <td class="frams6
"></td>
433 <td class="frams4
"><div class="bor
"></div></td>
434 <td class="frams7
"></td>
435 <td class="frams3
"></td>
440 <table id="layer_upd_relation
" style="display
:none
;"
441 width="5%
" cellpadding="0" cellspacing="0">
444 <td class="frams1
" width="10px
"></td>
445 <td class="frams5
" width="99%
"></td>
446 <td class="frams2
" width="10px
"><div class="bor
"></div></td>
449 <td class="frams8
"></td>
450 <td class="input_tab
">
451 <table width="100%
" class="center
" cellpadding="2" cellspacing="0">
453 <td colspan="3" class="center nowrap
"><strong><?php echo __('Delete relation'); ?></strong></td>
456 <td colspan="3" class="center nowrap
">
457 <input name="Button
" type="button
" class="butt
"
458 onclick="Upd_relation()" value="<?php
echo __('Delete'); ?
>" />
459 <input type="button
" class="butt
" name="Button
"
460 value="<?php
echo __('Cancel'); ?
>"
461 onclick="document
.getElementById('layer_upd_relation').style
.display
= 'none'; Re_load();" />
465 <td class="frams6
"></td>
468 <td class="frams4
"><div class="bor
"></div></td>
469 <td class="frams7
"></td>
470 <td class="frams3
"></td>
475 <table id="pmd_optionse
" style="display
:none
;"
476 width="5%
" cellpadding="0" cellspacing="0">
479 <td class="frams1
" width="10px
"></td>
480 <td class="frams5
" width="99%
" ></td>
481 <td class="frams2
" width="10px
"><div class="bor
"></div></td>
484 <td class="frams8
"></td>
485 <td class="input_tab
">
486 <table width="168" class="center
" cellpadding="2" cellspacing="0">
489 <td colspan="2" rowspan="2" id="option_col_name
" class="center nowrap
"></td>
493 <tr><td class="center nowrap
"><b>WHERE</b></td></tr>
495 <td width="58" class="nowrap
"><?php echo __('Relation operator'); ?></td>
496 <td width="102"><select name="rel_opt
" id="rel_opt
">
497 <option value="--" selected="selected
"> -- </option>
498 <option value="="> = </option>
499 <option value=">
;"> > </option>
500 <option value="<
;"> < </option>
501 <option value=">
;="> >= </option>
502 <option value="<
;="> <= </option>
503 <option value="NOT
"> NOT </option>
504 <option value="IN
"> IN </option>
505 <option value="EXCEPT
"> <?php echo __('Except'); ?> </option>
506 <option value="NOT IN
"> NOT IN </option>
511 <td class="nowrap
"><?php echo __('Value'); ?>/<br /><?php echo __('subquery'); ?></td>
512 <td><textarea id="Query
" value="" cols="18"></textarea>
515 <tr><td class="center nowrap
"><b><?php echo __('Rename to'); ?></b></td></tr>
517 <td width="58" class="nowrap
"><?php echo __('New name'); ?></td>
518 <td width="102"><input type="text
" value="" id="new_name
"/></td>
520 <tr><td class="center nowrap
"><b><?php echo __('Aggregate'); ?></b></td></tr>
522 <td width="58" class="nowrap
"><?php echo __('Operator'); ?></td>
523 <td width="102"><select name="operator
" id="operator
">
524 <option value="---" selected="selected
">---</option>
525 <option value="sum
" > SUM </option>
526 <option value="min
"> MIN </option>
527 <option value="max
"> MAX </option>
528 <option value="avg
"> AVG </option>
529 <option value="count
"> COUNT </option>
533 <td width="58" class="center nowrap
"><b>GROUP BY</b></td>
534 <td><input type="checkbox
" value="groupby
" id="groupby
"/></td>
537 <td width="58" class="center nowrap
"><b>ORDER BY</b></td>
538 <td><input type="checkbox
" value="orderby
" id="orderby
"/></td>
540 <tr><td class="center nowrap
"><b>HAVING</b></td></tr>
542 <td width="58" class="nowrap
"><?php echo __('Operator'); ?></td>
543 <td width="102"><select name="h_operator
" id="h_operator
">
544 <option value="---" selected="selected
">---</option>
545 <option value="None
" > <?php echo __('None'); ?> </option>
546 <option value="sum
" > SUM </option>
547 <option value="min
"> MIN </option>
548 <option value="max
"> MAX </option>
549 <option value="avg
"> AVG </option>
550 <option value="count
"> COUNT </option>
554 <td width="58" class="nowrap
"><?php echo __('Relation operator'); ?></td>
555 <td width="102"><select name="h_rel_opt
" id="h_rel_opt
">
556 <option value="--" selected="selected
"> -- </option>
557 <option value="="> = </option>
558 <option value=">
;"> > </option>
559 <option value="<
;"> < </option>
560 <option value=">
;="> >= </option>
561 <option value="<
;="> <= </option>
562 <option value="NOT
"> NOT </option>
563 <option value="IN
"> IN </option>
564 <option value="EXCEPT
"> <?php echo __('Except'); ?> </option>
565 <option value="NOT IN
"> NOT IN </option>
570 <td width="58" class="nowrap
"><?php echo __('Value'); ?>/<br/><?php echo __('subquery'); ?></td>
571 <td width="102"><textarea id="having
" value="" cols="18"></textarea></td>
576 <td colspan="2" class="center nowrap
">
577 <input type="button
" class="butt
" name="Button
"
578 value="<?php
echo __('OK'); ?
>" onclick="add_object()" />
579 <input type="button
" class="butt
" name="Button
"
580 value="<?php
echo __('Cancel'); ?
>"
581 onclick="Close_option()" />
587 <td class="frams6
"></td>
590 <td class="frams4
"><div class="bor
"></div></td>
591 <td class="frams7
"></td>
592 <td class="frams3
"></td>
597 <table id="query_rename_to
" style="display
:none
;"
598 width="5%
" cellpadding="0" cellspacing="0">
601 <td class="frams1
" width="10px
"></td>
602 <td class="frams5
" width="99%
" ></td>
603 <td class="frams2
" width="10px
"><div class="bor
"></div></td>
606 <td class="frams8
"></td>
607 <td class="input_tab
">
608 <table width="168" class="center
" cellpadding="2" cellspacing="0">
611 <td colspan="2" class="center nowrap
"><strong><?php echo __('Rename to'); ?></strong></td>
614 <tbody id="rename_to
">
616 <td width="58" class="nowrap
"><?php echo __('New name'); ?></td>
618 <input type="text
" value="" id="e_rename
"/>
624 <td colspan="2" class="center nowrap
">
625 <input type="button
" class="butt
" name="Button
"
626 value="<?php
echo __('OK'); ?
>" onclick="edit('Rename')" />
627 <input type="button
" class="butt
" name="Button
"
628 value="<?php
echo __('Cancel'); ?
>"
629 onclick="document
.getElementById('query_rename_to').style
.display
= 'none';" />
635 <td class="frams6
"></td>
638 <td class="frams4
"><div class="bor
"></div></td>
639 <td class="frams7
"></td>
640 <td class="frams3
"></td>
645 <table id="query_having
" style="display
:none
;"
646 width="5%
" cellpadding="0" cellspacing="0">
649 <td class="frams1
" width="10px
"></td>
650 <td class="frams5
" width="99%
" ></td>
651 <td class="frams2
" width="10px
"><div class="bor
"></div></td>
654 <td class="frams8
"></td>
655 <td class="input_tab
">
656 <table width="168" class="center
" cellpadding="2" cellspacing="0">
659 <td colspan="2" class="center nowrap
"><strong>HAVING</strong></td>
662 <tbody id="rename_to
">
664 <td width="58" class="nowrap
"><?php echo __('Operator'); ?></td>
665 <td width="102"><select name="hoperator
" id="hoperator
">
666 <option value="---" selected="selected
">---</option>
667 <option value="None
" > None </option>
668 <option value="sum
" > SUM </option>
669 <option value="min
"> MIN </option>
670 <option value="max
"> MAX </option>
671 <option value="avg
"> AVG </option>
672 <option value="count
"> COUNT </option>
677 <td width="58" class="nowrap
"><?php echo __('Operator'); ?></td>
678 <td width="102"><select name="hrel_opt
" id="hrel_opt
">
679 <option value="--" selected="selected
"> -- </option>
680 <option value="="> = </option>
681 <option value=">
;"> > </option>
682 <option value="<
;"> < </option>
683 <option value=">
;="> >= </option>
684 <option value="<
;="> <= </option>
685 <option value="NOT
"> NOT </option>
686 <option value="IN
"> IN </option>
687 <option value="EXCEPT
"> <?php echo __('Except'); ?> </option>
688 <option value="NOT IN
"> NOT IN </option>
693 <td class="nowrap
"><?php echo __('Value'); ?>/<br /><?php echo __('subquery'); ?></td>
694 <td><textarea id="hQuery
" value="" cols="18"></textarea>
700 <td colspan="2" class="center nowrap
">
701 <input type="button
" class="butt
" name="Button
"
702 value="<?php
echo __('OK'); ?
>" onclick="edit('Having')" />
703 <input type="button
" class="butt
" name="Button
"
704 value="<?php
echo __('Cancel'); ?
>"
705 onclick="document
.getElementById('query_having').style
.display
= 'none';" />
711 <td class="frams6
"></td>
714 <td class="frams4
"><div class="bor
"></div></td>
715 <td class="frams7
"></td>
716 <td class="frams3
"></td>
721 <table id="query_Aggregate
" style="display
:none
;"
722 width="5%
" cellpadding="0" cellspacing="0">
725 <td class="frams1
" width="10px
"></td>
726 <td class="frams5
" width="99%
" ></td>
727 <td class="frams2
" width="10px
"><div class="bor
"></div></td>
730 <td class="frams8
"></td>
731 <td class="input_tab
">
732 <table width="168" class="center
" cellpadding="2" cellspacing="0">
735 <td colspan="2" class="center nowrap
"><strong><?php echo __('Aggregate'); ?></strong></td>
740 <td width="58" class="nowrap
"><?php echo __('Operator'); ?></td>
742 <select name="operator
" id="e_operator
">
743 <option value="---" selected="selected
">---</option>
744 <option value="sum
" > SUM </option>
745 <option value="min
"> MIN </option>
746 <option value="max
"> MAX </option>
747 <option value="avg
"> AVG </option>
748 <option value="avg
"> COUNT </option>
754 <td colspan="2" class="center nowrap
">
755 <input type="button
" class="butt
" name="Button
"
756 value="<?php
echo __('OK'); ?
>" onclick="edit('Aggregate')" />
757 <input type="button
" class="butt
" name="Button
"
758 value="<?php
echo __('Cancel'); ?
>"
759 onclick="document
.getElementById('query_Aggregate').style
.display
= 'none';" />
765 <td class="frams6
"></td>
768 <td class="frams4
"><div class="bor
"></div></td>
769 <td class="frams7
"></td>
770 <td class="frams3
"></td>
775 <table id="query_where
" style="display
:none
;"
776 width="5%
" cellpadding="0" cellspacing="0">
779 <td class="frams1
" width="10px
"></td>
780 <td class="frams5
" width="99%
" ></td>
781 <td class="frams2
" width="10px
"><div class="bor
"></div></td>
784 <td class="frams8
"></td>
785 <td class="input_tab
">
786 <table width="168" class="center
" cellpadding="2" cellspacing="0">
789 <td colspan="2" class="center nowrap
"><strong>WHERE</strong></td>
792 <tbody id="rename_to
">
794 <td width="58" class="nowrap
"><?php echo __('Operator'); ?></td>
795 <td width="102"><select name="erel_opt
" id="erel_opt
">
796 <option value="--" selected="selected
"> -- </option>
797 <option value="=" > = </option>
798 <option value=">
;"> > </option>
799 <option value="<
;"> < </option>
800 <option value=">
;="> >= </option>
801 <option value="<
;="> <= </option>
802 <option value="NOT
"> NOT </option>
803 <option value="IN
"> IN </option>
804 <option value="EXCEPT
"> <?php echo __('Except'); ?> </option>
805 <option value="NOT IN
"> NOT IN </option>
810 <td class="nowrap
"><?php echo __('Value'); ?>/<br /><?php echo __('subquery'); ?></td>
811 <td><textarea id="eQuery
" value="" cols="18"></textarea>
817 <td colspan="2" class="center nowrap
">
818 <input type="button
" class="butt
" name="Button
"
819 value="<?php
echo __('OK'); ?
>" onclick="edit('Where')" />
820 <input type="button
" class="butt
" name="Button
"
821 value="<?php
echo __('Cancel'); ?
>"
822 onclick="document
.getElementById('query_where').style
.display
= 'none';" />
828 <td class="frams6
"></td>
831 <td class="frams4
"><div class="bor
"></div></td>
832 <td class="frams7
"></td>
833 <td class="frams3
"></td>
839 if (! empty($_REQUEST['query'])) {
840 echo '<div class="panel
">';
841 echo '<div style="clear
:both
;"></div>';
842 echo '<div id="ab
"></div>';
843 echo '<div style="clear
:both
;"></div>';
845 echo '<a class="trigger
" href="#">' . __('Active options') . '</a>';
846 echo '<div id="filter"></div>';
847 echo '<div id="box">';
848 echo '<span id="boxtitle"></span>';
849 echo '<form method="post" action="db_qbe.php">';
850 echo '<textarea cols="80" name="sql_query" id="textSqlquery"'
851 . ' rows="15"></textarea><div id="tblfooter">';
852 echo ' <input type="submit" name="submit_sql" class="btn" />';
853 echo ' <input type="button" name="cancel" value="'
854 . __('Cancel') . '" onclick="closebox()" class="btn" />';
855 echo PMA_URL_getHiddenInputs($_GET['db']);
857 echo '</form></div>';
862 <!-- cache images
-->
865 . $_SESSION['PMA_Theme']->getImgPath('pmd/2leftarrow_m.png')
866 . '" width="0" height="0" alt="" />'
868 . $_SESSION['PMA_Theme']->getImgPath('pmd/rightarrow1.png')
869 . '" width="0" height="0" alt="" />'
871 . $_SESSION['PMA_Theme']->getImgPath('pmd/rightarrow2.png')
872 . '" width="0" height="0" alt="" />'
874 . $_SESSION['PMA_Theme']->getImgPath('pmd/uparrow2_m.png')
875 . '" width="0" height="0" alt="" />'
876 . '<div id="PMA_disable_floating_menubar"></div>';