Remove deprecated function PMA_DBI_get_fields
[phpmyadmin/thilankatest.git] / pmd_general.php
blob6da6b2e7a55d9765ab9235289b86a7a0a86e9456
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 * @package phpMyAdmin-Designer
5 */
7 /**
9 */
10 require_once "./pmd_common.php";
12 $tab_column = get_tab_info();
13 $script_tabs = get_script_tabs();
14 $script_contr = get_script_contr();
15 $tab_pos = get_tab_pos();
16 $tables_pk_or_unique_keys = get_pk_or_unique_keys();
17 $tables_all_keys = get_all_keys();
18 $hidden = "hidden";
21 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
22 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
23 <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']; ?>">
24 <head>
25 <meta http-equiv="Content-Type" content="text/html; charset=<?php echo $charset ?>" />
26 <link rel="icon" href="pmd/images/favicon.ico" type="image/x-icon" />
27 <link rel="shortcut icon" href="pmd/images/favicon.ico" type="image/x-icon" />
28 <link rel="stylesheet" type="text/css" href="pmd/styles/<?php echo $GLOBALS['PMD']['STYLE'] ?>/style1.css" />
29 <title>Designer</title>
30 <?php
31 $params = array('lang' => $GLOBALS['lang']);
32 if (isset($GLOBALS['db'])) {
33 $params['db'] = $GLOBALS['db'];
35 require_once './libraries/header_scripts.inc.php';
37 <script type="text/javascript">
38 // <![CDATA[
39 <?php
40 echo '
41 var server = "' . PMA_escapeJsString($server) . '";
42 var db = "' . PMA_escapeJsString($db) . '";
43 var token = "' . PMA_escapeJsString($token) . '";';
44 echo "\n";
45 if($_REQUEST['query']) {
46 echo '
47 $(document).ready(function(){
48 $(".trigger").click(function(){
49 $(".panel").toggle("fast");
50 $(this).toggleClass("active");
51 return false;
52 });
53 });';
56 // ]]>
57 </script>
58 <script src="pmd/scripts/ajax.js" type="text/javascript"></script>
59 <script src="pmd/scripts/history.js" type="text/javascript"></script>
60 <script src="pmd/scripts/move.js" type="text/javascript"></script>
61 <!--[if IE]>
62 <script src="pmd/scripts/iecanvas.js" type="text/javascript"></script>
63 <![endif]-->
64 <?php
65 echo $script_tabs . $script_contr . $script_display_field;
68 </head>
69 <body onload="Main()" class="general_body" id="pmd_body">
71 <div class="header" id="top_menu">
72 <a href="javascript:Show_left_menu(document.getElementById('key_Show_left_menu'));"
73 onmousedown="return false;" class="M_butt first" target="_self">
74 <img id='key_Show_left_menu' title="<?php echo __('Show/Hide left menu'); ?>"
75 alt="v" src="pmd/images/downarrow2_m.png" /></a>
76 <a href="javascript:Save2();" onmousedown="return false;"
77 class="M_butt" target="_self"
78 ><img title="<?php echo __('Save position') ?>" src="pmd/images/save.png" alt=""
79 /></a><a href="javascript:Start_table_new();" onmousedown="return false;"
80 class="M_butt" target="_self"
81 ><img title="<?php echo __('Create table')?>" src="pmd/images/table.png" alt=""
82 /></a><a href="javascript:Start_relation();" onmousedown="return false;"
83 class="M_butt" id="rel_button" target="_self"
84 ><img title="<?php echo __('Create relation') ?>" src="pmd/images/relation.png" alt=""
85 /></a><a href="javascript:Start_display_field();" onmousedown="return false;"
86 class="M_butt" id="display_field_button" target="_self"
87 ><img title="<?php echo __('Choose column to display') ?>" src="pmd/images/display_field.png" alt=""
88 /></a><a href="javascript:location.reload();" onmousedown="return false;"
89 class="M_butt" target="_self"
90 ><img title="<?php echo __('Reload'); ?>" src="pmd/images/reload.png" alt=""
91 /></a><a href="javascript:Help();" onmousedown="return false;"
92 class="M_butt" target="_self"
93 ><img title="<?php echo __('Help'); ?>" src="pmd/images/help.png" alt=""
94 /></a><img class="M_bord" src="pmd/images/bord.png" alt=""
95 /><a href="javascript:Angular_direct();" onmousedown="return false;"
96 class="M_butt" id="angular_direct_button" target="_self"
97 ><img title="<?php echo __('Angular links') . ' / ' . __('Direct links'); ?>"
98 src="pmd/images/ang_direct.png" alt=""
99 /></a><a href="javascript:Grid();" onmousedown="return false;"
100 class="M_butt" id="grid_button" target="_self"
101 ><img title="<?php echo __('Snap to grid') ?>" src="pmd/images/grid.png" alt=""
102 /></a><img class="M_bord" src="pmd/images/bord.png" alt=""
103 /><a href="javascript:Small_tab_all(document.getElementById('key_SB_all'));"
104 onmousedown="return false;" class="M_butt" target="_self"
105 ><img id='key_SB_all' title="<?php echo __('Small/Big All'); ?>" alt="v"
106 src="pmd/images/downarrow1.png"
107 /></a><a href="javascript:Small_tab_invert();" onmousedown="return false;"
108 class="M_butt" target="_self"
109 ><img title="<?php echo __('Toggle small/big'); ?>" alt="key" src="pmd/images/bottom.png"
110 /></a><img class="M_bord" src="pmd/images/bord.png" alt=""
111 /><a href="javascript:PDF_save();" onmousedown="return false;"
112 class="M_butt" target="_self"
113 ><img src="pmd/images/pdf.png" alt="key" width="20" height="20"
114 title="<?php echo __('Import/Export coordinates for PDF schema'); ?>" /></a
116 <?php if($_REQUEST['query']){
117 echo '<a href="#" onClick="build_query(\'SQL Query on Database\', 0)" onmousedown="return false;"
118 class="M_butt" target="_self">';
119 echo '<img src="pmd/images/query_builder.png" alt="key" width="20" height="20" title="';
120 echo __('Build Query');
121 echo '"/></a>'; }?>
122 <a href="javascript:Top_menu_right(document.getElementById('key_Left_Right'));"
123 onmousedown="return false;" class="M_butt last" target="_self">
124 <img src="pmd/images/2rightarrow_m.png" id="key_Left_Right" alt=">"
125 title="<?php echo __('Move Menu'); ?>" /></a>
126 </div>
128 <div id="osn_tab">
129 <CANVAS id="canvas" width="100" height="100" onclick="Canvas_click(this)"></CANVAS>
130 </div>
132 <form action="" method="post" name="form1">
133 <div id="layer_menu" style="visibility:<?php echo $hidden ?>;">
134 <div align="center" style="padding-top:5px;">
135 <a href="javascript:Hide_tab_all(document.getElementById('key_HS_all'));"
136 onmousedown="return false;" class="M_butt" target="_self">
137 <img title="<?php echo __('Hide/Show all'); ?>" alt="v"
138 src="pmd/images/downarrow1.png" id='key_HS_all' /></a>
139 <a href="javascript:No_have_constr(document.getElementById('key_HS'));"
140 onmousedown="return false;" class="M_butt" target="_self">
141 <img title="<?php echo __('Hide/Show Tables with no relation'); ?>" alt="v"
142 src="pmd/images/downarrow2.png" id='key_HS' /></a>
143 </div>
145 <div id="id_scroll_tab" class="scroll_tab">
146 <table width="100%" style="padding-left: 3px;">
147 <?php
148 $name_cnt = count($GLOBALS['PMD']['TABLE_NAME']);
149 for ($i = 0; $i < $name_cnt; $i++) {
151 <tr><td title="<?php echo __('Structure'); ?>" width="1px"
152 onmouseover="this.className='L_butt2_2'"
153 onmouseout="this.className='L_butt2_1'">
154 <img onclick="Start_tab_upd('<?php echo $GLOBALS['PMD_URL']["TABLE_NAME_SMALL"][$i]; ?>');"
155 src="pmd/images/exec.png" alt="" /></td>
156 <td width="1px">
157 <input onclick="VisibleTab(this,'<?php echo $GLOBALS['PMD_URL']["TABLE_NAME"][$i]; ?>')"
158 title="<?php echo __('Hide'); ?>"
159 id="check_vis_<?php echo $GLOBALS['PMD_URL']["TABLE_NAME"][$i]; ?>"
160 style="margin:0px;" type="checkbox"
161 value="<?php echo $GLOBALS['PMD_URL']["TABLE_NAME"][$i]; ?>"
162 <?php
163 if (isset($tab_pos[$GLOBALS['PMD']["TABLE_NAME"][$i]])) {
164 echo $tab_pos[$GLOBALS['PMD']["TABLE_NAME"][$i]]["H"] ? 'checked="checked"' : '';
165 } else {
166 echo 'checked="checked"';
168 ?> /></td>
169 <td class="Tabs" onmouseover="this.className='Tabs2'"
170 onmouseout="this.className='Tabs'"
171 onclick="Select_tab('<?php echo $GLOBALS['PMD_URL']["TABLE_NAME"][$i]; ?>');">
172 <?php echo $GLOBALS['PMD_OUT']["TABLE_NAME"][$i]; ?></td>
173 </tr>
174 <?php
177 </table>
178 </div>
180 <div align="center">
181 <?php echo __('Number of tables') . ': ' . $name_cnt; ?>
182 </div>
183 <div align="right">
184 <div id="layer_menu_sizer" onmousedown="layer_menu_cur_click=1">
185 </div>
186 </div>
187 </div>
188 <?php
189 for ($i = 0; $i < count($GLOBALS['PMD']["TABLE_NAME"]); $i++) {
190 $t_n = $GLOBALS['PMD']["TABLE_NAME"][$i];
191 $t_n_url = $GLOBALS['PMD_URL']["TABLE_NAME"][$i];
194 <input name="t_x[<?php echo $t_n_url ?>]" type="hidden" id="t_x_<?php echo $t_n_url ?>_" />
195 <input name="t_y[<?php echo $t_n_url ?>]" type="hidden" id="t_y_<?php echo $t_n_url ?>_" />
196 <input name="t_v[<?php echo $t_n_url ?>]" type="hidden" id="t_v_<?php echo $t_n_url ?>_" />
197 <input name="t_h[<?php echo $t_n_url ?>]" type="hidden" id="t_h_<?php echo $t_n_url ?>_" />
199 <table id="<?php echo $t_n_url ?>" cellpadding="0" cellspacing="0" class="tab"
200 style="position: absolute;
201 left: <?php if (isset($tab_pos[$t_n])) echo $tab_pos[$t_n]["X"]; else echo rand(180, 800); ?>px;
202 top: <?php if (isset($tab_pos[$t_n])) echo $tab_pos[$t_n]["Y"]; else echo rand(30, 500); ?>px;
203 visibility: <?php if (isset($tab_pos[$t_n])) echo $tab_pos[$t_n]["H"] ? "visible" : "hidden"; ?>;
205 <thead>
206 <tr>
207 <?php
208 if(isset($_REQUEST['query'])) {
209 echo '<td class="select_all">';
210 echo '<input type="checkbox" value="select_all_'.htmlspecialchars($t_n_url).'" style="margin: 0px;" ';
211 echo 'id="select_all_'.htmlspecialchars($t_n_url).'" title="select all" ';
212 echo 'onclick="Select_all(\''. htmlspecialchars($t_n_url) .'\',\''.htmlspecialchars($GLOBALS['PMD_OUT']["OWNER"][$i]).'\')"></td>';
214 <td class="small_tab" onmouseover="this.className='small_tab2';"
215 onmouseout="this.className='small_tab';"
216 id="id_hide_tbody_<?php echo $t_n_url ?>"
217 onclick="Small_tab('<?php echo $t_n_url ?>', 1)"><?php
218 // no space alloawd here, between tags and content !!!
219 // JavaScript function does require this
220 if (! isset($tab_pos[$t_n]) || ! empty($tab_pos[$t_n]["V"])) {
221 echo 'v';
222 } else {
223 echo '&gt;';
225 ?></td>
226 <td class="small_tab_pref" onmouseover="this.className='small_tab_pref2';"
227 onmouseout="this.className='small_tab_pref';"
228 onclick="Start_tab_upd('<?php echo $GLOBALS['PMD_URL']["TABLE_NAME_SMALL"][$i]; ?>');">
229 <img src="pmd/images/exec_small.png" alt="" /></td>
230 <td nowrap="nowrap" id="id_zag_<?php echo $t_n_url ?>" class="tab_zag"
231 onmousedown="cur_click=document.getElementById('<?php echo $t_n_url ?>');"/
232 onmouseover="Table_onover('<?php echo $t_n_url ?>',0,<?php echo (isset($_REQUEST['query'])? 1 : 0 )?> )"
233 onmouseout="Table_onover('<?php echo $t_n_url ?>',1,<?php echo (isset($_REQUEST['query']) ? 1 : 0 )?>)">
234 <span class='owner'>
235 <?php
236 echo $GLOBALS['PMD_OUT']["OWNER"][$i];
237 echo '.</span>';
238 echo $GLOBALS['PMD_OUT']["TABLE_NAME_SMALL"][$i];
239 ?></td>
240 <?php
241 if(isset($_REQUEST['query'])) {
242 echo '<td class="tab_zag" onmouseover="Table_onover(\''.htmlspecialchars($t_n_url).'\',0,1)" id="id_zag_'.htmlspecialchars($t_n_url).'_2"';
243 echo 'onmousedown="cur_click=document.getElementById(\''.htmlspecialchars($t_n_url).'\');"';
244 echo 'onmouseout="Table_onover(\''.htmlspecialchars($t_n_url).'\',1,1)">';
246 </tr>
247 </thead>
248 <tbody id="id_tbody_<?php echo $t_n_url ?>"
249 <?php if ( isset($tab_pos[$t_n])) echo 'style="display: none;"'; ?>>
250 <?php
251 $display_field = PMA_getDisplayField($db, $GLOBALS['PMD']["TABLE_NAME_SMALL"][$i]);
252 for ($j = 0, $id_cnt = count($tab_column[$t_n]["COLUMN_ID"]); $j < $id_cnt; $j++) {
254 <tr id="id_tr_<?php
255 echo $GLOBALS['PMD_URL']["TABLE_NAME_SMALL"][$i] . '.'
256 . urlencode($tab_column[$t_n]["COLUMN_NAME"][$j]) ?>"
257 <?php
258 if ($display_field == $tab_column[$t_n]["COLUMN_NAME"][$j]) {
259 echo ' class="tab_field_3" ';
260 } else {
261 echo ' class="tab_field" ';
264 onmouseover="old_class = this.className; this.className = 'tab_field_2';"
265 onmouseout="this.className = old_class;"
266 onmousedown="Click_field('<?php
267 echo $GLOBALS['PMD_URL']["TABLE_NAME_SMALL"][$i]."','".urlencode($tab_column[$t_n]["COLUMN_NAME"][$j])."',";
268 if (! PMA_foreignkey_supported($GLOBALS['PMD']['TABLE_TYPE'][$i])) {
269 echo (isset($tables_pk_or_unique_keys[$t_n . "." . $tab_column[$t_n]["COLUMN_NAME"][$j]]) ? 1 : 0);
270 } else {
271 // if foreign keys are supported, it's not necessary that the
272 // index is a primary key
273 echo (isset($tables_all_keys[$t_n.".".$tab_column[$t_n]["COLUMN_NAME"][$j]]) ? 1 : 0);
275 ?>)">
276 <?php
277 if(isset($_REQUEST['query'])) {
278 echo '<td class="select_all">';
279 echo '<input value="'.htmlspecialchars($t_n_url).urlencode($tab_column[$t_n]["COLUMN_NAME"][$j]).'"';
280 echo 'type="checkbox" id="select_'.htmlspecialchars($t_n_url).'._'.urlencode($tab_column[$t_n]["COLUMN_NAME"][$j]).'" ';
281 echo 'style="margin: 0px;" title="select_'.urlencode($tab_column[$t_n]["COLUMN_NAME"][$j]).'" ';
282 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>';
284 <td width="10px" colspan="3"
285 id="<?php echo $t_n_url.".".urlencode($tab_column[$t_n]["COLUMN_NAME"][$j]) ?>">
286 <div style="white-space:nowrap">
287 <?php
288 if (isset($tables_pk_or_unique_keys[$t_n.".".$tab_column[$t_n]["COLUMN_NAME"][$j]])) {
290 <img src="pmd/styles/<?php echo $GLOBALS['PMD']['STYLE'];?>/images/FieldKey_small.png"
291 alt="*" />
292 <?php
293 } else {
295 <img src="pmd/styles/<?php echo $GLOBALS['PMD']['STYLE']?>/images/Field_small<?php
296 if (strstr($tab_column[$t_n]["TYPE"][$j],'char')
297 || strstr($tab_column[$t_n]["TYPE"][$j],'text')) {
298 echo '_char';
299 } elseif (strstr($tab_column[$t_n]["TYPE"][$j],'int')
300 || strstr($tab_column[$t_n]["TYPE"][$j],'float')
301 || strstr($tab_column[$t_n]["TYPE"][$j],'double')
302 || strstr($tab_column[$t_n]["TYPE"][$j],'decimal')) {
303 echo '_int';
304 } elseif (strstr($tab_column[$t_n]["TYPE"][$j],'date')
305 || strstr($tab_column[$t_n]["TYPE"][$j],'time')
306 || strstr($tab_column[$t_n]["TYPE"][$j],'year')) {
307 echo '_date';
309 ?>.png" alt="*" />
310 <?php
312 echo htmlspecialchars($tab_column[$t_n]["COLUMN_NAME"][$j]
313 . " : " . $tab_column[$t_n]["TYPE"][$j], ENT_QUOTES);
315 </div>
316 </td>
317 <?php
318 if(isset($_REQUEST['query'])) {
319 //$temp = $GLOBALS['PMD_OUT']["OWNER"][$i].'.'.$GLOBALS['PMD_OUT']["TABLE_NAME_SMALL"][$i];
320 echo '<td class="small_tab_pref" onmouseover="this.className=\'small_tab_pref2\';"';
321 echo 'onmouseout="this.className=\'small_tab_pref\';"';
322 echo 'onclick="Click_option(\'pmd_optionse\',\''.urlencode($tab_column[$t_n]["COLUMN_NAME"][$j]).'\',\''.$GLOBALS['PMD_OUT']["TABLE_NAME_SMALL"][$i].'\')" >';
323 echo '<img src="pmd/images/exec_small.png" title="options" alt="" /></td> ';
324 } ?>
325 </tr>
326 <?php
329 </tbody>
330 </table>
331 <?php
334 </form>
335 <div id="hint"></div>
336 <div id='layer_action' style="visibility:<?php echo $hidden ?>;">Load...</div>
338 <table id="layer_new_relation" style="visibility:<?php echo $hidden ?>;"
339 width="5%" border="0" cellpadding="0" cellspacing="0">
340 <tbody>
341 <tr>
342 <td class="frams1" width="10px"></td>
343 <td class="frams5" width="99%" ></td>
344 <td class="frams2" width="10px"><div class="bor"></div></td>
345 </tr>
346 <tr>
347 <td class="frams8"></td>
348 <td class="input_tab">
349 <table width="168" border="0" align="center" cellpadding="2" cellspacing="0">
350 <thead>
351 <tr>
352 <td colspan="2" align="center" nowrap="nowrap"><strong><?php echo __('Create relation'); ?></strong></td>
353 </tr>
354 </thead>
355 <tbody id="foreign_relation">
356 <tr>
357 <td colspan="2" align="center" nowrap="nowrap"><strong>FOREIGN KEY</strong></td>
358 </tr>
359 <tr>
360 <td width="58" nowrap="nowrap">on delete</td>
361 <td width="102"><select name="on_delete" id="on_delete">
362 <option value="nix" selected="selected">--</option>
363 <option value="CASCADE">CASCADE</option>
364 <option value="SET NULL">SET NULL</option>
365 <option value="NO ACTION">NO ACTION</option>
366 <option value="RESTRICT">RESTRICT</option>
367 </select>
368 </td>
369 </tr>
370 <tr>
371 <td nowrap="nowrap">on update</td>
372 <td><select name="on_update" id="on_update">
373 <option value="nix" selected="selected">--</option>
374 <option value="CASCADE">CASCADE</option>
375 <option value="SET NULL">SET NULL</option>
376 <option value="NO ACTION">NO ACTION</option>
377 <option value="RESTRICT">RESTRICT</option>
378 </select>
379 </td>
380 </tr>
381 </tbody>
382 <tbody>
383 <tr>
384 <td colspan="2" align="center" nowrap="nowrap">
385 <input type="button" class="butt" name="Button"
386 value="<?php echo __('OK'); ?>" onclick="New_relation()" />
387 <input type="button" class="butt" name="Button"
388 value="<?php echo __('Cancel'); ?>"
389 onclick="document.getElementById('layer_new_relation').style.visibility = 'hidden';" />
390 </td>
391 </tr>
392 </tbody>
393 </table>
394 </td>
395 <td class="frams6"></td>
396 </tr>
397 <tr>
398 <td class="frams4"><div class="bor"></div></td>
399 <td class="frams7"></td>
400 <td class="frams3"></td>
401 </tr>
402 </tbody>
403 </table>
405 <table id="layer_upd_relation" style="visibility:<?PHP echo $hidden ?>;"
406 width="5%" border="0" cellpadding="0" cellspacing="0">
407 <tbody>
408 <tr>
409 <td class="frams1" width="10px"></td>
410 <td class="frams5" width="99%"></td>
411 <td class="frams2" width="10px"><div class="bor"></div></td>
412 </tr>
413 <tr>
414 <td class="frams8"></td>
415 <td class="input_tab">
416 <table width="100%" border="0" align="center" cellpadding="2" cellspacing="0">
417 <tr>
418 <td colspan="3" align="center" nowrap="nowrap"><strong><?php echo __('Delete relation'); ?></strong></td>
419 </tr>
420 <tr>
421 <td colspan="3" align="center" nowrap="nowrap">
422 <input name="Button" type="button" class="butt"
423 onclick="Upd_relation()" value="<?php echo __('Delete'); ?>" />
424 <input type="button" class="butt" name="Button"
425 value="<?php echo __('Cancel'); ?>"
426 onclick="document.getElementById('layer_upd_relation').style.visibility = 'hidden'; Re_load();" />
427 </td>
428 </tr>
429 </table></td>
430 <td class="frams6"></td>
431 </tr>
432 <tr>
433 <td class="frams4"><div class="bor"></div></td>
434 <td class="frams7"></td>
435 <td class="frams3"></td>
436 </tr>
437 </tbody>
438 </table>
440 <table id="pmd_optionse" style="visibility:<?php echo $hidden ?>;"
441 width="5%" border="0" cellpadding="0" cellspacing="0">
442 <tbody>
443 <tr>
444 <td class="frams1" width="10px"></td>
445 <td class="frams5" width="99%" ></td>
446 <td class="frams2" width="10px"><div class="bor"></div></td>
447 </tr>
448 <tr>
449 <td class="frams8"></td>
450 <td class="input_tab">
451 <table width="168" border="0" align="center" cellpadding="2" cellspacing="0">
452 <thead>
453 <tr>
454 <td colspan="2" rowspan="2" id="option_col_name" nowrap="nowrap" align="center"></td>
455 </tr>
456 </thead>
457 <tbody id="where">
458 <tr><td align="center" nowrap="nowrap"><b>WHERE</b></td></tr>
459 <tr>
460 <td width="58" nowrap="nowrap"><?php echo __('Relation operator'); ?></td>
461 <td width="102"><select name="rel_opt" id="rel_opt">
462 <option value="--" selected="selected"> -- </option>
463 <option value="=" > = </option>
464 <option value=">"> > </option>
465 <option value="<"> < </option>
466 <option value=">="> >= </option>
467 <option value="<="> <= </option>
468 <option value="NOT"> NOT </option>
469 <option value="IN"> IN </option>
470 <option value="EXCEPT"> <?php echo __('Except'); ?> </option>
471 <option value="NOT IN"> NOT IN </option>
472 </select>
473 </td>
474 </tr>
475 <tr>
476 <td nowrap="nowrap"><?php echo __('Value'); ?>/<br /><?php echo __('subquery'); ?></td>
477 <td><textarea id="Query" value="" cols="18"></textarea>
478 </td>
479 </tr>
480 <tr><td align="center" nowrap="nowrap"><b><?php echo __('Rename to'); ?></b></td></tr>
481 <tr>
482 <td width="58" nowrap="nowrap"><?php echo __('New name'); ?></td>
483 <td width="102"><input type="text" value="" id="new_name"/></td>
484 </tr>
485 <tr><td align="center" nowrap="nowrap"><b><?php echo __('Aggregate'); ?></b></td></tr>
486 <tr>
487 <td width="58" nowrap="nowrap"><?php echo __('Operator'); ?></td>
488 <td width="102"><select name="operator" id="operator">
489 <option value="---" selected="selected">---</option>
490 <option value="sum" > SUM </option>
491 <option value="min"> MIN </option>
492 <option value="max"> MAX </option>
493 <option value="avg"> AVG </option>
494 <option value="count"> COUNT </option>
495 </select>
496 </td></tr>
497 <tr>
498 <td nowrap="nowrap" width="58" align="center"><b>GROUP BY</b></td>
499 <td><input type="checkbox" value="groupby" id="groupby"/></td>
500 </tr>
501 <tr>
502 <td nowrap="nowrap" width="58" align="center"><b>ORDER BY</b></td>
503 <td><input type="checkbox" value="orderby" id="orderby"/></td>
504 </tr>
505 <tr><td align="center" nowrap="nowrap"><b>HAVING</b></td></tr>
506 <tr>
507 <td width="58" nowrap="nowrap"><?php echo __('Operator'); ?></td>
508 <td width="102"><select name="h_operator" id="h_operator">
509 <option value="---" selected="selected">---</option>
510 <option value="None" > <?php echo __('None'); ?> </option>
511 <option value="sum" > SUM </option>
512 <option value="min"> MIN </option>
513 <option value="max"> MAX </option>
514 <option value="avg"> AVG </option>
515 <option value="count"> COUNT </option>
516 </select>
517 </td></tr>
518 <tr>
519 <td width="58" nowrap="nowrap"><?php echo __('Relation operator'); ?></td>
520 <td width="102"><select name="h_rel_opt" id="h_rel_opt">
521 <option value="--" selected="selected"> -- </option>
522 <option value="=" > = </option>
523 <option value=">"> > </option>
524 <option value="<"> < </option>
525 <option value=">="> >= </option>
526 <option value="<="> <= </option>
527 <option value="NOT"> NOT </option>
528 <option value="IN"> IN </option>
529 <option value="EXCEPT"> <?php echo __('Except'); ?> </option>
530 <option value="NOT IN"> NOT IN </option>
531 </select>
532 </td>
533 </tr>
534 <tr>
535 <td width="58" nowrap="nowrap"><?php echo __('Value'); ?>/<br/><?php echo __('subquery'); ?></td>
536 <td width="102"><textarea id="having" value="" cols="18"></textarea></td>
537 </tr>
538 </tbody>
539 <tbody>
540 <tr>
541 <td colspan="2" align="center" nowrap="nowrap">
542 <input type="button" class="butt" name="Button"
543 value="<?php echo __('OK'); ?>" onclick="add_object()" />
544 <input type="button" class="butt" name="Button"
545 value="<?php echo __('Cancel'); ?>"
546 onclick="Close_option()" />
547 </td>
548 </tr>
549 </tbody>
550 </table>
551 </td>
552 <td class="frams6"></td>
553 </tr>
554 <tr>
555 <td class="frams4"><div class="bor"></div></td>
556 <td class="frams7"></td>
557 <td class="frams3"></td>
558 </tr>
559 </tbody>
560 </table>
562 <table id="query_rename_to" style="visibility:<?php echo $hidden ?>;"
563 width="5%" border="0" cellpadding="0" cellspacing="0">
564 <tbody>
565 <tr>
566 <td class="frams1" width="10px"></td>
567 <td class="frams5" width="99%" ></td>
568 <td class="frams2" width="10px"><div class="bor"></div></td>
569 </tr>
570 <tr>
571 <td class="frams8"></td>
572 <td class="input_tab">
573 <table width="168" border="0" align="center" cellpadding="2" cellspacing="0">
574 <thead>
575 <tr>
576 <td colspan="2" align="center" nowrap="nowrap"><strong><?php echo __('Rename to'); ?></strong></td>
577 </tr>
578 </thead>
579 <tbody id="rename_to">
580 <tr>
581 <td width="58" nowrap="nowrap"><?php echo __('New name'); ?></td>
582 <td width="102">
583 <input type="text" value="" id="e_rename"/>
584 </td>
585 </tr>
586 </tbody>
587 <tbody>
588 <tr>
589 <td colspan="2" align="center" nowrap="nowrap">
590 <input type="button" class="butt" name="Button"
591 value="<?php echo __('OK'); ?>" onclick="edit('Rename')" />
592 <input type="button" class="butt" name="Button"
593 value="<?php echo __('Cancel'); ?>"
594 onclick="document.getElementById('query_rename_to').style.visibility = 'hidden';" />
595 </td>
596 </tr>
597 </tbody>
598 </table>
599 </td>
600 <td class="frams6"></td>
601 </tr>
602 <tr>
603 <td class="frams4"><div class="bor"></div></td>
604 <td class="frams7"></td>
605 <td class="frams3"></td>
606 </tr>
607 </tbody>
608 </table>
610 <table id="query_having" style="visibility:<?php echo $hidden ?>;"
611 width="5%" border="0" cellpadding="0" cellspacing="0">
612 <tbody>
613 <tr>
614 <td class="frams1" width="10px"></td>
615 <td class="frams5" width="99%" ></td>
616 <td class="frams2" width="10px"><div class="bor"></div></td>
617 </tr>
618 <tr>
619 <td class="frams8"></td>
620 <td class="input_tab">
621 <table width="168" border="0" align="center" cellpadding="2" cellspacing="0">
622 <thead>
623 <tr>
624 <td colspan="2" align="center" nowrap="nowrap"><strong>HAVING</strong></td>
625 </tr>
626 </thead>
627 <tbody id="rename_to">
628 <tr>
629 <td width="58" nowrap="nowrap"><?php echo __('Operator'); ?></td>
630 <td width="102"><select name="hoperator" id="hoperator">
631 <option value="---" selected="selected">---</option>
632 <option value="None" > None </option>
633 <option value="sum" > SUM </option>
634 <option value="min"> MIN </option>
635 <option value="max"> MAX </option>
636 <option value="avg"> AVG </option>
637 <option value="count"> COUNT </option>
638 </select>
639 </td></tr>
640 <tr>
641 <tr>
642 <td width="58" nowrap="nowrap"><?php echo __('Operator'); ?></td>
643 <td width="102"><select name="hrel_opt" id="hrel_opt">
644 <option value="--" selected="selected"> -- </option>
645 <option value="=" > = </option>
646 <option value=">"> > </option>
647 <option value="<"> < </option>
648 <option value=">="> >= </option>
649 <option value="<="> <= </option>
650 <option value="NOT"> NOT </option>
651 <option value="IN"> IN </option>
652 <option value="EXCEPT"> <?php echo __('Except'); ?> </option>
653 <option value="NOT IN"> NOT IN </option>
654 </select>
655 </td>
656 </tr>
657 <tr>
658 <td nowrap="nowrap"><?php echo __('Value'); ?>/<br /><?php echo __('subquery'); ?></td>
659 <td><textarea id="hQuery" value="" cols="18"></textarea>
660 </td>
661 </tr>
662 </tbody>
663 <tbody>
664 <tr>
665 <td colspan="2" align="center" nowrap="nowrap">
666 <input type="button" class="butt" name="Button"
667 value="<?php echo __('OK'); ?>" onclick="edit('Having')" />
668 <input type="button" class="butt" name="Button"
669 value="<?php echo __('Cancel'); ?>"
670 onclick="document.getElementById('query_having').style.visibility = 'hidden';" />
671 </td>
672 </tr>
673 </tbody>
674 </table>
675 </td>
676 <td class="frams6"></td>
677 </tr>
678 <tr>
679 <td class="frams4"><div class="bor"></div></td>
680 <td class="frams7"></td>
681 <td class="frams3"></td>
682 </tr>
683 </tbody>
684 </table>
686 <table id="query_Aggregate" style="visibility:<?php echo $hidden ?>;"
687 width="5%" border="0" cellpadding="0" cellspacing="0">
688 <tbody>
689 <tr>
690 <td class="frams1" width="10px"></td>
691 <td class="frams5" width="99%" ></td>
692 <td class="frams2" width="10px"><div class="bor"></div></td>
693 </tr>
694 <tr>
695 <td class="frams8"></td>
696 <td class="input_tab">
697 <table width="168" border="0" align="center" cellpadding="2" cellspacing="0">
698 <thead>
699 <tr>
700 <td colspan="2" align="center" nowrap="nowrap"><strong><?php echo __('Aggregate'); ?></strong></td>
701 </tr>
702 </thead>
703 <tbody>
704 <tr>
705 <td width="58" nowrap="nowrap"><?php echo __('Operator'); ?></td>
706 <td width="102">
707 <select name="operator" id="e_operator">
708 <option value="---" selected="selected">---</option>
709 <option value="sum" > SUM </option>
710 <option value="min"> MIN </option>
711 <option value="max"> MAX </option>
712 <option value="avg"> AVG </option>
713 <option value="avg"> COUNT </option>
714 </select>
715 </td></tr>
716 </tbody>
717 <tbody>
718 <tr>
719 <td colspan="2" align="center" nowrap="nowrap">
720 <input type="button" class="butt" name="Button"
721 value="<?php echo __('OK'); ?>" onclick="edit('Aggregate')" />
722 <input type="button" class="butt" name="Button"
723 value="<?php echo __('Cancel'); ?>"
724 onclick="document.getElementById('query_Aggregate').style.visibility = 'hidden';" />
725 </td>
726 </tr>
727 </tbody>
728 </table>
729 </td>
730 <td class="frams6"></td>
731 </tr>
732 <tr>
733 <td class="frams4"><div class="bor"></div></td>
734 <td class="frams7"></td>
735 <td class="frams3"></td>
736 </tr>
737 </tbody>
738 </table>
740 <table id="query_where" style="visibility:<?php echo $hidden ?>;"
741 width="5%" border="0" cellpadding="0" cellspacing="0">
742 <tbody>
743 <tr>
744 <td class="frams1" width="10px"></td>
745 <td class="frams5" width="99%" ></td>
746 <td class="frams2" width="10px"><div class="bor"></div></td>
747 </tr>
748 <tr>
749 <td class="frams8"></td>
750 <td class="input_tab">
751 <table width="168" border="0" align="center" cellpadding="2" cellspacing="0">
752 <thead>
753 <tr>
754 <td colspan="2" align="center" nowrap="nowrap"><strong>WHERE</strong></td>
755 </tr>
756 </thead>
757 <tbody id="rename_to">
758 <tr>
759 <td width="58" nowrap="nowrap"><?php echo __('Operator'); ?></td>
760 <td width="102"><select name="erel_opt" id="erel_opt">
761 <option value="--" selected="selected"> -- </option>
762 <option value="=" > = </option>
763 <option value=">"> > </option>
764 <option value="<"> < </option>
765 <option value=">="> >= </option>
766 <option value="<="> <= </option>
767 <option value="NOT"> NOT </option>
768 <option value="IN"> IN </option>
769 <option value="EXCEPT"> <?php echo __('Except'); ?> </option>
770 <option value="NOT IN"> NOT IN </option>
771 </select>
772 </td>
773 </tr>
774 <tr>
775 <td nowrap="nowrap"><?php echo __('Value'); ?>/<br /><?php echo __('subquery'); ?></td>
776 <td><textarea id="eQuery" value="" cols="18"></textarea>
777 </td>
778 </tr>
779 </tbody>
780 <tbody>
781 <tr>
782 <td colspan="2" align="center" nowrap="nowrap">
783 <input type="button" class="butt" name="Button"
784 value="<?php echo __('OK'); ?>" onclick="edit('Where')" />
785 <input type="button" class="butt" name="Button"
786 value="<?php echo __('Cancel'); ?>"
787 onclick="document.getElementById('query_where').style.visibility = 'hidden';" />
788 </td>
789 </tr>
790 </tbody>
791 </table>
792 </td>
793 <td class="frams6"></td>
794 </tr>
795 <tr>
796 <td class="frams4"><div class="bor"></div></td>
797 <td class="frams7"></td>
798 <td class="frams3"></td>
799 </tr>
800 </tbody>
801 </table>
803 <?php
804 if($_REQUEST['query']) {
805 echo '<div class="panel">';
806 echo '<div style="clear:both;"></div>';
807 echo '<div id="ab"></div>';
808 echo '<div style="clear:both;"></div>';
809 echo '</div>';
810 echo '<a class="trigger" href="#">' . __('Active options') . '</a>';
811 echo '<div id="filter"></div>';
812 echo '<div id="box">';
813 echo '<span id="boxtitle"></span>';
814 echo '<form method="post" action="db_qbe.php" >';
815 echo '<textarea cols="80" name="sql_query" id="textSqlquery" rows="15"></textarea><div id="tblfooter">';
816 echo ' <input type="submit" name="submit_sql" class="btn">';
817 echo ' <input type="button" name="cancel" value="Cancel" onClick="closebox()" class="btn">';
818 echo PMA_generate_common_hidden_inputs($GLOBALS['db']);
819 echo '</div></p>';
820 echo '</form></div>';
822 } ?>
825 <!-- cache images -->
826 <img src="pmd/images/2leftarrow_m.png" width="0" height="0" alt="" />
827 <img src="pmd/images/rightarrow1.png" width="0" height="0" alt="" />
828 <img src="pmd/images/rightarrow2.png" width="0" height="0" alt="" />
829 <img src="pmd/images/uparrow2_m.png" width="0" height="0" alt="" />
830 </body>
831 </html>