v1.0.0.1
StocketBase
- <?php
-
- declare(strict_types=1);
-
- if (count(get_included_files()) === 1) {
- http_response_code(403);
- exit;
- }
-
- if (!Auth::hasRoleAtLeast(Auth::ROLE_STORE_MANAGER)) {
- return;
- }
-
- $discountId = (int) ($_POST['discount_id'] ?? 0);
-
- if ($discountId <= 0) {
- return;
- }
-
- Database::site()->prepare('DELETE FROM discounts WHERE id = :id')->execute(['id' => $discountId]);
-