Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * Created by JetBrains PhpStorm.
- * User: marce
- * Date: 29-04-2016
- * Time: 13:57
- * To change this template use File | Settings | File Templates.
- */
- function ok($val) {
- is_numeric($val)?$x=$val:$y=0;
- return $x;
- }
- error_reporting(0);
- /**
- * Created by JetBrains PhpStorm.
- * User: marce
- * Date: 10-02-2016
- * Time: 14:17
- * To change this template use File | Settings | File Templates.
- */
- $gameid = $_GET['id'];
- $ebotid = $_GET['ebot'];
- if ($gameid == 0) exit;
- if ($ebotid == 0) exit;
- $servername = "localhost";
- $username = "root";
- $password = "xx";
- $connectlocal = mysql_connect($servername, $username, $password) or die("Could not connect. " . mysql_error());
- mysql_select_db('matchticker', $connectlocal);
- $queryebot = "SELECT * FROM `ebot` WHERE `id`=".$ebotid;
- $r = mysql_query($queryebot);
- if ( $r !== false && mysql_num_rows($r) > 0 ) {
- while ( $a = mysql_fetch_assoc($r)) {
- $servername_ebot = $a['ip_sql'];
- $username_ebot = $a['username_sql'];
- $password_ebot = $a['password_sql'];
- $database_ebot = $a['database_sql'];
- $log_url = $a['logs_url'];
- }
- }
- mysql_close($connectlocal);
- $servername = $servername_ebot;
- $username = $username_ebot;
- $password = $password_ebot;
- $connectstats = mysql_connect($servername, $username, $password) or die("Could not connect. " . mysql_error());
- mysql_select_db($database_ebot, $connectstats);
- $q_kills = mysql_query("SELECT * FROM `player_kill` WHERE `match_id`='".$gameid."' ORDER by `created_at` DESC");
- $q_bombs = mysql_query("SELECT * FROM `round` WHERE (`match_id`='".$gameid."') AND (`event_name` = 'bomb_planting' || `event_name` = 'bomb_defused' || `event_name` = 'bomb_exploded') ORDER by `created_at` DESC");
- if ( ($q_kills !== false && mysql_num_rows($q_kills) > 0) || ($q_bombs !== false && mysql_num_rows($q_bombs) > 0) ) {
- while ( ($a = mysql_fetch_assoc($q_kills)) || ($b = mysql_fetch_assoc($q_bombs)) ) {
- $round_num = -1;
- if($a['round_id'] == $roundnum){
- ?>
- <table>
- <tr>
- <td style="<?php
- if($a['killer_team'] == "CT") { echo "color: blue;"; }
- if($a['killer_team'] == "TERRORIST"){ echo "color: red;"; }
- ?>">
- <?php echo substr($a['killer_name'], 0,15); ?>
- </td>
- <td><img src="img_armas/<?php echo $a['weapon']; ?>.png"></td>
- <td>
- <?php if($a['headshot'] == 0){
- }
- else {
- ?><img src="img_armas/headshot.png"><?php
- }
- ?>
- </td>
- <td style="<?php
- if($a['killed_team'] == "CT") { echo "color: blue;"; }
- if($a['killed_team'] == "TERRORIST"){ echo "color: red;"; }
- ?>">
- <?php echo substr($a['killed_name'], 0,15); ?>
- </td>
- <?php $roundnum = $a['round_id'];
- $criado_a = $a['created_at'];?>
- </tr>
- </table>
- <?php
- }
- if($a['round_id'] !== $roundnum){
- ?><br>
- <table>
- <tr colspan="4">
- <?php
- $round_lessone = $a['round_id'];
- $q_score = mysql_query("SELECT * FROM `round_summary` WHERE `match_id`='".$gameid."' AND `round_id`='".$round_lessone."'");
- $b = mysql_fetch_assoc($q_score);
- $score_a = $b['score_a'];
- $score_b = $b['score_b'];
- if($score_a > 0 || $score_b > 0){
- switch($score_a){
- case ($score_a > $score_b):
- $score_a = "<font color='green'>" . $score_a . "</font>";
- $score_b = "<font color='red'>" . $score_b . "</font>";
- break;
- case ($score_a < $score_b):
- $score_a = "<font color='red'>" . $score_a . "</font>";
- $score_b = "<font color='green'>" . $score_b . "</font>";
- break;
- case ($score_a == $score_b):
- $score_a = "<font color='orange'>" . $score_a . "</font>";
- $score_b = "<font color='orange'>" . $score_b . "</font>";
- break;
- }
- switch($b['win_type']){
- case ( $b['win_type'] == "bombdefused" ):
- $win_type = "<font color='blue'>Bomba defusada</font>";
- break;
- case ( $b['win_type'] == "bombeexploded" ):
- $win_type = "<font color='red'>Bomba explodiu</font>";
- break;
- case ( $b['win_type'] == "normal" ):
- $win_type = "";
- break;
- }
- echo $win_type . "<br>";
- ?>
- Os
- <?php
- if($b['t_win'] == 1){ echo "<span style=\"color: red;\">Terroristas</span>"; } if($b['ct_win'] == 1) { echo "<span style=\"color: blue;\">Contra-Terroristas</span>"; }
- ?> venceram.
- <br><b>
- Ronda <?php echo $a['round_id']; ?> (<?php echo $score_a; ?>:<?php echo $score_b; ?>) terminou.</b>
- <?php } ?>
- </tr>
- <tr style="height: 15px;"></tr>
- <tr>
- <td style="<?php
- if($a['killer_team'] == "CT") { echo "color: blue;"; }
- if($a['killer_team'] == "TERRORIST"){ echo "color: red;"; }
- ?>">
- <?php echo substr($a['killer_name'], 0,15); ?>
- </td>
- <td><img src="img_armas/<?php echo $a['weapon']; ?>.png"></td>
- <td>
- <?php if($a['headshot'] == 0){
- }
- else {
- ?><img src="img_armas/headshot.png"><?php
- }
- ?>
- </td>
- <td style="<?php
- if($a['killed_team'] == "CT") { echo "color: blue;"; }
- if($a['killed_team'] == "TERRORIST"){ echo "color: red;"; }
- ?>">
- <?php echo substr($a['killed_name'], 0,15); ?>
- </td>
- <?php $roundnum = $a['round_id'];
- ?>
- </tr>
- </table>
- <?php
- }
- }
- }
- ?>
- <html>
- <head>
- </head>
- <body>
- <?php
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement