Tuned logo colors in setup
[phpmyadmin.git] / pmd_general.php
blob29c24836e65a438bb729110e7ef3d12ca8a48a3b
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 * phpMyAdmin designer general code
6 * @package PhpMyAdmin-Designer
7 */
9 /**
12 require_once 'libraries/common.inc.php';
13 require_once 'libraries/pmd_common.php';
15 $script_display_field = get_tables_info();
16 $tab_column = get_columns_info();
17 $script_tables = get_script_tabs();
18 $script_contr = get_script_contr();
19 $tab_pos = get_tab_pos();
20 $tables_pk_or_unique_keys = get_pk_or_unique_keys();
21 $tables_all_keys = get_all_keys();
23 $params = array('lang' => $GLOBALS['lang']);
24 if (isset($_GET['db'])) {
25 $params['db'] = $_GET['db'];
28 $response = PMA_Response::getInstance();
29 $response->getFooter()->setMinimal();
30 $header = $response->getHeader();
31 $header->setBodyId('pmd_body');
32 $scripts = $header->getScripts();
33 $scripts->addFile('pmd/ajax.js');
34 $scripts->addFile('pmd/history.js');
35 $scripts->addFile('pmd/move.js');
36 $scripts->addFile('pmd/iecanvas.js', true);
37 $scripts->addFile('pmd/init.js');
38 $scripts->addFile('jquery/jquery.fullscreen.js');
40 require 'libraries/db_common.inc.php';
41 require 'libraries/db_info.inc.php';
43 // Embed some data into HTML, later it will be read
44 // by pmd/init.js and converted to JS variables.
45 echo '<div id="script_server" class="hide">';
46 echo htmlspecialchars($GLOBALS['server']);
47 echo '</div>';
48 echo '<div id="script_db" class="hide">';
49 echo htmlspecialchars($_GET['db']);
50 echo '</div>';
51 echo '<div id="script_token" class="hide">';
52 echo htmlspecialchars($_GET['token']);
53 echo '</div>';
54 echo '<div id="script_tables" class="hide">';
55 echo htmlspecialchars(json_encode($script_tables));
56 echo '</div>';
57 echo '<div id="script_contr" class="hide">';
58 echo htmlspecialchars(json_encode($script_contr));
59 echo '</div>';
60 echo '<div id="script_display_field" class="hide">';
61 echo htmlspecialchars(json_encode($script_display_field));
62 echo '</div>';
65 <div class="pmd_header" id="top_menu">
66 <a href="#" onclick="Show_left_menu(document.getElementById('key_Show_left_menu')); return false"
67 class="M_butt first" target="_self">
68 <img id='key_Show_left_menu' title="<?php echo __('Show/Hide left menu'); ?>" alt="v"
69 src="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/downarrow2_m.png'); ?>" />
70 </a>
71 <a href="#" id="enterFullscreen" onclick="Enter_fullscreen(); return false" class="M_butt" target="_self">
72 <img title="<?php echo __('View in fullscreen') ?>" alt=""
73 src="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/viewInFullscreen.png'); ?>" />
74 </a>
75 <a href="#" id="exitFullscreen" onclick="Exit_fullscreen(); return false" class="M_butt hide" target="_self">
76 <img title="<?php echo __('Exit fullscreen') ?>" alt=""
77 src="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/exitFullscreen.png'); ?>" />
78 </a>
79 <img class="M_bord" src="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/bord.png'); ?>" alt="" />
80 <a href="#" onclick="Save2(); return false" class="M_butt" target="_self">
81 <img title="<?php echo __('Save position') ?>" alt=""
82 src="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/save.png'); ?>" />
83 </a>
84 <a href="#" onclick="Start_table_new(); return false"
85 class="M_butt" target="_self">
86 <img title="<?php echo __('Create table')?>" alt=""
87 src="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/table.png'); ?>" />
88 </a>
89 <a href="#" onclick="Start_relation(); return false" class="M_butt" id="rel_button" target="_self">
90 <img title="<?php echo __('Create relation') ?>" alt=""
91 src="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/relation.png'); ?>" />
92 </a>
93 <a href="#" onclick="Start_display_field(); return false"
94 class="M_butt" id="display_field_button" target="_self">
95 <img title="<?php echo __('Choose column to display') ?>" alt=""
96 src="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/display_field.png'); ?>" />
97 </a>
98 <a href="#" onclick="location.reload(); return false" class="M_butt" target="_self">
99 <img title="<?php echo __('Reload'); ?>" alt=""
100 src="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/reload.png'); ?>" />
101 </a>
102 <a href="<?php echo PMA_Util::getDocuLink('faq', 'faq6-31') ?>" target="documentation" class="M_butt" target="_self">
103 <img title="<?php echo __('Help'); ?>" alt=""
104 src="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/help.png'); ?>" />
105 </a>
106 <img class="M_bord" src="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/bord.png'); ?>" alt="" />
107 <a href="#" onclick="Angular_direct(); return false"
108 class="M_butt" id="angular_direct_button" target="_self">
109 <img title="<?php echo __('Angular links') . ' / ' . __('Direct links'); ?>" alt=""
110 src="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/ang_direct.png'); ?>" />
111 </a>
112 <a href="#" onclick="Grid(); return false" class="M_butt" id="grid_button" target="_self">
113 <img title="<?php echo __('Snap to grid') ?>"
114 src="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/grid.png'); ?>" alt="" />
115 </a>
116 <img class="M_bord" src="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/bord.png'); ?>" alt="" />
117 <a href="#" onclick="Small_tab_all(document.getElementById('key_SB_all')); return false"
118 class="M_butt" target="_self">
119 <img id='key_SB_all' title="<?php echo __('Small/Big All'); ?>" alt="v"
120 src="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/downarrow1.png'); ?>" />
121 </a>
122 <a href="#" onclick="Small_tab_invert(); return false" class="M_butt" target="_self" >
123 <img title="<?php echo __('Toggle small/big'); ?>" alt="key"
124 src="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/bottom.png'); ?>" />
125 </a>
126 <a href="#" onclick="Relation_lines_invert(); return false" class="M_butt" target="_self" >
127 <img title="<?php echo __('Toggle relation lines'); ?>" alt="key"
128 src="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/toggle_lines.png'); ?>" />
129 </a>
130 <img class="M_bord" src="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/bord.png'); ?>" alt="" />
131 <a href="#" onclick="PDF_save(); return false" class="M_butt ajax">
132 <img src="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/pdf.png'); ?>" alt="key"
133 width="20" height="20" title="<?php echo __('Import/Export coordinates for PDF schema'); ?>" />
134 </a>
135 <?php
136 if (isset($_REQUEST['query'])) {
137 echo '<a href="#" onclick="build_query(\'SQL Query on Database\', 0)" onmousedown="return false;"
138 class="M_butt" target="_self">';
139 echo '<img src="'. $_SESSION['PMA_Theme']->getImgPath('pmd/query_builder.png') . '" alt="key" width="20" height="20" title="';
140 echo __('Build Query');
141 echo '"/></a>';
144 <a href="#" onclick="Top_menu_right(document.getElementById('key_Left_Right')); return false"
145 class="M_butt last" target="_self">
146 <img src="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/2rightarrow_m.png'); ?>"
147 id="key_Left_Right" alt=">" title="<?php echo __('Move Menu'); ?>" />
148 </a>
149 </div>
151 <div id="canvas_outer">
152 <form action="" method="post" name="form1">
153 <div id="osn_tab">
154 <canvas class="pmd" id="canvas" width="100" height="100" onclick="Canvas_click(this)"></canvas>
155 </div>
156 <div id="layer_menu" style="display:none;">
157 <div class="center" style="padding-top:5px;">
158 <a href="#"
159 onclick="Hide_tab_all(document.getElementById('key_HS_all')); return false" class="M_butt" target="_self">
160 <img title="<?php echo __('Hide/Show all'); ?>" alt="v"
161 src="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/downarrow1.png'); ?>" id='key_HS_all' /></a>
162 <a href="#"
163 onclick="No_have_constr(document.getElementById('key_HS')); return false" class="M_butt" target="_self">
164 <img title="<?php echo __('Hide/Show Tables with no relation'); ?>" alt="v"
165 src="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/downarrow2.png'); ?>" id='key_HS' /></a>
166 </div>
168 <div id="id_scroll_tab" class="scroll_tab">
169 <table width="100%" style="padding-left: 3px;">
170 <?php
171 $name_cnt = count($GLOBALS['PMD']['TABLE_NAME']);
172 for ($i = 0; $i < $name_cnt; $i++) {
174 echo '<tr><td title="' . __('Structure') . '" width="1px" '
175 . 'onmouseover="this.className=\'L_butt2_2\'" '
176 . 'onmouseout="this.className=\'L_butt2_1\'" class="L_butt2_1">';
177 echo '<img '
178 . 'onclick="Start_tab_upd(\'' . $GLOBALS['PMD_URL']["TABLE_NAME_SMALL"][$i] . '\');" '
179 . 'src="' . $_SESSION['PMA_Theme']->getImgPath('pmd/exec.png') . '" alt="" />';
180 echo '</td>';
181 echo '<td width="1px">';
182 echo '<input onclick="VisibleTab(this,\'' . $GLOBALS['PMD_URL']["TABLE_NAME"][$i] . '\')" '
183 . 'title="' . __('Hide') . '" '
184 . 'id="check_vis_' . $GLOBALS['PMD_URL']["TABLE_NAME"][$i] . '" '
185 . 'style="margin:0px;" type="checkbox" '
186 . 'value="' . $GLOBALS['PMD_URL']["TABLE_NAME"][$i] . '"';
187 if (isset($tab_pos[$GLOBALS['PMD']["TABLE_NAME"][$i]])) {
188 echo $tab_pos[$GLOBALS['PMD']["TABLE_NAME"][$i]]["H"] ? 'checked="checked"' : '';
189 } else {
190 echo 'checked="checked"';
192 echo '/></td>';
193 echo '<td class="pmd_Tabs" onmouseover="this.className=\'pmd_Tabs2\'" '
194 . 'onmouseout="this.className=\'pmd_Tabs\'" '
195 . 'onclick="Select_tab(\'' . $GLOBALS['PMD_URL']["TABLE_NAME"][$i] . '\');">';
196 echo $GLOBALS['PMD_OUT']["TABLE_NAME"][$i];
197 echo '</td>';
198 echo '</tr>';
200 echo '</table>';
201 echo '</div>';
203 echo '<div class="center">';
204 echo __('Number of tables:') . ' ' . $name_cnt;
205 echo '</div>';
206 echo '<div class="floatright">';
207 echo '<div id="layer_menu_sizer" onmousedown="layer_menu_cur_click=1">';
208 echo '</div>';
209 echo '</div>';
210 echo '</div>';
212 for ($i = 0; $i < count($GLOBALS['PMD']["TABLE_NAME"]); $i++) {
213 $t_n = $GLOBALS['PMD']["TABLE_NAME"][$i];
214 $t_n_url = $GLOBALS['PMD_URL']["TABLE_NAME"][$i];
217 <input name="t_x[<?php echo $t_n_url ?>]" type="hidden" id="t_x_<?php echo $t_n_url ?>_" />
218 <input name="t_y[<?php echo $t_n_url ?>]" type="hidden" id="t_y_<?php echo $t_n_url ?>_" />
219 <input name="t_v[<?php echo $t_n_url ?>]" type="hidden" id="t_v_<?php echo $t_n_url ?>_" />
220 <input name="t_h[<?php echo $t_n_url ?>]" type="hidden" id="t_h_<?php echo $t_n_url ?>_" />
222 <table id="<?php echo $t_n_url ?>" cellpadding="0" cellspacing="0" class="pmd_tab"
223 style="position: absolute;
224 left: <?php
225 echo isset($tab_pos[$t_n]) ? $tab_pos[$t_n]["X"] : rand(20, 700); ?>px;
226 top: <?php
227 echo isset($tab_pos[$t_n]) ? $tab_pos[$t_n]["Y"] : rand(20, 550); ?>px;
228 visibility: <?php
229 echo ! isset($tab_pos[$t_n]) || $tab_pos[$t_n]["H"]
230 ? "visible"
231 : "hidden"; ?>;
232 z-index: 1;">
233 <thead>
234 <tr>
235 <?php
236 if (isset($_REQUEST['query'])) {
237 echo '<td class="select_all">';
238 echo '<input type="checkbox" value="select_all_'.htmlspecialchars($t_n_url).'" style="margin: 0px;" ';
239 echo 'id="select_all_'.htmlspecialchars($t_n_url).'" title="select all" ';
240 echo 'onclick="Select_all(\''. htmlspecialchars($t_n_url) .'\',\''.htmlspecialchars($GLOBALS['PMD_OUT']["OWNER"][$i]).'\')"></td>';
243 <td class="small_tab" onmouseover="this.className='small_tab2';"
244 onmouseout="this.className='small_tab';"
245 id="id_hide_tbody_<?php echo $t_n_url ?>"
246 onclick="Small_tab('<?php echo $t_n_url ?>', 1)"><?php
247 // no space alloawd here, between tags and content !!!
248 // JavaScript function does require this
249 if (! isset($tab_pos[$t_n]) || ! empty($tab_pos[$t_n]["V"])) {
250 echo 'v';
251 } else {
252 echo '&gt;';
254 ?></td>
255 <td class="small_tab_pref" onmouseover="this.className='small_tab_pref2';"
256 onmouseout="this.className='small_tab_pref';"
257 onclick="Start_tab_upd('<?php echo $GLOBALS['PMD_URL']["TABLE_NAME_SMALL"][$i]; ?>');">
258 <img src="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/exec_small.png'); ?>" alt="" /></td>
259 <td id="id_zag_<?php echo $t_n_url ?>" class="tab_zag nowrap"
260 onmousedown="cur_click=document.getElementById('<?php echo $t_n_url ?>');"/
261 onmouseover="Table_onover('<?php echo $t_n_url ?>',0,<?php echo (isset($_REQUEST['query'])? 1 : 0 )?> )"
262 onmouseout="Table_onover('<?php echo $t_n_url ?>',1,<?php echo (isset($_REQUEST['query']) ? 1 : 0 )?>)">
263 <span class='owner'>
264 <?php
265 echo $GLOBALS['PMD_OUT']["OWNER"][$i];
266 echo '.</span>';
267 echo $GLOBALS['PMD_OUT']["TABLE_NAME_SMALL"][$i];
268 ?></td>
269 <?php
270 if (isset($_REQUEST['query'])) {
271 echo '<td class="tab_zag" onmouseover="Table_onover(\''.htmlspecialchars($t_n_url).'\',0,1)" id="id_zag_'.htmlspecialchars($t_n_url).'_2"';
272 echo 'onmousedown="cur_click=document.getElementById(\''.htmlspecialchars($t_n_url).'\');"';
273 echo 'onmouseout="Table_onover(\''.htmlspecialchars($t_n_url).'\',1,1)">';
276 </tr>
277 </thead>
278 <tbody id="id_tbody_<?php echo $t_n_url ?>"
279 <?php
280 if (isset($tab_pos[$t_n]) && empty($tab_pos[$t_n]["V"])) {
281 echo 'style="display: none;"';
283 echo '>';
284 $display_field = PMA_getDisplayField($_GET['db'], $GLOBALS['PMD']["TABLE_NAME_SMALL"][$i]);
285 for ($j = 0, $id_cnt = count($tab_column[$t_n]["COLUMN_ID"]); $j < $id_cnt; $j++) {
287 <tr id="id_tr_<?php
288 echo $GLOBALS['PMD_URL']["TABLE_NAME_SMALL"][$i] . '.'
289 . urlencode($tab_column[$t_n]["COLUMN_NAME"][$j]) ?>"
290 <?php
291 if ($display_field == $tab_column[$t_n]["COLUMN_NAME"][$j]) {
292 echo ' class="tab_field_3" ';
293 } else {
294 echo ' class="tab_field" ';
297 onmouseover="old_class = this.className; this.className = 'tab_field_2';"
298 onmouseout="this.className = old_class;"
299 onmousedown="Click_field('<?php
300 echo $GLOBALS['PMD_URL']["TABLE_NAME_SMALL"][$i]."','".urlencode($tab_column[$t_n]["COLUMN_NAME"][$j])."',";
301 if (!PMA_Util::isForeignKeySupported($GLOBALS['PMD']['TABLE_TYPE'][$i])) {
302 echo (isset($tables_pk_or_unique_keys[$t_n . "." . $tab_column[$t_n]["COLUMN_NAME"][$j]]) ? 1 : 0);
303 } else {
304 // if foreign keys are supported, it's not necessary that the
305 // index is a primary key
306 echo (isset($tables_all_keys[$t_n.".".$tab_column[$t_n]["COLUMN_NAME"][$j]]) ? 1 : 0);
308 ?>)">
309 <?php
310 if (isset($_REQUEST['query'])) {
311 echo '<td class="select_all">';
312 echo '<input value="'.htmlspecialchars($t_n_url).urlencode($tab_column[$t_n]["COLUMN_NAME"][$j]).'"';
313 echo 'type="checkbox" id="select_'.htmlspecialchars($t_n_url).'._'.urlencode($tab_column[$t_n]["COLUMN_NAME"][$j]).'" ';
314 echo 'style="margin: 0px;" title="select_'.urlencode($tab_column[$t_n]["COLUMN_NAME"][$j]).'" ';
315 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>';
317 <td width="10px" colspan="3"
318 id="<?php echo $t_n_url.".".urlencode($tab_column[$t_n]["COLUMN_NAME"][$j]) ?>">
319 <div class="nowrap">
320 <?php
321 if (isset($tables_pk_or_unique_keys[$t_n.".".$tab_column[$t_n]["COLUMN_NAME"][$j]])) {
323 <img src="<?php echo $_SESSION['PMA_Theme']->getImgPath(); ?>pmd/FieldKey_small.png"
324 alt="*" />
325 <?php
326 } else {
328 <img src="<?php echo $_SESSION['PMA_Theme']->getImgPath(); ?>pmd/Field_small<?php
329 if (strstr($tab_column[$t_n]["TYPE"][$j], 'char')
330 || strstr($tab_column[$t_n]["TYPE"][$j], 'text')
332 echo '_char';
333 } elseif (strstr($tab_column[$t_n]["TYPE"][$j], 'int')
334 || strstr($tab_column[$t_n]["TYPE"][$j], 'float')
335 || strstr($tab_column[$t_n]["TYPE"][$j], 'double')
336 || strstr($tab_column[$t_n]["TYPE"][$j], 'decimal')
338 echo '_int';
339 } elseif (strstr($tab_column[$t_n]["TYPE"][$j], 'date')
340 || strstr($tab_column[$t_n]["TYPE"][$j], 'time')
341 || strstr($tab_column[$t_n]["TYPE"][$j], 'year')
343 echo '_date';
345 ?>.png" alt="*" />
346 <?php
348 echo htmlspecialchars(
349 $tab_column[$t_n]["COLUMN_NAME"][$j] . " : " . $tab_column[$t_n]["TYPE"][$j],
350 ENT_QUOTES
352 echo "</div>\n</td>\n";
353 if (isset($_REQUEST['query'])) {
354 //$temp = $GLOBALS['PMD_OUT']["OWNER"][$i].'.'.$GLOBALS['PMD_OUT']["TABLE_NAME_SMALL"][$i];
355 echo '<td class="small_tab_pref" onmouseover="this.className=\'small_tab_pref2\';"';
356 echo 'onmouseout="this.className=\'small_tab_pref\';"';
357 echo 'onclick="Click_option(\'pmd_optionse\',\''
358 . urlencode($tab_column[$t_n]["COLUMN_NAME"][$j]) . '\',\''
359 . $GLOBALS['PMD_OUT']["TABLE_NAME_SMALL"][$i].'\')" >';
360 echo '<img src="'
361 . $_SESSION['PMA_Theme']->getImgPath('pmd/exec_small.png')
362 . '" title="options" alt="" /></td> ';
364 echo "</tr>\n";
366 echo "</tbody>\n</table>\n";
369 </form>
370 </div>
371 <div id="pmd_hint"></div>
373 <table id="layer_new_relation" style="display:none;"
374 width="5%" cellpadding="0" cellspacing="0">
375 <tbody>
376 <tr>
377 <td class="frams1" width="10px"></td>
378 <td class="frams5" width="99%" ></td>
379 <td class="frams2" width="10px"><div class="bor"></div></td>
380 </tr>
381 <tr>
382 <td class="frams8"></td>
383 <td class="input_tab">
384 <table width="168" class="center" cellpadding="2" cellspacing="0">
385 <thead>
386 <tr>
387 <td colspan="2" class="center nowrap"><strong><?php echo __('Create relation'); ?></strong></td>
388 </tr>
389 </thead>
390 <tbody id="foreign_relation">
391 <tr>
392 <td colspan="2" class="center nowrap"><strong>FOREIGN KEY</strong></td>
393 </tr>
394 <tr>
395 <td width="58" class="nowrap">on delete</td>
396 <td width="102"><select name="on_delete" id="on_delete">
397 <option value="nix" selected="selected">--</option>
398 <option value="CASCADE">CASCADE</option>
399 <option value="SET NULL">SET NULL</option>
400 <option value="NO ACTION">NO ACTION</option>
401 <option value="RESTRICT">RESTRICT</option>
402 </select>
403 </td>
404 </tr>
405 <tr>
406 <td class="nowrap">on update</td>
407 <td><select name="on_update" id="on_update">
408 <option value="nix" selected="selected">--</option>
409 <option value="CASCADE">CASCADE</option>
410 <option value="SET NULL">SET NULL</option>
411 <option value="NO ACTION">NO ACTION</option>
412 <option value="RESTRICT">RESTRICT</option>
413 </select>
414 </td>
415 </tr>
416 </tbody>
417 <tbody>
418 <tr>
419 <td colspan="2" class="center nowrap">
420 <input type="button" class="butt" name="Button"
421 value="<?php echo __('OK'); ?>" onclick="New_relation()" />
422 <input type="button" class="butt" name="Button"
423 value="<?php echo __('Cancel'); ?>"
424 onclick="document.getElementById('layer_new_relation').style.display = 'none';" />
425 </td>
426 </tr>
427 </tbody>
428 </table>
429 </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="layer_upd_relation" style="display:none;"
441 width="5%" 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="100%" class="center" cellpadding="2" cellspacing="0">
452 <tr>
453 <td colspan="3" class="center nowrap"><strong><?php echo __('Delete relation'); ?></strong></td>
454 </tr>
455 <tr>
456 <td colspan="3" class="center nowrap">
457 <input name="Button" type="button" class="butt"
458 onclick="Upd_relation()" value="<?php echo __('Delete'); ?>" />
459 <input type="button" class="butt" name="Button"
460 value="<?php echo __('Cancel'); ?>"
461 onclick="document.getElementById('layer_upd_relation').style.display = 'none'; Re_load();" />
462 </td>
463 </tr>
464 </table></td>
465 <td class="frams6"></td>
466 </tr>
467 <tr>
468 <td class="frams4"><div class="bor"></div></td>
469 <td class="frams7"></td>
470 <td class="frams3"></td>
471 </tr>
472 </tbody>
473 </table>
475 <table id="pmd_optionse" style="display:none;"
476 width="5%" cellpadding="0" cellspacing="0">
477 <tbody>
478 <tr>
479 <td class="frams1" width="10px"></td>
480 <td class="frams5" width="99%" ></td>
481 <td class="frams2" width="10px"><div class="bor"></div></td>
482 </tr>
483 <tr>
484 <td class="frams8"></td>
485 <td class="input_tab">
486 <table width="168" class="center" cellpadding="2" cellspacing="0">
487 <thead>
488 <tr>
489 <td colspan="2" rowspan="2" id="option_col_name" class="center nowrap"></td>
490 </tr>
491 </thead>
492 <tbody id="where">
493 <tr><td class="center nowrap"><b>WHERE</b></td></tr>
494 <tr>
495 <td width="58" class="nowrap"><?php echo __('Relation operator'); ?></td>
496 <td width="102"><select name="rel_opt" id="rel_opt">
497 <option value="--" selected="selected"> -- </option>
498 <option value="="> = </option>
499 <option value="&gt;"> &gt; </option>
500 <option value="&lt;"> &lt; </option>
501 <option value="&gt;="> &gt;= </option>
502 <option value="&lt;="> &lt;= </option>
503 <option value="NOT"> NOT </option>
504 <option value="IN"> IN </option>
505 <option value="EXCEPT"> <?php echo __('Except'); ?> </option>
506 <option value="NOT IN"> NOT IN </option>
507 </select>
508 </td>
509 </tr>
510 <tr>
511 <td class="nowrap"><?php echo __('Value'); ?>/<br /><?php echo __('subquery'); ?></td>
512 <td><textarea id="Query" value="" cols="18"></textarea>
513 </td>
514 </tr>
515 <tr><td class="center nowrap"><b><?php echo __('Rename to'); ?></b></td></tr>
516 <tr>
517 <td width="58" class="nowrap"><?php echo __('New name'); ?></td>
518 <td width="102"><input type="text" value="" id="new_name"/></td>
519 </tr>
520 <tr><td class="center nowrap"><b><?php echo __('Aggregate'); ?></b></td></tr>
521 <tr>
522 <td width="58" class="nowrap"><?php echo __('Operator'); ?></td>
523 <td width="102"><select name="operator" id="operator">
524 <option value="---" selected="selected">---</option>
525 <option value="sum" > SUM </option>
526 <option value="min"> MIN </option>
527 <option value="max"> MAX </option>
528 <option value="avg"> AVG </option>
529 <option value="count"> COUNT </option>
530 </select>
531 </td></tr>
532 <tr>
533 <td width="58" class="center nowrap"><b>GROUP BY</b></td>
534 <td><input type="checkbox" value="groupby" id="groupby"/></td>
535 </tr>
536 <tr>
537 <td width="58" class="center nowrap"><b>ORDER BY</b></td>
538 <td><input type="checkbox" value="orderby" id="orderby"/></td>
539 </tr>
540 <tr><td class="center nowrap"><b>HAVING</b></td></tr>
541 <tr>
542 <td width="58" class="nowrap"><?php echo __('Operator'); ?></td>
543 <td width="102"><select name="h_operator" id="h_operator">
544 <option value="---" selected="selected">---</option>
545 <option value="None" > <?php echo __('None'); ?> </option>
546 <option value="sum" > SUM </option>
547 <option value="min"> MIN </option>
548 <option value="max"> MAX </option>
549 <option value="avg"> AVG </option>
550 <option value="count"> COUNT </option>
551 </select>
552 </td></tr>
553 <tr>
554 <td width="58" class="nowrap"><?php echo __('Relation operator'); ?></td>
555 <td width="102"><select name="h_rel_opt" id="h_rel_opt">
556 <option value="--" selected="selected"> -- </option>
557 <option value="="> = </option>
558 <option value="&gt;"> &gt; </option>
559 <option value="&lt;"> &lt; </option>
560 <option value="&gt;="> &gt;= </option>
561 <option value="&lt;="> &lt;= </option>
562 <option value="NOT"> NOT </option>
563 <option value="IN"> IN </option>
564 <option value="EXCEPT"> <?php echo __('Except'); ?> </option>
565 <option value="NOT IN"> NOT IN </option>
566 </select>
567 </td>
568 </tr>
569 <tr>
570 <td width="58" class="nowrap"><?php echo __('Value'); ?>/<br/><?php echo __('subquery'); ?></td>
571 <td width="102"><textarea id="having" value="" cols="18"></textarea></td>
572 </tr>
573 </tbody>
574 <tbody>
575 <tr>
576 <td colspan="2" class="center nowrap">
577 <input type="button" class="butt" name="Button"
578 value="<?php echo __('OK'); ?>" onclick="add_object()" />
579 <input type="button" class="butt" name="Button"
580 value="<?php echo __('Cancel'); ?>"
581 onclick="Close_option()" />
582 </td>
583 </tr>
584 </tbody>
585 </table>
586 </td>
587 <td class="frams6"></td>
588 </tr>
589 <tr>
590 <td class="frams4"><div class="bor"></div></td>
591 <td class="frams7"></td>
592 <td class="frams3"></td>
593 </tr>
594 </tbody>
595 </table>
597 <table id="query_rename_to" style="display:none;"
598 width="5%" cellpadding="0" cellspacing="0">
599 <tbody>
600 <tr>
601 <td class="frams1" width="10px"></td>
602 <td class="frams5" width="99%" ></td>
603 <td class="frams2" width="10px"><div class="bor"></div></td>
604 </tr>
605 <tr>
606 <td class="frams8"></td>
607 <td class="input_tab">
608 <table width="168" class="center" cellpadding="2" cellspacing="0">
609 <thead>
610 <tr>
611 <td colspan="2" class="center nowrap"><strong><?php echo __('Rename to'); ?></strong></td>
612 </tr>
613 </thead>
614 <tbody id="rename_to">
615 <tr>
616 <td width="58" class="nowrap"><?php echo __('New name'); ?></td>
617 <td width="102">
618 <input type="text" value="" id="e_rename"/>
619 </td>
620 </tr>
621 </tbody>
622 <tbody>
623 <tr>
624 <td colspan="2" class="center nowrap">
625 <input type="button" class="butt" name="Button"
626 value="<?php echo __('OK'); ?>" onclick="edit('Rename')" />
627 <input type="button" class="butt" name="Button"
628 value="<?php echo __('Cancel'); ?>"
629 onclick="document.getElementById('query_rename_to').style.display = 'none';" />
630 </td>
631 </tr>
632 </tbody>
633 </table>
634 </td>
635 <td class="frams6"></td>
636 </tr>
637 <tr>
638 <td class="frams4"><div class="bor"></div></td>
639 <td class="frams7"></td>
640 <td class="frams3"></td>
641 </tr>
642 </tbody>
643 </table>
645 <table id="query_having" style="display:none;"
646 width="5%" cellpadding="0" cellspacing="0">
647 <tbody>
648 <tr>
649 <td class="frams1" width="10px"></td>
650 <td class="frams5" width="99%" ></td>
651 <td class="frams2" width="10px"><div class="bor"></div></td>
652 </tr>
653 <tr>
654 <td class="frams8"></td>
655 <td class="input_tab">
656 <table width="168" class="center" cellpadding="2" cellspacing="0">
657 <thead>
658 <tr>
659 <td colspan="2" class="center nowrap"><strong>HAVING</strong></td>
660 </tr>
661 </thead>
662 <tbody id="rename_to">
663 <tr>
664 <td width="58" class="nowrap"><?php echo __('Operator'); ?></td>
665 <td width="102"><select name="hoperator" id="hoperator">
666 <option value="---" selected="selected">---</option>
667 <option value="None" > None </option>
668 <option value="sum" > SUM </option>
669 <option value="min"> MIN </option>
670 <option value="max"> MAX </option>
671 <option value="avg"> AVG </option>
672 <option value="count"> COUNT </option>
673 </select>
674 </td></tr>
675 <tr>
676 <tr>
677 <td width="58" class="nowrap"><?php echo __('Operator'); ?></td>
678 <td width="102"><select name="hrel_opt" id="hrel_opt">
679 <option value="--" selected="selected"> -- </option>
680 <option value="="> = </option>
681 <option value="&gt;"> &gt; </option>
682 <option value="&lt;"> &lt; </option>
683 <option value="&gt;="> &gt;= </option>
684 <option value="&lt;="> &lt;= </option>
685 <option value="NOT"> NOT </option>
686 <option value="IN"> IN </option>
687 <option value="EXCEPT"> <?php echo __('Except'); ?> </option>
688 <option value="NOT IN"> NOT IN </option>
689 </select>
690 </td>
691 </tr>
692 <tr>
693 <td class="nowrap"><?php echo __('Value'); ?>/<br /><?php echo __('subquery'); ?></td>
694 <td><textarea id="hQuery" value="" cols="18"></textarea>
695 </td>
696 </tr>
697 </tbody>
698 <tbody>
699 <tr>
700 <td colspan="2" class="center nowrap">
701 <input type="button" class="butt" name="Button"
702 value="<?php echo __('OK'); ?>" onclick="edit('Having')" />
703 <input type="button" class="butt" name="Button"
704 value="<?php echo __('Cancel'); ?>"
705 onclick="document.getElementById('query_having').style.display = 'none';" />
706 </td>
707 </tr>
708 </tbody>
709 </table>
710 </td>
711 <td class="frams6"></td>
712 </tr>
713 <tr>
714 <td class="frams4"><div class="bor"></div></td>
715 <td class="frams7"></td>
716 <td class="frams3"></td>
717 </tr>
718 </tbody>
719 </table>
721 <table id="query_Aggregate" style="display:none;"
722 width="5%" cellpadding="0" cellspacing="0">
723 <tbody>
724 <tr>
725 <td class="frams1" width="10px"></td>
726 <td class="frams5" width="99%" ></td>
727 <td class="frams2" width="10px"><div class="bor"></div></td>
728 </tr>
729 <tr>
730 <td class="frams8"></td>
731 <td class="input_tab">
732 <table width="168" class="center" cellpadding="2" cellspacing="0">
733 <thead>
734 <tr>
735 <td colspan="2" class="center nowrap"><strong><?php echo __('Aggregate'); ?></strong></td>
736 </tr>
737 </thead>
738 <tbody>
739 <tr>
740 <td width="58" class="nowrap"><?php echo __('Operator'); ?></td>
741 <td width="102">
742 <select name="operator" id="e_operator">
743 <option value="---" selected="selected">---</option>
744 <option value="sum" > SUM </option>
745 <option value="min"> MIN </option>
746 <option value="max"> MAX </option>
747 <option value="avg"> AVG </option>
748 <option value="avg"> COUNT </option>
749 </select>
750 </td></tr>
751 </tbody>
752 <tbody>
753 <tr>
754 <td colspan="2" class="center nowrap">
755 <input type="button" class="butt" name="Button"
756 value="<?php echo __('OK'); ?>" onclick="edit('Aggregate')" />
757 <input type="button" class="butt" name="Button"
758 value="<?php echo __('Cancel'); ?>"
759 onclick="document.getElementById('query_Aggregate').style.display = 'none';" />
760 </td>
761 </tr>
762 </tbody>
763 </table>
764 </td>
765 <td class="frams6"></td>
766 </tr>
767 <tr>
768 <td class="frams4"><div class="bor"></div></td>
769 <td class="frams7"></td>
770 <td class="frams3"></td>
771 </tr>
772 </tbody>
773 </table>
775 <table id="query_where" style="display:none;"
776 width="5%" cellpadding="0" cellspacing="0">
777 <tbody>
778 <tr>
779 <td class="frams1" width="10px"></td>
780 <td class="frams5" width="99%" ></td>
781 <td class="frams2" width="10px"><div class="bor"></div></td>
782 </tr>
783 <tr>
784 <td class="frams8"></td>
785 <td class="input_tab">
786 <table width="168" class="center" cellpadding="2" cellspacing="0">
787 <thead>
788 <tr>
789 <td colspan="2" class="center nowrap"><strong>WHERE</strong></td>
790 </tr>
791 </thead>
792 <tbody id="rename_to">
793 <tr>
794 <td width="58" class="nowrap"><?php echo __('Operator'); ?></td>
795 <td width="102"><select name="erel_opt" id="erel_opt">
796 <option value="--" selected="selected"> -- </option>
797 <option value="=" > = </option>
798 <option value="&gt;"> &gt; </option>
799 <option value="&lt;"> &lt; </option>
800 <option value="&gt;="> &gt;= </option>
801 <option value="&lt;="> &lt;= </option>
802 <option value="NOT"> NOT </option>
803 <option value="IN"> IN </option>
804 <option value="EXCEPT"> <?php echo __('Except'); ?> </option>
805 <option value="NOT IN"> NOT IN </option>
806 </select>
807 </td>
808 </tr>
809 <tr>
810 <td class="nowrap"><?php echo __('Value'); ?>/<br /><?php echo __('subquery'); ?></td>
811 <td><textarea id="eQuery" value="" cols="18"></textarea>
812 </td>
813 </tr>
814 </tbody>
815 <tbody>
816 <tr>
817 <td colspan="2" class="center nowrap">
818 <input type="button" class="butt" name="Button"
819 value="<?php echo __('OK'); ?>" onclick="edit('Where')" />
820 <input type="button" class="butt" name="Button"
821 value="<?php echo __('Cancel'); ?>"
822 onclick="document.getElementById('query_where').style.display = 'none';" />
823 </td>
824 </tr>
825 </tbody>
826 </table>
827 </td>
828 <td class="frams6"></td>
829 </tr>
830 <tr>
831 <td class="frams4"><div class="bor"></div></td>
832 <td class="frams7"></td>
833 <td class="frams3"></td>
834 </tr>
835 </tbody>
836 </table>
838 <?php
839 if (! empty($_REQUEST['query'])) {
840 echo '<div class="panel">';
841 echo '<div style="clear:both;"></div>';
842 echo '<div id="ab"></div>';
843 echo '<div style="clear:both;"></div>';
844 echo '</div>';
845 echo '<a class="trigger" href="#">' . __('Active options') . '</a>';
846 echo '<div id="filter"></div>';
847 echo '<div id="box">';
848 echo '<span id="boxtitle"></span>';
849 echo '<form method="post" action="db_qbe.php">';
850 echo '<textarea cols="80" name="sql_query" id="textSqlquery"'
851 . ' rows="15"></textarea><div id="tblfooter">';
852 echo ' <input type="submit" name="submit_sql" class="btn" />';
853 echo ' <input type="button" name="cancel" value="'
854 . __('Cancel') . '" onclick="closebox()" class="btn" />';
855 echo PMA_URL_getHiddenInputs($_GET['db']);
856 echo '</div></p>';
857 echo '</form></div>';
859 } ?>
862 <!-- cache images -->
863 <?php
864 echo '<img src="'
865 . $_SESSION['PMA_Theme']->getImgPath('pmd/2leftarrow_m.png')
866 . '" width="0" height="0" alt="" />'
867 . '<img src="'
868 . $_SESSION['PMA_Theme']->getImgPath('pmd/rightarrow1.png')
869 . '" width="0" height="0" alt="" />'
870 . '<img src="'
871 . $_SESSION['PMA_Theme']->getImgPath('pmd/rightarrow2.png')
872 . '" width="0" height="0" alt="" />'
873 . '<img src="'
874 . $_SESSION['PMA_Theme']->getImgPath('pmd/uparrow2_m.png')
875 . '" width="0" height="0" alt="" />'
876 . '<div id="PMA_disable_floating_menubar"></div>';