<?php 	

session_start();
require_once '../../includes/conn.php';


$valid['success'] = array('success' => false, 'messages' => array());

$orderId = $_POST['orderId'];

if($orderId) { 

 $sql = "delete from orders  WHERE order_id = {$orderId}";

 // $orderItem = "UPDATE order_item SET order_item_status = 2 WHERE  order_id = {$orderId}";

 if($con->query($sql) === TRUE && $con->query($orderItem) === TRUE) {
 	$valid['success'] = true;
	$valid['messages'] = "Successfully Removed";		
 } else {
 	$valid['success'] = false;
 	$valid['messages'] = "Error while remove the brand";
 }
 
 $con->close();

 echo json_encode($valid);
 
} // /if $_POST