Select part of Query builder complete with rename and aggregate operators
[phpmyadmin/ankitg.git] / pmd_general.php
blob2c94c2d80020be1222f5f32edaab4694080de99d
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 * @version $Id$
5 * @package phpMyAdmin-Designer
6 */
8 /**
11 require_once "./pmd_common.php";
13 $tab_column = get_tab_info();
14 $script_tabs = get_script_tabs();
15 $script_contr = get_script_contr();
16 $tab_pos = get_tab_pos();
17 $tables_pk_or_unique_keys = get_pk_or_unique_keys();
18 $tables_all_keys = get_all_keys();
19 $hidden = "hidden";
22 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
23 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
24 <html xmlns:v="urn:schemas-microsoft-com:vml" xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $GLOBALS['available_languages'][$GLOBALS['lang']][1]; ?>" lang="<?php echo $GLOBALS['available_languages'][$GLOBALS['lang']][1]; ?>" dir="<?php echo $GLOBALS['text_dir']; ?>">
25 <head>
26 <meta http-equiv="Content-Type" content="text/html; charset=<?php echo $charset ?>" />
27 <link rel="icon" href="pmd/images/favicon.ico" type="image/x-icon" />
28 <link rel="shortcut icon" href="pmd/images/favicon.ico" type="image/x-icon" />
29 <link rel="stylesheet" type="text/css" href="pmd/styles/<?php echo $GLOBALS['PMD']['STYLE'] ?>/style1.css" />
30 <title>Designer</title>
31 <script src="./js/jquery/jquery-1.4.2.js" type="text/javascript"></script>
32 <script type="text/javascript">
33 // <![CDATA[
34 <?php
35 echo '
36 var server = "' . PMA_escapeJsString($server) . '";
37 var db = "' . PMA_escapeJsString($db) . '";
38 var token = "' . PMA_escapeJsString($token) . '";';
39 echo "\n";
40 if($_REQUEST['query']) {
41 echo '
42 $(document).ready(function(){
43 $(".trigger").click(function(){
44 $(".panel").toggle("fast");
45 $(this).toggleClass("active");
46 return false;
47 });
48 });';
51 // ]]>
52 </script>
53 <?php
54 $params = array('lang' => $GLOBALS['lang']);
55 if (isset($GLOBALS['db'])) {
56 $params['db'] = $GLOBALS['db'];
59 <script src="js/messages.php<?php echo PMA_generate_common_url($params); ?>" type="text/javascript"></script>
60 <script src="pmd/scripts/ajax.js" type="text/javascript"></script>
61 <script src="pmd/scripts/history.js" type="text/javascript"></script>
62 <script src="pmd/scripts/move.js" type="text/javascript"></script>
63 <!--[if IE]>
64 <script src="pmd/scripts/iecanvas.js" type="text/javascript"></script>
65 <![endif]-->
66 <?php
67 echo $script_tabs . $script_contr . $script_display_field;
70 </head>
71 <body onload="Main()" class="general_body" id="pmd_body">
73 <div class="header" id="top_menu">
74 <a href="javascript:Show_left_menu(document.getElementById('key_Show_left_menu'));"
75 onmousedown="return false;" class="M_butt first" target="_self">
76 <img id='key_Show_left_menu' title="<?php echo __('Show/Hide left menu'); ?>"
77 alt="v" src="pmd/images/downarrow2_m.png" /></a>
78 <a href="javascript:Save2();" onmousedown="return false;"
79 class="M_butt" target="_self"
80 ><img title="<?php echo __('Save position') ?>" src="pmd/images/save.png" alt=""
81 /></a><a href="javascript:Start_table_new();" onmousedown="return false;"
82 class="M_butt" target="_self"
83 ><img title="<?php echo __('Create table')?>" src="pmd/images/table.png" alt=""
84 /></a><a href="javascript:Start_relation();" onmousedown="return false;"
85 class="M_butt" id="rel_button" target="_self"
86 ><img title="<?php echo __('Create relation') ?>" src="pmd/images/relation.png" alt=""
87 /></a><a href="javascript:Start_display_field();" onmousedown="return false;"
88 class="M_butt" id="display_field_button" target="_self"
89 ><img title="<?php echo __('Choose column to display') ?>" src="pmd/images/display_field.png" alt=""
90 /></a><a href="javascript:location.reload();" onmousedown="return false;"
91 class="M_butt" target="_self"
92 ><img title="<?php echo __('Reload'); ?>" src="pmd/images/reload.png" alt=""
93 /></a><a href="javascript:Help();" onmousedown="return false;"
94 class="M_butt" target="_self"
95 ><img title="<?php echo __('Help'); ?>" src="pmd/images/help.png" alt=""
96 /></a><img class="M_bord" src="pmd/images/bord.png" alt=""
97 /><a href="javascript:Angular_direct();" onmousedown="return false;"
98 class="M_butt" id="angular_direct_button" target="_self"
99 ><img title="<?php echo __('Angular links') . ' / ' . __('Direct links'); ?>"
100 src="pmd/images/ang_direct.png" alt=""
101 /></a><a href="javascript:Grid();" onmousedown="return false;"
102 class="M_butt" id="grid_button" target="_self"
103 ><img title="<?php echo __('Snap to grid') ?>" src="pmd/images/grid.png" alt=""
104 /></a><img class="M_bord" src="pmd/images/bord.png" alt=""
105 /><a href="javascript:Small_tab_all(document.getElementById('key_SB_all'));"
106 onmousedown="return false;" class="M_butt" target="_self"
107 ><img id='key_SB_all' title="<?php echo __('Small/Big All'); ?>" alt="v"
108 src="pmd/images/downarrow1.png"
109 /></a><a href="javascript:Small_tab_invert();" onmousedown="return false;"
110 class="M_butt" target="_self"
111 ><img title="<?php echo __('Toggle small/big'); ?>" alt="key" src="pmd/images/bottom.png"
112 /></a><img class="M_bord" src="pmd/images/bord.png" alt=""
113 /><a href="javascript:build_query()" onmousedown="return false;"
114 class="M_butt" target="_self"
115 ><img src="pmd/images/pdf.png" alt="key" width="20" height="20"
116 title="<?php echo __('Import/Export coordinates for PDF schema'); ?>" /></a>
117 <a href="javascript:Top_menu_right(document.getElementById('key_Left_Right'));"
118 onmousedown="return false;" class="M_butt last" target="_self">
119 <img src="pmd/images/2rightarrow_m.png" id="key_Left_Right" alt=">"
120 title="<?php echo __('Move Menu'); ?>" /></a>
121 </div>
123 <div id="osn_tab">
124 <CANVAS id="canvas" width="100" height="100" onclick="Canvas_click(this)"></CANVAS>
125 </div>
127 <form action="" method="post" name="form1">
128 <div id="layer_menu" style="visibility:<?php echo $hidden ?>;">
129 <div align="center" style="padding-top:5px;">
130 <a href="javascript:Hide_tab_all(document.getElementById('key_HS_all'));"
131 onmousedown="return false;" class="M_butt" target="_self">
132 <img title="<?php echo __('Hide/Show all'); ?>" alt="v"
133 src="pmd/images/downarrow1.png" id='key_HS_all' /></a>
134 <a href="javascript:No_have_constr(document.getElementById('key_HS'));"
135 onmousedown="return false;" class="M_butt" target="_self">
136 <img title="<?php echo __('Hide/Show Tables with no relation'); ?>" alt="v"
137 src="pmd/images/downarrow2.png" id='key_HS' /></a>
138 </div>
140 <div id="id_scroll_tab" class="scroll_tab">
141 <table width="100%" style="padding-left: 3px;">
142 <?php
143 $name_cnt = count($GLOBALS['PMD']['TABLE_NAME']);
144 for ($i = 0; $i < $name_cnt; $i++) {
146 <tr><td title="<?php echo __('Structure'); ?>" width="1px"
147 onmouseover="this.className='L_butt2_2'"
148 onmouseout="this.className='L_butt2_1'">
149 <img onclick="Start_tab_upd('<?php echo $GLOBALS['PMD_URL']["TABLE_NAME_SMALL"][$i]; ?>');"
150 src="pmd/images/exec.png" alt="" /></td>
151 <td width="1px">
152 <input onclick="VisibleTab(this,'<?php echo $GLOBALS['PMD_URL']["TABLE_NAME"][$i]; ?>')"
153 title="<?php echo __('Hide'); ?>"
154 id="check_vis_<?php echo $GLOBALS['PMD_URL']["TABLE_NAME"][$i]; ?>"
155 style="margin:0px;" type="checkbox"
156 value="<?php echo $GLOBALS['PMD_URL']["TABLE_NAME"][$i]; ?>"
157 <?php
158 if (isset($tab_pos[$GLOBALS['PMD']["TABLE_NAME"][$i]])) {
159 echo $tab_pos[$GLOBALS['PMD']["TABLE_NAME"][$i]]["H"] ? 'checked="checked"' : '';
160 } else {
161 echo 'checked="checked"';
163 ?> /></td>
164 <td class="Tabs" onmouseover="this.className='Tabs2'"
165 onmouseout="this.className='Tabs'"
166 onclick="Select_tab('<?php echo $GLOBALS['PMD_URL']["TABLE_NAME"][$i]; ?>');">
167 <?php echo $GLOBALS['PMD_OUT']["TABLE_NAME"][$i]; ?></td>
168 </tr>
169 <?php
172 </table>
173 </div>
175 <div align="center">
176 <?php echo __('Number of tables') . ': ' . $name_cnt; ?>
177 </div>
178 <div align="right">
179 <div id="layer_menu_sizer" onmousedown="layer_menu_cur_click=1">
180 </div>
181 </div>
182 </div>
183 <?php
184 for ($i = 0; $i < count($GLOBALS['PMD']["TABLE_NAME"]); $i++) {
185 $t_n = $GLOBALS['PMD']["TABLE_NAME"][$i];
186 $t_n_url = $GLOBALS['PMD_URL']["TABLE_NAME"][$i];
189 <input name="t_x[<?php echo $t_n_url ?>]" type="hidden" id="t_x_<?php echo $t_n_url ?>_" />
190 <input name="t_y[<?php echo $t_n_url ?>]" type="hidden" id="t_y_<?php echo $t_n_url ?>_" />
191 <input name="t_v[<?php echo $t_n_url ?>]" type="hidden" id="t_v_<?php echo $t_n_url ?>_" />
192 <input name="t_h[<?php echo $t_n_url ?>]" type="hidden" id="t_h_<?php echo $t_n_url ?>_" />
194 <table id="<?php echo $t_n_url ?>" cellpadding="0" cellspacing="0" class="tab"
195 style="position: absolute;
196 left: <?php if (isset($tab_pos[$t_n])) echo $tab_pos[$t_n]["X"]; else echo rand(180, 800); ?>px;
197 top: <?php if (isset($tab_pos[$t_n])) echo $tab_pos[$t_n]["Y"]; else echo rand(30, 500); ?>px;
198 visibility: <?php if (isset($tab_pos[$t_n])) echo $tab_pos[$t_n]["H"] ? "visible" : "hidden"; ?>;
200 <thead>
201 <tr>
202 <?php
203 if(isset($_REQUEST['query'])) {
204 echo '<td class="select_all">';
205 echo '<input type="checkbox" value="select_all_'.htmlspecialchars($t_n_url).'" style="margin: 0px;" ';
206 echo 'id="select_all_'.htmlspecialchars($t_n_url).'" title="select all" ';
207 echo 'onclick="Select_all(\''. htmlspecialchars($t_n_url) .'\',\''.htmlspecialchars($GLOBALS['PMD_OUT']["OWNER"][$i]).'\')"></td>';
209 <td class="small_tab" onmouseover="this.className='small_tab2';"
210 onmouseout="this.className='small_tab';"
211 id="id_hide_tbody_<?php echo $t_n_url ?>"
212 onclick="Small_tab('<?php echo $t_n_url ?>', 1)"><?php
213 // no space alloawd here, between tags and content !!!
214 // JavaScript function does require this
215 if (! isset($tab_pos[$t_n]) || ! empty($tab_pos[$t_n]["V"])) {
216 echo 'v';
217 } else {
218 echo '&gt;';
220 ?></td>
221 <td class="small_tab_pref" onmouseover="this.className='small_tab_pref2';"
222 onmouseout="this.className='small_tab_pref';"
223 onclick="Start_tab_upd('<?php echo $GLOBALS['PMD_URL']["TABLE_NAME_SMALL"][$i]; ?>');">
224 <img src="pmd/images/exec_small.png" alt="" /></td>
225 <td nowrap="nowrap" id="id_zag_<?php echo $t_n_url ?>" class="tab_zag"
226 onmousedown="cur_click=document.getElementById('<?php echo $t_n_url ?>');"
227 onmouseover="Table_onover('<?php echo $t_n_url ?>',0)"
228 onmouseout="Table_onover('<?php echo $t_n_url ?>',1)">
229 <span class='owner'>
230 <?php
231 echo $GLOBALS['PMD_OUT']["OWNER"][$i];
232 echo '.</span>';
233 echo $GLOBALS['PMD_OUT']["TABLE_NAME_SMALL"][$i];
234 ?></td>
235 <?php
236 if(isset($_REQUEST['query'])) {
237 echo '<td class="tab_zag" onmouseover="Table_onover(\''.htmlspecialchars($t_n_url).'\',0)" id="id_zag_'.htmlspecialchars($t_n_url).'_2"';
238 echo 'onmousedown="cur_click=document.getElementById(\''.htmlspecialchars($t_n_url).'\');"';
239 echo 'onmouseout="Table_onover(\''.htmlspecialchars($t_n_url).'\',1)">';
241 </tr>
242 </thead>
243 <tbody id="id_tbody_<?php echo $t_n_url ?>"
244 <?php if ( isset($tab_pos[$t_n])) echo 'style="display: none;"'; ?>>
245 <?php
246 $display_field = PMA_getDisplayField($db, $GLOBALS['PMD']["TABLE_NAME_SMALL"][$i]);
247 for ($j = 0, $id_cnt = count($tab_column[$t_n]["COLUMN_ID"]); $j < $id_cnt; $j++) {
249 <tr id="id_tr_<?php
250 echo $GLOBALS['PMD_URL']["TABLE_NAME_SMALL"][$i] . '.'
251 . urlencode($tab_column[$t_n]["COLUMN_NAME"][$j]) ?>"
252 <?php
253 if ($display_field == $tab_column[$t_n]["COLUMN_NAME"][$j]) {
254 echo ' class="tab_field_3" ';
255 } else {
256 echo ' class="tab_field" ';
259 onmouseover="old_class = this.className; this.className = 'tab_field_2';"
260 onmouseout="this.className = old_class;"
261 onmousedown="Click_field('<?php
262 echo $GLOBALS['PMD_URL']["TABLE_NAME_SMALL"][$i]."','".urlencode($tab_column[$t_n]["COLUMN_NAME"][$j])."',";
263 if (! PMA_foreignkey_supported($GLOBALS['PMD']['TABLE_TYPE'][$i])) {
264 echo (isset($tables_pk_or_unique_keys[$t_n . "." . $tab_column[$t_n]["COLUMN_NAME"][$j]]) ? 1 : 0);
265 } else {
266 // if foreign keys are supported, it's not necessary that the
267 // index is a primary key
268 echo (isset($tables_all_keys[$t_n.".".$tab_column[$t_n]["COLUMN_NAME"][$j]]) ? 1 : 0);
270 ?>)">
271 <?php
272 if(isset($_REQUEST['query'])) {
273 echo '<td class="select_all">';
274 echo '<input value="'.htmlspecialchars($t_n_url).urlencode($tab_column[$t_n]["COLUMN_NAME"][$j]).'"';
275 echo 'type="checkbox" id="select_'.htmlspecialchars($t_n_url).'._'.urlencode($tab_column[$t_n]["COLUMN_NAME"][$j]).'" ';
276 echo 'style="margin: 0px;" title="select_'.urlencode($tab_column[$t_n]["COLUMN_NAME"][$j]).'" ';
277 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>';
279 <td width="10px" colspan="3"
280 id="<?php echo $t_n_url.".".urlencode($tab_column[$t_n]["COLUMN_NAME"][$j]) ?>">
281 <div style="white-space:nowrap">
282 <?php
283 if (isset($tables_pk_or_unique_keys[$t_n.".".$tab_column[$t_n]["COLUMN_NAME"][$j]])) {
285 <img src="pmd/styles/<?php echo $GLOBALS['PMD']['STYLE'];?>/images/FieldKey_small.png"
286 alt="*" />
287 <?php
288 } else {
290 <img src="pmd/styles/<?php echo $GLOBALS['PMD']['STYLE']?>/images/Field_small<?php
291 if (strstr($tab_column[$t_n]["TYPE"][$j],'char')
292 || strstr($tab_column[$t_n]["TYPE"][$j],'text')) {
293 echo '_char';
294 } elseif (strstr($tab_column[$t_n]["TYPE"][$j],'int')
295 || strstr($tab_column[$t_n]["TYPE"][$j],'float')
296 || strstr($tab_column[$t_n]["TYPE"][$j],'double')
297 || strstr($tab_column[$t_n]["TYPE"][$j],'decimal')) {
298 echo '_int';
299 } elseif (strstr($tab_column[$t_n]["TYPE"][$j],'date')
300 || strstr($tab_column[$t_n]["TYPE"][$j],'time')
301 || strstr($tab_column[$t_n]["TYPE"][$j],'year')) {
302 echo '_date';
304 ?>.png" alt="*" />
305 <?php
307 echo htmlspecialchars($tab_column[$t_n]["COLUMN_NAME"][$j]
308 . " : " . $tab_column[$t_n]["TYPE"][$j], ENT_QUOTES);
310 </div>
311 </td>
312 <?php
313 if(isset($_REQUEST['query'])) {
314 //$temp = $GLOBALS['PMD_OUT']["OWNER"][$i].'.'.$GLOBALS['PMD_OUT']["TABLE_NAME_SMALL"][$i];
315 echo '<td class="small_tab_pref" onmouseover="this.className=\'small_tab_pref2\';"';
316 echo 'onmouseout="this.className=\'small_tab_pref\';"';
317 echo 'onclick="Click_option(\'pmd_optionse\',\''.urlencode($tab_column[$t_n]["COLUMN_NAME"][$j]).'\',\''.$GLOBALS['PMD_OUT']["TABLE_NAME_SMALL"][$i].'\')" >';
318 echo '<img src="pmd/images/exec_small.png" title="options" alt="" /></td> ';
319 } ?>
320 </tr>
321 <?php
324 </tbody>
325 </table>
326 <?php
329 </form>
330 <div id="hint"></div>
331 <div id='layer_action' style="visibility:<?php echo $hidden ?>;">Load...</div>
333 <table id="layer_new_relation" style="visibility:<?php echo $hidden ?>;"
334 width="5%" border="0" cellpadding="0" cellspacing="0">
335 <tbody>
336 <tr>
337 <td class="frams1" width="10px"></td>
338 <td class="frams5" width="99%" ></td>
339 <td class="frams2" width="10px"><div class="bor"></div></td>
340 </tr>
341 <tr>
342 <td class="frams8"></td>
343 <td class="input_tab">
344 <table width="168" border="0" align="center" cellpadding="2" cellspacing="0">
345 <thead>
346 <tr>
347 <td colspan="2" align="center" nowrap="nowrap"><strong><?php echo __('Create relation'); ?></strong></td>
348 </tr>
349 </thead>
350 <tbody id="foreign_relation">
351 <tr>
352 <td colspan="2" align="center" nowrap="nowrap"><strong>FOREIGN KEY</strong></td>
353 </tr>
354 <tr>
355 <td width="58" nowrap="nowrap">on delete</td>
356 <td width="102"><select name="on_delete" id="on_delete">
357 <option value="nix" selected="selected">--</option>
358 <option value="CASCADE">CASCADE</option>
359 <option value="SET NULL">SET NULL</option>
360 <option value="NO ACTION">NO ACTION</option>
361 <option value="RESTRICT">RESTRICT</option>
362 </select>
363 </td>
364 </tr>
365 <tr>
366 <td nowrap="nowrap">on update</td>
367 <td><select name="on_update" id="on_update">
368 <option value="nix" selected="selected">--</option>
369 <option value="CASCADE">CASCADE</option>
370 <option value="SET NULL">SET NULL</option>
371 <option value="NO ACTION">NO ACTION</option>
372 <option value="RESTRICT">RESTRICT</option>
373 </select>
374 </td>
375 </tr>
376 </tbody>
377 <tbody>
378 <tr>
379 <td colspan="2" align="center" nowrap="nowrap">
380 <input type="button" class="butt" name="Button"
381 value="<?php echo __('OK'); ?>" onclick="New_relation()" />
382 <input type="button" class="butt" name="Button"
383 value="<?php echo __('Cancel'); ?>"
384 onclick="document.getElementById('layer_new_relation').style.visibility = 'hidden';" />
385 </td>
386 </tr>
387 </tbody>
388 </table>
389 </td>
390 <td class="frams6"></td>
391 </tr>
392 <tr>
393 <td class="frams4"><div class="bor"></div></td>
394 <td class="frams7"></td>
395 <td class="frams3"></td>
396 </tr>
397 </tbody>
398 </table>
400 <table id="layer_upd_relation" style="visibility:<?PHP echo $hidden ?>;"
401 width="5%" border="0" cellpadding="0" cellspacing="0">
402 <tbody>
403 <tr>
404 <td class="frams1" width="10px"></td>
405 <td class="frams5" width="99%"></td>
406 <td class="frams2" width="10px"><div class="bor"></div></td>
407 </tr>
408 <tr>
409 <td class="frams8"></td>
410 <td class="input_tab">
411 <table width="100%" border="0" align="center" cellpadding="2" cellspacing="0">
412 <tr>
413 <td colspan="3" align="center" nowrap="nowrap"><strong><?php echo __('Delete relation'); ?></strong></td>
414 </tr>
415 <tr>
416 <td colspan="3" align="center" nowrap="nowrap">
417 <input name="Button" type="button" class="butt"
418 onclick="Upd_relation()" value="<?php echo __('Delete'); ?>" />
419 <input type="button" class="butt" name="Button"
420 value="<?php echo __('Cancel'); ?>"
421 onclick="document.getElementById('layer_upd_relation').style.visibility = 'hidden'; Re_load();" />
422 </td>
423 </tr>
424 </table></td>
425 <td class="frams6"></td>
426 </tr>
427 <tr>
428 <td class="frams4"><div class="bor"></div></td>
429 <td class="frams7"></td>
430 <td class="frams3"></td>
431 </tr>
432 </tbody>
433 </table>
435 <table id="pmd_optionse" style="visibility:<?php echo $hidden ?>;"
436 width="5%" border="0" cellpadding="0" cellspacing="0">
437 <tbody>
438 <tr>
439 <td class="frams1" width="10px"></td>
440 <td class="frams5" width="99%" ></td>
441 <td class="frams2" width="10px"><div class="bor"></div></td>
442 </tr>
443 <tr>
444 <td class="frams8"></td>
445 <td class="input_tab">
446 <table width="168" border="0" align="center" cellpadding="2" cellspacing="0">
447 <thead>
448 <tr>
449 <td colspan="2" rowspan="2" id="option_col_name" nowrap="nowrap" align="center"></td>
450 </tr>
451 </thead>
452 <tbody id="where">
453 <tr><td align="center" nowrap="nowrap"><b>Where</b></td></tr>
454 <tr>
455 <td width="58" nowrap="nowrap">Relation operator</td>
456 <td width="102"><select name="rel_opt" id="rel_opt">
457 <option value="--" selected="selected"> -- </option>
458 <option value="=" > = </option>
459 <option value=">"> > </option>
460 <option value="<"> < </option>
461 <option value=">="> >= </option>
462 <option value="<="> <= </option>
463 <option value="NOT"> NOT </option>
464 <option value="IN"> IN </option>
465 <option value="EXCEPT"> Except </option>
466 <option value="NOT IN"> Not In </option>
467 </select>
468 </td>
469 </tr>
470 <tr>
471 <td nowrap="nowrap">Value/<br />Subquery</td>
472 <td><textarea id="Query" value="" cols="18"></textarea>
473 </td>
474 </tr>
475 <tr><td align="center" nowrap="nowrap"><b>Rename To</b></td></tr>
476 <tr>
477 <td width="58" nowrap="nowrap">New Name</td>
478 <td width="102"><input type="text" value="" id="new_name"/></td>
479 </tr>
480 <tr><td align="center" nowrap="nowrap"><b>Aggregate</b></td></tr>
481 <tr>
482 <td width="58" nowrap="nowrap">Operator</td>
483 <td width="102"><select name="operator" id="operator">
484 <option value="---" selected="selected">---</option>
485 <option value="sum" > Sum </option>
486 <option value="min"> Min </option>
487 <option value="max"> Max </option>
488 <option value="avg"> Avg </option>
489 <option value="avg"> Count </option>
490 </select>
491 </td></tr>
492 <tr>
493 <td nowrap="nowrap" width="58" align="center"><b>Group By</b></td>
494 <td><input type="checkbox" value="groupby" id="groupby"/></td>
495 </tr>
496 <tr>
497 <td nowrap="nowrap" width="58" align="center"><b>Order By</b></td>
498 <td><input type="checkbox" value="orderby" id="orderby"/></td>
499 </tr>
500 </tbody>
501 <tbody>
502 <tr>
503 <td colspan="2" align="center" nowrap="nowrap">
504 <input type="button" class="butt" name="Button"
505 value="<?php echo __('OK'); ?>" onclick="add_object()" />
506 <input type="button" class="butt" name="Button"
507 value="<?php echo __('Cancel'); ?>"
508 onclick="Close_option()" />
509 </td>
510 </tr>
511 </tbody>
512 </table>
513 </td>
514 <td class="frams6"></td>
515 </tr>
516 <tr>
517 <td class="frams4"><div class="bor"></div></td>
518 <td class="frams7"></td>
519 <td class="frams3"></td>
520 </tr>
521 </tbody>
522 </table>
524 <table id="query_rename_to" style="visibility:<?php echo $hidden ?>;"
525 width="5%" border="0" cellpadding="0" cellspacing="0">
526 <tbody>
527 <tr>
528 <td class="frams1" width="10px"></td>
529 <td class="frams5" width="99%" ></td>
530 <td class="frams2" width="10px"><div class="bor"></div></td>
531 </tr>
532 <tr>
533 <td class="frams8"></td>
534 <td class="input_tab">
535 <table width="168" border="0" align="center" cellpadding="2" cellspacing="0">
536 <thead>
537 <tr>
538 <td colspan="2" align="center" nowrap="nowrap"><strong>Rename To</strong></td>
539 </tr>
540 </thead>
541 <tbody id="rename_to">
542 <tr>
543 <td width="58" nowrap="nowrap">New Name</td>
544 <td width="102">
545 <input type="text" value="" id="e_rename"/>
546 </td>
547 </tr>
548 </tbody>
549 <tbody>
550 <tr>
551 <td colspan="2" align="center" nowrap="nowrap">
552 <input type="button" class="butt" name="Button"
553 value="<?php echo __('OK'); ?>" onclick="edit('Rename')" />
554 <input type="button" class="butt" name="Button"
555 value="<?php echo __('Cancel'); ?>"
556 onclick="document.getElementById('query_rename_to').style.visibility = 'hidden';" />
557 </td>
558 </tr>
559 </tbody>
560 </table>
561 </td>
562 <td class="frams6"></td>
563 </tr>
564 <tr>
565 <td class="frams4"><div class="bor"></div></td>
566 <td class="frams7"></td>
567 <td class="frams3"></td>
568 </tr>
569 </tbody>
570 </table>
572 <table id="query_Aggregate" style="visibility:<?php echo $hidden ?>;"
573 width="5%" border="0" cellpadding="0" cellspacing="0">
574 <tbody>
575 <tr>
576 <td class="frams1" width="10px"></td>
577 <td class="frams5" width="99%" ></td>
578 <td class="frams2" width="10px"><div class="bor"></div></td>
579 </tr>
580 <tr>
581 <td class="frams8"></td>
582 <td class="input_tab">
583 <table width="168" border="0" align="center" cellpadding="2" cellspacing="0">
584 <thead>
585 <tr>
586 <td colspan="2" align="center" nowrap="nowrap"><strong>Aggregate</strong></td>
587 </tr>
588 </thead>
589 <tbody>
590 <tr>
591 <td width="58" nowrap="nowrap">Operator</td>
592 <td width="102">
593 <select name="operator" id="e_operator">
594 <option value="---" selected="selected">---</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="avg"> Count </option>
600 </select>
601 </td></tr>
602 </tbody>
603 <tbody>
604 <tr>
605 <td colspan="2" align="center" nowrap="nowrap">
606 <input type="button" class="butt" name="Button"
607 value="<?php echo __('OK'); ?>" onclick="edit('Aggregate')" />
608 <input type="button" class="butt" name="Button"
609 value="<?php echo __('Cancel'); ?>"
610 onclick="document.getElementById('query_Aggregate').style.visibility = 'hidden';" />
611 </td>
612 </tr>
613 </tbody>
614 </table>
615 </td>
616 <td class="frams6"></td>
617 </tr>
618 <tr>
619 <td class="frams4"><div class="bor"></div></td>
620 <td class="frams7"></td>
621 <td class="frams3"></td>
622 </tr>
623 </tbody>
624 </table>
626 <table id="query_where" style="visibility:<?php echo $hidden ?>;"
627 width="5%" border="0" cellpadding="0" cellspacing="0">
628 <tbody>
629 <tr>
630 <td class="frams1" width="10px"></td>
631 <td class="frams5" width="99%" ></td>
632 <td class="frams2" width="10px"><div class="bor"></div></td>
633 </tr>
634 <tr>
635 <td class="frams8"></td>
636 <td class="input_tab">
637 <table width="168" border="0" align="center" cellpadding="2" cellspacing="0">
638 <thead>
639 <tr>
640 <td colspan="2" align="center" nowrap="nowrap"><strong>Where</strong></td>
641 </tr>
642 </thead>
643 <tbody id="rename_to">
644 <tr>
645 <td width="58" nowrap="nowrap">Opeartor</td>
646 <td width="102"><select name="erel_opt" id="erel_opt">
647 <option value="--" selected="selected"> -- </option>
648 <option value="=" > = </option>
649 <option value=">"> > </option>
650 <option value="<"> < </option>
651 <option value=">="> >= </option>
652 <option value="<="> <= </option>
653 <option value="NOT"> NOT </option>
654 <option value="IN"> IN </option>
655 <option value="EXCEPT"> Except </option>
656 <option value="NOT IN"> Not In </option>
657 </select>
658 </td>
659 </tr>
660 <tr>
661 <td nowrap="nowrap">Value/<br />Subquery</td>
662 <td><textarea id="eQuery" value="" cols="18"></textarea>
663 </td>
664 </tr>
665 </tbody>
666 <tbody>
667 <tr>
668 <td colspan="2" align="center" nowrap="nowrap">
669 <input type="button" class="butt" name="Button"
670 value="<?php echo __('OK'); ?>" onclick="edit('Where')" />
671 <input type="button" class="butt" name="Button"
672 value="<?php echo __('Cancel'); ?>"
673 onclick="document.getElementById('query_where').style.visibility = 'hidden';" />
674 </td>
675 </tr>
676 </tbody>
677 </table>
678 </td>
679 <td class="frams6"></td>
680 </tr>
681 <tr>
682 <td class="frams4"><div class="bor"></div></td>
683 <td class="frams7"></td>
684 <td class="frams3"></td>
685 </tr>
686 </tbody>
687 </table>
689 <?php
690 if($_REQUEST['query']) {
691 echo '<div class="panel">';
692 echo '<div style="clear:both;"></div>';
693 echo '<div id="ab"></div>';
694 echo '<div style="clear:both;"></div>';
695 echo '</div>';
696 echo '<a class="trigger" href="#">History</a>';
697 } ?>
698 <!-- cache images -->
699 <img src="pmd/images/2leftarrow_m.png" width="0" height="0" alt="" />
700 <img src="pmd/images/rightarrow1.png" width="0" height="0" alt="" />
701 <img src="pmd/images/rightarrow2.png" width="0" height="0" alt="" />
702 <img src="pmd/images/uparrow2_m.png" width="0" height="0" alt="" />
703 </body>
704 </html>