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

41 lines
1.0 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 'Voice Calls'
$p = db()->prepare('SELECT id FROM services WHERE name = ?');
$p->execute(['Voice Calls']);
$service = $p->fetch();
if (!$service) {
die('Voice 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">Voice Calls</h1>
<p class="lead">This is where the voice call functionality would be.</p>
<p>You could have a feature to initiate calls, or view your call history.</p>
</div>
<?php require_once '../includes/footer.php'; ?>