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 = PMA_getTablesInfo();
16 $tab_column = PMA_getColumnsInfo();
17 $script_tables = PMA_getScriptTabs();
18 $script_contr = PMA_getScriptContr();
19 $tab_pos = PMA_getTabPos();
20 $tables_pk_or_unique_keys = PMA_getPKOrUniqueKeys();
21 $tables_all_keys = PMA_getAllKeys();
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('jquery/jquery.fullscreen.js');
34 $scripts->addFile('pmd/ajax.js');
35 $scripts->addFile('pmd/history.js');
36 $scripts->addFile('pmd/move.js');
37 $scripts->addFile('pmd/iecanvas.js', true);
38 $scripts->addFile('pmd/init.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'
69 title
="<?php echo __('Show/Hide left menu'); ?>" alt
="v"
70 src
="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/downarrow2_m.png'); ?>" />
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'); ?>" />
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'); ?>" />
83 src
="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/bord.png'); ?>"
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'); ?>" />
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'); ?>" />
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'); ?>" />
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'); ?>" />
104 <a href
="#" onclick
="location.reload(); return false" class="M_butt"
106 <img title
="<?php echo __('Reload'); ?>" alt
=""
107 src
="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/reload.png'); ?>" />
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'); ?>" />
115 src
="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/bord.png'); ?>"
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'); ?>" />
122 <a href
="#" onclick
="Grid(); return false" class="M_butt" id
="grid_button"
124 <img title
="<?php echo __('Snap to grid') ?>"
125 src
="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/grid.png'); ?>" alt
="" />
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'); ?>" />
133 <a href
="#" onclick
="Small_tab_invert(); return false" class="M_butt"
135 <img title
="<?php echo __('Toggle small/big'); ?>" alt
="key"
136 src
="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/bottom.png'); ?>" />
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'); ?>" />
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 relational schema'); ?>" />
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">';
153 . $_SESSION['PMA_Theme']->getImgPath('pmd/query_builder.png')
154 . '" alt="key" width="20" height="20" title="';
155 echo __('Build Query');
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'); ?>" />
166 <div id
="canvas_outer">
167 <form action
="" method
="post" name
="form1">
169 <canvas
class="pmd" id
="canvas" width
="100" height
="100"
170 onclick
="Canvas_click(this)"></canvas
>
172 <div id
="layer_menu" style
="display:none;">
173 <div
class="center" style
="padding-top:5px;">
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
>
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
>
184 <div id
="id_scroll_tab" class="scroll_tab">
185 <table width
="100%" style
="padding-left: 3px;">
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">';
194 . 'onclick="Start_tab_upd(\''
195 . $GLOBALS['PMD_URL']["TABLE_NAME_SMALL"][$i] . '\');" '
196 . 'src="' . $_SESSION['PMA_Theme']->getImgPath('pmd/exec.png')
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"'
211 echo 'checked="checked"';
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];
224 echo '<div class="center">';
225 echo __('Number of tables:') . ' ' . $name_cnt;
227 echo '<div class="floatright">';
228 echo '<div id="layer_menu_sizer" onmousedown="layer_menu_cur_click=1">';
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];
237 echo '<input name="t_x[' . $t_n_url . ']" type="hidden" id="t_x_'
239 . '<input name="t_y[' . $t_n_url . ']" type="hidden" id="t_y_'
241 . '<input name="t_v[' . $t_n_url . ']" type="hidden" id="t_v_'
243 . '<input name="t_h[' . $t_n_url . ']" type="hidden" id="t_h_'
244 . $t_n_url . '_" />';
246 <table id
="<?php echo $t_n_url ?>" cellpadding
="0" cellspacing
="0" class="pmd_tab"
247 style
="position: absolute;
249 echo isset($tab_pos[$t_n]) ? $tab_pos[$t_n]["X
"] : rand(20, 700); ?>px;
251 echo isset($tab_pos[$t_n]) ? $tab_pos[$t_n]["Y
"] : rand(20, 550); ?>px;
253 echo ! isset($tab_pos[$t_n]) || $tab_pos[$t_n]["H
"]
260 if (isset($_REQUEST['query'])) {
261 echo '<td class="select_all">';
262 echo '<input type="checkbox" value="select_all_'
263 . htmlspecialchars($t_n_url) . '" style="margin: 0px;" ';
264 echo 'id="select_all_' . htmlspecialchars($t_n_url) . '" title="select all" ';
265 echo 'onclick="Select_all(\'' . htmlspecialchars($t_n_url) . '\',\''
266 . htmlspecialchars($GLOBALS['PMD_OUT']["OWNER"][$i]) . '\')"></td>';
269 <td
class="small_tab" onmouseover
="this.className='small_tab2';"
270 onmouseout
="this.className='small_tab';"
271 id
="id_hide_tbody_<?php echo $t_n_url ?>"
272 onclick
="Small_tab('<?php echo $t_n_url ?>', 1)"><?php
273 // no space alloawd here, between tags and content !!!
274 // JavaScript function does require this
275 if (! isset($tab_pos[$t_n]) ||
! empty($tab_pos[$t_n]["V"])) {
281 <td
class="small_tab_pref" onmouseover
="this.className='small_tab_pref2';"
282 onmouseout
="this.className='small_tab_pref';"
283 onclick
="Start_tab_upd('<?php echo $GLOBALS['PMD_URL']["TABLE_NAME_SMALL
"][$i]; ?>');">
284 <img src
="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/exec_small.png'); ?>" alt
="" /></td
>
285 <td id
="id_zag_<?php echo $t_n_url ?>" class="tab_zag nowrap"
286 onmousedown
="cur_click=document.getElementById('<?php echo $t_n_url ?>');"/
287 onmouseover
="Table_onover('<?php echo $t_n_url ?>',0,<?php echo (isset($_REQUEST['query'])? 1 : 0 )?> )"
288 onmouseout
="Table_onover('<?php echo $t_n_url ?>',1,<?php echo (isset($_REQUEST['query']) ? 1 : 0 )?>)">
290 <?php
echo $GLOBALS['PMD_OUT']["OWNER"][$i]; ?
>.
292 <?php
echo $GLOBALS['PMD_OUT']["TABLE_NAME_SMALL"][$i]; ?
>
295 if (isset($_REQUEST['query'])) {
296 echo '<td class="tab_zag" onmouseover="Table_onover(\''
297 . htmlspecialchars($t_n_url) . '\',0,1)" id="id_zag_'
298 . htmlspecialchars($t_n_url) . '_2"';
299 echo 'onmousedown="cur_click=document.getElementById(\''
300 . htmlspecialchars($t_n_url) . '\');"';
301 echo 'onmouseout="Table_onover(\'' . htmlspecialchars($t_n_url) . '\',1,1)">';
306 <tbody id
="id_tbody_<?php echo $t_n_url ?>"
308 if (isset($tab_pos[$t_n]) && empty($tab_pos[$t_n]["V"])) {
309 echo 'style="display: none;"';
312 $display_field = PMA_getDisplayField(
314 $GLOBALS['PMD']["TABLE_NAME_SMALL"][$i]
317 $j = 0, $id_cnt = count($tab_column[$t_n]["COLUMN_ID"]);
321 echo '<tr id="id_tr_'
322 . $GLOBALS['PMD_URL']["TABLE_NAME_SMALL"][$i] . '.'
323 . urlencode($tab_column[$t_n]["COLUMN_NAME"][$j]) . '"';
324 if ($display_field == $tab_column[$t_n]["COLUMN_NAME"][$j]) {
325 echo ' class="tab_field_3" ';
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 $tmpColumn = $t_n . "." . $tab_column[$t_n]["COLUMN_NAME"][$j];
336 if (!PMA_Util::isForeignKeySupported($GLOBALS['PMD
']['TABLE_TYPE
'][$i])) {
337 echo (isset($tables_pk_or_unique_keys[$tmpColumn]) ? 1 : 0);
339 // if foreign keys are supported, it's not necessary that the
340 // index is a primary key
341 echo (isset($tables_all_keys[$tmpColumn]) ?
1 : 0);
345 if (isset($_REQUEST['query'])) {
346 echo '<td class="select_all
">';
347 echo '<input value="' . htmlspecialchars($t_n_url)
348 . urlencode($tab_column[$t_n]["COLUMN_NAME"][$j]) . '"';
349 echo 'type="checkbox
" id="select_
' . htmlspecialchars($t_n_url) . '._
'
350 . urlencode($tab_column[$t_n]["COLUMN_NAME"][$j]) . '" ';
351 echo 'style="margin
: 0px
;" title="select_
'
352 . urlencode($tab_column[$t_n]["COLUMN_NAME"][$j]) . '" ';
353 echo 'onclick="store_column(\''
354 . urlencode($GLOBALS['PMD_OUT
']["TABLE_NAME_SMALL"][$i]) . '\'
,\''
355 . htmlspecialchars($GLOBALS['PMD_OUT
']["OWNER"][$i]) . '\'
,\''
356 . urlencode($tab_column[$t_n]["COLUMN_NAME"][$j]) . '\'
)"></td>';
358 <td width="10px
" colspan="3"
359 id="<?php
echo $t_n_url
361 . urlencode($tab_column[$t_n]["COLUMN_NAME"][$j]) ?
>">
364 if (isset($tables_pk_or_unique_keys[$t_n . "." . $tab_column[$t_n]["COLUMN_NAME
"][$j]])) {
366 <img src="<?php
echo $_SESSION['PMA_Theme']->getImgPath(); ?
>pmd
/FieldKey_small
.png
"
371 <img src="<?php
echo $_SESSION['PMA_Theme']->getImgPath(); ?
>pmd
/Field_small
<?php
372 if (strstr($tab_column[$t_n]["TYPE"][$j], 'char')
373 ||
strstr($tab_column[$t_n]["TYPE"][$j], 'text')
376 } elseif (strstr($tab_column[$t_n]["TYPE"][$j], 'int')
377 ||
strstr($tab_column[$t_n]["TYPE"][$j], 'float')
378 ||
strstr($tab_column[$t_n]["TYPE"][$j], 'double')
379 ||
strstr($tab_column[$t_n]["TYPE"][$j], 'decimal')
382 } elseif (strstr($tab_column[$t_n]["TYPE"][$j], 'date')
383 ||
strstr($tab_column[$t_n]["TYPE"][$j], 'time')
384 ||
strstr($tab_column[$t_n]["TYPE"][$j], 'year')
391 echo htmlspecialchars(
392 $tab_column[$t_n]["COLUMN_NAME
"][$j] . " : "
393 . $tab_column[$t_n]["TYPE
"][$j],
396 echo "</div
>\n</td
>\n";
397 if (isset($_REQUEST['query'])) {
398 /*$temp = $GLOBALS['PMD_OUT']["OWNER
"][$i] . '.'
399 . $GLOBALS['PMD_OUT']["TABLE_NAME_SMALL
"][$i];*/
400 echo '<td class="small_tab_pref
" '
401 . 'onmouseover="this
.className
=\'small_tab_pref2\'
;"';
402 echo 'onmouseout="this
.className
=\'small_tab_pref\'
;"';
403 echo 'onclick="Click_option(\'pmd_optionse\'
,\''
404 . urlencode($tab_column[$t_n]["COLUMN_NAME"][$j]) . '\'
,\''
405 . $GLOBALS['PMD_OUT
']["TABLE_NAME_SMALL"][$i] . '\'
)" >';
407 . $_SESSION['PMA_Theme
']->getImgPath('pmd
/exec_small
.png
')
408 . '" title="options
" alt="" /></td> ';
412 echo "</tbody
>\n</table
>\n";
417 <div id="pmd_hint
"></div>
419 <table id="layer_new_relation
" style="display
:none
;"
420 width="5%
" cellpadding="0" cellspacing="0">
423 <td class="frams1
" width="10px
"></td>
424 <td class="frams5
" width="99%
" ></td>
425 <td class="frams2
" width="10px
"><div class="bor
"></div></td>
428 <td class="frams8
"></td>
429 <td class="input_tab
">
430 <table width="168" class="center
" cellpadding="2" cellspacing="0">
433 <td colspan="2" class="center nowrap
">
434 <strong><?php echo __('Create relation'); ?></strong>
438 <tbody id="foreign_relation
">
440 <td colspan="2" class="center nowrap
"><strong>FOREIGN KEY</strong></td>
443 <td width="58" class="nowrap
">on delete</td>
444 <td width="102"><select name="on_delete
" id="on_delete
">
445 <option value="nix
" selected="selected
">--</option>
446 <option value="CASCADE
">CASCADE</option>
447 <option value="SET
NULL">SET NULL</option>
448 <option value="NO ACTION
">NO ACTION</option>
449 <option value="RESTRICT
">RESTRICT</option>
454 <td class="nowrap
">on update</td>
455 <td><select name="on_update
" id="on_update
">
456 <option value="nix
" selected="selected
">--</option>
457 <option value="CASCADE
">CASCADE</option>
458 <option value="SET
NULL">SET NULL</option>
459 <option value="NO ACTION
">NO ACTION</option>
460 <option value="RESTRICT
">RESTRICT</option>
467 <td colspan="2" class="center nowrap
">
468 <input type="button
" class="butt
" name="Button
"
469 value="<?php
echo __('OK'); ?
>" onclick="New_relation()" />
470 <input type="button
" class="butt
" name="Button
"
471 value="<?php
echo __('Cancel'); ?
>"
472 onclick="document
.getElementById('layer_new_relation').style
.display
= 'none';" />
478 <td class="frams6
"></td>
481 <td class="frams4
"><div class="bor
"></div></td>
482 <td class="frams7
"></td>
483 <td class="frams3
"></td>
488 <table id="layer_upd_relation
" style="display
:none
;"
489 width="5%
" cellpadding="0" cellspacing="0">
492 <td class="frams1
" width="10px
"></td>
493 <td class="frams5
" width="99%
"></td>
494 <td class="frams2
" width="10px
"><div class="bor
"></div></td>
497 <td class="frams8
"></td>
498 <td class="input_tab
">
499 <table width="100%
" class="center
" cellpadding="2" cellspacing="0">
501 <td colspan="3" class="center nowrap
">
502 <strong><?php echo __('Delete relation'); ?></strong>
506 <td colspan="3" class="center nowrap
">
507 <input name="Button
" type="button
" class="butt
"
508 onclick="Upd_relation()" value="<?php
echo __('Delete'); ?
>" />
509 <input type="button
" class="butt
" name="Button
"
510 value="<?php
echo __('Cancel'); ?
>"
511 onclick="document
.getElementById('layer_upd_relation').style
.display
= 'none'; Re_load();" />
515 <td class="frams6
"></td>
518 <td class="frams4
"><div class="bor
"></div></td>
519 <td class="frams7
"></td>
520 <td class="frams3
"></td>
525 <table id="pmd_optionse
" style="display
:none
;"
526 width="5%
" cellpadding="0" cellspacing="0">
529 <td class="frams1
" width="10px
"></td>
530 <td class="frams5
" width="99%
" ></td>
531 <td class="frams2
" width="10px
"><div class="bor
"></div></td>
534 <td class="frams8
"></td>
535 <td class="input_tab
">
536 <table width="168" class="center
" cellpadding="2" cellspacing="0">
539 <td colspan="2" rowspan="2" id="option_col_name
"
540 class="center nowrap
">
545 <tr><td class="center nowrap
"><b>WHERE</b></td></tr>
547 <td width="58" class="nowrap
"><?php echo __('Relation operator'); ?></td>
548 <td width="102"><select name="rel_opt
" id="rel_opt
">
549 <option value="--" selected="selected
"> -- </option>
550 <option value="="> = </option>
551 <option value=">
;"> > </option>
552 <option value="<
;"> < </option>
553 <option value=">
;="> >= </option>
554 <option value="<
;="> <= </option>
555 <option value="NOT
"> NOT </option>
556 <option value="IN
"> IN </option>
557 <option value="EXCEPT
"> <?php echo __('Except'); ?> </option>
558 <option value="NOT IN
"> NOT IN </option>
563 <td class="nowrap
"><?php echo __('Value'); ?>/<br /><?php echo __('subquery'); ?></td>
564 <td><textarea id="Query
" value="" cols="18"></textarea>
567 <tr><td class="center nowrap
"><b><?php echo __('Rename to'); ?></b></td></tr>
569 <td width="58" class="nowrap
"><?php echo __('New name'); ?></td>
570 <td width="102"><input type="text
" value="" id="new_name
"/></td>
572 <tr><td class="center nowrap
"><b><?php echo __('Aggregate'); ?></b></td></tr>
574 <td width="58" class="nowrap
"><?php echo __('Operator'); ?></td>
575 <td width="102"><select name="operator
" id="operator
">
576 <option value="---" selected="selected
">---</option>
577 <option value="sum
" > SUM </option>
578 <option value="min
"> MIN </option>
579 <option value="max
"> MAX </option>
580 <option value="avg
"> AVG </option>
581 <option value="count
"> COUNT </option>
585 <td width="58" class="center nowrap
"><b>GROUP BY</b></td>
586 <td><input type="checkbox
" value="groupby
" id="groupby
"/></td>
589 <td width="58" class="center nowrap
"><b>ORDER BY</b></td>
590 <td><input type="checkbox
" value="orderby
" id="orderby
"/></td>
592 <tr><td class="center nowrap
"><b>HAVING</b></td></tr>
594 <td width="58" class="nowrap
"><?php echo __('Operator'); ?></td>
595 <td width="102"><select name="h_operator
" id="h_operator
">
596 <option value="---" selected="selected
">---</option>
597 <option value="None
" > <?php echo __('None'); ?> </option>
598 <option value="sum
" > SUM </option>
599 <option value="min
"> MIN </option>
600 <option value="max
"> MAX </option>
601 <option value="avg
"> AVG </option>
602 <option value="count
"> COUNT </option>
606 <td width="58" class="nowrap
"><?php echo __('Relation operator'); ?></td>
607 <td width="102"><select name="h_rel_opt
" id="h_rel_opt
">
608 <option value="--" selected="selected
"> -- </option>
609 <option value="="> = </option>
610 <option value=">
;"> > </option>
611 <option value="<
;"> < </option>
612 <option value=">
;="> >= </option>
613 <option value="<
;="> <= </option>
614 <option value="NOT
"> NOT </option>
615 <option value="IN
"> IN </option>
616 <option value="EXCEPT
"> <?php echo __('Except'); ?> </option>
617 <option value="NOT IN
"> NOT IN </option>
622 <td width="58" class="nowrap
">
623 <?php echo __('Value'); ?>/<br/>
624 <?php echo __('subquery'); ?>
627 <textarea id="having
" value="" cols="18"></textarea>
633 <td colspan="2" class="center nowrap
">
634 <input type="button
" class="butt
" name="Button
"
635 value="<?php
echo __('OK'); ?
>" onclick="add_object()" />
636 <input type="button
" class="butt
" name="Button
"
637 value="<?php
echo __('Cancel'); ?
>"
638 onclick="Close_option()" />
644 <td class="frams6
"></td>
647 <td class="frams4
"><div class="bor
"></div></td>
648 <td class="frams7
"></td>
649 <td class="frams3
"></td>
654 <table id="query_rename_to
" style="display
:none
;"
655 width="5%
" cellpadding="0" cellspacing="0">
658 <td class="frams1
" width="10px
"></td>
659 <td class="frams5
" width="99%
" ></td>
660 <td class="frams2
" width="10px
"><div class="bor
"></div></td>
663 <td class="frams8
"></td>
664 <td class="input_tab
">
665 <table width="168" class="center
" cellpadding="2" cellspacing="0">
668 <td colspan="2" class="center nowrap
">
669 <strong><?php echo __('Rename to'); ?></strong>
673 <tbody id="rename_to
">
675 <td width="58" class="nowrap
"><?php echo __('New name'); ?></td>
677 <input type="text
" value="" id="e_rename
"/>
683 <td colspan="2" class="center nowrap
">
684 <input type="button
" class="butt
" name="Button
"
685 value="<?php
echo __('OK'); ?
>" onclick="edit('Rename')" />
686 <input type="button
" class="butt
" name="Button
"
687 value="<?php
echo __('Cancel'); ?
>"
688 onclick="document
.getElementById('query_rename_to').style
.display
= 'none';" />
694 <td class="frams6
"></td>
697 <td class="frams4
"><div class="bor
"></div></td>
698 <td class="frams7
"></td>
699 <td class="frams3
"></td>
704 <table id="query_having
" style="display
:none
;"
705 width="5%
" cellpadding="0" cellspacing="0">
708 <td class="frams1
" width="10px
"></td>
709 <td class="frams5
" width="99%
" ></td>
710 <td class="frams2
" width="10px
"><div class="bor
"></div></td>
713 <td class="frams8
"></td>
714 <td class="input_tab
">
715 <table width="168" class="center
" cellpadding="2" cellspacing="0">
718 <td colspan="2" class="center nowrap
"><strong>HAVING</strong></td>
721 <tbody id="rename_to
">
723 <td width="58" class="nowrap
"><?php echo __('Operator'); ?></td>
724 <td width="102"><select name="hoperator
" id="hoperator
">
725 <option value="---" selected="selected
">---</option>
726 <option value="None
" > None </option>
727 <option value="sum
" > SUM </option>
728 <option value="min
"> MIN </option>
729 <option value="max
"> MAX </option>
730 <option value="avg
"> AVG </option>
731 <option value="count
"> COUNT </option>
736 <td width="58" class="nowrap
"><?php echo __('Operator'); ?></td>
737 <td width="102"><select name="hrel_opt
" id="hrel_opt
">
738 <option value="--" selected="selected
"> -- </option>
739 <option value="="> = </option>
740 <option value=">
;"> > </option>
741 <option value="<
;"> < </option>
742 <option value=">
;="> >= </option>
743 <option value="<
;="> <= </option>
744 <option value="NOT
"> NOT </option>
745 <option value="IN
"> IN </option>
746 <option value="EXCEPT
"> <?php echo __('Except'); ?> </option>
747 <option value="NOT IN
"> NOT IN </option>
752 <td class="nowrap
"><?php echo __('Value'); ?>/<br /><?php echo __('subquery'); ?></td>
753 <td><textarea id="hQuery
" value="" cols="18"></textarea>
759 <td colspan="2" class="center nowrap
">
760 <input type="button
" class="butt
" name="Button
"
761 value="<?php
echo __('OK'); ?
>" onclick="edit('Having')" />
762 <input type="button
" class="butt
" name="Button
"
763 value="<?php
echo __('Cancel'); ?
>"
764 onclick="document
.getElementById('query_having').style
.display
= 'none';" />
770 <td class="frams6
"></td>
773 <td class="frams4
"><div class="bor
"></div></td>
774 <td class="frams7
"></td>
775 <td class="frams3
"></td>
780 <table id="query_Aggregate
" style="display
:none
;"
781 width="5%
" cellpadding="0" cellspacing="0">
784 <td class="frams1
" width="10px
"></td>
785 <td class="frams5
" width="99%
" ></td>
786 <td class="frams2
" width="10px
"><div class="bor
"></div></td>
789 <td class="frams8
"></td>
790 <td class="input_tab
">
791 <table width="168" class="center
" cellpadding="2" cellspacing="0">
794 <td colspan="2" class="center nowrap
">
795 <strong><?php echo __('Aggregate'); ?></strong>
801 <td width="58" class="nowrap
"><?php echo __('Operator'); ?></td>
803 <select name="operator
" id="e_operator
">
804 <option value="---" selected="selected
">---</option>
805 <option value="sum
" > SUM </option>
806 <option value="min
"> MIN </option>
807 <option value="max
"> MAX </option>
808 <option value="avg
"> AVG </option>
809 <option value="avg
"> COUNT </option>
815 <td colspan="2" class="center nowrap
">
816 <input type="button
" class="butt
" name="Button
"
817 value="<?php
echo __('OK'); ?
>" onclick="edit('Aggregate')" />
818 <input type="button
" class="butt
" name="Button
"
819 value="<?php
echo __('Cancel'); ?
>"
820 onclick="document
.getElementById('query_Aggregate').style
.display
= 'none';" />
826 <td class="frams6
"></td>
829 <td class="frams4
"><div class="bor
"></div></td>
830 <td class="frams7
"></td>
831 <td class="frams3
"></td>
836 <table id="query_where
" style="display
:none
;"
837 width="5%
" cellpadding="0" cellspacing="0">
840 <td class="frams1
" width="10px
"></td>
841 <td class="frams5
" width="99%
" ></td>
842 <td class="frams2
" width="10px
"><div class="bor
"></div></td>
845 <td class="frams8
"></td>
846 <td class="input_tab
">
847 <table width="168" class="center
" cellpadding="2" cellspacing="0">
850 <td colspan="2" class="center nowrap
"><strong>WHERE</strong></td>
853 <tbody id="rename_to
">
855 <td width="58" class="nowrap
"><?php echo __('Operator'); ?></td>
856 <td width="102"><select name="erel_opt
" id="erel_opt
">
857 <option value="--" selected="selected
"> -- </option>
858 <option value="=" > = </option>
859 <option value=">
;"> > </option>
860 <option value="<
;"> < </option>
861 <option value=">
;="> >= </option>
862 <option value="<
;="> <= </option>
863 <option value="NOT
"> NOT </option>
864 <option value="IN
"> IN </option>
865 <option value="EXCEPT
"> <?php echo __('Except'); ?> </option>
866 <option value="NOT IN
"> NOT IN </option>
871 <td class="nowrap
"><?php echo __('Value'); ?>/<br /><?php echo __('subquery'); ?></td>
872 <td><textarea id="eQuery
" value="" cols="18"></textarea>
878 <td colspan="2" class="center nowrap
">
879 <input type="button
" class="butt
" name="Button
"
880 value="<?php
echo __('OK'); ?
>" onclick="edit('Where')" />
881 <input type="button
" class="butt
" name="Button
"
882 value="<?php
echo __('Cancel'); ?
>"
883 onclick="document
.getElementById('query_where').style
.display
= 'none';" />
889 <td class="frams6
"></td>
892 <td class="frams4
"><div class="bor
"></div></td>
893 <td class="frams7
"></td>
894 <td class="frams3
"></td>
900 if (! empty($_REQUEST['query'])) {
901 echo '<div class="panel
">';
902 echo '<div style="clear
:both
;"></div>';
903 echo '<div id="ab
"></div>';
904 echo '<div style="clear
:both
;"></div>';
906 echo '<a class="trigger
" href="#">' . __('Active options') . '</a>';
907 echo '<div id="filter"></div>';
908 echo '<div id="box">';
909 echo '<span id="boxtitle"></span>';
910 echo '<form method="post" action="db_qbe.php">';
911 echo '<textarea cols="80" name="sql_query" id="textSqlquery"'
912 . ' rows="15"></textarea><div id="tblfooter">';
913 echo ' <input type="submit" name="submit_sql" class="btn" />';
914 echo ' <input type="button" name="cancel" value="'
915 . __('Cancel') . '" onclick="closebox()" class="btn" />';
916 echo PMA_URL_getHiddenInputs($_GET['db']);
918 echo '</form></div>';
923 <!-- cache images
-->
926 . $_SESSION['PMA_Theme']->getImgPath('pmd/2leftarrow_m.png')
927 . '" width="0" height="0" alt="" />'
929 . $_SESSION['PMA_Theme']->getImgPath('pmd/rightarrow1.png')
930 . '" width="0" height="0" alt="" />'
932 . $_SESSION['PMA_Theme']->getImgPath('pmd/rightarrow2.png')
933 . '" width="0" height="0" alt="" />'
935 . $_SESSION['PMA_Theme']->getImgPath('pmd/uparrow2_m.png')
936 . '" width="0" height="0" alt="" />'
937 . '<div id="PMA_disable_floating_menubar"></div>';