36692-vm/services/smsnotifications.php
2025-12-05 20:00:32 +00:00

41 lines
1.1 KiB
PHP

<?php
require_once '../includes/header.php';
require_once '../db/config.php';
if (!isset($_SESSION['user_id'])) {
header('Location: ../login.php');
exit();
}
$user_id = $_SESSION['user_id'];
// Get the service ID for 'SMS Notifications'
$p = db()->prepare('SELECT id FROM services WHERE name = ?');
$p->execute(['SMS Notifications']);
$service = $p->fetch();
if (!$service) {
die('SMS service not found.');
}
$service_id = $service['id'];
// Check if the user is subscribed to this service
$p = db()->prepare('SELECT * FROM user_services WHERE user_id = ? AND service_id = ?');
$p->execute([$user_id, $service_id]);
$subscription = $p->fetch();
if (!$subscription) {
die('You are not subscribed to this service. <a href="../subscribe.php">Subscribe now</a>');
}
?>
<div class="container">
<h1 class="mt-5">SMS Notifications</h1>
<p class="lead">This is where the SMS notification functionality would be.</p>
<p>You could have a form here to send an SMS, or view a history of sent messages.</p>
</div>
<?php require_once '../includes/footer.php'; ?>