/Quản lý website tin tức bóng đá PHP/code_bongdaso/an.php

https://gitlab.com/phamngsinh/baitaplon_sinhvien · PHP · 130 lines · 114 code · 6 blank · 10 comment · 10 complexity · ab82d9d0be67277ec4c40ac320a7abc8 MD5 · raw file

  1. <?php
  2. if($_GET['xem']='')
  3. {
  4. if($_GET['id']=='')
  5. {
  6. $xem=1;
  7. $urlsn="http://www.bongdaso.com/_ComingMatches.aspx?Odd=".$xem."&LExp=0&CExp=0&PExp=0&LeagueID=-1&SeasonID=-1&AT=1/";
  8. $raw_document = file_get_contents($urlsn);
  9. $str = $raw_document;
  10. $string = $str;
  11. $patterns[0] = "/Fix_/";
  12. $replacements[2] = "./?id=";
  13. $view= preg_replace($patterns, $replacements, $string);
  14. $template -> assign_vars(array(
  15. 'result'=> $view,
  16. ));
  17. }
  18. elseif(isset($_GET['id']) && $_GET['id']!='')
  19. {
  20. $content= $_GET['id'];
  21. //$content = "10832.aspx?LeagueID=-1";
  22. preg_match_all('@(.*?).aspx?@',$content, $match,PREG_SET_ORDER);
  23. $id= $match[0][1];
  24. //http://bongdaso.com/Fix_10832.aspx?LeagueID=-1&SeasonID=19&Data=Odds
  25. $tiep = "http://www.bongdaso.com/_CastingInfo.aspx?FixtureID=".$id."&Status=FullTime";
  26. $tiep_document = file_get_contents($tiep);
  27. $template -> assign_vars(array(
  28. 'result'=> $tiep_document,
  29. ));
  30. }
  31. }
  32. else
  33. {
  34. if($_GET['id']=='')
  35. {
  36. $xem=$_GET['xem'];
  37. $urlsn="http://www.bongdaso.com/_ComingMatches.aspx?Odd=".$xem."&LExp=0&CExp=0&PExp=0&LeagueID=-1&SeasonID=-1&AT=1/";
  38. $raw_document = file_get_contents($urlsn);
  39. $str =$raw_document;
  40. $string = $str;
  41. $patterns[0] = "/Fix_/";
  42. $replacements[2] = "./?id=";
  43. $view= preg_replace($patterns, $replacements, $string);
  44. $template -> assign_vars(array(
  45. 'result'=> $view,
  46. ));
  47. }
  48. elseif(isset($_GET['id']) && $_GET['id']!='')
  49. {
  50. $content= $_GET['id'];
  51. //$content = "10832.aspx?LeagueID=-1";
  52. preg_match_all('@(.*?).aspx?@',$content, $match,PREG_SET_ORDER);
  53. $id= $match[0][1];
  54. //http://bongdaso.com/Fix_10832.aspx?LeagueID=-1&SeasonID=19&Data=Odds
  55. $tiep = "http://www.bongdaso.com/_CastingInfo.aspx?FixtureID=".$id."&Status=FullTime";
  56. $tiep_document = file_get_contents($tiep);
  57. $template -> assign_vars(array(
  58. 'result'=> $tiep_document,
  59. ));
  60. }
  61. }
  62. //tran da dau
  63. if($_GET['dau']=='')
  64. {
  65. if($_GET['id2']=='')
  66. {
  67. $dau=2;
  68. $urlsn="http://www.bongdaso.com/_PlayedMatches.aspx?Odd=1&Week=".$dau."&LExp=0&CExp=0&PExp=0&LeagueID=-1&SeasonID=-1&AT=1/";
  69. $raw_document = file_get_contents($urlsn);
  70. $str = $raw_document;
  71. $string = $str;
  72. $patterns[0] = "/Fix_/";
  73. $replacements[2] = "./?id2=";
  74. $viewdau= preg_replace($patterns, $replacements, $string);
  75. $template -> assign_vars(array(
  76. 'resultdau'=> $viewdau,
  77. ));
  78. }
  79. elseif(isset($_GET['id2']) && $_GET['id2']!='')
  80. {
  81. $content= $_GET['id2'];
  82. //$content = "10832.aspx?LeagueID=-1";
  83. preg_match_all('@(.*?).aspx?@',$content, $match,PREG_SET_ORDER);
  84. $id2= $match[0][1];
  85. //http://bongdaso.com/Fix_10832.aspx?LeagueID=-1&SeasonID=19&Data=Odds
  86. $tiep = "http://www.bongdaso.com/_CastingInfo.aspx?FixtureID=".$id2."&Status=FullTime";
  87. $tiep_documentdau = file_get_contents($tiep);
  88. $template -> assign_vars(array(
  89. 'resultdau'=> $tiep_documentdau,
  90. ));
  91. }
  92. }
  93. else
  94. {
  95. if($_GET['id2']=='')
  96. {
  97. $dau=$_GET['dau'];
  98. $urlsn="http://www.bongdaso.com/_PlayedMatches.aspx?Odd=1&Week=".$dau."&LExp=0&CExp=0&PExp=0&LeagueID=-1&SeasonID=-1&AT=1/";
  99. $raw_document = file_get_contents($urlsn);
  100. $str = $raw_document;
  101. $string = $str;
  102. $patterns[0] = "/Fix_/";
  103. $replacements[2] = "./?id2=";
  104. $viewdau= preg_replace($patterns, $replacements, $string);
  105. $template -> assign_vars(array(
  106. 'resultdau'=> $viewdau,
  107. ));
  108. }
  109. elseif(isset($_GET['id2']) && $_GET['id2']!='')
  110. {
  111. $content= $_GET['id2'];
  112. //$content = "10832.aspx?LeagueID=-1";
  113. preg_match_all('@(.*?).aspx?@',$content, $match,PREG_SET_ORDER);
  114. $id2= $match[0][1];
  115. //http://bongdaso.com/Fix_10832.aspx?LeagueID=-1&SeasonID=19&Data=Odds
  116. $tiep = "http://www.bongdaso.com/_CastingInfo.aspx?FixtureID=".$id2."&Status=FullTime";
  117. $tiep_documentdau = file_get_contents($tiep);
  118. $template -> assign_vars(array(
  119. 'resultdau'=> $tiep_documentdau,
  120. ));
  121. }
  122. }
  123. //******************************
  124. ?>