diff --git a/endpoints/settings/mobile_navigation.php b/endpoints/settings/mobile_navigation.php new file mode 100644 index 000000000..4d9ee7580 --- /dev/null +++ b/endpoints/settings/mobile_navigation.php @@ -0,0 +1,36 @@ + false, + "message" => translate('session_expired', $i18n) + ])); +} + +if ($_SERVER["REQUEST_METHOD"] === "POST") { + $postData = file_get_contents("php://input"); + $data = json_decode($postData, true); + + $mobile_nav = $data['value']; + + $stmt = $db->prepare('UPDATE settings SET mobile_nav = :mobile_nav WHERE user_id = :userId'); + $stmt->bindParam(':mobile_nav', $mobile_nav, SQLITE3_INTEGER); + $stmt->bindParam(':userId', $userId, SQLITE3_INTEGER); + + if ($stmt->execute()) { + die(json_encode([ + "success" => true, + "message" => translate("success", $i18n) + ])); + } else { + die(json_encode([ + "success" => false, + "message" => translate("error", $i18n) + ])); + } +} +« + +?> \ No newline at end of file diff --git a/endpoints/subscriptions/get.php b/endpoints/subscriptions/get.php index 487490723..2614f50fb 100644 --- a/endpoints/subscriptions/get.php +++ b/endpoints/subscriptions/get.php @@ -18,6 +18,13 @@ $colorTheme = $settings['color_theme']; } +$locale = isset($_COOKIE['user_locale']) ? $_COOKIE['user_locale'] : 'en_US'; +$formatter = new IntlDateFormatter( + $locale, + IntlDateFormatter::MEDIUM, + IntlDateFormatter::NONE +); + if (isset($_SESSION['loggedin']) && $_SESSION['loggedin'] === true) { @@ -146,7 +153,9 @@ $paymentMethodId = $subscription['payment_method_id']; $print[$id]['currency_code'] = $currencies[$subscription['currency_id']]['code']; $currencyId = $subscription['currency_id']; - $print[$id]['next_payment'] = date('M d, Y', strtotime($subscription['next_payment'])); + $next_payment_timestamp = strtotime($subscription['next_payment']); + $formatted_date = $formatter->format($next_payment_timestamp); + $print[$id]['next_payment'] = $formatted_date; $paymentIconFolder = (strpos($payment_methods[$paymentMethodId]['icon'], 'images/uploads/icons/') !== false) ? "" : "images/uploads/logos/"; $print[$id]['payment_method_icon'] = $paymentIconFolder . $payment_methods[$paymentMethodId]['icon']; $print[$id]['payment_method_name'] = $payment_methods[$paymentMethodId]['name']; diff --git a/includes/footer.php b/includes/footer.php index 0ef9f170a..0684cf747 100644 --- a/includes/footer.php +++ b/includes/footer.php @@ -1,35 +1,35 @@ - + -