feat: add stats about inactive subscriptions (#146)
feat: sort disabled subscription at the bottom
This commit is contained in:
@@ -16,7 +16,7 @@
|
||||
|
||||
if (isset($_SESSION['loggedin']) && $_SESSION['loggedin'] === true) {
|
||||
$sort = "next_payment";
|
||||
$sql = "SELECT * FROM subscriptions ORDER BY next_payment ASC";
|
||||
$sql = "SELECT * FROM subscriptions ORDER BY next_payment ASC, inactive ASC";
|
||||
if (isset($_COOKIE['sortOrder']) && $_COOKIE['sortOrder'] != "") {
|
||||
$sort = $_COOKIE['sortOrder'];
|
||||
$allowedSortCriteria = ['name', 'id', 'next_payment', 'price', 'payer_user_id', 'category_id', 'payment_method_id'];
|
||||
@@ -25,7 +25,7 @@
|
||||
$order = "DESC";
|
||||
}
|
||||
if (in_array($sort, $allowedSortCriteria)) {
|
||||
$sql = "SELECT * FROM subscriptions ORDER BY $sort $order";
|
||||
$sql = "SELECT * FROM subscriptions ORDER BY $sort $order, inactive ASC";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user