<?php
$title="Live Cricket Score | Cricket Fixtures | Cricket Results | Cricket News
| ODI | Test | 20- 20 | Cricket News | Inda | Pakistan | bangaldesh  |
Sri lanka | australia | National Elite League Twenty20 | East Africa
Premier League | Metropolitan Bank Twenty20 | Stanbic Bank 20 Series |
Standard Bank Pro 20 Series | MiWay T20 Challenge | Ram Slam T20
Challenge | Scotiabank National T20 Championship | Upcoming league |
Stanford 20/20 | Stanford Super Series | Caribbean Twenty20 |
Caribbean Premier League | Bangladesh Premier League | Inter-State T20
Championship | Indian Premier Leagu | Syed Mushtaq Ali Trophy |
ABN-AMRO Twenty-20 Cup | RBS Twenty-20 Cup | Faysal Bank Twenty-20 Cup
| Faysal Bank Super 8 T20 Cup | Ramadan T20 Cup | Faysal Bank T-20 Cup
for Departments | Twenty20 Tournament | Inter-Provincial Twenty20 |
Sri Lanka Premier League | Twenty20 Cup | Friends Life t20 | Insinger
de Beaufort Twenty20 Cup | Murgitroyd Twenty20 | KFC Twenty20 Big Bash
| Big Bash League | State Twenty20 | HRV Cup | International 20:20
Club Championship | Champions League Twenty20";

include "header.php";
?>
<div class="block">
<div style="text-align: center; padding: 5px">
<a href="<?php echo "match.php?id=".$_GET['id']; ?>" class="button">Summary</a><a href="<?php echo "score.php?id=".$_GET['id'] ?>" class="button">Scorecard</a><a href="<? echo "commentry.php?id=".$_GET['id']; ?>" class="button">Commentary</a>
</div>
</div>
<?php
function url_contents($url){
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
//curl_setopt($ch, CURLOPT_PROXY,"localhost:8080");
curl_setopt($ch, CURLOPT_REFERER, "http://www.cricwaves.com/mobile/");
$data=curl_exec ($ch);
curl_close ($ch);

return $data;
}

$dom = new domDocument;
@$dom->loadHTML(url_contents('http://www.cricwaves.com/mobile/loadCom?mid='.$_GET['id']));
if(isset($_GET['tid'])){
	@$dom->loadHTML(url_contents('http://www.cricwaves.com/mobile/loadCom?mid='.$_GET['id'].'&tid='.$_GET['tid']));
};
if(isset($_GET['inngs'])){
@$dom->loadHTML(url_contents('http://www.cricwaves.com/mobile/loadCom?mid='.$_GET['id'].'&inngs='.$_GET['inngs']));
}
if(isset($_GET['tid'])){
	if(isset($_GET['inngs'])){
		@$dom->loadHTML(url_contents('http://www.cricwaves.com/mobile/loadCom?mid='.$_GET['id'].'&tid='.$_GET['tid'].'&inngs='.$_GET['inngs']));
	}
}





$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("Ltab","block-head",$html);
$html=str_ireplace("background:#007ABB;","background:#555555;color:white",$html);

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

echo $html;
?>
<div class="block">
<a href="index.php">Home</a>

</div>
<?php
include "footer.php";
?>