Tryag File Manager
Home
||
Turbo Force
||
B-F Config_Cpanel
Current Path :
/
home
/
ynormeco
/
.trash
/
ynormedemos
/
smadmin
/
pages
/
Or
Select Your Path :
Upload File :
New :
File
Dir
//home/ynormeco/.trash/ynormedemos/smadmin/pages/main-bazar.php
<?php error_reporting(0); include("../../inc/config.php"); $conn = connect_database(); date_default_timezone_set("Asia/Kolkata"); $ww="mydpboss.com"; echo $ww; $post = [ 'domain'=>$ww, 'api_key'=>"62569eb576d5a", // get on login panel 'domain_key'=>"9f4709f4538c9e30e8a047d797efd6a3",// get on login panel 'market'=>"MAIN BAZAR", // auto name match ]; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "https://matkaapi.com/api/market_api.php"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post)); $response = curl_exec($ch); curl_close($ch); $obj = json_decode($response,true); $display=$obj["data"][0]["result"]; if($display!="") { $resu=explode("-",$display); $datee=date("Y-m-d"); $time=date("H:i:s"); $l1 = isset($resu[0][0]) ? $resu[0][0] : NULL; $l2 = isset($resu[0][1]) ? $resu[0][1] : NULL; $l3 = isset($resu[0][2]) ? $resu[0][2] : NULL; $middle = mysqli_real_escape_string($conn, $resu[1]); $r1 = isset($resu[2][0]) ? $resu[2][0] : NULL; $r2 = isset($resu[2][1]) ? $resu[2][1] : NULL; $r3 = isset($resu[2][2]) ? $resu[2][2] : NULL; /*if($resu[2]!="") { $date=date("Y-m-d"); $datee=date('Y-m-d', strtotime('-1 day', strtotime($date))); $qry1="select * from `live_update` where `market_name`='21' and `entrydate`='$datee'"; } else { $qry1="select * from `live_update` where `market_name`='21' and `entrydate`='$datee'"; }*/ $qry1="select * from `live_update` where `market_name`='16' and `entrydate`='$datee' ORDER BY `id` DESC "; $query1=mysqli_query($conn,$qry1); $chcou=mysqli_num_rows($query1); if($chcou>0) { $chrow=mysqli_fetch_assoc($query1); //$upqry="update `result` set `fval`='$resu[0]',`mval`='$resu[1]',`lval`='$resu[2]' where `id`='$chrow[id]'"; $sql = mysqli_query($conn,"UPDATE `live_update` SET `l1` = '$l1', `l2` = '$l2', `l3` = '$l3', `c` = '$middle', `r1` = '$r1', `r2` = '$r2', `r3` = '$r3', `msg` = '$desc' WHERE `id` = '$id' "); mysqli_query($conn,$sql); } else { $time=date("H:i"); $t="21:35"; if($time>$t || $time==$t) { //$inqry="insert into `result` values('','$datee','$value[id]','$resu[0]','$resu[1]','$resu[2]')"; $sql = mysqli_query($conn, "INSERT INTO `live_update` (`id`, `market_name`, `l1`, `l2`, `l3`, `c`, `r1`, `r2`, `r3`,`entrydate`,`msg`) VALUES (NULL, '16', '$l1', '$l2', '$l3', '$middle', '$r1', '$r2', '$r3','$datee','$desc')"); mysqli_query($conn,$sql); } } } // SEt cron working or not // ----------------------------- // $daa=date("h:i:s a"); // $san_q="insert into `api_call_time` values('','$daa')"; // mysqli_query($link,$san_q); ?>