<?php
$title="Results of Completed Matches | Live Cricket Score | Live Score on Mobile | Free Cricket Scores | ODI | TEST | IPL Scores | Live Score Card | Free Score Updates | CricSkore.com";

include "header.php";



$dom = new domDocument;
if(isset($_GET['aid'])){
    $aid = $_GET['aid'];
    $at = $_GET['at'];
    
@$dom->loadHTML(url_contents("https://www.cricwaves.com/mobile/loadArtD?aid=$aid&at=$at"));
}else{
    echo "404";
    die();exit;
 // @$dom->loadHTML(url_contents('https://www.cricwaves.com/mobile/articles'));   
}

$dom->preserveWhiteSpace = false;


$html = '';
$domxpath = new DOMXPath($dom);
$newDom = new DOMDocument;
$newDom->formatOutput = true;

$sections = $domxpath->query('//div[@class="clr list_content" or @class="clr list_content "]');

$i = 0;
while( $myItem = $sections->item($i++) ){
    $node = $newDom->importNode( $myItem, true );    // import node
    $newDom->appendChild($node);                    // append node
}
$html = $newDom->saveHTML();

$html=str_ireplace("http://www.cricwaves.com","",$html);
$html=str_ireplace("mobile/loadMatch?mid=","$base_url"."match.php?id=",$html);
$html=str_ireplace("mobile/loadScore?mid=","$base_url"."score.php?id=",$html);
$html=str_ireplace("mobile/loadCom?mid=","$base_url"."commentry.php?id=",$html);
$html=str_ireplace("mobile/loadTPlD","$base_url"."player.php",$html);

$html=str_ireplace("clr list_content","block",$html);
$html=str_ireplace("margin:0px;","",$html);
$html=str_ireplace("clr Tabs","block-head",$html);

$html=str_ireplace("mobile/cricket-results","$base_url"."results.php",$html);
$html=str_ireplace("mobile/articles","$base_url"."articles.php",$html);

$html=str_ireplace("mobile/cricket-schedule","$base_url"."schedule.php",$html);
$html=str_ireplace("mobile/loadArtD","$base_url"."articles_detail.php",$html);

echo $html;

include "footer.php";
?>