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';
16 * Sets globals from $_GET
23 foreach ($get_params as $one_get_param) {
24 if (isset($_GET[$one_get_param])) {
25 $GLOBALS[$one_get_param] = $_GET[$one_get_param];
29 $script_display_field = get_tables_info();
30 $tab_column = get_columns_info();
31 $script_tables = get_script_tabs();
32 $script_contr = get_script_contr();
33 $tab_pos = get_tab_pos();
34 $tables_pk_or_unique_keys = get_pk_or_unique_keys();
35 $tables_all_keys = get_all_keys();
37 $params = array('lang' => $GLOBALS['lang']);
38 if (isset($GLOBALS['db'])) {
39 $params['db'] = $GLOBALS['db'];
42 $response = PMA_Response
::getInstance();
43 $response->getFooter()->setMinimal();
44 $header = $response->getHeader();
45 $header->setBodyId('pmd_body');
46 $scripts = $header->getScripts();
47 $scripts->addFile('pmd/ajax.js');
48 $scripts->addFile('pmd/history.js');
49 $scripts->addFile('pmd/move.js');
50 $scripts->addFile('pmd/iecanvas.js', true);
51 $scripts->addFile('pmd/init.js');
52 $scripts->addFile('jquery/jquery.fullscreen.js');
54 require 'libraries/db_common.inc.php';
55 require 'libraries/db_info.inc.php';
57 // Embed some data into HTML, later it will be read
58 // by pmd/init.js and converted to JS variables.
59 echo '<div id="script_server" class="hide">';
60 echo htmlspecialchars($GLOBALS['server']);
62 echo '<div id="script_db" class="hide">';
63 echo htmlspecialchars($GLOBALS['db']);
65 echo '<div id="script_token" class="hide">';
66 echo htmlspecialchars($GLOBALS['token']);
68 echo '<div id="script_tables" class="hide">';
69 echo htmlspecialchars(json_encode($script_tables));
71 echo '<div id="script_contr" class="hide">';
72 echo htmlspecialchars(json_encode($script_contr));
74 echo '<div id="script_display_field" class="hide">';
75 echo htmlspecialchars(json_encode($script_display_field));
79 <div
class="pmd_header" id
="top_menu">
80 <a href
="#" onclick
="Show_left_menu(document.getElementById('key_Show_left_menu')); return false"
81 class="M_butt first" target
="_self">
82 <img id
='key_Show_left_menu' title
="<?php echo __('Show/Hide left menu'); ?>" alt
="v"
83 src
="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/downarrow2_m.png'); ?>" />
85 <a href
="#" id
="enterFullscreen" onclick
="Enter_fullscreen(); return false" class="M_butt" target
="_self">
86 <img title
="<?php echo __('View in fullscreen') ?>" alt
=""
87 src
="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/viewInFullscreen.png'); ?>" />
89 <a href
="#" id
="exitFullscreen" onclick
="Exit_fullscreen(); return false" class="M_butt hide" target
="_self">
90 <img title
="<?php echo __('Exit fullscreen') ?>" alt
=""
91 src
="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/exitFullscreen.png'); ?>" />
93 <img
class="M_bord" src
="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/bord.png'); ?>" alt
="" />
94 <a href
="#" onclick
="Save2(); return false" class="M_butt" target
="_self">
95 <img title
="<?php echo __('Save position') ?>" alt
=""
96 src
="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/save.png'); ?>" />
98 <a href
="#" onclick
="Start_table_new(); return false"
99 class="M_butt" target
="_self">
100 <img title
="<?php echo __('Create table')?>" alt
=""
101 src
="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/table.png'); ?>" />
103 <a href
="#" onclick
="Start_relation(); return false" class="M_butt" id
="rel_button" target
="_self">
104 <img title
="<?php echo __('Create relation') ?>" alt
=""
105 src
="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/relation.png'); ?>" />
107 <a href
="#" onclick
="Start_display_field(); return false"
108 class="M_butt" id
="display_field_button" target
="_self">
109 <img title
="<?php echo __('Choose column to display') ?>" alt
=""
110 src
="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/display_field.png'); ?>" />
112 <a href
="#" onclick
="location.reload(); return false" class="M_butt" target
="_self">
113 <img title
="<?php echo __('Reload'); ?>" alt
=""
114 src
="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/reload.png'); ?>" />
116 <a href
="<?php echo PMA_Util::getDocuLink('faq', 'faq6-31') ?>" target
="documentation" class="M_butt" target
="_self">
117 <img title
="<?php echo __('Help'); ?>" alt
=""
118 src
="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/help.png'); ?>" />
120 <img
class="M_bord" src
="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/bord.png'); ?>" alt
="" />
121 <a href
="#" onclick
="Angular_direct(); return false"
122 class="M_butt" id
="angular_direct_button" target
="_self">
123 <img title
="<?php echo __('Angular links') . ' / ' . __('Direct links'); ?>" alt
=""
124 src
="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/ang_direct.png'); ?>" />
126 <a href
="#" onclick
="Grid(); return false" class="M_butt" id
="grid_button" target
="_self">
127 <img title
="<?php echo __('Snap to grid') ?>"
128 src
="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/grid.png'); ?>" alt
="" />
130 <img
class="M_bord" src
="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/bord.png'); ?>" alt
="" />
131 <a href
="#" onclick
="Small_tab_all(document.getElementById('key_SB_all')); return false"
132 class="M_butt" target
="_self">
133 <img id
='key_SB_all' title
="<?php echo __('Small/Big All'); ?>" alt
="v"
134 src
="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/downarrow1.png'); ?>" />
136 <a href
="#" onclick
="Small_tab_invert(); return false" class="M_butt" target
="_self" >
137 <img title
="<?php echo __('Toggle small/big'); ?>" alt
="key"
138 src
="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/bottom.png'); ?>" />
140 <a href
="#" onclick
="Relation_lines_invert(); return false" class="M_butt" target
="_self" >
141 <img title
="<?php echo __('Toggle relation lines'); ?>" alt
="key"
142 src
="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/toggle_lines.png'); ?>" />
144 <img
class="M_bord" src
="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/bord.png'); ?>" alt
="" />
145 <a href
="#" onclick
="PDF_save(); return false" class="M_butt ajax">
146 <img src
="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/pdf.png'); ?>" alt
="key"
147 width
="20" height
="20" title
="<?php echo __('Import/Export coordinates for PDF schema'); ?>" />
150 if (isset($_REQUEST['query'])) {
151 echo '<a href="#" onclick="build_query(\'SQL Query on Database\', 0)" onmousedown="return false;"
152 class="M_butt" target="_self">';
153 echo '<img src="'. $_SESSION['PMA_Theme']->getImgPath('pmd/query_builder.png') . '" alt="key" width="20" height="20" title="';
154 echo __('Build Query');
158 <a href
="#" onclick
="Top_menu_right(document.getElementById('key_Left_Right')); return false"
159 class="M_butt last" target
="_self">
160 <img src
="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/2rightarrow_m.png'); ?>"
161 id
="key_Left_Right" alt
=">" title
="<?php echo __('Move Menu'); ?>" />
165 <div id
="canvas_outer">
166 <form action
="" method
="post" name
="form1">
168 <canvas
class="pmd" id
="canvas" width
="100" height
="100" onclick
="Canvas_click(this)"></canvas
>
170 <div id
="layer_menu" style
="display:none;">
171 <div
class="center" style
="padding-top:5px;">
173 onclick
="Hide_tab_all(document.getElementById('key_HS_all')); return false" class="M_butt" target
="_self">
174 <img title
="<?php echo __('Hide/Show all'); ?>" alt
="v"
175 src
="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/downarrow1.png'); ?>" id
='key_HS_all' /></a
>
177 onclick
="No_have_constr(document.getElementById('key_HS')); return false" class="M_butt" target
="_self">
178 <img title
="<?php echo __('Hide/Show Tables with no relation'); ?>" alt
="v"
179 src
="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/downarrow2.png'); ?>" id
='key_HS' /></a
>
182 <div id
="id_scroll_tab" class="scroll_tab">
183 <table width
="100%" style
="padding-left: 3px;">
185 $name_cnt = count($GLOBALS['PMD']['TABLE_NAME']);
186 for ($i = 0; $i < $name_cnt; $i++
) {
188 echo '<tr><td title="' . __('Structure') . '" width="1px" '
189 . 'onmouseover="this.className=\'L_butt2_2\'" '
190 . 'onmouseout="this.className=\'L_butt2_1\'" class="L_butt2_1">';
192 . 'onclick="Start_tab_upd(\'' . $GLOBALS['PMD_URL']["TABLE_NAME_SMALL"][$i] . '\');" '
193 . 'src="' . $_SESSION['PMA_Theme']->getImgPath('pmd/exec.png') . '" alt="" />';
195 echo '<td width="1px">';
196 echo '<input onclick="VisibleTab(this,\'' . $GLOBALS['PMD_URL']["TABLE_NAME"][$i] . '\')" '
197 . 'title="' . __('Hide') . '" '
198 . 'id="check_vis_' . $GLOBALS['PMD_URL']["TABLE_NAME"][$i] . '" '
199 . 'style="margin:0px;" type="checkbox" '
200 . 'value="' . $GLOBALS['PMD_URL']["TABLE_NAME"][$i] . '"';
201 if (isset($tab_pos[$GLOBALS['PMD']["TABLE_NAME"][$i]])) {
202 echo $tab_pos[$GLOBALS['PMD']["TABLE_NAME"][$i]]["H"] ?
'checked="checked"' : '';
204 echo 'checked="checked"';
207 echo '<td class="pmd_Tabs" onmouseover="this.className=\'pmd_Tabs2\'" '
208 . 'onmouseout="this.className=\'pmd_Tabs\'" '
209 . 'onclick="Select_tab(\'' . $GLOBALS['PMD_URL']["TABLE_NAME"][$i] . '\');">';
210 echo $GLOBALS['PMD_OUT']["TABLE_NAME"][$i];
217 echo '<div class="center">';
218 echo __('Number of tables') . ': ' . $name_cnt;
220 echo '<div class="floatright">';
221 echo '<div id="layer_menu_sizer" onmousedown="layer_menu_cur_click=1">';
226 for ($i = 0; $i < count($GLOBALS['PMD']["TABLE_NAME"]); $i++
) {
227 $t_n = $GLOBALS['PMD']["TABLE_NAME"][$i];
228 $t_n_url = $GLOBALS['PMD_URL']["TABLE_NAME"][$i];
231 <input name
="t_x[<?php echo $t_n_url ?>]" type
="hidden" id
="t_x_<?php echo $t_n_url ?>_" />
232 <input name
="t_y[<?php echo $t_n_url ?>]" type
="hidden" id
="t_y_<?php echo $t_n_url ?>_" />
233 <input name
="t_v[<?php echo $t_n_url ?>]" type
="hidden" id
="t_v_<?php echo $t_n_url ?>_" />
234 <input name
="t_h[<?php echo $t_n_url ?>]" type
="hidden" id
="t_h_<?php echo $t_n_url ?>_" />
236 <table id
="<?php echo $t_n_url ?>" cellpadding
="0" cellspacing
="0" class="pmd_tab"
237 style
="position: absolute;
239 echo isset($tab_pos[$t_n]) ? $tab_pos[$t_n]["X
"] : rand(20, 700); ?>px;
241 echo isset($tab_pos[$t_n]) ? $tab_pos[$t_n]["Y
"] : rand(20, 550); ?>px;
243 echo ! isset($tab_pos[$t_n]) || $tab_pos[$t_n]["H
"]
250 if (isset($_REQUEST['query'])) {
251 echo '<td class="select_all">';
252 echo '<input type="checkbox" value="select_all_'.htmlspecialchars($t_n_url).'" style="margin: 0px;" ';
253 echo 'id="select_all_'.htmlspecialchars($t_n_url).'" title="select all" ';
254 echo 'onclick="Select_all(\''. htmlspecialchars($t_n_url) .'\',\''.htmlspecialchars($GLOBALS['PMD_OUT']["OWNER"][$i]).'\')"></td>';
257 <td
class="small_tab" onmouseover
="this.className='small_tab2';"
258 onmouseout
="this.className='small_tab';"
259 id
="id_hide_tbody_<?php echo $t_n_url ?>"
260 onclick
="Small_tab('<?php echo $t_n_url ?>', 1)"><?php
261 // no space alloawd here, between tags and content !!!
262 // JavaScript function does require this
263 if (! isset($tab_pos[$t_n]) ||
! empty($tab_pos[$t_n]["V"])) {
269 <td
class="small_tab_pref" onmouseover
="this.className='small_tab_pref2';"
270 onmouseout
="this.className='small_tab_pref';"
271 onclick
="Start_tab_upd('<?php echo $GLOBALS['PMD_URL']["TABLE_NAME_SMALL
"][$i]; ?>');">
272 <img src
="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/exec_small.png'); ?>" alt
="" /></td
>
273 <td id
="id_zag_<?php echo $t_n_url ?>" class="tab_zag nowrap"
274 onmousedown
="cur_click=document.getElementById('<?php echo $t_n_url ?>');"/
275 onmouseover
="Table_onover('<?php echo $t_n_url ?>',0,<?php echo (isset($_REQUEST['query'])? 1 : 0 )?> )"
276 onmouseout
="Table_onover('<?php echo $t_n_url ?>',1,<?php echo (isset($_REQUEST['query']) ? 1 : 0 )?>)">
279 echo $GLOBALS['PMD_OUT']["OWNER"][$i];
281 echo $GLOBALS['PMD_OUT']["TABLE_NAME_SMALL"][$i];
284 if (isset($_REQUEST['query'])) {
285 echo '<td class="tab_zag" onmouseover="Table_onover(\''.htmlspecialchars($t_n_url).'\',0,1)" id="id_zag_'.htmlspecialchars($t_n_url).'_2"';
286 echo 'onmousedown="cur_click=document.getElementById(\''.htmlspecialchars($t_n_url).'\');"';
287 echo 'onmouseout="Table_onover(\''.htmlspecialchars($t_n_url).'\',1,1)">';
292 <tbody id
="id_tbody_<?php echo $t_n_url ?>"
294 if (isset($tab_pos[$t_n]) && empty($tab_pos[$t_n]["V"])) {
295 echo 'style="display: none;"';
298 $display_field = PMA_getDisplayField($db, $GLOBALS['PMD']["TABLE_NAME_SMALL"][$i]);
299 for ($j = 0, $id_cnt = count($tab_column[$t_n]["COLUMN_ID"]); $j < $id_cnt; $j++
) {
302 echo $GLOBALS['PMD_URL']["TABLE_NAME_SMALL
"][$i] . '.'
303 . urlencode($tab_column[$t_n]["COLUMN_NAME
"][$j]) ?>"
305 if ($display_field == $tab_column[$t_n]["COLUMN_NAME"][$j]) {
306 echo ' class="tab_field_3" ';
308 echo ' class="tab_field" ';
311 onmouseover
="old_class = this.className; this.className = 'tab_field_2';"
312 onmouseout
="this.className = old_class;"
313 onmousedown
="Click_field('<?php
314 echo $GLOBALS['PMD_URL']["TABLE_NAME_SMALL
"][$i]."','".urlencode($tab_column[$t_n]["COLUMN_NAME
"][$j])."',";
315 if (!PMA_Util::isForeignKeySupported($GLOBALS['PMD
']['TABLE_TYPE
'][$i])) {
316 echo (isset($tables_pk_or_unique_keys[$t_n . "." . $tab_column[$t_n]["COLUMN_NAME"][$j]]) ? 1 : 0);
318 // if foreign keys are supported, it's not necessary that the
319 // index is a primary key
320 echo (isset($tables_all_keys[$t_n.".".$tab_column[$t_n]["COLUMN_NAME"][$j]]) ?
1 : 0);
324 if (isset($_REQUEST['query'])) {
325 echo '<td class="select_all
">';
326 echo '<input value="'.htmlspecialchars($t_n_url).urlencode($tab_column[$t_n]["COLUMN_NAME"][$j]).'"';
327 echo 'type="checkbox
" id="select_
'.htmlspecialchars($t_n_url).'._
'.urlencode($tab_column[$t_n]["COLUMN_NAME"][$j]).'" ';
328 echo 'style="margin
: 0px
;" title="select_
'.urlencode($tab_column[$t_n]["COLUMN_NAME"][$j]).'" ';
329 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>';
331 <td width="10px
" colspan="3"
332 id="<?php
echo $t_n_url.".".urlencode($tab_column[$t_n]["COLUMN_NAME"][$j]) ?
>">
335 if (isset($tables_pk_or_unique_keys[$t_n.".".$tab_column[$t_n]["COLUMN_NAME
"][$j]])) {
337 <img src="<?php
echo $_SESSION['PMA_Theme']->getImgPath(); ?
>pmd
/FieldKey_small
.png
"
342 <img src="<?php
echo $_SESSION['PMA_Theme']->getImgPath(); ?
>pmd
/Field_small
<?php
343 if (strstr($tab_column[$t_n]["TYPE"][$j], 'char')
344 ||
strstr($tab_column[$t_n]["TYPE"][$j], 'text')
347 } elseif (strstr($tab_column[$t_n]["TYPE"][$j], 'int')
348 ||
strstr($tab_column[$t_n]["TYPE"][$j], 'float')
349 ||
strstr($tab_column[$t_n]["TYPE"][$j], 'double')
350 ||
strstr($tab_column[$t_n]["TYPE"][$j], 'decimal')
353 } elseif (strstr($tab_column[$t_n]["TYPE"][$j], 'date')
354 ||
strstr($tab_column[$t_n]["TYPE"][$j], 'time')
355 ||
strstr($tab_column[$t_n]["TYPE"][$j], 'year')
362 echo htmlspecialchars(
363 $tab_column[$t_n]["COLUMN_NAME
"][$j] . " : " . $tab_column[$t_n]["TYPE
"][$j],
366 echo "</div
>\n</td
>\n";
367 if (isset($_REQUEST['query'])) {
368 //$temp = $GLOBALS['PMD_OUT']["OWNER
"][$i].'.'.$GLOBALS['PMD_OUT']["TABLE_NAME_SMALL
"][$i];
369 echo '<td class="small_tab_pref
" onmouseover="this
.className
=\'small_tab_pref2\'
;"';
370 echo 'onmouseout="this
.className
=\'small_tab_pref\'
;"';
371 echo 'onclick="Click_option(\'pmd_optionse\'
,\''
372 . urlencode($tab_column[$t_n]["COLUMN_NAME"][$j]) . '\'
,\''
373 . $GLOBALS['PMD_OUT
']["TABLE_NAME_SMALL"][$i].'\'
)" >';
375 . $_SESSION['PMA_Theme
']->getImgPath('pmd
/exec_small
.png
')
376 . '" title="options
" alt="" /></td> ';
380 echo "</tbody
>\n</table
>\n";
385 <div id="pmd_hint
"></div>
387 <table id="layer_new_relation
" style="display
:none
;"
388 width="5%
" cellpadding="0" cellspacing="0">
391 <td class="frams1
" width="10px
"></td>
392 <td class="frams5
" width="99%
" ></td>
393 <td class="frams2
" width="10px
"><div class="bor
"></div></td>
396 <td class="frams8
"></td>
397 <td class="input_tab
">
398 <table width="168" class="center
" cellpadding="2" cellspacing="0">
401 <td colspan="2" class="center nowrap
"><strong><?php echo __('Create relation'); ?></strong></td>
404 <tbody id="foreign_relation
">
406 <td colspan="2" class="center nowrap
"><strong>FOREIGN KEY</strong></td>
409 <td width="58" class="nowrap
">on delete</td>
410 <td width="102"><select name="on_delete
" id="on_delete
">
411 <option value="nix
" selected="selected
">--</option>
412 <option value="CASCADE
">CASCADE</option>
413 <option value="SET
NULL">SET NULL</option>
414 <option value="NO ACTION
">NO ACTION</option>
415 <option value="RESTRICT
">RESTRICT</option>
420 <td class="nowrap
">on update</td>
421 <td><select name="on_update
" id="on_update
">
422 <option value="nix
" selected="selected
">--</option>
423 <option value="CASCADE
">CASCADE</option>
424 <option value="SET
NULL">SET NULL</option>
425 <option value="NO ACTION
">NO ACTION</option>
426 <option value="RESTRICT
">RESTRICT</option>
433 <td colspan="2" class="center nowrap
">
434 <input type="button
" class="butt
" name="Button
"
435 value="<?php
echo __('OK'); ?
>" onclick="New_relation()" />
436 <input type="button
" class="butt
" name="Button
"
437 value="<?php
echo __('Cancel'); ?
>"
438 onclick="document
.getElementById('layer_new_relation').style
.display
= 'none';" />
444 <td class="frams6
"></td>
447 <td class="frams4
"><div class="bor
"></div></td>
448 <td class="frams7
"></td>
449 <td class="frams3
"></td>
454 <table id="layer_upd_relation
" style="display
:none
;"
455 width="5%
" cellpadding="0" cellspacing="0">
458 <td class="frams1
" width="10px
"></td>
459 <td class="frams5
" width="99%
"></td>
460 <td class="frams2
" width="10px
"><div class="bor
"></div></td>
463 <td class="frams8
"></td>
464 <td class="input_tab
">
465 <table width="100%
" class="center
" cellpadding="2" cellspacing="0">
467 <td colspan="3" class="center nowrap
"><strong><?php echo __('Delete relation'); ?></strong></td>
470 <td colspan="3" class="center nowrap
">
471 <input name="Button
" type="button
" class="butt
"
472 onclick="Upd_relation()" value="<?php
echo __('Delete'); ?
>" />
473 <input type="button
" class="butt
" name="Button
"
474 value="<?php
echo __('Cancel'); ?
>"
475 onclick="document
.getElementById('layer_upd_relation').style
.display
= 'none'; Re_load();" />
479 <td class="frams6
"></td>
482 <td class="frams4
"><div class="bor
"></div></td>
483 <td class="frams7
"></td>
484 <td class="frams3
"></td>
489 <table id="pmd_optionse
" style="display
:none
;"
490 width="5%
" cellpadding="0" cellspacing="0">
493 <td class="frams1
" width="10px
"></td>
494 <td class="frams5
" width="99%
" ></td>
495 <td class="frams2
" width="10px
"><div class="bor
"></div></td>
498 <td class="frams8
"></td>
499 <td class="input_tab
">
500 <table width="168" class="center
" cellpadding="2" cellspacing="0">
503 <td colspan="2" rowspan="2" id="option_col_name
" class="center nowrap
"></td>
507 <tr><td class="center nowrap
"><b>WHERE</b></td></tr>
509 <td width="58" class="nowrap
"><?php echo __('Relation operator'); ?></td>
510 <td width="102"><select name="rel_opt
" id="rel_opt
">
511 <option value="--" selected="selected
"> -- </option>
512 <option value="="> = </option>
513 <option value=">
;"> > </option>
514 <option value="<
;"> < </option>
515 <option value=">
;="> >= </option>
516 <option value="<
;="> <= </option>
517 <option value="NOT
"> NOT </option>
518 <option value="IN
"> IN </option>
519 <option value="EXCEPT
"> <?php echo __('Except'); ?> </option>
520 <option value="NOT IN
"> NOT IN </option>
525 <td class="nowrap
"><?php echo __('Value'); ?>/<br /><?php echo __('subquery'); ?></td>
526 <td><textarea id="Query
" value="" cols="18"></textarea>
529 <tr><td class="center nowrap
"><b><?php echo __('Rename to'); ?></b></td></tr>
531 <td width="58" class="nowrap
"><?php echo __('New name'); ?></td>
532 <td width="102"><input type="text
" value="" id="new_name
"/></td>
534 <tr><td class="center nowrap
"><b><?php echo __('Aggregate'); ?></b></td></tr>
536 <td width="58" class="nowrap
"><?php echo __('Operator'); ?></td>
537 <td width="102"><select name="operator
" id="operator
">
538 <option value="---" selected="selected
">---</option>
539 <option value="sum
" > SUM </option>
540 <option value="min
"> MIN </option>
541 <option value="max
"> MAX </option>
542 <option value="avg
"> AVG </option>
543 <option value="count
"> COUNT </option>
547 <td width="58" class="center nowrap
"><b>GROUP BY</b></td>
548 <td><input type="checkbox
" value="groupby
" id="groupby
"/></td>
551 <td width="58" class="center nowrap
"><b>ORDER BY</b></td>
552 <td><input type="checkbox
" value="orderby
" id="orderby
"/></td>
554 <tr><td class="center nowrap
"><b>HAVING</b></td></tr>
556 <td width="58" class="nowrap
"><?php echo __('Operator'); ?></td>
557 <td width="102"><select name="h_operator
" id="h_operator
">
558 <option value="---" selected="selected
">---</option>
559 <option value="None
" > <?php echo __('None'); ?> </option>
560 <option value="sum
" > SUM </option>
561 <option value="min
"> MIN </option>
562 <option value="max
"> MAX </option>
563 <option value="avg
"> AVG </option>
564 <option value="count
"> COUNT </option>
568 <td width="58" class="nowrap
"><?php echo __('Relation operator'); ?></td>
569 <td width="102"><select name="h_rel_opt
" id="h_rel_opt
">
570 <option value="--" selected="selected
"> -- </option>
571 <option value="="> = </option>
572 <option value=">
;"> > </option>
573 <option value="<
;"> < </option>
574 <option value=">
;="> >= </option>
575 <option value="<
;="> <= </option>
576 <option value="NOT
"> NOT </option>
577 <option value="IN
"> IN </option>
578 <option value="EXCEPT
"> <?php echo __('Except'); ?> </option>
579 <option value="NOT IN
"> NOT IN </option>
584 <td width="58" class="nowrap
"><?php echo __('Value'); ?>/<br/><?php echo __('subquery'); ?></td>
585 <td width="102"><textarea id="having
" value="" cols="18"></textarea></td>
590 <td colspan="2" class="center nowrap
">
591 <input type="button
" class="butt
" name="Button
"
592 value="<?php
echo __('OK'); ?
>" onclick="add_object()" />
593 <input type="button
" class="butt
" name="Button
"
594 value="<?php
echo __('Cancel'); ?
>"
595 onclick="Close_option()" />
601 <td class="frams6
"></td>
604 <td class="frams4
"><div class="bor
"></div></td>
605 <td class="frams7
"></td>
606 <td class="frams3
"></td>
611 <table id="query_rename_to
" style="display
:none
;"
612 width="5%
" cellpadding="0" cellspacing="0">
615 <td class="frams1
" width="10px
"></td>
616 <td class="frams5
" width="99%
" ></td>
617 <td class="frams2
" width="10px
"><div class="bor
"></div></td>
620 <td class="frams8
"></td>
621 <td class="input_tab
">
622 <table width="168" class="center
" cellpadding="2" cellspacing="0">
625 <td colspan="2" class="center nowrap
"><strong><?php echo __('Rename to'); ?></strong></td>
628 <tbody id="rename_to
">
630 <td width="58" class="nowrap
"><?php echo __('New name'); ?></td>
632 <input type="text
" value="" id="e_rename
"/>
638 <td colspan="2" class="center nowrap
">
639 <input type="button
" class="butt
" name="Button
"
640 value="<?php
echo __('OK'); ?
>" onclick="edit('Rename')" />
641 <input type="button
" class="butt
" name="Button
"
642 value="<?php
echo __('Cancel'); ?
>"
643 onclick="document
.getElementById('query_rename_to').style
.display
= 'none';" />
649 <td class="frams6
"></td>
652 <td class="frams4
"><div class="bor
"></div></td>
653 <td class="frams7
"></td>
654 <td class="frams3
"></td>
659 <table id="query_having
" style="display
:none
;"
660 width="5%
" cellpadding="0" cellspacing="0">
663 <td class="frams1
" width="10px
"></td>
664 <td class="frams5
" width="99%
" ></td>
665 <td class="frams2
" width="10px
"><div class="bor
"></div></td>
668 <td class="frams8
"></td>
669 <td class="input_tab
">
670 <table width="168" class="center
" cellpadding="2" cellspacing="0">
673 <td colspan="2" class="center nowrap
"><strong>HAVING</strong></td>
676 <tbody id="rename_to
">
678 <td width="58" class="nowrap
"><?php echo __('Operator'); ?></td>
679 <td width="102"><select name="hoperator
" id="hoperator
">
680 <option value="---" selected="selected
">---</option>
681 <option value="None
" > None </option>
682 <option value="sum
" > SUM </option>
683 <option value="min
"> MIN </option>
684 <option value="max
"> MAX </option>
685 <option value="avg
"> AVG </option>
686 <option value="count
"> COUNT </option>
691 <td width="58" class="nowrap
"><?php echo __('Operator'); ?></td>
692 <td width="102"><select name="hrel_opt
" id="hrel_opt
">
693 <option value="--" selected="selected
"> -- </option>
694 <option value="="> = </option>
695 <option value=">
;"> > </option>
696 <option value="<
;"> < </option>
697 <option value=">
;="> >= </option>
698 <option value="<
;="> <= </option>
699 <option value="NOT
"> NOT </option>
700 <option value="IN
"> IN </option>
701 <option value="EXCEPT
"> <?php echo __('Except'); ?> </option>
702 <option value="NOT IN
"> NOT IN </option>
707 <td class="nowrap
"><?php echo __('Value'); ?>/<br /><?php echo __('subquery'); ?></td>
708 <td><textarea id="hQuery
" value="" cols="18"></textarea>
714 <td colspan="2" class="center nowrap
">
715 <input type="button
" class="butt
" name="Button
"
716 value="<?php
echo __('OK'); ?
>" onclick="edit('Having')" />
717 <input type="button
" class="butt
" name="Button
"
718 value="<?php
echo __('Cancel'); ?
>"
719 onclick="document
.getElementById('query_having').style
.display
= 'none';" />
725 <td class="frams6
"></td>
728 <td class="frams4
"><div class="bor
"></div></td>
729 <td class="frams7
"></td>
730 <td class="frams3
"></td>
735 <table id="query_Aggregate
" style="display
:none
;"
736 width="5%
" cellpadding="0" cellspacing="0">
739 <td class="frams1
" width="10px
"></td>
740 <td class="frams5
" width="99%
" ></td>
741 <td class="frams2
" width="10px
"><div class="bor
"></div></td>
744 <td class="frams8
"></td>
745 <td class="input_tab
">
746 <table width="168" class="center
" cellpadding="2" cellspacing="0">
749 <td colspan="2" class="center nowrap
"><strong><?php echo __('Aggregate'); ?></strong></td>
754 <td width="58" class="nowrap
"><?php echo __('Operator'); ?></td>
756 <select name="operator
" id="e_operator
">
757 <option value="---" selected="selected
">---</option>
758 <option value="sum
" > SUM </option>
759 <option value="min
"> MIN </option>
760 <option value="max
"> MAX </option>
761 <option value="avg
"> AVG </option>
762 <option value="avg
"> COUNT </option>
768 <td colspan="2" class="center nowrap
">
769 <input type="button
" class="butt
" name="Button
"
770 value="<?php
echo __('OK'); ?
>" onclick="edit('Aggregate')" />
771 <input type="button
" class="butt
" name="Button
"
772 value="<?php
echo __('Cancel'); ?
>"
773 onclick="document
.getElementById('query_Aggregate').style
.display
= 'none';" />
779 <td class="frams6
"></td>
782 <td class="frams4
"><div class="bor
"></div></td>
783 <td class="frams7
"></td>
784 <td class="frams3
"></td>
789 <table id="query_where
" style="display
:none
;"
790 width="5%
" cellpadding="0" cellspacing="0">
793 <td class="frams1
" width="10px
"></td>
794 <td class="frams5
" width="99%
" ></td>
795 <td class="frams2
" width="10px
"><div class="bor
"></div></td>
798 <td class="frams8
"></td>
799 <td class="input_tab
">
800 <table width="168" class="center
" cellpadding="2" cellspacing="0">
803 <td colspan="2" class="center nowrap
"><strong>WHERE</strong></td>
806 <tbody id="rename_to
">
808 <td width="58" class="nowrap
"><?php echo __('Operator'); ?></td>
809 <td width="102"><select name="erel_opt
" id="erel_opt
">
810 <option value="--" selected="selected
"> -- </option>
811 <option value="=" > = </option>
812 <option value=">
;"> > </option>
813 <option value="<
;"> < </option>
814 <option value=">
;="> >= </option>
815 <option value="<
;="> <= </option>
816 <option value="NOT
"> NOT </option>
817 <option value="IN
"> IN </option>
818 <option value="EXCEPT
"> <?php echo __('Except'); ?> </option>
819 <option value="NOT IN
"> NOT IN </option>
824 <td class="nowrap
"><?php echo __('Value'); ?>/<br /><?php echo __('subquery'); ?></td>
825 <td><textarea id="eQuery
" value="" cols="18"></textarea>
831 <td colspan="2" class="center nowrap
">
832 <input type="button
" class="butt
" name="Button
"
833 value="<?php
echo __('OK'); ?
>" onclick="edit('Where')" />
834 <input type="button
" class="butt
" name="Button
"
835 value="<?php
echo __('Cancel'); ?
>"
836 onclick="document
.getElementById('query_where').style
.display
= 'none';" />
842 <td class="frams6
"></td>
845 <td class="frams4
"><div class="bor
"></div></td>
846 <td class="frams7
"></td>
847 <td class="frams3
"></td>
853 if (! empty($_REQUEST['query'])) {
854 echo '<div class="panel
">';
855 echo '<div style="clear
:both
;"></div>';
856 echo '<div id="ab
"></div>';
857 echo '<div style="clear
:both
;"></div>';
859 echo '<a class="trigger
" href="#">' . __('Active options') . '</a>';
860 echo '<div id="filter"></div>';
861 echo '<div id="box">';
862 echo '<span id="boxtitle"></span>';
863 echo '<form method="post" action="db_qbe.php">';
864 echo '<textarea cols="80" name="sql_query" id="textSqlquery" rows="15"></textarea><div id="tblfooter">';
865 echo ' <input type="submit" name="submit_sql" class="btn" />';
866 echo ' <input type="button" name="cancel" value="' . __('Cancel') . '" onclick="closebox()" class="btn" />';
867 echo PMA_generate_common_hidden_inputs($GLOBALS['db']);
869 echo '</form></div>';
874 <!-- cache images
-->
875 <img src
="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/2leftarrow_m.png'); ?>" width
="0" height
="0" alt
="" />
876 <img src
="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/rightarrow1.png'); ?>" width
="0" height
="0" alt
="" />
877 <img src
="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/rightarrow2.png'); ?>" width
="0" height
="0" alt
="" />
878 <img src
="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/uparrow2_m.png'); ?>" width
="0" height
="0" alt
="" />
879 <div id
="PMA_disable_floating_menubar"></div
>