<?php 
include("db_config.php"); 
if($_SERVER['REQUEST_METHOD']=='POST'){
     $order_id = $_POST['order_id'];
            $sql_ptm="select user_payment.*,countries.name as count_name,states.name as st_name,cities.name as c_name from user_payment join countries on user_payment.country=countries.id join states on user_payment.state=states.id join cities on user_payment.city=cities.id where user_payment.order_id='".$order_id."'";
    $result_ptm = mysqli_query($conn, $sql_ptm);
    $res_ptm= mysqli_fetch_array($result_ptm);
      $user_id=$res_ptm['user_id'];
      $cart_id=$res_ptm['cart_id'];
       $ct_id = explode(",",$cart_id);
       foreach($ct_id as $pm_id){
	 $query="select addto_cart.*,product.prod_img1,product.prod_name from addto_cart join product on addto_cart.prod_id=product.id where addto_cart.user_id='$user_id' and addto_cart.id='".$pm_id."' ";
	 $result = mysqli_query($conn, $query);
	
	if(mysqli_num_rows($result) > 0) {
		while($row[] = mysqli_fetch_assoc($result)) {
		 $tem = $row;
		 }
	  $response['data_ptm']=$res_ptm;
	  $response['data']=$tem;
	  $response['status']=1;
	}
	else {
		//$json =  json_encode(array("status" => 0, "msg" => "data Not Found!"));
		$response['status']=0;
	}
	}
	
	echo json_encode($response);
	mysqli_close($conn);
}