<?php

include "classes/class.loader.php";

$db = new db();

$calls = new functions();

$db->query("UPDATE `bookings` SET `status` = 2 WHERE `record_id` = '{$_GET['record_id']}'");

$booking = $db->query("SELECT * FROM `bookings` WHERE `record_id` = '{$_GET['record_id']}' LIMIT 1");

$booking = $booking->fetch_assoc();

$email = new email();

$email->add_address($calls->get_user_email($booking['user_id']),$calls->get_username($booking['user_id']));

$email->subject("Unleashed - Booking Confirmed");

$email->body("Your booking has been Confirmed.");

$email->send();

header("location: home.php");