<?php
session_start();
include '../include/config.php';
$consult_id = $_POST['consult_id'];
$room = "uhd_" . uniqid();
$link = "https://meet.jit.si/$room";
$conn->query("UPDATE consultations SET meeting_link = '$link', status = 'ongoing' WHERE id = $consult_id");
echo "<script>window.open('$link','_blank'); window.location.href='uhd_dashboard.php';</script>";
?>