2 /* vim: set expandtab sw=4 ts=4 sts=4: */
4 * @package PhpMyAdmin-Designer
10 require_once './libraries/pmd_common.php';
11 require './libraries/db_common.inc.php';
12 require './libraries/db_info.inc.php';
14 $tab_column = get_tab_info();
15 $script_tabs = get_script_tabs();
16 $script_contr = get_script_contr();
17 $tab_pos = get_tab_pos();
18 $tables_pk_or_unique_keys = get_pk_or_unique_keys();
19 $tables_all_keys = get_all_keys();
21 $params = array('lang' => $GLOBALS['lang']);
22 if (isset($GLOBALS['db'])) {
23 $params['db'] = $GLOBALS['db'];
25 require_once './libraries/header_scripts.inc.php';
27 <script type
="text/javascript">
31 var server = "' . PMA_escapeJsString($server) . '";
32 var db = "' . PMA_escapeJsString($db) . '";
33 var token = "' . PMA_escapeJsString($token) . '";';
35 if (isset($_REQUEST['query'])) {
37 $(document).ready(function() {
38 $(".trigger").click(function() {
39 $(".panel").toggle("fast");
40 $(this).toggleClass("active");
48 <script src
="js/pmd/ajax.js" type
="text/javascript"></script
>
49 <script src
="js/pmd/history.js" type
="text/javascript"></script
>
50 <script src
="js/pmd/move.js" type
="text/javascript"></script
>
52 <script src
="js/pmd/iecanvas.js" type
="text/javascript"></script
>
55 echo $script_tabs . $script_contr . $script_display_field;
59 <body onload
="Main()" class="general_body" id
="pmd_body">
61 <div
class="pmd_header" id
="top_menu">
63 onclick
="Show_left_menu(document.getElementById('key_Show_left_menu')); return false" class="M_butt first" target
="_self">
64 <img id
='key_Show_left_menu' title
="<?php echo __('Show/Hide left menu'); ?>"
65 alt
="v" src
="<?php echo $GLOBALS['pmaThemeImage'] ?>pmd/downarrow2_m.png" /></a
>
66 <a href
="#" onclick
="Save2(); return false"
67 class="M_butt" target
="_self"
68 ><img title
="<?php echo __('Save position') ?>" src
="<?php echo $GLOBALS['pmaThemeImage'] ?>pmd/save.png" alt
=""
69 /></a
><a href
="#" onclick
="Start_table_new(); return false"
70 class="M_butt" target
="_self"
71 ><img title
="<?php echo __('Create table')?>" src
="<?php echo $GLOBALS['pmaThemeImage'] ?>pmd/table.png" alt
=""
72 /></a
><a href
="#" onclick
="Start_relation(); return false"
73 class="M_butt" id
="rel_button" target
="_self"
74 ><img title
="<?php echo __('Create relation') ?>" src
="<?php echo $GLOBALS['pmaThemeImage'] ?>pmd/relation.png" alt
=""
75 /></a
><a href
="#" onclick
="Start_display_field(); return false"
76 class="M_butt" id
="display_field_button" target
="_self"
77 ><img title
="<?php echo __('Choose column to display') ?>" src
="<?php echo $GLOBALS['pmaThemeImage'] ?>pmd/display_field.png" alt
=""
78 /></a
><a href
="#" onclick
="location.reload(); return false"
79 class="M_butt" target
="_self"
80 ><img title
="<?php echo __('Reload'); ?>" src
="<?php echo $GLOBALS['pmaThemeImage'] ?>pmd/reload.png" alt
=""
81 /></a
><a href
="Documentation.html#faq6_31" target
="documentation"
82 class="M_butt" target
="_self"
83 ><img title
="<?php echo __('Help'); ?>" src
="<?php echo $GLOBALS['pmaThemeImage'] ?>pmd/help.png" alt
=""
84 /></a
><img
class="M_bord" src
="<?php echo $GLOBALS['pmaThemeImage'] ?>pmd/bord.png" alt
=""
85 /><a href
="#" onclick
="Angular_direct(); return false"
86 class="M_butt" id
="angular_direct_button" target
="_self"
87 ><img title
="<?php echo __('Angular links') . ' / ' . __('Direct links'); ?>"
88 src
="<?php echo $GLOBALS['pmaThemeImage'] ?>pmd/ang_direct.png" alt
=""
89 /></a
><a href
="#" onclick
="Grid(); return false"
90 class="M_butt" id
="grid_button" target
="_self"
91 ><img title
="<?php echo __('Snap to grid') ?>" src
="<?php echo $GLOBALS['pmaThemeImage'] ?>pmd/grid.png" alt
=""
92 /></a
><img
class="M_bord" src
="<?php echo $GLOBALS['pmaThemeImage'] ?>pmd/bord.png" alt
=""
94 onclick
="Small_tab_all(document.getElementById('key_SB_all')); return false" class="M_butt" target
="_self"
95 ><img id
='key_SB_all' title
="<?php echo __('Small/Big All'); ?>" alt
="v"
96 src
="<?php echo $GLOBALS['pmaThemeImage'] ?>pmd/downarrow1.png"
98 <a href
="#" onclick
="Small_tab_invert(); return false" class="M_butt" target
="_self" ><img title
="<?php echo __('Toggle small/big'); ?>" alt
="key" src
="<?php echo $GLOBALS['pmaThemeImage'] ?>pmd/bottom.png" /></a
>
99 <a href
="#" onclick
="Relation_lines_invert(); return false" class="M_butt" target
="_self" ><img title
="<?php echo __('Toggle relation lines'); ?>" alt
="key" src
="<?php echo $GLOBALS['pmaThemeImage'] ?>pmd/toggle_lines.png" /></a
>
100 <img
class="M_bord" src
="<?php echo $GLOBALS['pmaThemeImage'] ?>pmd/bord.png" alt
="" />
101 <a href
="#" onclick
="PDF_save(); return false"
102 class="M_butt" target
="_self"
103 ><img src
="<?php echo $GLOBALS['pmaThemeImage'] ?>pmd/pdf.png" alt
="key" width
="20" height
="20"
104 title
="<?php echo __('Import/Export coordinates for PDF schema'); ?>" /></a
106 <?php
if (isset($_REQUEST['query'])) {
107 echo '<a href="#" onclick="build_query(\'SQL Query on Database\', 0)" onmousedown="return false;"
108 class="M_butt" target="_self">';
109 echo '<img src="'. $GLOBALS['pmaThemeImage'] . 'pmd/query_builder.png" alt="key" width="20" height="20" title="';
110 echo __('Build Query');
113 onclick
="Top_menu_right(document.getElementById('key_Left_Right')); return false" class="M_butt last" target
="_self">
114 <img src
="<?php echo $GLOBALS['pmaThemeImage'] ?>pmd/2rightarrow_m.png" id
="key_Left_Right" alt
=">"
115 title
="<?php echo __('Move Menu'); ?>" /></a
>
118 <form action
="" method
="post" name
="form1">
120 <canvas
class="pmd" id
="canvas" width
="100" height
="100" onclick
="Canvas_click(this)"></canvas
>
122 <div id
="layer_menu" style
="display:none;">
123 <div align
="center" style
="padding-top:5px;">
125 onclick
="Hide_tab_all(document.getElementById('key_HS_all')); return false" class="M_butt" target
="_self">
126 <img title
="<?php echo __('Hide/Show all'); ?>" alt
="v"
127 src
="<?php echo $GLOBALS['pmaThemeImage'] ?>pmd/downarrow1.png" id
='key_HS_all' /></a
>
129 onclick
="No_have_constr(document.getElementById('key_HS')); return false" class="M_butt" target
="_self">
130 <img title
="<?php echo __('Hide/Show Tables with no relation'); ?>" alt
="v"
131 src
="<?php echo $GLOBALS['pmaThemeImage'] ?>pmd/downarrow2.png" id
='key_HS' /></a
>
134 <div id
="id_scroll_tab" class="scroll_tab">
135 <table width
="100%" style
="padding-left: 3px;">
137 $name_cnt = count($GLOBALS['PMD']['TABLE_NAME']);
138 for ($i = 0; $i < $name_cnt; $i++
) {
140 <tr
><td title
="<?php echo __('Structure'); ?>" width
="1px"
141 onmouseover
="this.className='L_butt2_2'"
142 onmouseout
="this.className='L_butt2_1'">
143 <img onclick
="Start_tab_upd('<?php echo $GLOBALS['PMD_URL']["TABLE_NAME_SMALL
"][$i]; ?>');"
144 src
="<?php echo $GLOBALS['pmaThemeImage'] ?>pmd/exec.png" alt
="" /></td
>
146 <input onclick
="VisibleTab(this,'<?php echo $GLOBALS['PMD_URL']["TABLE_NAME
"][$i]; ?>')"
147 title
="<?php echo __('Hide'); ?>"
148 id
="check_vis_<?php echo $GLOBALS['PMD_URL']["TABLE_NAME
"][$i]; ?>"
149 style
="margin:0px;" type
="checkbox"
150 value
="<?php echo $GLOBALS['PMD_URL']["TABLE_NAME
"][$i]; ?>"
152 if (isset($tab_pos[$GLOBALS['PMD']["TABLE_NAME"][$i]])) {
153 echo $tab_pos[$GLOBALS['PMD']["TABLE_NAME"][$i]]["H"] ?
'checked="checked"' : '';
155 echo 'checked="checked"';
158 <td
class="pmd_Tabs" onmouseover
="this.className='pmd_Tabs2'"
159 onmouseout
="this.className='pmd_Tabs'"
160 onclick
="Select_tab('<?php echo $GLOBALS['PMD_URL']["TABLE_NAME
"][$i]; ?>');">
161 <?php
echo $GLOBALS['PMD_OUT']["TABLE_NAME"][$i]; ?
></td
>
170 <?php
echo __('Number of tables') . ': ' . $name_cnt; ?
>
173 <div id
="layer_menu_sizer" onmousedown
="layer_menu_cur_click=1">
180 for ($i = 0; $i < count($GLOBALS['PMD']["TABLE_NAME"]); $i++
) {
181 $t_n = $GLOBALS['PMD']["TABLE_NAME"][$i];
182 $t_n_url = $GLOBALS['PMD_URL']["TABLE_NAME"][$i];
185 <input name
="t_x[<?php echo $t_n_url ?>]" type
="hidden" id
="t_x_<?php echo $t_n_url ?>_" />
186 <input name
="t_y[<?php echo $t_n_url ?>]" type
="hidden" id
="t_y_<?php echo $t_n_url ?>_" />
187 <input name
="t_v[<?php echo $t_n_url ?>]" type
="hidden" id
="t_v_<?php echo $t_n_url ?>_" />
188 <input name
="t_h[<?php echo $t_n_url ?>]" type
="hidden" id
="t_h_<?php echo $t_n_url ?>_" />
190 <table id
="<?php echo $t_n_url ?>" cellpadding
="0" cellspacing
="0" class="pmd_tab"
191 style
="position: absolute;
192 left: <?php if (isset($tab_pos[$t_n])) echo $tab_pos[$t_n]["X
"]; else echo rand(180, 800); ?>px;
193 top: <?php if (isset($tab_pos[$t_n])) echo $tab_pos[$t_n]["Y
"]; else echo rand(30, 500); ?>px;
194 visibility: <?php if (isset($tab_pos[$t_n])) echo $tab_pos[$t_n]["H
"] ? "visible
" : "hidden
"; ?>;
199 if (isset($_REQUEST['query'])) {
200 echo '<td class="select_all">';
201 echo '<input type="checkbox" value="select_all_'.htmlspecialchars($t_n_url).'" style="margin: 0px;" ';
202 echo 'id="select_all_'.htmlspecialchars($t_n_url).'" title="select all" ';
203 echo 'onclick="Select_all(\''. htmlspecialchars($t_n_url) .'\',\''.htmlspecialchars($GLOBALS['PMD_OUT']["OWNER"][$i]).'\')"></td>';
205 <td
class="small_tab" onmouseover
="this.className='small_tab2';"
206 onmouseout
="this.className='small_tab';"
207 id
="id_hide_tbody_<?php echo $t_n_url ?>"
208 onclick
="Small_tab('<?php echo $t_n_url ?>', 1)"><?php
209 // no space alloawd here, between tags and content !!!
210 // JavaScript function does require this
211 if (! isset($tab_pos[$t_n]) ||
! empty($tab_pos[$t_n]["V"])) {
217 <td
class="small_tab_pref" onmouseover
="this.className='small_tab_pref2';"
218 onmouseout
="this.className='small_tab_pref';"
219 onclick
="Start_tab_upd('<?php echo $GLOBALS['PMD_URL']["TABLE_NAME_SMALL
"][$i]; ?>');">
220 <img src
="<?php echo $GLOBALS['pmaThemeImage'] ?>pmd/exec_small.png" alt
="" /></td
>
221 <td nowrap
="nowrap" id
="id_zag_<?php echo $t_n_url ?>" class="tab_zag"
222 onmousedown
="cur_click=document.getElementById('<?php echo $t_n_url ?>');"/
223 onmouseover
="Table_onover('<?php echo $t_n_url ?>',0,<?php echo (isset($_REQUEST['query'])? 1 : 0 )?> )"
224 onmouseout
="Table_onover('<?php echo $t_n_url ?>',1,<?php echo (isset($_REQUEST['query']) ? 1 : 0 )?>)">
227 echo $GLOBALS['PMD_OUT']["OWNER"][$i];
229 echo $GLOBALS['PMD_OUT']["TABLE_NAME_SMALL"][$i];
232 if (isset($_REQUEST['query'])) {
233 echo '<td class="tab_zag" onmouseover="Table_onover(\''.htmlspecialchars($t_n_url).'\',0,1)" id="id_zag_'.htmlspecialchars($t_n_url).'_2"';
234 echo 'onmousedown="cur_click=document.getElementById(\''.htmlspecialchars($t_n_url).'\');"';
235 echo 'onmouseout="Table_onover(\''.htmlspecialchars($t_n_url).'\',1,1)">';
239 <tbody id
="id_tbody_<?php echo $t_n_url ?>"
241 if (isset($tab_pos[$t_n]) && empty($tab_pos[$t_n]["V"])) {
242 echo 'style="display: none;"';
245 $display_field = PMA_getDisplayField($db, $GLOBALS['PMD']["TABLE_NAME_SMALL"][$i]);
246 for ($j = 0, $id_cnt = count($tab_column[$t_n]["COLUMN_ID"]); $j < $id_cnt; $j++
) {
249 echo $GLOBALS['PMD_URL']["TABLE_NAME_SMALL
"][$i] . '.'
250 . urlencode($tab_column[$t_n]["COLUMN_NAME
"][$j]) ?>"
252 if ($display_field == $tab_column[$t_n]["COLUMN_NAME"][$j]) {
253 echo ' class="tab_field_3" ';
255 echo ' class="tab_field" ';
258 onmouseover
="old_class = this.className; this.className = 'tab_field_2';"
259 onmouseout
="this.className = old_class;"
260 onmousedown
="Click_field('<?php
261 echo $GLOBALS['PMD_URL']["TABLE_NAME_SMALL
"][$i]."','".urlencode($tab_column[$t_n]["COLUMN_NAME
"][$j])."',";
262 if (! PMA_foreignkey_supported($GLOBALS['PMD
']['TABLE_TYPE
'][$i])) {
263 echo (isset($tables_pk_or_unique_keys[$t_n . "." . $tab_column[$t_n]["COLUMN_NAME"][$j]]) ? 1 : 0);
265 // if foreign keys are supported, it's not necessary that the
266 // index is a primary key
267 echo (isset($tables_all_keys[$t_n.".".$tab_column[$t_n]["COLUMN_NAME"][$j]]) ?
1 : 0);
271 if (isset($_REQUEST['query'])) {
272 echo '<td class="select_all
">';
273 echo '<input value="'.htmlspecialchars($t_n_url).urlencode($tab_column[$t_n]["COLUMN_NAME"][$j]).'"';
274 echo 'type="checkbox
" id="select_
'.htmlspecialchars($t_n_url).'._
'.urlencode($tab_column[$t_n]["COLUMN_NAME"][$j]).'" ';
275 echo 'style="margin
: 0px
;" title="select_
'.urlencode($tab_column[$t_n]["COLUMN_NAME"][$j]).'" ';
276 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>';
278 <td width="10px
" colspan="3"
279 id="<?php
echo $t_n_url.".".urlencode($tab_column[$t_n]["COLUMN_NAME"][$j]) ?
>">
280 <div style="white
-space
:nowrap
">
282 if (isset($tables_pk_or_unique_keys[$t_n.".".$tab_column[$t_n]["COLUMN_NAME
"][$j]])) {
284 <img src="<?php
echo $_SESSION['PMA_Theme']->getImgPath(); ?
>pmd
/FieldKey_small
.png
"
289 <img src="<?php
echo $_SESSION['PMA_Theme']->getImgPath(); ?
>pmd
/Field_small
<?php
290 if (strstr($tab_column[$t_n]["TYPE"][$j], 'char')
291 ||
strstr($tab_column[$t_n]["TYPE"][$j], 'text')) {
293 } elseif (strstr($tab_column[$t_n]["TYPE"][$j], 'int')
294 ||
strstr($tab_column[$t_n]["TYPE"][$j], 'float')
295 ||
strstr($tab_column[$t_n]["TYPE"][$j], 'double')
296 ||
strstr($tab_column[$t_n]["TYPE"][$j], 'decimal')) {
298 } elseif (strstr($tab_column[$t_n]["TYPE"][$j], 'date')
299 ||
strstr($tab_column[$t_n]["TYPE"][$j], 'time')
300 ||
strstr($tab_column[$t_n]["TYPE"][$j], 'year')) {
306 echo htmlspecialchars($tab_column[$t_n]["COLUMN_NAME
"][$j]
307 . " : " . $tab_column[$t_n]["TYPE
"][$j], ENT_QUOTES);
312 if (isset($_REQUEST['query'])) {
313 //$temp = $GLOBALS['PMD_OUT']["OWNER
"][$i].'.'.$GLOBALS['PMD_OUT']["TABLE_NAME_SMALL
"][$i];
314 echo '<td class="small_tab_pref
" onmouseover="this
.className
=\'small_tab_pref2\'
;"';
315 echo 'onmouseout="this
.className
=\'small_tab_pref\'
;"';
316 echo 'onclick="Click_option(\'pmd_optionse\'
,\''.urlencode($tab_column[$t_n]["COLUMN_NAME"][$j]).'\'
,\''.$GLOBALS['PMD_OUT
']["TABLE_NAME_SMALL"][$i].'\'
)" >';
317 echo '<img src="' . $GLOBALS['pmaThemeImage
'] . 'pmd
/exec_small
.png
" title="options
" alt="" /></td> ';
329 <div id="pmd_hint
"></div>
330 <div id='layer_action' style="display
:none
;">Load...</div>
332 <table id="layer_new_relation
" style="display
:none
;"
333 width="5%
" border="0" cellpadding="0" cellspacing="0">
336 <td class="frams1
" width="10px
"></td>
337 <td class="frams5
" width="99%
" ></td>
338 <td class="frams2
" width="10px
"><div class="bor
"></div></td>
341 <td class="frams8
"></td>
342 <td class="input_tab
">
343 <table width="168" border="0" align="center
" cellpadding="2" cellspacing="0">
346 <td colspan="2" align="center
" nowrap="nowrap
"><strong><?php echo __('Create relation'); ?></strong></td>
349 <tbody id="foreign_relation
">
351 <td colspan="2" align="center
" nowrap="nowrap
"><strong>FOREIGN KEY</strong></td>
354 <td width="58" nowrap="nowrap
">on delete</td>
355 <td width="102"><select name="on_delete
" id="on_delete
">
356 <option value="nix
" selected="selected
">--</option>
357 <option value="CASCADE
">CASCADE</option>
358 <option value="SET
NULL">SET NULL</option>
359 <option value="NO ACTION
">NO ACTION</option>
360 <option value="RESTRICT
">RESTRICT</option>
365 <td nowrap="nowrap
">on update</td>
366 <td><select name="on_update
" id="on_update
">
367 <option value="nix
" selected="selected
">--</option>
368 <option value="CASCADE
">CASCADE</option>
369 <option value="SET
NULL">SET NULL</option>
370 <option value="NO ACTION
">NO ACTION</option>
371 <option value="RESTRICT
">RESTRICT</option>
378 <td colspan="2" align="center
" nowrap="nowrap
">
379 <input type="button
" class="butt
" name="Button
"
380 value="<?php
echo __('OK'); ?
>" onclick="New_relation()" />
381 <input type="button
" class="butt
" name="Button
"
382 value="<?php
echo __('Cancel'); ?
>"
383 onclick="document
.getElementById('layer_new_relation').style
.display
= 'none';" />
389 <td class="frams6
"></td>
392 <td class="frams4
"><div class="bor
"></div></td>
393 <td class="frams7
"></td>
394 <td class="frams3
"></td>
399 <table id="layer_upd_relation
" style="display
:none
;"
400 width="5%
" border="0" cellpadding="0" cellspacing="0">
403 <td class="frams1
" width="10px
"></td>
404 <td class="frams5
" width="99%
"></td>
405 <td class="frams2
" width="10px
"><div class="bor
"></div></td>
408 <td class="frams8
"></td>
409 <td class="input_tab
">
410 <table width="100%
" border="0" align="center
" cellpadding="2" cellspacing="0">
412 <td colspan="3" align="center
" nowrap="nowrap
"><strong><?php echo __('Delete relation'); ?></strong></td>
415 <td colspan="3" align="center
" nowrap="nowrap
">
416 <input name="Button
" type="button
" class="butt
"
417 onclick="Upd_relation()" value="<?php
echo __('Delete'); ?
>" />
418 <input type="button
" class="butt
" name="Button
"
419 value="<?php
echo __('Cancel'); ?
>"
420 onclick="document
.getElementById('layer_upd_relation').style
.display
= 'none'; Re_load();" />
424 <td class="frams6
"></td>
427 <td class="frams4
"><div class="bor
"></div></td>
428 <td class="frams7
"></td>
429 <td class="frams3
"></td>
434 <table id="pmd_optionse
" style="display
:none
;"
435 width="5%
" border="0" cellpadding="0" cellspacing="0">
438 <td class="frams1
" width="10px
"></td>
439 <td class="frams5
" width="99%
" ></td>
440 <td class="frams2
" width="10px
"><div class="bor
"></div></td>
443 <td class="frams8
"></td>
444 <td class="input_tab
">
445 <table width="168" border="0" align="center
" cellpadding="2" cellspacing="0">
448 <td colspan="2" rowspan="2" id="option_col_name
" nowrap="nowrap
" align="center
"></td>
452 <tr><td align="center
" nowrap="nowrap
"><b>WHERE</b></td></tr>
454 <td width="58" nowrap="nowrap
"><?php echo __('Relation operator'); ?></td>
455 <td width="102"><select name="rel_opt
" id="rel_opt
">
456 <option value="--" selected="selected
"> -- </option>
457 <option value="=" > = </option>
458 <option value=">"> > </option>
459 <option value="<"> < </option>
460 <option value=">="> >= </option>
461 <option value="<="> <= </option>
462 <option value="NOT
"> NOT </option>
463 <option value="IN
"> IN </option>
464 <option value="EXCEPT
"> <?php echo __('Except'); ?> </option>
465 <option value="NOT IN
"> NOT IN </option>
470 <td nowrap="nowrap
"><?php echo __('Value'); ?>/<br /><?php echo __('subquery'); ?></td>
471 <td><textarea id="Query
" value="" cols="18"></textarea>
474 <tr><td align="center
" nowrap="nowrap
"><b><?php echo __('Rename to'); ?></b></td></tr>
476 <td width="58" nowrap="nowrap
"><?php echo __('New name'); ?></td>
477 <td width="102"><input type="text
" value="" id="new_name
"/></td>
479 <tr><td align="center
" nowrap="nowrap
"><b><?php echo __('Aggregate'); ?></b></td></tr>
481 <td width="58" nowrap="nowrap
"><?php echo __('Operator'); ?></td>
482 <td width="102"><select name="operator
" id="operator
">
483 <option value="---" selected="selected
">---</option>
484 <option value="sum
" > SUM </option>
485 <option value="min
"> MIN </option>
486 <option value="max
"> MAX </option>
487 <option value="avg
"> AVG </option>
488 <option value="count
"> COUNT </option>
492 <td nowrap="nowrap
" width="58" align="center
"><b>GROUP BY</b></td>
493 <td><input type="checkbox
" value="groupby
" id="groupby
"/></td>
496 <td nowrap="nowrap
" width="58" align="center
"><b>ORDER BY</b></td>
497 <td><input type="checkbox
" value="orderby
" id="orderby
"/></td>
499 <tr><td align="center
" nowrap="nowrap
"><b>HAVING</b></td></tr>
501 <td width="58" nowrap="nowrap
"><?php echo __('Operator'); ?></td>
502 <td width="102"><select name="h_operator
" id="h_operator
">
503 <option value="---" selected="selected
">---</option>
504 <option value="None
" > <?php echo __('None'); ?> </option>
505 <option value="sum
" > SUM </option>
506 <option value="min
"> MIN </option>
507 <option value="max
"> MAX </option>
508 <option value="avg
"> AVG </option>
509 <option value="count
"> COUNT </option>
513 <td width="58" nowrap="nowrap
"><?php echo __('Relation operator'); ?></td>
514 <td width="102"><select name="h_rel_opt
" id="h_rel_opt
">
515 <option value="--" selected="selected
"> -- </option>
516 <option value="=" > = </option>
517 <option value=">"> > </option>
518 <option value="<"> < </option>
519 <option value=">="> >= </option>
520 <option value="<="> <= </option>
521 <option value="NOT
"> NOT </option>
522 <option value="IN
"> IN </option>
523 <option value="EXCEPT
"> <?php echo __('Except'); ?> </option>
524 <option value="NOT IN
"> NOT IN </option>
529 <td width="58" nowrap="nowrap
"><?php echo __('Value'); ?>/<br/><?php echo __('subquery'); ?></td>
530 <td width="102"><textarea id="having
" value="" cols="18"></textarea></td>
535 <td colspan="2" align="center
" nowrap="nowrap
">
536 <input type="button
" class="butt
" name="Button
"
537 value="<?php
echo __('OK'); ?
>" onclick="add_object()" />
538 <input type="button
" class="butt
" name="Button
"
539 value="<?php
echo __('Cancel'); ?
>"
540 onclick="Close_option()" />
546 <td class="frams6
"></td>
549 <td class="frams4
"><div class="bor
"></div></td>
550 <td class="frams7
"></td>
551 <td class="frams3
"></td>
556 <table id="query_rename_to
" style="display
:none
;"
557 width="5%
" border="0" cellpadding="0" cellspacing="0">
560 <td class="frams1
" width="10px
"></td>
561 <td class="frams5
" width="99%
" ></td>
562 <td class="frams2
" width="10px
"><div class="bor
"></div></td>
565 <td class="frams8
"></td>
566 <td class="input_tab
">
567 <table width="168" border="0" align="center
" cellpadding="2" cellspacing="0">
570 <td colspan="2" align="center
" nowrap="nowrap
"><strong><?php echo __('Rename to'); ?></strong></td>
573 <tbody id="rename_to
">
575 <td width="58" nowrap="nowrap
"><?php echo __('New name'); ?></td>
577 <input type="text
" value="" id="e_rename
"/>
583 <td colspan="2" align="center
" nowrap="nowrap
">
584 <input type="button
" class="butt
" name="Button
"
585 value="<?php
echo __('OK'); ?
>" onclick="edit('Rename')" />
586 <input type="button
" class="butt
" name="Button
"
587 value="<?php
echo __('Cancel'); ?
>"
588 onclick="document
.getElementById('query_rename_to').style
.display
= 'none';" />
594 <td class="frams6
"></td>
597 <td class="frams4
"><div class="bor
"></div></td>
598 <td class="frams7
"></td>
599 <td class="frams3
"></td>
604 <table id="query_having
" style="display
:none
;"
605 width="5%
" border="0" cellpadding="0" cellspacing="0">
608 <td class="frams1
" width="10px
"></td>
609 <td class="frams5
" width="99%
" ></td>
610 <td class="frams2
" width="10px
"><div class="bor
"></div></td>
613 <td class="frams8
"></td>
614 <td class="input_tab
">
615 <table width="168" border="0" align="center
" cellpadding="2" cellspacing="0">
618 <td colspan="2" align="center
" nowrap="nowrap
"><strong>HAVING</strong></td>
621 <tbody id="rename_to
">
623 <td width="58" nowrap="nowrap
"><?php echo __('Operator'); ?></td>
624 <td width="102"><select name="hoperator
" id="hoperator
">
625 <option value="---" selected="selected
">---</option>
626 <option value="None
" > None </option>
627 <option value="sum
" > SUM </option>
628 <option value="min
"> MIN </option>
629 <option value="max
"> MAX </option>
630 <option value="avg
"> AVG </option>
631 <option value="count
"> COUNT </option>
636 <td width="58" nowrap="nowrap
"><?php echo __('Operator'); ?></td>
637 <td width="102"><select name="hrel_opt
" id="hrel_opt
">
638 <option value="--" selected="selected
"> -- </option>
639 <option value="=" > = </option>
640 <option value=">"> > </option>
641 <option value="<"> < </option>
642 <option value=">="> >= </option>
643 <option value="<="> <= </option>
644 <option value="NOT
"> NOT </option>
645 <option value="IN
"> IN </option>
646 <option value="EXCEPT
"> <?php echo __('Except'); ?> </option>
647 <option value="NOT IN
"> NOT IN </option>
652 <td nowrap="nowrap
"><?php echo __('Value'); ?>/<br /><?php echo __('subquery'); ?></td>
653 <td><textarea id="hQuery
" value="" cols="18"></textarea>
659 <td colspan="2" align="center
" nowrap="nowrap
">
660 <input type="button
" class="butt
" name="Button
"
661 value="<?php
echo __('OK'); ?
>" onclick="edit('Having')" />
662 <input type="button
" class="butt
" name="Button
"
663 value="<?php
echo __('Cancel'); ?
>"
664 onclick="document
.getElementById('query_having').style
.display
= 'none';" />
670 <td class="frams6
"></td>
673 <td class="frams4
"><div class="bor
"></div></td>
674 <td class="frams7
"></td>
675 <td class="frams3
"></td>
680 <table id="query_Aggregate
" style="display
:none
;"
681 width="5%
" border="0" cellpadding="0" cellspacing="0">
684 <td class="frams1
" width="10px
"></td>
685 <td class="frams5
" width="99%
" ></td>
686 <td class="frams2
" width="10px
"><div class="bor
"></div></td>
689 <td class="frams8
"></td>
690 <td class="input_tab
">
691 <table width="168" border="0" align="center
" cellpadding="2" cellspacing="0">
694 <td colspan="2" align="center
" nowrap="nowrap
"><strong><?php echo __('Aggregate'); ?></strong></td>
699 <td width="58" nowrap="nowrap
"><?php echo __('Operator'); ?></td>
701 <select name="operator
" id="e_operator
">
702 <option value="---" selected="selected
">---</option>
703 <option value="sum
" > SUM </option>
704 <option value="min
"> MIN </option>
705 <option value="max
"> MAX </option>
706 <option value="avg
"> AVG </option>
707 <option value="avg
"> COUNT </option>
713 <td colspan="2" align="center
" nowrap="nowrap
">
714 <input type="button
" class="butt
" name="Button
"
715 value="<?php
echo __('OK'); ?
>" onclick="edit('Aggregate')" />
716 <input type="button
" class="butt
" name="Button
"
717 value="<?php
echo __('Cancel'); ?
>"
718 onclick="document
.getElementById('query_Aggregate').style
.display
= 'none';" />
724 <td class="frams6
"></td>
727 <td class="frams4
"><div class="bor
"></div></td>
728 <td class="frams7
"></td>
729 <td class="frams3
"></td>
734 <table id="query_where
" style="display
:none
;"
735 width="5%
" border="0" cellpadding="0" cellspacing="0">
738 <td class="frams1
" width="10px
"></td>
739 <td class="frams5
" width="99%
" ></td>
740 <td class="frams2
" width="10px
"><div class="bor
"></div></td>
743 <td class="frams8
"></td>
744 <td class="input_tab
">
745 <table width="168" border="0" align="center
" cellpadding="2" cellspacing="0">
748 <td colspan="2" align="center
" nowrap="nowrap
"><strong>WHERE</strong></td>
751 <tbody id="rename_to
">
753 <td width="58" nowrap="nowrap
"><?php echo __('Operator'); ?></td>
754 <td width="102"><select name="erel_opt
" id="erel_opt
">
755 <option value="--" selected="selected
"> -- </option>
756 <option value="=" > = </option>
757 <option value=">"> > </option>
758 <option value="<"> < </option>
759 <option value=">="> >= </option>
760 <option value="<="> <= </option>
761 <option value="NOT
"> NOT </option>
762 <option value="IN
"> IN </option>
763 <option value="EXCEPT
"> <?php echo __('Except'); ?> </option>
764 <option value="NOT IN
"> NOT IN </option>
769 <td nowrap="nowrap
"><?php echo __('Value'); ?>/<br /><?php echo __('subquery'); ?></td>
770 <td><textarea id="eQuery
" value="" cols="18"></textarea>
776 <td colspan="2" align="center
" nowrap="nowrap
">
777 <input type="button
" class="butt
" name="Button
"
778 value="<?php
echo __('OK'); ?
>" onclick="edit('Where')" />
779 <input type="button
" class="butt
" name="Button
"
780 value="<?php
echo __('Cancel'); ?
>"
781 onclick="document
.getElementById('query_where').style
.display
= 'none';" />
787 <td class="frams6
"></td>
790 <td class="frams4
"><div class="bor
"></div></td>
791 <td class="frams7
"></td>
792 <td class="frams3
"></td>
798 if (! empty($_REQUEST['query'])) {
799 echo '<div class="panel
">';
800 echo '<div style="clear
:both
;"></div>';
801 echo '<div id="ab
"></div>';
802 echo '<div style="clear
:both
;"></div>';
804 echo '<a class="trigger
" href="#">' . __('Active options') . '</a>';
805 echo '<div id="filter"></div>';
806 echo '<div id="box">';
807 echo '<span id="boxtitle"></span>';
808 echo '<form method="post" action="db_qbe.php" >';
809 echo '<textarea cols="80" name="sql_query" id="textSqlquery" rows="15"></textarea><div id="tblfooter">';
810 echo ' <input type="submit" name="submit_sql" class="btn">';
811 echo ' <input type="button" name="cancel" value="' . __('Cancel') . '" onclick="closebox()" class="btn">';
812 echo PMA_generate_common_hidden_inputs($GLOBALS['db']);
814 echo '</form></div>';
819 <!-- cache images
-->
820 <img src
="<?php echo $GLOBALS['pmaThemeImage'] ?>pmd/2leftarrow_m.png" width
="0" height
="0" alt
="" />
821 <img src
="<?php echo $GLOBALS['pmaThemeImage'] ?>pmd/rightarrow1.png" width
="0" height
="0" alt
="" />
822 <img src
="<?php echo $GLOBALS['pmaThemeImage'] ?>pmd/rightarrow2.png" width
="0" height
="0" alt
="" />
823 <img src
="<?php echo $GLOBALS['pmaThemeImage'] ?>pmd/uparrow2_m.png" width
="0" height
="0" alt
="" />
824 <div id
="PMA_disable_floating_menubar"></div
>