View file wapirate/wml/lotto.php

File size: 6.89Kb
<?php

include("head.php");

////////////////////////////////////////MAIN PAGE

if($action=="main")

{

addonline(getuid_sid($sid),"Lottery!","");

  echo "<card id=\"main\" title=\"wapirate\">";

  echo "<p align=\"center\">";

  echo "<b>Lottery</b><br/>";

  echo "<img src=\"/images/lotto.gif\" alt=\"lotto\"/><br/>";

  echo "<br/>";

echo "<a href=\"lotto.php?action=result&amp;sid=$sid&amp;result=lotto\">Lotto</a><br/>";

echo "<a href=\"lotto.php?action=result&amp;sid=$sid&amp;result=euro\">EuroMillions</a><br/>";

echo "<a href=\"lotto.php?action=result&amp;sid=$sid&amp;result=dailyplay\">Daily Play</a><br/>";

echo "<a href=\"lotto.php?action=result&amp;sid=$sid&amp;result=thunderball\">Thunderball</a><br/>";

echo "<a href=\"lotto.php?action=result&amp;sid=$sid&amp;result=hotpicks\">HotPicks</a><br/>";



echo "<a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"images$folder/home.gif\" alt=\"*\"/>Home</a><br/><br/>";

echo "</p>\n";

  echo "</card>";

}

/////////////////////////////Result

if($action=="result")

{

addonline(getuid_sid($sid),"Lottery-$result!","");

  echo "<card id=\"main\" title=\"wapirate\">";



$url="http://wap.national-lottery.co.uk/results.php?game=$result";

preg_match("/^(https?:\/\/)?([^\/]*)(.*)/i", "$url", $matches);

$domain = "http://" . $matches[2];

$page = $matches[3];

$code = file_get_contents($domain.$page);

if($result=="lotto"){

$start= strpos($code, "<b>Lotto Results</b>");

}else if($result=="euro"){

$start= strpos($code, "<b>EuroMillions Results</b>");

}else if($result=="dailyplay"){

$start= strpos($code, "<b>Daily Play Results</b>");

}else if($result=="thunderball"){

$start= strpos($code, "<b>Thunderball Results</b>");

}else if($result=="hotpicks"){

$start= strpos($code, "<b>HotPicks Results</b>");

}

$finish= strpos($code, "<small><a href=\"results.php?game=$result&amp;start=4\">-&nbsp;Further Draws</a>");

$length= $finish-$start;

$code=substr($code, $start, $length);

$newcode = preg_replace("/(href=\"?)(\/[^\"\/]+)/", "\\1" . $domain . "\\2", $code);

$newcode = str_replace("<small><a href=\"results.php?game=$result&amp;start=4\">-&nbsp;Further Draws</a>","",$newcode);

$newcode = str_replace("Results</b>","Results</b><br/>",$newcode);





$newcode = str_replace("</p>","",$newcode);

$newcode = str_replace("<p>","",$newcode);

$newcode = str_replace("<small>","",$newcode);

$newcode = str_replace("</small>","",$newcode);

$newcode = str_replace(".php","",$newcode);

$newcode = str_replace("results/$result/","lotto.php?action=result2&amp;sid=$sid&amp;result=$result&amp;date=",$newcode);

echo "<p align=\"center\">";

  echo "<b>Lottery</b><br/>";

 echo "<img src=\"/images/lotto.gif\" alt=\"lotto\"/><br/>";

  echo "<br/>";

echo "$newcode<br/>";

echo "<br/><a href=\"lotto.php?action=main&amp;sid=$sid\">Back</a><br/><br/>";

echo "<a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"images$folder/home.gif\" alt=\"*\"/>Home</a><br/><br/>";

echo "</p>\n";

  echo "</card>";

}

/////////////////////////////////

if($action=="result2")

