$sportid) { $post_fields = [ 'url' => BaseUrl::get().'/v1/matches?sportId='.$client_sportid, 'header' => json_encode(['Authorization: Bearer '.$data['token'], 'accept: application/json', 'content-type: application/json']), ]; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://proxydb1.nuhodds.com/logifuture.php'); curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_TIMEOUT, 30); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $post_fields); curl_setopt($ch, CURLOPT_HTTPHEADER, [ 'Proxy-Auth: AIkcoRnipSgMK88WMQhOQQN3LKDrNDCIebNfPnEayJdmDeTigx', ]); $file = curl_exec($ch); $matches = json_decode($file, 1); if (! isset($matches['error'])) { foreach ($matches as $match) { if (strpos($match['sportCategory'], 'Simulated Reality') === false) { $event = ActiveEvent::filter($sportid, $match); dd($event); $_spreads = []; switch ($sportid) { case 1: Soccer::get($event, $match); break; case 2: Icehockey::get($event, $_spreads, $match); break; case 3: Basket::get($event, $_spreads, $match); break; case 5: Tennis::get($event, $_spreads, $match); break; default: Notice::note('SPORT NOT IMPLEMENTED', 'r', 1); break; } Parser::$_matches_array = []; Parser::$_matches_array[] = $event; $matchid = Parser::processData(1); if ($matchid) { $event['matchid'] = $matchid; if (isset($_spreads['point'])) { $tmp = $event + $_spreads['point']; DB_Parser::addPointOdds('bai_points', $matchid, $tmp); } if (isset($_spreads['point_qt'])) { $tmp = $event + $_spreads['point_qt']; DB_Parser::addPointOdds('bai_points_qt', $matchid, $tmp); } if (isset($_spreads['total'])) { $tmp = $event + $_spreads['total']; DB_Parser::addTotalOdds('bai_totals', $matchid, $tmp); } if (isset($_spreads['total_qt'])) { $tmp = $event + $_spreads['total_qt']; DB_Parser::addTotalOdds('bai_totals_qt', $matchid, $tmp); } if (isset($_spreads['mlset1'])) { $tmp = $event + $_spreads['mlset1']; DB_Parser::addTotalOdds('bai_2way_set1', $matchid, $tmp); } if (Database::$debug) { Notice::note($event, 'y'); } } } } Parser::flagStatus($sportid); } } } }