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