<?php
// required headers
header("Access-Control-Allow-Origin: *");
header("Content-Type: application/json; charset=UTF-8");
header("Access-Control-Allow-Methods: POST");
header("Access-Control-Max-Age: 3600");
header("Access-Control-Allow-Headers: Content-Type, Access-Control-Allow-Headers, Authorization, X-Requested-With");

date_default_timezone_set('Asia/Rangoon');
$data = json_decode(file_get_contents("php://input"));

$date1=date_create($data->suspend_from);
$date2=date_create($data->suspend_to);
$diff=date_diff($date1,$date2);
$days = (int) $diff->format("%a");


$today = date("Y-m-d");
$epdate = $data->current_expire;

$msg_arr = array(
    "days" => $days+1,
    "ed" => date('Y-m-d', strtotime("+" . ($days+1) . " days", strtotime($epdate)))
);	

echo json_encode($msg_arr);
?>