190
* Displays a navigation button
192
* @uses $GLOBALS['cfg']['NavigationBarIconic']
193
* @uses PMA_generate_common_hidden_inputs()
195
* @param string iconic caption for button
196
* @param string text for button
197
* @param integer position for next query
198
* @param string query ready for display
199
* @param string optional onsubmit clause
200
* @param string optional hidden field for special treatment
201
* @param string optional onclick clause
203
* @global string $db the database name
204
* @global string $table the table name
205
* @global string $goto the URL to go back in case of errors
209
* @see PMA_displayTableNavigation()
211
function PMA_displayTableNavigationOneButton($caption, $title, $pos, $html_sql_query, $onsubmit = '', $input_for_real_end = '', $onclick = '') {
213
global $db, $table, $goto;
215
$caption_output = '';
216
// for true or 'both'
217
if ($GLOBALS['cfg']['NavigationBarIconic']) {
218
$caption_output .= $caption;
220
// for false or 'both'
221
if (false === $GLOBALS['cfg']['NavigationBarIconic'] || 'both' === $GLOBALS['cfg']['NavigationBarIconic']) {
222
$caption_output .= ' ' . $title;
224
$title_output = ' title="' . $title . '"';
227
<form action="sql.php" method="post" <?php echo $onsubmit; ?>>
228
<?php echo PMA_generate_common_hidden_inputs($db, $table); ?>
229
<input type="hidden" name="sql_query" value="<?php echo $html_sql_query; ?>" />
230
<input type="hidden" name="pos" value="<?php echo $pos; ?>" />
231
<input type="hidden" name="goto" value="<?php echo $goto; ?>" />
232
<?php echo $input_for_real_end; ?>
233
<input type="submit" name="navig" value="<?php echo $caption_output; ?>"<?php echo $title_output . $onclick; ?> />
237
} // end function PMA_displayTableNavigationOneButton()
190
240
* Displays a navigation bar to browse among the results of a SQL query
192
* @uses $_SESSION['userconf']['disp_direction']
193
* @uses $_SESSION['userconf']['repeat_cells']
194
* @uses $_SESSION['userconf']['max_rows']
195
* @uses $_SESSION['userconf']['pos']
242
* @uses $_SESSION['tmp_user_values']['disp_direction']
243
* @uses $_SESSION['tmp_user_values']['repeat_cells']
244
* @uses $_SESSION['tmp_user_values']['max_rows']
245
* @uses $_SESSION['tmp_user_values']['pos']
196
246
* @param integer the offset for the "next" page
197
247
* @param integer the offset for the "previous" page
198
248
* @param string the URL-encoded query
249
* @param string the id for the direction dropdown
200
251
* @global string $db the database name
201
252
* @global string $table the table name
237
288
// Move to the beginning or to the previous page
238
if ($_SESSION['userconf']['pos'] && $_SESSION['userconf']['max_rows'] != 'all') {
239
// loic1: patch #474210 from Gosha Sakovich - part 1
240
if ($GLOBALS['cfg']['NavigationBarIconic']) {
241
$caption1 = '<<';
242
$caption2 = ' < ';
243
$title1 = ' title="' . $GLOBALS['strPos1'] . '"';
244
$title2 = ' title="' . $GLOBALS['strPrevious'] . '"';
246
$caption1 = $GLOBALS['strPos1'] . ' <<';
247
$caption2 = $GLOBALS['strPrevious'] . ' <';
250
} // end if... else...
253
<form action="sql.php" method="post">
254
<?php echo PMA_generate_common_hidden_inputs($db, $table); ?>
255
<input type="hidden" name="sql_query" value="<?php echo $html_sql_query; ?>" />
256
<input type="hidden" name="pos" value="0" />
257
<input type="hidden" name="goto" value="<?php echo $goto; ?>" />
258
<input type="submit" name="navig" value="<?php echo $caption1; ?>"<?php echo $title1; ?> />
262
<form action="sql.php" method="post">
263
<?php echo PMA_generate_common_hidden_inputs($db, $table); ?>
264
<input type="hidden" name="sql_query" value="<?php echo $html_sql_query; ?>" />
265
<input type="hidden" name="pos" value="<?php echo $pos_prev; ?>" />
266
<input type="hidden" name="goto" value="<?php echo $goto; ?>" />
267
<input type="submit" name="navig" value="<?php echo $caption2; ?>"<?php echo $title2; ?> />
289
if ($_SESSION['tmp_user_values']['pos'] && $_SESSION['tmp_user_values']['max_rows'] != 'all') {
290
PMA_displayTableNavigationOneButton('<<', $GLOBALS['strPos1'], 0, $html_sql_query);
291
PMA_displayTableNavigationOneButton('<', $GLOBALS['strPrevious'], $pos_prev, $html_sql_query);
271
293
} // end move back
284
306
<input type="hidden" name="sql_query" value="<?php echo $html_sql_query; ?>" />
285
307
<input type="hidden" name="goto" value="<?php echo $goto; ?>" />
286
308
<input type="submit" name="navig" value="<?php echo $GLOBALS['strShow']; ?> :" />
287
<input type="text" name="session_max_rows" size="3" value="<?php echo (($_SESSION['userconf']['max_rows'] != 'all') ? $_SESSION['userconf']['max_rows'] : $GLOBALS['cfg']['MaxRows']); ?>" class="textfield" onfocus="this.select()" />
309
<input type="text" name="session_max_rows" size="3" value="<?php echo (($_SESSION['tmp_user_values']['max_rows'] != 'all') ? $_SESSION['tmp_user_values']['max_rows'] : $GLOBALS['cfg']['MaxRows']); ?>" class="textfield" onfocus="this.select()" />
288
310
<?php echo $GLOBALS['strRowsFrom'] . "\n"; ?>
289
311
<input type="text" name="pos" size="6" value="<?php echo (($pos_next >= $unlim_num_rows) ? 0 : $pos_next); ?>" class="textfield" onfocus="this.select()" />
292
314
// Display mode (horizontal/vertical and repeat headers)
293
$param1 = ' <select name="disp_direction">' . "\n"
294
. ' <option value="horizontal"' . (($_SESSION['userconf']['disp_direction'] == 'horizontal') ? ' selected="selected"': '') . '>' . $GLOBALS['strRowsModeHorizontal'] . '</option>' . "\n"
295
. ' <option value="horizontalflipped"' . (($_SESSION['userconf']['disp_direction'] == 'horizontalflipped') ? ' selected="selected"': '') . '>' . $GLOBALS['strRowsModeFlippedHorizontal'] . '</option>' . "\n"
296
. ' <option value="vertical"' . (($_SESSION['userconf']['disp_direction'] == 'vertical') ? ' selected="selected"': '') . '>' . $GLOBALS['strRowsModeVertical'] . '</option>' . "\n"
297
. ' </select>' . "\n"
299
$param2 = ' <input type="text" size="3" name="repeat_cells" value="' . $_SESSION['userconf']['repeat_cells'] . '" class="textfield" />' . "\n"
316
'horizontal' => $GLOBALS['strRowsModeHorizontal'],
317
'horizontalflipped' => $GLOBALS['strRowsModeFlippedHorizontal'],
318
'vertical' => $GLOBALS['strRowsModeVertical']);
319
$param1 = PMA_generate_html_dropdown('disp_direction', $choices, $_SESSION['tmp_user_values']['disp_direction'], $id_for_direction_dropdown);
322
$param2 = ' <input type="text" size="3" name="repeat_cells" value="' . $_SESSION['tmp_user_values']['repeat_cells'] . '" class="textfield" />' . "\n"
301
324
echo ' ' . sprintf($GLOBALS['strRowsModeOptions'], "\n" . $param1, "\n" . $param2) . "\n";
309
332
// Move to the next page or to the last one
310
if (($_SESSION['userconf']['pos'] + $_SESSION['userconf']['max_rows'] < $unlim_num_rows) && $num_rows >= $_SESSION['userconf']['max_rows']
311
&& $_SESSION['userconf']['max_rows'] != 'all') {
312
// loic1: patch #474210 from Gosha Sakovich - part 2
313
if ($GLOBALS['cfg']['NavigationBarIconic']) {
314
$caption3 = ' > ';
315
$caption4 = '>>';
316
$title3 = ' title="' . $GLOBALS['strNext'] . '"';
317
$title4 = ' title="' . $GLOBALS['strEnd'] . '"';
319
$caption3 = '> ' . $GLOBALS['strNext'];
320
$caption4 = '>> ' . $GLOBALS['strEnd'];
323
} // end if... else...
327
<form action="sql.php" method="post">
328
<?php echo PMA_generate_common_hidden_inputs($db, $table); ?>
329
<input type="hidden" name="sql_query" value="<?php echo $html_sql_query; ?>" />
330
<input type="hidden" name="pos" value="<?php echo $pos_next; ?>" />
331
<input type="hidden" name="goto" value="<?php echo $goto; ?>" />
332
<input type="submit" name="navig" value="<?php echo $caption3; ?>"<?php echo $title3; ?> />
336
<form action="sql.php" method="post"
337
onsubmit="return <?php echo (($_SESSION['userconf']['pos'] + $_SESSION['userconf']['max_rows'] < $unlim_num_rows && $num_rows >= $_SESSION['userconf']['max_rows']) ? 'true' : 'false'); ?>">
338
<?php echo PMA_generate_common_hidden_inputs($db, $table); ?>
339
<input type="hidden" name="sql_query" value="<?php echo $html_sql_query; ?>" />
340
<input type="hidden" name="pos" value="<?php echo @((ceil($unlim_num_rows / $_SESSION['userconf']['max_rows'])- 1) * $_SESSION['userconf']['max_rows']); ?>" />
333
if (($_SESSION['tmp_user_values']['pos'] + $_SESSION['tmp_user_values']['max_rows'] < $unlim_num_rows) && $num_rows >= $_SESSION['tmp_user_values']['max_rows']
334
&& $_SESSION['tmp_user_values']['max_rows'] != 'all') {
336
// display the Next button
337
PMA_displayTableNavigationOneButton('>',
342
// prepare some options for the End button
342
343
if ($is_innodb && $unlim_num_rows > $GLOBALS['cfg']['MaxExactCount']) {
343
echo '<input type="hidden" name="find_real_end" value="1" />' . "\n";
344
$input_for_real_end = '<input type="hidden" name="find_real_end" value="1" />';
344
345
// no backquote around this message
345
346
$onclick = ' onclick="return confirmAction(\'' . PMA_jsFormat($GLOBALS['strLongOperation'], false) . '\')"';
348
$input_for_real_end = $onclick = '';
348
<input type="hidden" name="goto" value="<?php echo $goto; ?>" />
349
<input type="submit" name="navig" value="<?php echo $caption4; ?>"<?php echo $title4; ?> <?php echo (empty($onclick) ? '' : $onclick); ?>/>
351
// display the End button
352
PMA_displayTableNavigationOneButton('>>',
354
@((ceil($unlim_num_rows / $_SESSION['tmp_user_values']['max_rows'])- 1) * $_SESSION['tmp_user_values']['max_rows']),
356
'onsubmit="return ' . (($_SESSION['tmp_user_values']['pos'] + $_SESSION['tmp_user_values']['max_rows'] < $unlim_num_rows && $num_rows >= $_SESSION['tmp_user_values']['max_rows']) ? 'true' : 'false') . '"',
353
360
} // end move toward
356
363
//page redirection
357
364
// (unless we are showing all records)
358
if ('all' != $_SESSION['userconf']['max_rows']) { //if1
359
$pageNow = @floor($_SESSION['userconf']['pos'] / $_SESSION['userconf']['max_rows']) + 1;
360
$nbTotalPage = @ceil($unlim_num_rows / $_SESSION['userconf']['max_rows']);
365
if ('all' != $_SESSION['tmp_user_values']['max_rows']) { //if1
366
$pageNow = @floor($_SESSION['tmp_user_values']['pos'] / $_SESSION['tmp_user_values']['max_rows']) + 1;
367
$nbTotalPage = @ceil($unlim_num_rows / $_SESSION['tmp_user_values']['max_rows']);
362
369
if ($nbTotalPage > 1){ //if2
552
560
'P' => $GLOBALS['strPartialText'],
553
561
'F' => $GLOBALS['strFullText']
555
PMA_generate_html_radio('display_text', $choices, $_SESSION['userconf']['display_text']);
563
PMA_display_html_radio('display_text', $choices, $_SESSION['tmp_user_values']['display_text']);
566
// prepare full/partial text button or link
567
if ($_SESSION['tmp_user_values']['display_text']=='F') {
568
// currently in fulltext mode so show the opposite link
569
$tmp_image_file = $GLOBALS['pmaThemeImage'] . 's_partialtext.png';
570
$tmp_txt = $GLOBALS['strPartialText'];
571
$url_params['display_text'] = 'P';
573
$tmp_image_file = $GLOBALS['pmaThemeImage'] . 's_fulltext.png';
574
$tmp_txt = $GLOBALS['strFullText'];
575
$url_params['display_text'] = 'F';
578
$tmp_image = '<img class="fulltext" width="50" height="20" src="' . $tmp_image_file . '" alt="' . $tmp_txt . '" title="' . $tmp_txt . '" />';
579
$tmp_url = 'sql.php' . PMA_generate_common_url($url_params);
580
$full_or_partial_text_link = PMA_linkOrButton($tmp_url, $tmp_image, array(), false);
581
unset($tmp_image_file, $tmp_txt, $tmp_url, $tmp_image);
558
584
if ($GLOBALS['cfgRelation']['relwork'] && $GLOBALS['cfgRelation']['displaywork']) {
559
585
echo '<div class="formelement">';
560
586
$choices = array(
561
587
'K' => $GLOBALS['strRelationalKey'],
562
588
'D' => $GLOBALS['strRelationalDisplayField']
564
PMA_generate_html_radio('relational_display', $choices, $_SESSION['userconf']['relational_display']);
590
PMA_display_html_radio('relational_display', $choices, $_SESSION['tmp_user_values']['relational_display']);
568
594
echo '<div class="formelement">';
569
PMA_generate_html_checkbox('display_binary', $GLOBALS['strShowBinaryContents'], ! empty($_SESSION['userconf']['display_binary']), false);
571
PMA_generate_html_checkbox('display_blob', $GLOBALS['strShowBLOBContents'], ! empty($_SESSION['userconf']['display_blob']), false);
595
PMA_display_html_checkbox('display_binary', $GLOBALS['strShowBinaryContents'], ! empty($_SESSION['tmp_user_values']['display_binary']), false);
597
PMA_display_html_checkbox('display_blob', $GLOBALS['strShowBLOBContents'], ! empty($_SESSION['tmp_user_values']['display_blob']), false);
599
PMA_display_html_checkbox('display_binary_as_hex', $GLOBALS['strShowBinaryContentsAsHex'], ! empty($_SESSION['tmp_user_values']['display_binary_as_hex']), false);
574
602
// I would have preferred to name this "display_transformation".
1592
* @uses $_SESSION['userconf']['disp_direction']
1625
* @uses $_SESSION['tmp_user_values']['disp_direction']
1593
1626
* @uses $_REQUEST['disp_direction']
1594
1627
* @uses $GLOBALS['cfg']['DefaultDisplay']
1595
* @uses $_SESSION['userconf']['repeat_cells']
1628
* @uses $_SESSION['tmp_user_values']['repeat_cells']
1596
1629
* @uses $_REQUEST['repeat_cells']
1597
1630
* @uses $GLOBALS['cfg']['RepeatCells']
1598
* @uses $_SESSION['userconf']['max_rows']
1631
* @uses $_SESSION['tmp_user_values']['max_rows']
1599
1632
* @uses $_REQUEST['session_max_rows']
1600
1633
* @uses $GLOBALS['cfg']['MaxRows']
1601
* @uses $_SESSION['userconf']['pos']
1634
* @uses $_SESSION['tmp_user_values']['pos']
1602
1635
* @uses $_REQUEST['pos']
1603
* @uses $_SESSION['userconf']['display_text']
1636
* @uses $_SESSION['tmp_user_values']['display_text']
1604
1637
* @uses $_REQUEST['display_text']
1605
* @uses $_SESSION['userconf']['relational_display']
1638
* @uses $_SESSION['tmp_user_values']['relational_display']
1606
1639
* @uses $_REQUEST['relational_display']
1607
* @uses $_SESSION['userconf']['display_binary']
1640
* @uses $_SESSION['tmp_user_values']['display_binary']
1608
1641
* @uses $_REQUEST['display_binary']
1609
* @uses $_SESSION['userconf']['display_blob']
1642
* @uses $_SESSION['tmp_user_values']['display_binary_as_hex']
1643
* @uses $_REQUEST['display_binary_as_hex']
1644
* @uses $_SESSION['tmp_user_values']['display_blob']
1610
1645
* @uses $_REQUEST['display_blob']
1611
1646
* @uses PMA_isValid()
1612
1647
* @uses $GLOBALS['sql_query']
1620
1655
$sql_key = md5($GLOBALS['sql_query']);
1622
$_SESSION['userconf']['query'][$sql_key]['sql'] = $GLOBALS['sql_query'];
1657
$_SESSION['tmp_user_values']['query'][$sql_key]['sql'] = $GLOBALS['sql_query'];
1624
1659
if (PMA_isValid($_REQUEST['disp_direction'], array('horizontal', 'vertical', 'horizontalflipped'))) {
1625
$_SESSION['userconf']['query'][$sql_key]['disp_direction'] = $_REQUEST['disp_direction'];
1660
$_SESSION['tmp_user_values']['query'][$sql_key]['disp_direction'] = $_REQUEST['disp_direction'];
1626
1661
unset($_REQUEST['disp_direction']);
1627
} elseif (empty($_SESSION['userconf']['query'][$sql_key]['disp_direction'])) {
1628
$_SESSION['userconf']['query'][$sql_key]['disp_direction'] = $GLOBALS['cfg']['DefaultDisplay'];
1662
} elseif (empty($_SESSION['tmp_user_values']['query'][$sql_key]['disp_direction'])) {
1663
$_SESSION['tmp_user_values']['query'][$sql_key]['disp_direction'] = $GLOBALS['cfg']['DefaultDisplay'];
1631
1666
if (PMA_isValid($_REQUEST['repeat_cells'], 'numeric')) {
1632
$_SESSION['userconf']['query'][$sql_key]['repeat_cells'] = $_REQUEST['repeat_cells'];
1667
$_SESSION['tmp_user_values']['query'][$sql_key]['repeat_cells'] = $_REQUEST['repeat_cells'];
1633
1668
unset($_REQUEST['repeat_cells']);
1634
} elseif (empty($_SESSION['userconf']['query'][$sql_key]['repeat_cells'])) {
1635
$_SESSION['userconf']['query'][$sql_key]['repeat_cells'] = $GLOBALS['cfg']['RepeatCells'];
1669
} elseif (empty($_SESSION['tmp_user_values']['query'][$sql_key]['repeat_cells'])) {
1670
$_SESSION['tmp_user_values']['query'][$sql_key]['repeat_cells'] = $GLOBALS['cfg']['RepeatCells'];
1638
1673
if (PMA_isValid($_REQUEST['session_max_rows'], 'numeric') || $_REQUEST['session_max_rows'] == 'all') {
1639
$_SESSION['userconf']['query'][$sql_key]['max_rows'] = $_REQUEST['session_max_rows'];
1674
$_SESSION['tmp_user_values']['query'][$sql_key]['max_rows'] = $_REQUEST['session_max_rows'];
1640
1675
unset($_REQUEST['session_max_rows']);
1641
} elseif (empty($_SESSION['userconf']['query'][$sql_key]['max_rows'])) {
1642
$_SESSION['userconf']['query'][$sql_key]['max_rows'] = $GLOBALS['cfg']['MaxRows'];
1676
} elseif (empty($_SESSION['tmp_user_values']['query'][$sql_key]['max_rows'])) {
1677
$_SESSION['tmp_user_values']['query'][$sql_key]['max_rows'] = $GLOBALS['cfg']['MaxRows'];
1645
1680
if (PMA_isValid($_REQUEST['pos'], 'numeric')) {
1646
$_SESSION['userconf']['query'][$sql_key]['pos'] = $_REQUEST['pos'];
1681
$_SESSION['tmp_user_values']['query'][$sql_key]['pos'] = $_REQUEST['pos'];
1647
1682
unset($_REQUEST['pos']);
1648
} elseif (empty($_SESSION['userconf']['query'][$sql_key]['pos'])) {
1649
$_SESSION['userconf']['query'][$sql_key]['pos'] = 0;
1683
} elseif (empty($_SESSION['tmp_user_values']['query'][$sql_key]['pos'])) {
1684
$_SESSION['tmp_user_values']['query'][$sql_key]['pos'] = 0;
1652
1687
if (PMA_isValid($_REQUEST['display_text'], array('P', 'F'))) {
1653
$_SESSION['userconf']['query'][$sql_key]['display_text'] = $_REQUEST['display_text'];
1688
$_SESSION['tmp_user_values']['query'][$sql_key]['display_text'] = $_REQUEST['display_text'];
1654
1689
unset($_REQUEST['display_text']);
1655
} elseif (empty($_SESSION['userconf']['query'][$sql_key]['display_text'])) {
1656
$_SESSION['userconf']['query'][$sql_key]['display_text'] = 'P';
1690
} elseif (empty($_SESSION['tmp_user_values']['query'][$sql_key]['display_text'])) {
1691
$_SESSION['tmp_user_values']['query'][$sql_key]['display_text'] = 'P';
1659
1694
if (PMA_isValid($_REQUEST['relational_display'], array('K', 'D'))) {
1660
$_SESSION['userconf']['query'][$sql_key]['relational_display'] = $_REQUEST['relational_display'];
1695
$_SESSION['tmp_user_values']['query'][$sql_key]['relational_display'] = $_REQUEST['relational_display'];
1661
1696
unset($_REQUEST['relational_display']);
1662
} elseif (empty($_SESSION['userconf']['query'][$sql_key]['relational_display'])) {
1663
$_SESSION['userconf']['query'][$sql_key]['relational_display'] = 'K';
1697
} elseif (empty($_SESSION['tmp_user_values']['query'][$sql_key]['relational_display'])) {
1698
$_SESSION['tmp_user_values']['query'][$sql_key]['relational_display'] = 'K';
1666
1701
if (isset($_REQUEST['display_binary'])) {
1667
$_SESSION['userconf']['query'][$sql_key]['display_binary'] = true;
1702
$_SESSION['tmp_user_values']['query'][$sql_key]['display_binary'] = true;
1668
1703
unset($_REQUEST['display_binary']);
1669
1704
} elseif (isset($_REQUEST['display_options_form'])) {
1670
1705
// we know that the checkbox was unchecked
1671
unset($_SESSION['userconf']['query'][$sql_key]['display_binary']);
1706
unset($_SESSION['tmp_user_values']['query'][$sql_key]['display_binary']);
1673
1708
// selected by default because some operations like OPTIMIZE TABLE
1674
1709
// and all queries involving functions return "binary" contents,
1675
1710
// according to low-level field flags
1676
$_SESSION['userconf']['query'][$sql_key]['display_binary'] = true;
1711
$_SESSION['tmp_user_values']['query'][$sql_key]['display_binary'] = true;
1714
if (isset($_REQUEST['display_binary_as_hex'])) {
1715
$_SESSION['tmp_user_values']['query'][$sql_key]['display_binary_as_hex'] = true;
1716
unset($_REQUEST['display_binary_as_hex']);
1717
} elseif (isset($_REQUEST['display_options_form'])) {
1718
// we know that the checkbox was unchecked
1719
unset($_SESSION['tmp_user_values']['query'][$sql_key]['display_binary_as_hex']);
1721
// display_binary_as_hex config option
1722
if (isset($GLOBALS['cfg']['DisplayBinaryAsHex']) && true === $GLOBALS['cfg']['DisplayBinaryAsHex']) {
1723
$_SESSION['tmp_user_values']['query'][$sql_key]['display_binary_as_hex'] = true;
1679
1727
if (isset($_REQUEST['display_blob'])) {
1680
$_SESSION['userconf']['query'][$sql_key]['display_blob'] = true;
1728
$_SESSION['tmp_user_values']['query'][$sql_key]['display_blob'] = true;
1681
1729
unset($_REQUEST['display_blob']);
1682
1730
} elseif (isset($_REQUEST['display_options_form'])) {
1683
1731
// we know that the checkbox was unchecked
1684
unset($_SESSION['userconf']['query'][$sql_key]['display_blob']);
1732
unset($_SESSION['tmp_user_values']['query'][$sql_key]['display_blob']);
1687
1735
if (isset($_REQUEST['hide_transformation'])) {
1688
$_SESSION['userconf']['query'][$sql_key]['hide_transformation'] = true;
1736
$_SESSION['tmp_user_values']['query'][$sql_key]['hide_transformation'] = true;
1689
1737
unset($_REQUEST['hide_transformation']);
1690
1738
} elseif (isset($_REQUEST['display_options_form'])) {
1691
1739
// we know that the checkbox was unchecked
1692
unset($_SESSION['userconf']['query'][$sql_key]['hide_transformation']);
1740
unset($_SESSION['tmp_user_values']['query'][$sql_key]['hide_transformation']);
1695
1743
// move current query to the last position, to be removed last
1696
1744
// so only least executed query will be removed if maximum remembered queries
1697
1745
// limit is reached
1698
$tmp = $_SESSION['userconf']['query'][$sql_key];
1699
unset($_SESSION['userconf']['query'][$sql_key]);
1700
$_SESSION['userconf']['query'][$sql_key] = $tmp;
1746
$tmp = $_SESSION['tmp_user_values']['query'][$sql_key];
1747
unset($_SESSION['tmp_user_values']['query'][$sql_key]);
1748
$_SESSION['tmp_user_values']['query'][$sql_key] = $tmp;
1702
1750
// do not exceed a maximum number of queries to remember
1703
if (count($_SESSION['userconf']['query']) > 10) {
1704
array_shift($_SESSION['userconf']['query']);
1751
if (count($_SESSION['tmp_user_values']['query']) > 10) {
1752
array_shift($_SESSION['tmp_user_values']['query']);
1705
1753
//echo 'deleting one element ...';
1708
1756
// populate query configuration
1709
$_SESSION['userconf']['display_text'] = $_SESSION['userconf']['query'][$sql_key]['display_text'];
1710
$_SESSION['userconf']['relational_display'] = $_SESSION['userconf']['query'][$sql_key]['relational_display'];
1711
$_SESSION['userconf']['display_binary'] = isset($_SESSION['userconf']['query'][$sql_key]['display_binary']) ? true : false;
1712
$_SESSION['userconf']['display_blob'] = isset($_SESSION['userconf']['query'][$sql_key]['display_blob']) ? true : false;
1713
$_SESSION['userconf']['hide_transformation'] = isset($_SESSION['userconf']['query'][$sql_key]['hide_transformation']) ? true : false;
1714
$_SESSION['userconf']['pos'] = $_SESSION['userconf']['query'][$sql_key]['pos'];
1715
$_SESSION['userconf']['max_rows'] = $_SESSION['userconf']['query'][$sql_key]['max_rows'];
1716
$_SESSION['userconf']['repeat_cells'] = $_SESSION['userconf']['query'][$sql_key]['repeat_cells'];
1717
$_SESSION['userconf']['disp_direction'] = $_SESSION['userconf']['query'][$sql_key]['disp_direction'];
1757
$_SESSION['tmp_user_values']['display_text'] = $_SESSION['tmp_user_values']['query'][$sql_key]['display_text'];
1758
$_SESSION['tmp_user_values']['relational_display'] = $_SESSION['tmp_user_values']['query'][$sql_key]['relational_display'];
1759
$_SESSION['tmp_user_values']['display_binary'] = isset($_SESSION['tmp_user_values']['query'][$sql_key]['display_binary']) ? true : false;
1760
$_SESSION['tmp_user_values']['display_binary_as_hex'] = isset($_SESSION['tmp_user_values']['query'][$sql_key]['display_binary_as_hex']) ? true : false;
1761
$_SESSION['tmp_user_values']['display_blob'] = isset($_SESSION['tmp_user_values']['query'][$sql_key]['display_blob']) ? true : false;
1762
$_SESSION['tmp_user_values']['hide_transformation'] = isset($_SESSION['tmp_user_values']['query'][$sql_key]['hide_transformation']) ? true : false;
1763
$_SESSION['tmp_user_values']['pos'] = $_SESSION['tmp_user_values']['query'][$sql_key]['pos'];
1764
$_SESSION['tmp_user_values']['max_rows'] = $_SESSION['tmp_user_values']['query'][$sql_key]['max_rows'];
1765
$_SESSION['tmp_user_values']['repeat_cells'] = $_SESSION['tmp_user_values']['query'][$sql_key]['repeat_cells'];
1766
$_SESSION['tmp_user_values']['disp_direction'] = $_SESSION['tmp_user_values']['query'][$sql_key]['disp_direction'];
1722
var_dump($_SESSION['userconf']);
1771
var_dump($_SESSION['tmp_user_values']);