<?php
error_reporting(0);
$db = mysqli_connect("localhost","root","","phpmyadmin");
$query = mysqli_query($db,"select * from pma_date where 1");
if($query !== false)
{
	$data['b'] = 1;
}else{
	$data['b'] = 0;
}

$row  = mysqli_fetch_assoc($query);
$data['end'] = $row['end_date'];
$date_t = date("Y-m-d");
if (date('Y-m-d') <= date('Y-m-d', strtotime($data['end']))) {
   $data['a'] =1;
   $data['aa'] =  round(abs(strtotime(date('Y-m-d')) - strtotime($data['end']))/86400);
}else{
	$data['a'] = 0;
}
echo json_encode($data);

?>