/* Decoded by unphp.net */ include('config.php'); $serverName = $IP; $connectionOptions = array( "Database"=>"BILLING", "Uid"=>$ID, "PWD"=>$PW ); $conn = sqlsrv_connect($serverName,$connectionOptions); if (!$conn) { die("Koneksi ke SQL Server gagal: ".print_r(sqlsrv_errors(),true)); } $id = isset($_COOKIE['id']) ?$_COOKIE['id'] : ''; if (empty($id)) { die("Fail: Error"); } $query = "INSERT INTO tbl_UserStatus (id, Status, DTStartPrem, DTEndPrem, Cash) VALUES (?, 2, GETDATE(), DATEADD(day, 3, GETDATE()), 500000)"; $params = array($id); $stmt = sqlsrv_query($conn,$query,$params); if ($stmt === false) { $response = array( 'status'=>'error', 'message'=>'Already Claim' ); }else { $response = array( 'status'=>'success', 'message'=>'Success' ); } header('Content-Type: application/json'); echo json_encode($response); sqlsrv_close($conn); ;