diff --git a/endpoints/subscription/add.php b/endpoints/subscription/add.php index 1071d8351..ed6f92fa1 100644 --- a/endpoints/subscription/add.php +++ b/endpoints/subscription/add.php @@ -144,6 +144,7 @@ function resizeAndUploadLogo($uploadedFile, $uploadDir, $name) { $payerUserId = $_POST["payer_user_id"]; $categoryId = $_POST['category_id']; $notes = $_POST["notes"]; + $url = $_POST['url']; $logoUrl = $_POST['logo-url']; $logo = ""; $notify = isset($_POST['notifications']) ? true : false; @@ -158,15 +159,15 @@ function resizeAndUploadLogo($uploadedFile, $uploadDir, $name) { if (!$isEdit) { $sql = "INSERT INTO subscriptions (name, logo, price, currency_id, next_payment, cycle, frequency, notes, - payment_method_id, payer_user_id, category_id, notify) + payment_method_id, payer_user_id, category_id, notify, url) VALUES (:name, :logo, :price, :currencyId, :nextPayment, :cycle, :frequency, :notes, - :paymentMethodId, :payerUserId, :categoryId, :notify)"; + :paymentMethodId, :payerUserId, :categoryId, :notify, :url)"; } else { $id = $_POST['id']; if ($logo != "") { - $sql = "UPDATE subscriptions SET name = :name, logo = :logo, price = :price, currency_id = :currencyId, next_payment = :nextPayment, cycle = :cycle, frequency = :frequency, notes = :notes, payment_method_id = :paymentMethodId, payer_user_id = :payerUserId, category_id = :categoryId, notify = :notify WHERE id = :id"; + $sql = "UPDATE subscriptions SET name = :name, logo = :logo, price = :price, currency_id = :currencyId, next_payment = :nextPayment, cycle = :cycle, frequency = :frequency, notes = :notes, payment_method_id = :paymentMethodId, payer_user_id = :payerUserId, category_id = :categoryId, notify = :notify, url = :url WHERE id = :id"; } else { - $sql = "UPDATE subscriptions SET name = :name, price = :price, currency_id = :currencyId, next_payment = :nextPayment, cycle = :cycle, frequency = :frequency, notes = :notes, payment_method_id = :paymentMethodId, payer_user_id = :payerUserId, category_id = :categoryId, notify = :notify WHERE id = :id"; + $sql = "UPDATE subscriptions SET name = :name, price = :price, currency_id = :currencyId, next_payment = :nextPayment, cycle = :cycle, frequency = :frequency, notes = :notes, payment_method_id = :paymentMethodId, payer_user_id = :payerUserId, category_id = :categoryId, notify = :notify, url = :url WHERE id = :id"; } } @@ -188,6 +189,7 @@ function resizeAndUploadLogo($uploadedFile, $uploadDir, $name) { $stmt->bindParam(':payerUserId', $payerUserId, SQLITE3_INTEGER); $stmt->bindParam(':categoryId', $categoryId, SQLITE3_INTEGER); $stmt->bindParam(':notify', $notify, SQLITE3_INTEGER); + $stmt->bindParam(':url', $url, SQLITE3_TEXT); if ($stmt->execute()) { $success['status'] = "Success"; diff --git a/endpoints/subscription/get.php b/endpoints/subscription/get.php index c0f29aa07..1b9b1122d 100644 --- a/endpoints/subscription/get.php +++ b/endpoints/subscription/get.php @@ -25,6 +25,7 @@ $subscriptionData['payer_user_id'] = $row['payer_user_id']; $subscriptionData['category_id'] = $row['category_id']; $subscriptionData['notify'] = $row['notify']; + $subscriptionData['url'] = $row['url']; $subscriptionJson = json_encode($subscriptionData); header('Content-Type: application/json'); diff --git a/endpoints/subscriptions/get.php b/endpoints/subscriptions/get.php index bb6f2561e..d1eb6820c 100644 --- a/endpoints/subscriptions/get.php +++ b/endpoints/subscriptions/get.php @@ -53,6 +53,7 @@ $print[$id]['category_id'] = $subscription['category_id']; $print[$id]['payer_user_id'] = $subscription['payer_user_id']; $print[$id]['price'] = floatval($subscription['price']); + $print[$id]['url'] = $subscription['url']; if (isset($_COOKIE['convertCurrency']) && $_COOKIE['convertCurrency'] === 'true' && $currencyId != $mainCurrencyId) { $print[$id]['price'] = getPriceConverted($print[$id]['price'], $currencyId, $db); diff --git a/images/siteicons/filter.png b/images/siteicons/filter.png new file mode 100644 index 000000000..5cbc99104 Binary files /dev/null and b/images/siteicons/filter.png differ diff --git a/images/siteicons/web.png b/images/siteicons/web.png new file mode 100644 index 000000000..2a7b42f21 Binary files /dev/null and b/images/siteicons/web.png differ diff --git a/includes/list_subscriptions.php b/includes/list_subscriptions.php index feaf6d6bb..4144e74d8 100644 --- a/includes/list_subscriptions.php +++ b/includes/list_subscriptions.php @@ -101,6 +101,17 @@ function printSubscriptions($subscriptions, $sort, $categories, $members) { = $subscription['name'] ?> = $members[$subscription['payer_user_id']]['name'] ?> = $categories[$subscription['category_id']]['name'] ?> + + + +