<?php

ob_start();

if (!session_start()) {
    session_start();
}

try {
    $db = new PDO('mysql:host=localhost;dbname=gdhhsxmy_monsoonvibespublica;charset=utf8', 'gdhhsxmy_monsoonvibespublica', 'monsoonvibespublica');
} catch (Exception $e) {
    echo 'Error has Occured';
}


if (isset($_POST['cancel_btn'])) {
    $id = $_POST['cancel_id'];
    echo $id;

    $exp  = date('Y-m-d', strtotime('+1 week'));
    $exp  = date('Y-m-d');
    $stmt = $db->prepare("UPDATE transcationbook SET  	DeliveryDate =now() , OrderStatus='Order Cancelled' where OrderID ='$id' ");


    $stmt->execute();
    header('location: profile.php');
    exit();
}
