dashboard\primary\error("This subscription already exists!"), 'failure' => dashboard\primary\error("Failed to create subscription!"), 'success' => dashboard\primary\success("Successfully created subscription!"), default => dashboard\primary\error("Unhandled Error! Contact us if you need help") }; } } if (isset($_POST['deletesub'])) { $resp = misc\sub\deleteSingular($_POST['deletesub']); match($resp){ 'failure' => dashboard\primary\error("Failed to delete subscription"), 'success' => dashboard\primary\success("Successfully deleted subscription"), default => dashboard\primary\error("Unhandled Error! Contact us if you need help") }; } if (isset($_POST['delallsubs'])){ $resp = misc\sub\deleteall(); match($resp){ 'failure' => dashboard\primary\error("Failed to delete subscriptions!"), 'success' => dashboard\primary\success("Successfully deleted all subscriptions!"), default => dashboard\primary\error("Unhandled Error! Contact us if you need help") }; } if (isset($_POST['pausesub'])){ $resp = misc\sub\pause($_POST['pausesub']); match($resp){ 'failure' => dashboard\primary\error("Failed to pause subscription!"), 'success' => dashboard\primary\success("Successfully paused subscription!"), default => dashboard\primary\error("Unhandled Error! Contact us if you need help") }; } if (isset($_POST['unpausesub'])){ $resp = misc\sub\unpause($_POST['unpausesub']); match($resp){ 'failure' => dashboard\primary\error("Failed to unpause subscription!"), 'success' => dashboard\primary\success("Successfully unpaused subscription!"), default => dashboard\primary\error("Unhandled Error! Contact us if you need help") }; } if (isset($_POST['editsub'])) { $subscription = misc\etc\sanitize($_POST['editsub']); $query = misc\mysql\query("SELECT * FROM `subscriptions` WHERE `name` = ? AND `app` = ?", [$subscription, $_SESSION['app']]); if ($query->num_rows < 1) { dashboard\primary\error("Subscription not Found!"); echo ""; return; } $row = mysqli_fetch_array($query->result); $level = $row["level"]; echo '
'; } if (isset($_POST['savesub'])) { $subscription = misc\etc\sanitize($_POST['subscription']); $level = misc\etc\sanitize($_POST['level']); if (!is_numeric($_POST['level'])) { dashboard\primary\error("Level must be a number!"); } else { misc\mysql\query("UPDATE `subscriptions` SET `level` = ? WHERE `name` = ? AND `app` = ?", [$level, $subscription, $_SESSION['app']]); if ($_SESSION['role'] == "seller") { misc\cache\purge('KeyAuthSubscriptions:' . $_SESSION['app']); } dashboard\primary\success("Successfully Updated Subscription!"); echo ""; } } if (isset($_POST["selected"]) && isset($_POST["action"])) { $selected = json_decode($_POST["selected"]); if ($_POST["action"] == "delete") { foreach ($selected as $sub) { $resp = misc\sub\deleteSingular($sub); match($resp){ 'failure' => dashboard\primary\error("Failed to delete subscription"), 'success' => dashboard\primary\success("Successfully deleted subscription"), default => dashboard\primary\error("Unhandled Error! Contact us if you need help") }; } } else if ($_POST["action"] == "pauseMulti") { foreach ($selected as $value) { $resp = misc\sub\pause($value); match($resp){ 'failure' => dashboard\primary\error("Failed to pause subscriptions!"), 'success' => dashboard\primary\success("Successfully paused subscriptions!"), default => dashboard\primary\error("Unhandled Error! Contact us if you need help") }; } } else if ($_POST["action"] == "unpauseMulti") { foreach ($selected as $value) { $resp = misc\sub\unpause($value); match($resp){ 'failure' => dashboard\primary\error("Failed to unpause subscriptions!"), 'success' => dashboard\primary\success("Successfully unpaused subscriptions!"), default => dashboard\primary\error("Unhandled Error! Contact us if you need help") }; } } else { dashboard\primary\error("Invalid action!"); } } ?>Subscriptions act as levels/tiers. Learn More.
| Select | Subscription Name | License Level | Actions |
|---|---|---|---|
| ' . ' | '; echo "" . $row["name"] . " | "; echo "" . $row["level"] . " | "; echo '
Dropdown actions in RED do not show a confirmation! Dropdown actions in BLUE will show a confirmation!