Skip to content

Commit

Permalink
sort by descending order on first click
Browse files Browse the repository at this point in the history
  • Loading branch information
Samnan committed Feb 20, 2019
1 parent d0a9fb2 commit e22cf1e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
11 changes: 10 additions & 1 deletion Docs/changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
-------------------------------
version 3.8
-------------------------------
Updates:
- sort by descending order on first click (as records sort in ascending order by default)

Miscellaneous:
- Fix display of result headers in safari (avoid wrapping)

-------------------------------
version 3.7
-------------------------------
Expand Down Expand Up @@ -611,4 +620,4 @@ version 0.2
-------------------------
version 0.1
-------------------------
- First public release.
- First public release.
4 changes: 2 additions & 2 deletions config/constants.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// You should not change anything below unless you know what you are doing!
define("EXTERNAL_PATH", defined('MYWEBSQL_COMPACT_DIST') ? $_SERVER["SCRIPT_NAME"] : str_replace(basename($_SERVER["SCRIPT_NAME"]), "", $_SERVER["SCRIPT_NAME"]));

define('APP_VERSION', '3.6');
define('APP_VERSION', '3.8');
define('PROJECT_SITEURL', 'http://mywebsql.net');
define("DEVELOPER_EMAIL", "[email protected]");
define("COOKIE_LIFETIME", 1440); // in hours
Expand Down Expand Up @@ -53,4 +53,4 @@ function stripdata($data)
}

}
?>
?>
6 changes: 3 additions & 3 deletions lib/util.php
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ function createInfoGrid(&$db, $query="", $numQueries=1, $affectedRows=-1, $addHi
if ($numQueries == 1) {
$formatted_query = preg_replace("/[\\n|\\r]?[\\n]+/", "<br>", htmlspecialchars($query));
print "<div class='sql-text ui-state-default'>".$formatted_query."</div>";

$warnings = $db->getWarnings();
if (count($warnings) > 0) {
print '<div class="message ui-state-error">';
Expand Down Expand Up @@ -435,7 +435,7 @@ function sortQuery($query, $field) {
$sort = '';
$sort_type = Session::get('select', 'sort');
if (!$sort_type)
$sort_type = 'ASC';
$sort_type = 'DESC';
$limit = '';
// find and extract limit clause out of query (must be the last clause, otherwise sorting will not work)
preg_match(LIMIT_REGEXP, $query, $matches);
Expand Down Expand Up @@ -603,4 +603,4 @@ function loadDbVars(&$db) {
$db->query($query);
}
}
?>
?>

0 comments on commit e22cf1e

Please sign in to comment.