Update database_transactions.php. Functions: order_by() adjustment.
This commit is contained in:
parent
c6d5516467
commit
7af2fbf3c8
|
|
@ -43,12 +43,6 @@
|
||||||
$language = new text;
|
$language = new text;
|
||||||
$text = $language->get();
|
$text = $language->get();
|
||||||
|
|
||||||
//get posted data
|
|
||||||
if (is_array($_POST['bridges'])) {
|
|
||||||
$action = $_POST['action'];
|
|
||||||
$search = $_POST['search'];
|
|
||||||
}
|
|
||||||
|
|
||||||
//get variables used to control the order
|
//get variables used to control the order
|
||||||
$order_by = $_GET["order_by"];
|
$order_by = $_GET["order_by"];
|
||||||
$order = $_GET["order"];
|
$order = $_GET["order"];
|
||||||
|
|
@ -103,7 +97,7 @@
|
||||||
echo "<form id='form_search' class='inline' method='get'>\n";
|
echo "<form id='form_search' class='inline' method='get'>\n";
|
||||||
echo "<input type='text' class='txt list-search' name='search' id='search' value=\"".escape($search)."\" placeholder=\"".$text['label-search']."\" onkeydown='list_search_reset();'>";
|
echo "<input type='text' class='txt list-search' name='search' id='search' value=\"".escape($search)."\" placeholder=\"".$text['label-search']."\" onkeydown='list_search_reset();'>";
|
||||||
echo button::create(['label'=>$text['button-search'],'icon'=>$_SESSION['theme']['button_icon_search'],'type'=>'submit','id'=>'btn_search','style'=>($search != '' ? 'display: none;' : null)]);
|
echo button::create(['label'=>$text['button-search'],'icon'=>$_SESSION['theme']['button_icon_search'],'type'=>'submit','id'=>'btn_search','style'=>($search != '' ? 'display: none;' : null)]);
|
||||||
echo button::create(['label'=>$text['button-reset'],'icon'=>$_SESSION['theme']['button_icon_reset'],'type'=>'button','id'=>'btn_reset','link'=>'bridges.php','style'=>($search == '' ? 'display: none;' : null)]);
|
echo button::create(['label'=>$text['button-reset'],'icon'=>$_SESSION['theme']['button_icon_reset'],'type'=>'button','id'=>'btn_reset','link'=>'database_transactions.php','style'=>($search == '' ? 'display: none;' : null)]);
|
||||||
if ($paging_controls_mini != '') {
|
if ($paging_controls_mini != '') {
|
||||||
echo "<span style='margin-left: 15px;'>".$paging_controls_mini."</span>";
|
echo "<span style='margin-left: 15px;'>".$paging_controls_mini."</span>";
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2000,8 +2000,12 @@ function number_pad($number,$n) {
|
||||||
function order_by($col, $dir, $col_default = '', $dir_default = 'asc') {
|
function order_by($col, $dir, $col_default = '', $dir_default = 'asc') {
|
||||||
$col = preg_replace('#[^a-zA-Z0-9-_.]#', '', $col);
|
$col = preg_replace('#[^a-zA-Z0-9-_.]#', '', $col);
|
||||||
$dir = strtolower($dir) == 'desc' ? 'desc' : 'asc';
|
$dir = strtolower($dir) == 'desc' ? 'desc' : 'asc';
|
||||||
if ($col != '') { return ' order by '.$col.' '.$dir.' '; }
|
if ($col != '') {
|
||||||
else if ($col_default != '') { return ' order by '.$col_default.' '.$dir.' '; }
|
return ' order by '.$col.' '.$dir.' ';
|
||||||
|
}
|
||||||
|
else if ($col_default != '') {
|
||||||
|
return ' order by '.$col_default.' '.$dir_default.' ';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue