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'];
$print[$id]['payment_method_id'] = $paymentMethodId;
$print[$id]['category_id'] = $subscription['category_id'];
$print[$id]['payer_user_id'] = $subscription['payer_user_id'];
$print[$id]['price'] = floatval($subscription['price']);
$print[$id]['progress'] = getSubscriptionProgress($cycle, $frequency, $subscription['next_payment']);
$print[$id]['inactive'] = $subscription['inactive'];
$print[$id]['url'] = $subscription['url'];
$print[$id]['notes'] = $subscription['notes'];
$print[$id]['replacement_subscription_id'] = $subscription['replacement_subscription_id'];
if (isset($settings['convertCurrency']) && $settings['convertCurrency'] === 'true' && $currencyId != $mainCurrencyId) {
$print[$id]['price'] = getPriceConverted($print[$id]['price'], $currencyId, $db);
$print[$id]['currency_code'] = $currencies[$mainCurrencyId]['code'];
}
if (isset($settings['showMonthlyPrice']) && $settings['showMonthlyPrice'] === 'true') {
$print[$id]['price'] = getPricePerMonth($cycle, $frequency, $print[$id]['price']);
}
if (isset($settings['showOriginalPrice']) && $settings['showOriginalPrice'] === 'true') {
$print[$id]['original_price'] = floatval($subscription['price']);
$print[$id]['original_currency_code'] = $currencies[$subscription['currency_id']]['code'];
}
}
if ($sortOrder == "alphanumeric") {
usort($print, function ($a, $b) {
return strnatcmp(strtolower($a['name']), strtolower($b['name']));
});
if ($settings['disabledToBottom'] === 'true') {
usort($print, function ($a, $b) {
return $a['inactive'] - $b['inactive'];
});
}
}
if (isset($print)) {
printSubscriptions($print, $sort, $categories, $members, $i18n, $colorTheme, "", $settings['disabledToBottom'], $settings['mobileNavigation'], $settings['showSubscriptionProgress'], $currencies, $lang);
}
$googleSearchEnabled = false;
if ($db->querySingle("SELECT COUNT(*) FROM sqlite_master WHERE type='table' AND name='google_search'") > 0) {
$googleSearchStmt = $db->prepare("SELECT COUNT(*) AS count FROM google_search WHERE user_id = :userId AND api_key != ''");
$googleSearchStmt->bindValue(':userId', $userId, SQLITE3_INTEGER);
$googleSearchResult = $googleSearchStmt->execute();
if ($googleSearchResult) {
$googleSearchRow = $googleSearchResult->fetchArray(SQLITE3_ASSOC);
$googleSearchEnabled = $googleSearchRow && $googleSearchRow['count'] > 0;
}
}
$db->close();
if (count($subscriptions) == 0) {
?>
= translate('no_subscriptions_yet', $i18n) ?>