Advertisement
Guest User

Untitled

a guest
Apr 22nd, 2019
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.53 KB | None | 0 0
  1. <p style="text-align:center;"><img src="logo.png" alt="Logo"></p>
  2. <script src="sorttable.js"></script>
  3. <?php
  4. echo "<body style='background-color:black'>";
  5. $i = '0';
  6. $z = '0';
  7. $a = '0';
  8. $gdir = "C:\\Users\\Administrator\\Downloads\\pvpgn-develop-1.99.7.2.0-PRO-8464f2b_plain\\var\\users\\";
  9. $value = count(glob($gdir . "*"));
  10. $files = scandir($gdir,1);
  11. $Awins = array();
  12. $Aname = array();
  13. $Aloss = array();
  14. $Tgames = array();
  15. $totalpercent = array();
  16. echo '<table align="center" class="sortable" border="1" BORDERCOLOR=blue style="width:30%">';
  17. echo "<tr align=left>
  18. <th><font color='White'>Name</font></th>
  19. <th><font color='White'>Wins</font></th>
  20. <th><font color='White'>Loss</font></th>
  21. <th><font color='White'>%</font></th>
  22. </tr>";
  23. while ($i < $value)
  24. {
  25. $txt_file = file_get_contents($gdir . $files[$i]);
  26. $rows = explode("\n", $txt_file);
  27. foreach($rows as $row => $data)
  28. {
  29. $data = str_replace("\\","","$data");
  30. if (strpos($data,'BNETacctusername') !== false){
  31. $data = explode('"', $data);
  32. $Aname[$i] = $data[3];
  33. }
  34.  
  35. if (strpos($data,'RecordW2BN0wins') !== false){
  36. $data = explode('"', $data);
  37. $Awins[$i] = $data[3];
  38. }
  39. if ($Awins[$i] == NULL){
  40. $Awins[$i] = "0";
  41. }
  42.  
  43. if (strpos($data,'RecordW2BN0losses') !== false){
  44. $data = explode('"', $data);
  45. $Aloss[$i] = $data[3];
  46. }
  47. if ($Aloss[$i] == NULL){
  48. $Aloss[$i] = "0";
  49. }
  50.  
  51. if ($Awins[$i] != 0 or $Aloss[$i] != 0 or $Tgames[$i] != 0) {
  52. $Tgames[$i] = ($Awins[$i] + $Aloss[$i]);
  53. $percentwin[$i] = ($Awins[$i] / $Tgames[$i]);
  54. $totalpercent[$i] = $percentwin[$i] * 100;
  55. } elseif ($totalpercent = NULL){
  56. $totalpercent[$i] = "0";
  57. }
  58. }
  59. $i++;
  60. $rowcount = count($Aname);
  61. while ($a < $rowcount)
  62. {
  63. if ($Awins[$a] > 9)
  64. {
  65. if ($Aname[$a] == NULL or $Awins[$a] == NULL or $Aloss[$a] == NULL) {
  66. } else {
  67. echo "<tr><td><font color='white'>".$Aname[$a]."</font></td><td><font color='white'>".floor($Awins[$a])."</font></td><td><font color='white'>".floor($Aloss[$a])."</font></td><td><font color='white'>".floor($totalpercent[$a])."</font></td></tr>";
  68. }
  69. }
  70. $a++;
  71. }
  72. }
  73. echo '</table>';
  74. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement