<?php
include "../connection/config.php";
extract($_REQUEST);
date_default_timezone_set("Asia/Kolkata");
$date=date('Y-m-d', strtotime('-6 days'));
$sx = query("SELECT * FROM `transactions` where user='$mobile' AND remark like '%Win Amount Added%' OR user='$mobile' AND remark='bet' and DATE_FORMAT( `date` , '%Y-%m-%d' ) > '$date' order by created_at desc");
while($x = fetch($sx))
{
    if($x['type'] == "0")
    {
        $x['amount'] = '-'.$x['amount'];
    }
    $x['date'] = date('d/m/y  h:i:s A',$x['created_at']);
    $data['data'][] = $x;
}

echo json_encode($data);