Translation update done using Pootle.
[phpmyadmin.git] / pmd_general.php
blob7f62bf227c712507043a3bb7073a0a040302a051
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 * @package PhpMyAdmin-Designer
5 */
7 /**
9 */
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">
28 // <![CDATA[
29 <?php
30 echo '
31 var server = "' . PMA_escapeJsString($server) . '";
32 var db = "' . PMA_escapeJsString($db) . '";
33 var token = "' . PMA_escapeJsString($token) . '";';
34 echo "\n";
35 if (isset($_REQUEST['query'])) {
36 echo '
37 $(document).ready(function() {
38 $(".trigger").click(function() {
39 $(".panel").toggle("fast");
40 $(this).toggleClass("active");
41 return false;
42 });
43 });';
46 // ]]>
47 </script>
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>
51 <!--[if IE]>
52 <script src="js/pmd/iecanvas.js" type="text/javascript"></script>
53 <![endif]-->
54 <?php
55 echo $script_tabs . $script_contr . $script_display_field;
58 </head>
59 <body onload="Main()" class="general_body" id="pmd_body">
61 <div class="pmd_header" id="top_menu">
62 <a href="#"
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=""
93 /><a href="#"
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"
97 /></a>
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');
111 echo '"/></a>'; }?>
112 <a href="#"
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>
116 </div>
118 <form action="" method="post" name="form1">
119 <div id="osn_tab">
120 <canvas class="pmd" id="canvas" width="100" height="100" onclick="Canvas_click(this)"></canvas>
121 </div>
122 <div id="layer_menu" style="display:none;">
123 <div align="center" style="padding-top:5px;">
124 <a href="#"
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>
128 <a href="#"
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>
132 </div>
134 <div id="id_scroll_tab" class="scroll_tab">
135 <table width="100%" style="padding-left: 3px;">
136 <?php
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>
145 <td width="1px">
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]; ?>"
151 <?php
152 if (isset($tab_pos[$GLOBALS['PMD']["TABLE_NAME"][$i]])) {
153 echo $tab_pos[$GLOBALS['PMD']["TABLE_NAME"][$i]]["H"] ? 'checked="checked"' : '';
154 } else {
155 echo 'checked="checked"';
157 ?> /></td>
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>
162 </tr>
163 <?php
166 </table>
167 </div>
169 <div align="center">
170 <?php echo __('Number of tables') . ': ' . $name_cnt; ?>
171 </div>
172 <div align="right">
173 <div id="layer_menu_sizer" onmousedown="layer_menu_cur_click=1">
174 </div>
175 </div>
176 </div>
179 <?php
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"; ?>;
196 <thead>
197 <tr>
198 <?php
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"])) {
212 echo 'v';
213 } else {
214 echo '&gt;';
216 ?></td>
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 )?>)">
225 <span class='owner'>
226 <?php
227 echo $GLOBALS['PMD_OUT']["OWNER"][$i];
228 echo '.</span>';
229 echo $GLOBALS['PMD_OUT']["TABLE_NAME_SMALL"][$i];
230 ?></td>
231 <?php
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)">';
237 </tr>
238 </thead>
239 <tbody id="id_tbody_<?php echo $t_n_url ?>"
240 <?php
241 if (isset($tab_pos[$t_n]) && empty($tab_pos[$t_n]["V"])) {
242 echo 'style="display: none;"';
243 }?>>
244 <?php
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++) {
248 <tr id="id_tr_<?php
249 echo $GLOBALS['PMD_URL']["TABLE_NAME_SMALL"][$i] . '.'
250 . urlencode($tab_column[$t_n]["COLUMN_NAME"][$j]) ?>"
251 <?php
252 if ($display_field == $tab_column[$t_n]["COLUMN_NAME"][$j]) {
253 echo ' class="tab_field_3" ';
254 } else {
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);
264 } else {
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);
269 ?>)">
270 <?php
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">
281 <?php
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"
285 alt="*" />
286 <?php
287 } else {
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')) {
292 echo '_char';
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')) {
297 echo '_int';
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')) {
301 echo '_date';
303 ?>.png" alt="*" />
304 <?php
306 echo htmlspecialchars($tab_column[$t_n]["COLUMN_NAME"][$j]
307 . " : " . $tab_column[$t_n]["TYPE"][$j], ENT_QUOTES);
309 </div>
310 </td>
311 <?php
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> ';
318 } ?>
319 </tr>
320 <?php
323 </tbody>
324 </table>
325 <?php
328 </form>
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">
334 <tbody>
335 <tr>
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>
339 </tr>
340 <tr>
341 <td class="frams8"></td>
342 <td class="input_tab">
343 <table width="168" border="0" align="center" cellpadding="2" cellspacing="0">
344 <thead>
345 <tr>
346 <td colspan="2" align="center" nowrap="nowrap"><strong><?php echo __('Create relation'); ?></strong></td>
347 </tr>
348 </thead>
349 <tbody id="foreign_relation">
350 <tr>
351 <td colspan="2" align="center" nowrap="nowrap"><strong>FOREIGN KEY</strong></td>
352 </tr>
353 <tr>
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>
361 </select>
362 </td>
363 </tr>
364 <tr>
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>
372 </select>
373 </td>
374 </tr>
375 </tbody>
376 <tbody>
377 <tr>
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';" />
384 </td>
385 </tr>
386 </tbody>
387 </table>
388 </td>
389 <td class="frams6"></td>
390 </tr>
391 <tr>
392 <td class="frams4"><div class="bor"></div></td>
393 <td class="frams7"></td>
394 <td class="frams3"></td>
395 </tr>
396 </tbody>
397 </table>
399 <table id="layer_upd_relation" style="display:none;"
400 width="5%" border="0" cellpadding="0" cellspacing="0">
401 <tbody>
402 <tr>
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>
406 </tr>
407 <tr>
408 <td class="frams8"></td>
409 <td class="input_tab">
410 <table width="100%" border="0" align="center" cellpadding="2" cellspacing="0">
411 <tr>
412 <td colspan="3" align="center" nowrap="nowrap"><strong><?php echo __('Delete relation'); ?></strong></td>
413 </tr>
414 <tr>
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();" />
421 </td>
422 </tr>
423 </table></td>
424 <td class="frams6"></td>
425 </tr>
426 <tr>
427 <td class="frams4"><div class="bor"></div></td>
428 <td class="frams7"></td>
429 <td class="frams3"></td>
430 </tr>
431 </tbody>
432 </table>
434 <table id="pmd_optionse" style="display:none;"
435 width="5%" border="0" cellpadding="0" cellspacing="0">
436 <tbody>
437 <tr>
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>
441 </tr>
442 <tr>
443 <td class="frams8"></td>
444 <td class="input_tab">
445 <table width="168" border="0" align="center" cellpadding="2" cellspacing="0">
446 <thead>
447 <tr>
448 <td colspan="2" rowspan="2" id="option_col_name" nowrap="nowrap" align="center"></td>
449 </tr>
450 </thead>
451 <tbody id="where">
452 <tr><td align="center" nowrap="nowrap"><b>WHERE</b></td></tr>
453 <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>
466 </select>
467 </td>
468 </tr>
469 <tr>
470 <td nowrap="nowrap"><?php echo __('Value'); ?>/<br /><?php echo __('subquery'); ?></td>
471 <td><textarea id="Query" value="" cols="18"></textarea>
472 </td>
473 </tr>
474 <tr><td align="center" nowrap="nowrap"><b><?php echo __('Rename to'); ?></b></td></tr>
475 <tr>
476 <td width="58" nowrap="nowrap"><?php echo __('New name'); ?></td>
477 <td width="102"><input type="text" value="" id="new_name"/></td>
478 </tr>
479 <tr><td align="center" nowrap="nowrap"><b><?php echo __('Aggregate'); ?></b></td></tr>
480 <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>
489 </select>
490 </td></tr>
491 <tr>
492 <td nowrap="nowrap" width="58" align="center"><b>GROUP BY</b></td>
493 <td><input type="checkbox" value="groupby" id="groupby"/></td>
494 </tr>
495 <tr>
496 <td nowrap="nowrap" width="58" align="center"><b>ORDER BY</b></td>
497 <td><input type="checkbox" value="orderby" id="orderby"/></td>
498 </tr>
499 <tr><td align="center" nowrap="nowrap"><b>HAVING</b></td></tr>
500 <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>
510 </select>
511 </td></tr>
512 <tr>
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>
525 </select>
526 </td>
527 </tr>
528 <tr>
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>
531 </tr>
532 </tbody>
533 <tbody>
534 <tr>
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()" />
541 </td>
542 </tr>
543 </tbody>
544 </table>
545 </td>
546 <td class="frams6"></td>
547 </tr>
548 <tr>
549 <td class="frams4"><div class="bor"></div></td>
550 <td class="frams7"></td>
551 <td class="frams3"></td>
552 </tr>
553 </tbody>
554 </table>
556 <table id="query_rename_to" style="display:none;"
557 width="5%" border="0" cellpadding="0" cellspacing="0">
558 <tbody>
559 <tr>
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>
563 </tr>
564 <tr>
565 <td class="frams8"></td>
566 <td class="input_tab">
567 <table width="168" border="0" align="center" cellpadding="2" cellspacing="0">
568 <thead>
569 <tr>
570 <td colspan="2" align="center" nowrap="nowrap"><strong><?php echo __('Rename to'); ?></strong></td>
571 </tr>
572 </thead>
573 <tbody id="rename_to">
574 <tr>
575 <td width="58" nowrap="nowrap"><?php echo __('New name'); ?></td>
576 <td width="102">
577 <input type="text" value="" id="e_rename"/>
578 </td>
579 </tr>
580 </tbody>
581 <tbody>
582 <tr>
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';" />
589 </td>
590 </tr>
591 </tbody>
592 </table>
593 </td>
594 <td class="frams6"></td>
595 </tr>
596 <tr>
597 <td class="frams4"><div class="bor"></div></td>
598 <td class="frams7"></td>
599 <td class="frams3"></td>
600 </tr>
601 </tbody>
602 </table>
604 <table id="query_having" style="display:none;"
605 width="5%" border="0" cellpadding="0" cellspacing="0">
606 <tbody>
607 <tr>
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>
611 </tr>
612 <tr>
613 <td class="frams8"></td>
614 <td class="input_tab">
615 <table width="168" border="0" align="center" cellpadding="2" cellspacing="0">
616 <thead>
617 <tr>
618 <td colspan="2" align="center" nowrap="nowrap"><strong>HAVING</strong></td>
619 </tr>
620 </thead>
621 <tbody id="rename_to">
622 <tr>
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>
632 </select>
633 </td></tr>
634 <tr>
635 <tr>
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>
648 </select>
649 </td>
650 </tr>
651 <tr>
652 <td nowrap="nowrap"><?php echo __('Value'); ?>/<br /><?php echo __('subquery'); ?></td>
653 <td><textarea id="hQuery" value="" cols="18"></textarea>
654 </td>
655 </tr>
656 </tbody>
657 <tbody>
658 <tr>
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';" />
665 </td>
666 </tr>
667 </tbody>
668 </table>
669 </td>
670 <td class="frams6"></td>
671 </tr>
672 <tr>
673 <td class="frams4"><div class="bor"></div></td>
674 <td class="frams7"></td>
675 <td class="frams3"></td>
676 </tr>
677 </tbody>
678 </table>
680 <table id="query_Aggregate" style="display:none;"
681 width="5%" border="0" cellpadding="0" cellspacing="0">
682 <tbody>
683 <tr>
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>
687 </tr>
688 <tr>
689 <td class="frams8"></td>
690 <td class="input_tab">
691 <table width="168" border="0" align="center" cellpadding="2" cellspacing="0">
692 <thead>
693 <tr>
694 <td colspan="2" align="center" nowrap="nowrap"><strong><?php echo __('Aggregate'); ?></strong></td>
695 </tr>
696 </thead>
697 <tbody>
698 <tr>
699 <td width="58" nowrap="nowrap"><?php echo __('Operator'); ?></td>
700 <td width="102">
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>
708 </select>
709 </td></tr>
710 </tbody>
711 <tbody>
712 <tr>
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';" />
719 </td>
720 </tr>
721 </tbody>
722 </table>
723 </td>
724 <td class="frams6"></td>
725 </tr>
726 <tr>
727 <td class="frams4"><div class="bor"></div></td>
728 <td class="frams7"></td>
729 <td class="frams3"></td>
730 </tr>
731 </tbody>
732 </table>
734 <table id="query_where" style="display:none;"
735 width="5%" border="0" cellpadding="0" cellspacing="0">
736 <tbody>
737 <tr>
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>
741 </tr>
742 <tr>
743 <td class="frams8"></td>
744 <td class="input_tab">
745 <table width="168" border="0" align="center" cellpadding="2" cellspacing="0">
746 <thead>
747 <tr>
748 <td colspan="2" align="center" nowrap="nowrap"><strong>WHERE</strong></td>
749 </tr>
750 </thead>
751 <tbody id="rename_to">
752 <tr>
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>
765 </select>
766 </td>
767 </tr>
768 <tr>
769 <td nowrap="nowrap"><?php echo __('Value'); ?>/<br /><?php echo __('subquery'); ?></td>
770 <td><textarea id="eQuery" value="" cols="18"></textarea>
771 </td>
772 </tr>
773 </tbody>
774 <tbody>
775 <tr>
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';" />
782 </td>
783 </tr>
784 </tbody>
785 </table>
786 </td>
787 <td class="frams6"></td>
788 </tr>
789 <tr>
790 <td class="frams4"><div class="bor"></div></td>
791 <td class="frams7"></td>
792 <td class="frams3"></td>
793 </tr>
794 </tbody>
795 </table>
797 <?php
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>';
803 echo '</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']);
813 echo '</div></p>';
814 echo '</form></div>';
816 } ?>
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>
825 </body>
826 </html>