Guest User

Untitled

a guest
Feb 24th, 2013
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.79 KB | None | 0 0
  1. <?php
  2. /**
  3. *
  4. * @ This file is created by deZender.Net
  5. * @ deZender (PHP5 Decoder for ionCube Encoder)
  6. *
  7. * @ Version : 1.1.5.0
  8. * @ Author : DeZender
  9. * @ Release on : 09.06.2012
  10. * @ Official site : http://DeZender.Net
  11. *
  12. */
  13.  
  14. include( '../../include/config.inc.php' );
  15. include( HOME_DIR . '/include/class_srv_minecraft.php' );
  16. $_POST = xss_protect( $_POST );
  17. $_GET = xss_protect( $_GET );
  18. $sess_userid = $strona->page_access( );
  19. $minecraft = new srv_minecraft( );
  20. $minecraft->userid = $sess_userid;
  21. $minecraft->serverid = $_GET['id'];
  22. $minecraft->level = 2;
  23. $minecraft->game_access( $_GET['id'] );
  24. $minecraft->status_check( );
  25. $minecraft->s_type_verify( 'minecraft' );
  26. $rok = date( 'Y' );
  27. $query = $pdo->prepare( 'SELECT cpu_div FROM `box_list` WHERE `boxid` = :boxid' );
  28. $query->bindValue( ':boxid', $minecraft->gameservers['boxid'], PARAM_INT );
  29. $query->execute( );
  30. $box_list = $query->fetch( );
  31. $query->closeCursor( );
  32. $query = $pdo->prepare( 'SELECT `cpu_limit`, `ram_limit` FROM `game_list` WHERE `gameid` = :game' );
  33. $query->bindValue( ':game', $minecraft->gameservers['game'], PARAM_STR );
  34. $query->execute( );
  35. $game_list = $query->fetch( );
  36. $query->closeCursor( );
  37. $cpu_limit = $game_list['cpu_limit'] * $minecraft->gameservers['slots'] * $box_list['cpu_div'] + $minecraft->gameservers['cpu_limit'];
  38. $ram_limit = $game_list['ram_limit'] * $minecraft->gameservers['slots'] + $minecraft->gameservers['ram_limit'];
  39.  
  40. if (empty( $_GET['type'] )) {
  41. if (( isset( $_GET['miesiac'] ) && isset( $_GET['dzien'] ) )) {
  42. $today = $rok . '-' . $_GET['miesiac'] . '-' . $_GET['dzien'];
  43. } else {
  44. $today = date( 'Y-m-d' );
  45. }
  46.  
  47. $todayend = date( 'Y-m-d H:i:s', strtotime( $today . ' +1 days' ) );
  48. $query = $pdo->prepare( 'SELECT * FROM `box_monitor_users` WHERE `user` = :user AND `date` > :today AND `date` < :todayend ORDER BY `date` ASC' );
  49. $query->bindValue( ':user', 's' . $minecraft->gameservers['serverid'], PARAM_STR );
  50. $query->bindValue( ':today', $today, PARAM_STR );
  51. $query->bindValue( ':todayend', $todayend, PARAM_STR );
  52. $query->execute( );
  53. $daneq = $query->fetchAll( );
  54. $query->closeCursor( );
  55. $pdo->prepare( 'SELECT * FROM `game_monitor` WHERE `serverid` = :serverid AND `time` > :today AND `time` < :todayend ORDER BY `time` ASC' );
  56. $query->bindValue( ':serverid', $minecraft->gameservers['serverid'], PARAM_STR );
  57. $query->bindValue( ':today', $today, PARAM_STR );
  58. $query->bindValue( ':todayend', $todayend, PARAM_STR );
  59. $query->execute( );
  60. $slotsq = $query->fetchAll( );
  61. $query->closeCursor( );
  62. date( 'd-m-Y' );
  63. $day2 = date( 'd-m-Y', strtotime( $day1 . ' -1 days' ) );
  64. date( 'd-m-Y', strtotime( $day1 . ' -2 days' ) );
  65. $day4 = $query = date( 'd-m-Y', strtotime( $day1 . ' -3 days' ) );
  66. $day5 = date( 'd-m-Y', strtotime( $day1 . ' -4 days' ) );
  67. $day6 = date( 'd-m-Y', strtotime( $day1 . ' -5 days' ) );
  68. $day7 = date( 'd-m-Y', strtotime( $day1 . ' -6 days' ) );
  69. $day1ex = explode( '-', $day1 );
  70. $day2ex = explode( '-', $day2 );
  71. $day3ex = explode( '-', $day3 );
  72. $day4ex = $day1 = explode( '-', $day4 );
  73. $day5ex = explode( '-', $day5 );
  74. $day6ex = explode( '-', $day6 );
  75. $day7ex = $day3 = explode( '-', $day7 );
  76. $menu2act = 'serwery';
  77. $menu3act = 'wykresy';
  78. include( HOME_DIR . '/szablon/header.php' );
  79. include( HOME_DIR . '/szablon/client/minecraft/minecraft_navi.php' );
  80. echo ' ';
  81. echo '<s';
  82. echo 'cript type="text/javascript" src="https://www.google.com/jsapi"></script>
  83.  
  84. ';
  85. echo '<s';
  86. echo 'cript type="text/javascript">
  87. google.load("visualization", "1", {packages:["corechart"]});
  88. google.setOnLoadCallback(drawChart);
  89. function drawChart() {
  90. var data = new google.visualization.DataTable();
  91. data.addColumn(\'string\', \'Godzina\');
  92. data.addColumn(\'number\', \'LIMIT\');
  93. data.addColumn(\'number\', \'%CPU\');
  94. data.addRows([
  95. ';
  96. foreach ($daneq as $dane) {
  97. echo ' [\'';
  98. echo substr( $dane['date'], 11, 5 );
  99. echo '\\\', ';
  100. echo $cpu_limit;
  101. echo ', ';
  102. echo $dane['cpu'];
  103. echo '],
  104. ';
  105. }
  106.  
  107. echo ' ]);
  108.  
  109. var chart = new google.visualization.AreaChart(document.getElementById(\'cpu_chart\'));
  110. chart.draw(data, {pointSize: 0, width: 700, height: 280, title: \'Obciążenie procesora dla: ';
  111. echo 's' . $minecraft->gameservers['serverid'];
  112. echo '\',
  113. chartArea:{left:40,top:50,width:"82%",height:"60%"},
  114. vAxis: {title: \'CPU (%)\', minValue: 0},
  115. hAxis: {title: \'Godzina\', titleTextStyle: {color: \'#FF0000\'}}
  116. });
  117. }
  118. </script>
  119.  
  120. ';
  121. echo '<s';
  122. echo 'cript type="text/javascript">
  123. google.load("visualization", "1", {packages:["corechart"]});
  124. google.setOnLoadCallback(drawChart);
  125. function drawChart() {
  126. var data = new google.visualization.DataTable();
  127. data.addColumn(\'string\', \'Godzina\');
  128. data.addColumn(\'number\', \'LIMIT\');
  129. data.addColumn(\'number\', \'RAM [MB]\');
  130. data.addRows([
  131. ';
  132. foreach ($daneq as $dane) {
  133. echo ' [\'';
  134. echo substr( $dane['date'], 11, 5 );
  135. echo '\\\', ';
  136. echo $ram_limit;
  137. echo ', ';
  138. echo $dane['mem'];
  139. echo '],
  140. ';
  141. }
  142.  
  143. echo ' ]);
  144.  
  145. var chart = new google.visualization.AreaChart(document.getElementById(\'mem_chart\'));
  146. chart.draw(data, {pointSize: 0, width: 700, height: 280, title: \'Obciążenie pamięci dla: ';
  147. echo 's' . $minecraft->gameservers['serverid'];
  148. echo '\',
  149. chartArea:{left:40,top:50,width:"82%",height:"60%"},
  150. vAxis: {title: \'RAM (MB)\', minValue: 0},
  151. hAxis: {title: \'Godzina\', titleTextStyle: {color: \'#FF0000\'}}
  152. });
  153. }
  154. </script>
  155.  
  156. ';
  157. ................................................................
  158. ...................................
  159. ................
Advertisement
Add Comment
Please, Sign In to add comment