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 = 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']);
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 PDF 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];
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;
246 echo isset($tab_pos[$t_n]) ? $tab_pos[$t_n]["X
"] : rand(20, 700); ?>px;
248 echo isset($tab_pos[$t_n]) ? $tab_pos[$t_n]["Y
"] : rand(20, 550); ?>px;
250 echo ! isset($tab_pos[$t_n]) || $tab_pos[$t_n]["H
"]
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"])) {
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 )?>)">
288 echo $GLOBALS['PMD_OUT']["OWNER"][$i];
290 echo $GLOBALS['PMD_OUT']["TABLE_NAME_SMALL"][$i];
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)">';
304 <tbody id
="id_tbody_<?php echo $t_n_url ?>"
306 if (isset($tab_pos[$t_n]) && empty($tab_pos[$t_n]["V"])) {
307 echo 'style="display: none;"';
310 $display_field = PMA_getDisplayField(
312 $GLOBALS['PMD']["TABLE_NAME_SMALL"][$i]
315 $j = 0, $id_cnt = count($tab_column[$t_n]["COLUMN_ID"]);
321 echo $GLOBALS['PMD_URL']["TABLE_NAME_SMALL
"][$i] . '.'
322 . 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 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);
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);
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]) ?
>">
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
"
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')
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')
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')
388 echo htmlspecialchars(
389 $tab_column[$t_n]["COLUMN_NAME
"][$j] . " : "
390 . $tab_column[$t_n]["TYPE
"][$j],
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].'\'
)" >';
404 . $_SESSION['PMA_Theme
']->getImgPath('pmd
/exec_small
.png
')
405 . '" title="options
" alt="" /></td> ';
409 echo "</tbody
>\n</table
>\n";
414 <div id="pmd_hint
"></div>
416 <table id="layer_new_relation
" style="display
:none
;"
417 width="5%
" cellpadding="0" cellspacing="0">
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>
425 <td class="frams8
"></td>
426 <td class="input_tab
">
427 <table width="168" class="center
" cellpadding="2" cellspacing="0">
430 <td colspan="2" class="center nowrap
">
431 <strong><?php echo __('Create relation'); ?></strong>
435 <tbody id="foreign_relation
">
437 <td colspan="2" class="center nowrap
"><strong>FOREIGN KEY</strong></td>
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>
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>
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';" />
475 <td class="frams6
"></td>
478 <td class="frams4
"><div class="bor
"></div></td>
479 <td class="frams7
"></td>
480 <td class="frams3
"></td>
485 <table id="layer_upd_relation
" style="display
:none
;"
486 width="5%
" cellpadding="0" cellspacing="0">
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>
494 <td class="frams8
"></td>
495 <td class="input_tab
">
496 <table width="100%
" class="center
" cellpadding="2" cellspacing="0">
498 <td colspan="3" class="center nowrap
">
499 <strong><?php echo __('Delete relation'); ?></strong>
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();" />
512 <td class="frams6
"></td>
515 <td class="frams4
"><div class="bor
"></div></td>
516 <td class="frams7
"></td>
517 <td class="frams3
"></td>
522 <table id="pmd_optionse
" style="display
:none
;"
523 width="5%
" cellpadding="0" cellspacing="0">
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>
531 <td class="frams8
"></td>
532 <td class="input_tab
">
533 <table width="168" class="center
" cellpadding="2" cellspacing="0">
536 <td colspan="2" rowspan="2" id="option_col_name
"
537 class="center nowrap
">
542 <tr><td class="center nowrap
"><b>WHERE</b></td></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=">
;"> > </option>
549 <option value="<
;"> < </option>
550 <option value=">
;="> >= </option>
551 <option value="<
;="> <= </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>
560 <td class="nowrap
"><?php echo __('Value'); ?>/<br /><?php echo __('subquery'); ?></td>
561 <td><textarea id="Query
" value="" cols="18"></textarea>
564 <tr><td class="center nowrap
"><b><?php echo __('Rename to'); ?></b></td></tr>
566 <td width="58" class="nowrap
"><?php echo __('New name'); ?></td>
567 <td width="102"><input type="text
" value="" id="new_name
"/></td>
569 <tr><td class="center nowrap
"><b><?php echo __('Aggregate'); ?></b></td></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>
582 <td width="58" class="center nowrap
"><b>GROUP BY</b></td>
583 <td><input type="checkbox
" value="groupby
" id="groupby
"/></td>
586 <td width="58" class="center nowrap
"><b>ORDER BY</b></td>
587 <td><input type="checkbox
" value="orderby
" id="orderby
"/></td>
589 <tr><td class="center nowrap
"><b>HAVING</b></td></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>
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=">
;"> > </option>
608 <option value="<
;"> < </option>
609 <option value=">
;="> >= </option>
610 <option value="<
;="> <= </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>
619 <td width="58" class="nowrap
">
620 <?php echo __('Value'); ?>/<br/>
621 <?php echo __('subquery'); ?>
624 <textarea id="having
" value="" cols="18"></textarea>
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()" />
641 <td class="frams6
"></td>
644 <td class="frams4
"><div class="bor
"></div></td>
645 <td class="frams7
"></td>
646 <td class="frams3
"></td>
651 <table id="query_rename_to
" style="display
:none
;"
652 width="5%
" cellpadding="0" cellspacing="0">
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>
660 <td class="frams8
"></td>
661 <td class="input_tab
">
662 <table width="168" class="center
" cellpadding="2" cellspacing="0">
665 <td colspan="2" class="center nowrap
">
666 <strong><?php echo __('Rename to'); ?></strong>
670 <tbody id="rename_to
">
672 <td width="58" class="nowrap
"><?php echo __('New name'); ?></td>
674 <input type="text
" value="" id="e_rename
"/>
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';" />
691 <td class="frams6
"></td>
694 <td class="frams4
"><div class="bor
"></div></td>
695 <td class="frams7
"></td>
696 <td class="frams3
"></td>
701 <table id="query_having
" style="display
:none
;"
702 width="5%
" cellpadding="0" cellspacing="0">
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>
710 <td class="frams8
"></td>
711 <td class="input_tab
">
712 <table width="168" class="center
" cellpadding="2" cellspacing="0">
715 <td colspan="2" class="center nowrap
"><strong>HAVING</strong></td>
718 <tbody id="rename_to
">
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>
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=">
;"> > </option>
738 <option value="<
;"> < </option>
739 <option value=">
;="> >= </option>
740 <option value="<
;="> <= </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>
749 <td class="nowrap
"><?php echo __('Value'); ?>/<br /><?php echo __('subquery'); ?></td>
750 <td><textarea id="hQuery
" value="" cols="18"></textarea>
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';" />
767 <td class="frams6
"></td>
770 <td class="frams4
"><div class="bor
"></div></td>
771 <td class="frams7
"></td>
772 <td class="frams3
"></td>
777 <table id="query_Aggregate
" style="display
:none
;"
778 width="5%
" cellpadding="0" cellspacing="0">
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>
786 <td class="frams8
"></td>
787 <td class="input_tab
">
788 <table width="168" class="center
" cellpadding="2" cellspacing="0">
791 <td colspan="2" class="center nowrap
">
792 <strong><?php echo __('Aggregate'); ?></strong>
798 <td width="58" class="nowrap
"><?php echo __('Operator'); ?></td>
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>
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';" />
823 <td class="frams6
"></td>
826 <td class="frams4
"><div class="bor
"></div></td>
827 <td class="frams7
"></td>
828 <td class="frams3
"></td>
833 <table id="query_where
" style="display
:none
;"
834 width="5%
" cellpadding="0" cellspacing="0">
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>
842 <td class="frams8
"></td>
843 <td class="input_tab
">
844 <table width="168" class="center
" cellpadding="2" cellspacing="0">
847 <td colspan="2" class="center nowrap
"><strong>WHERE</strong></td>
850 <tbody id="rename_to
">
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=">
;"> > </option>
857 <option value="<
;"> < </option>
858 <option value=">
;="> >= </option>
859 <option value="<
;="> <= </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>
868 <td class="nowrap
"><?php echo __('Value'); ?>/<br /><?php echo __('subquery'); ?></td>
869 <td><textarea id="eQuery
" value="" cols="18"></textarea>
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';" />
886 <td class="frams6
"></td>
889 <td class="frams4
"><div class="bor
"></div></td>
890 <td class="frams7
"></td>
891 <td class="frams3
"></td>
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>';
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']);
915 echo '</form></div>';
920 <!-- cache images
-->
923 . $_SESSION['PMA_Theme']->getImgPath('pmd/2leftarrow_m.png')
924 . '" width="0" height="0" alt="" />'
926 . $_SESSION['PMA_Theme']->getImgPath('pmd/rightarrow1.png')
927 . '" width="0" height="0" alt="" />'
929 . $_SESSION['PMA_Theme']->getImgPath('pmd/rightarrow2.png')
930 . '" width="0" height="0" alt="" />'
932 . $_SESSION['PMA_Theme']->getImgPath('pmd/uparrow2_m.png')
933 . '" width="0" height="0" alt="" />'
934 . '<div id="PMA_disable_floating_menubar"></div>';