<?php
    ob_start();
    session_start();
    include('fresh_panel/inc/config.php');
    
    if(isset($_POST['cancle_order'])){
        
         $order_id = $_POST['order_id'];
         $date = date('Y-m-d H:i:s');
        
         $statement = $pdo->prepare("UPDATE tbl_payment SET shipping_status=?,cancelled_date=? WHERE  payment_id=?");
         $statement->execute(array('Cancelled',$date,$order_id));
        
        header('location: '.BASE_URL.'order_view.php?order_id='.$order_id);
        exit;
    }    
    
    if(isset($_POST['return_order'])){
        
         $order_id = $_POST['order_id'];
         $date = date('Y-m-d H:i:s');
        
         $statement = $pdo->prepare("UPDATE tbl_payment SET shipping_status=?,returned_date=? WHERE  payment_id=?");
         $statement->execute(array('Returned',$date,$order_id));
        
        header('location: '.BASE_URL.'order_view.php?order_id='.$order_id);
        exit;
    }
?>