diff --git a/endpoints/cronjobs/sendnotifications.php b/endpoints/cronjobs/sendnotifications.php index 8b9153ff0..1298b399f 100644 --- a/endpoints/cronjobs/sendnotifications.php +++ b/endpoints/cronjobs/sendnotifications.php @@ -9,6 +9,9 @@ require __DIR__ . '/../../libs/PHPMailer/SMTP.php'; require __DIR__ . '/../../libs/PHPMailer/Exception.php'; +$date = new DateTime('now'); +echo "\n" . $date->format('Y-m-d') . " " . $date->format('H:i:s') . "
\n"; + // Get all user ids $query = "SELECT id, username FROM user"; $stmt = $db->prepare($query); @@ -16,7 +19,7 @@ while ($userToNotify = $usersToNotify->fetchArray(SQLITE3_ASSOC)) { $userId = $userToNotify['id']; - echo "For user: " . $userToNotify['username'] . "
"; + echo "\nFor user: " . $userToNotify['username'] . "
"; $days = 1; $emailNotificationsEnabled = false; diff --git a/endpoints/subscriptions/get.php b/endpoints/subscriptions/get.php index 141335e9f..98fd9a28f 100644 --- a/endpoints/subscriptions/get.php +++ b/endpoints/subscriptions/get.php @@ -20,6 +20,7 @@ if (isset($_SESSION['loggedin']) && $_SESSION['loggedin'] === true) { $sort = "next_payment"; + $sortOrder = $sort; $order = "ASC"; $sql = "SELECT * FROM subscriptions ORDER BY next_payment ASC, inactive ASC"; if (isset($_COOKIE['sortOrder']) && $_COOKIE['sortOrder'] != "") { diff --git a/includes/version.php b/includes/version.php index 9c7e85925..3308ab939 100644 --- a/includes/version.php +++ b/includes/version.php @@ -1,3 +1,3 @@ \ No newline at end of file diff --git a/index.php b/index.php index f3fb68d39..a3b966dc5 100644 --- a/index.php +++ b/index.php @@ -5,6 +5,7 @@ include_once 'includes/list_subscriptions.php'; $sort = "next_payment"; +$sortOrder = $sort; $sql = "SELECT * FROM subscriptions WHERE user_id = :userId ORDER BY next_payment ASC, inactive ASC"; if (isset($_COOKIE['sortOrder']) && $_COOKIE['sortOrder'] != "") { $sort = $_COOKIE['sortOrder']; @@ -22,7 +23,7 @@ } $sql = "SELECT * FROM subscriptions WHERE user_id = :userId"; - $sql .= " ORDER BY LOWER($sort) $order"; + $sql .= " ORDER BY $sort $order"; if ($sort != "next_payment") { $sql .= ", next_payment ASC"; }