{

addonline(getuid_sid($sid),"Lottery-$result!","");

  echo "<card id=\"main\" title=\"wapirate\">";



$url="http://wap.national-lottery.co.uk/results/$result/$date.php";

preg_match("/^(https?:\/\/)?([^\/]*)(.*)/i", "$url", $matches);

$domain = "http://" . $matches[2];

$page = $matches[3];

$code = file_get_contents($domain.$page);

if($result=="lotto"){

$start= strpos($code, "<b>Lotto Results</b>");

}else if($result=="euro"){

$start= strpos($code, "<b>EuroMillions Results</b>");

}else if($result=="dailyplay"){

$start= strpos($code, "<b>Daily Play Results</b>");

}else if($result=="thunderball"){

$start= strpos($code, "<b>Thunderball Results</b>");

}else if($result=="hotpicks"){

$start= strpos($code, "<b>HotPicks Results</b>");

}

$finish= strpos($code, "Breakdown</a>");

$length= $finish-$start;

$code=substr($code, $start, $length);

$newcode = preg_replace("/(href=\"?)(\/[^\"\/]+)/", "\\1" . $domain . "\\2", $code);



$newcode = str_replace("Results</b>","Results</b><br/>",$newcode);



$newcode = str_replace("</p>","",$newcode);

$newcode = str_replace("<p>","",$newcode);

$newcode = str_replace("<small>","",$newcode);

$newcode = str_replace("</small>","<br/>",$newcode);

$newcode = str_replace("<p align=\"center\">","",$newcode);

$newcode = str_replace(".php","",$newcode);

$newcode = str_replace("<a href=\"","<a href=\"lotto.php?action=prize&amp;result=$result&amp;sid=$sid&amp;date=",$newcode);

echo "<p align=\"center\">";

  echo "<b>Lottery</b><br/>";

 echo "<img src=\"/images/lotto.gif\" alt=\"lotto\"/><br/>";

  echo "<br/>";

echo "$newcode Breakdown</a><br/>";

echo "<br/><a href=\"lotto.php?action=main&amp;sid=$sid\">Back</a><br/><br/>";

echo "<a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"images$folder/home.gif\" alt=\"*\"/>Home</a><br/><br/>";

echo "</p>\n";

  echo "</card>";

}



/////////////////////////////////

if($action=="prize")

{

addonline(getuid_sid($sid),"Lottery-$result!","");

  echo "<card id=\"main\" title=\"wapirate\">";



$url="http://wap.national-lottery.co.uk/results/$result/$date.php";

preg_match("/^(https?:\/\/)?([^\/]*)(.*)/i", "$url", $matches);

$domain = "http://" . $matches[2];

$page = $matches[3];

$code = file_get_contents($domain.$page);



if($result=="lotto"){

$start= strpos($code, "<b>Lotto Prizes</b><br/>");

}else if($result=="euro"){

$start= strpos($code, "<b>EuroMillions Prizes</b><br/>");

}else if($result=="dailyplay"){

$start= strpos($code, "<b>Daily Play Prizes</b><br/>");

}else if($result=="thunderball"){

$start= strpos($code, "<b>Thunderball Prizes</b><br/>");

}else if($result=="hotpicks"){

$start= strpos($code, "<b>HotPicks Prizes</b><br/>");

}





$finish= strpos($code, "<a href=\"/results/$result");

$length= $finish-$start;

$code=substr($code, $start, $length);

$newcode = preg_replace("/(href=\"?)(\/[^\"\/]+)/", "\\1" . $domain . "\\2", $code);



$newcode = str_replace("Results</b>","Results</b><br/>",$newcode);

$newcode = str_replace("</p>","",$newcode);

$newcode = str_replace("<p>","",$newcode);

$newcode = str_replace("<small>","",$newcode);

$newcode = str_replace("</small>","<br/>",$newcode);

$newcode = str_replace("<p align=\"center\">","",$newcode);

$newcode = str_replace(".php","",$newcode);

$newcode = str_replace("<a href=\"/results/$result","",$newcode);

$newcode = str_replace("Match","<br/>Match",$newcode);

echo "<p align=\"center\">";

  echo "<b>Lottery</b><br/>";

 echo "<img src=\"/images/lotto.gif\" alt=\"lotto\"/><br/>";

  echo "<br/>";

echo "$newcode<br/>";

echo "<br/><a href=\"lotto.php?action=main&amp;sid=$sid\">Back</a><br/><br/>";

echo "<a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"images$folder/home.gif\" alt=\"*\"/>Home</a><br/><br/>";

echo "</p>\n";

  echo "</card>";

}







 ?>

</wml>