<?php 

include 'config.php';

$query = $db->query("SELECT * FROM kullanicilar WHERE user_id = '753088'")->fetch(PDO::FETCH_ASSOC);

$suan = time();

$fark = ($suan-$query['user_songiris']);

echo $fark;


if($fark<=300){

$token = "2039215678:AAHz7uXdojLiXTkSme_UHy6TuJHsiIyr9Tc";

$bildirim_icerik = "<b>Demo Kullanıcı HEYSEN'e Giriş Yaptı!</b> \nTarih: ".date('d.m.Y - H:i:s', $query['user_songiris']);
 
$parametre= array(
'chat_id' => "713052668",
'text' => $bildirim_icerik,
);
$ch = curl_init();
$url = "https://api.telegram.org/bot".$token."/sendmessage?parse_mode=html";
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $parametre);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$result = curl_exec($ch);

$json_cikti = json_decode($result,true);

if($json_cikti['ok']==true){
	//echo "bildirim bas";

	$query = $db->prepare("UPDATE odemeler SET
notify = :yeni_kadi
WHERE id = :eski_kadi");
$update = $query->execute(array(
     "yeni_kadi" => 1,
     "eski_kadi" => $veri['id']
));



}

}