Skip to content
This repository has been archived by the owner on Jun 14, 2020. It is now read-only.

Commit

Permalink
Revert "Обновление на версию 2.4.0"
Browse files Browse the repository at this point in the history
This reverts commit 94c813e.
  • Loading branch information
Lord FEAR committed Jul 19, 2018
1 parent 119b27c commit e98c91e
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 27 deletions.
66 changes: 47 additions & 19 deletions www/includes/class/Player.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*/

class Player {
public $steamid, $name, $value, $lvl, $kills, $death, $kd, $shot, $hit, $acc, $inhead, $help, $lastgame, $maxLvl;
public $steamid, $name, $value, $lvl, $kills, $death, $kd, $shot, $hit, $acc, $inhead, $help, $lastgame, $maxLvl, $reqursia;

public function __construct($steamid){
if(preg_match("/STEAM/", $steamid)){
Expand Down Expand Up @@ -58,44 +58,72 @@ function getLvlOnServer($server){
function getStat($server) {
$pdo = $this->connect($server);
$stmt = $pdo->prepare("SELECT * FROM lvl_base WHERE steam = :steam");
$stmt->execute(array(':steam' => $this->steamid));
unset($pdo);
$stmt->execute(array(':steam' => $this->steamid));
unset($pdo);
$stat = $stmt->fetch();
if(!$stat){
$this->name = NULL;
$this->value = NULL;
$this->lvl = NULL;
$this->kills = NULL;
$this->death = NULL;
$this->kd = NULL;
$this->shot = NULL;
$this->hit = NULL;
$this->acc = NULL;
$this->inhead = NULL;
$this->help = NULL;
$this->lastgame = NULL;
$pdo = $this->connect($server);
$stmt = $pdo->prepare("SELECT * FROM lvl_base WHERE steam = :steam");
$stmt->execute(array(':steam' => substr_replace($this->steamid, "STEAM_0", 0, 7)));
unset($pdo);
$stat = $stmt->fetch();
if(!$stat){
$this->name = NULL;
$this->value = NULL;
$this->lvl = NULL;
$this->kills = NULL;
$this->death = NULL;
$this->kd = NULL;
$this->shot = NULL;
$this->hit = NULL;
$this->acc = NULL;
$this->inhead = NULL;
$this->help = NULL;
$this->lastgame = NULL;
}else{
$this->name = $stat['name'];
$this->value = $stat['value'];
$this->lvl = $stat['rank'];
$this->kills = $stat['kills'];
$this->death = $stat['deaths'];
if($this->death!=0){
$this->kd = round($this->kills / $this->death, 2);
}else{
$this->kd = $this->kills;
}
$this->shot = $stat['shoots'];
$this->hit = $stat['hits_all'];
if($this->shot!=0){
$this->acc = round($this->hit * 100 / $this->shot);
}else{
$this->acc = 0;
}
$this->inhead = $stat['headshots'];
$this->help = $stat['assists'];
$this->lastgame = $stat['lastconnect'];
}
}else{
$this->name = $stat['name'];
$this->value = $stat['value'];
$this->lvl = $stat['rank'];
$this->kills = stristr($stat['kills'], ';', TRUE);
$this->kills = $stat['kills'];
$this->death = $stat['deaths'];
if($this->death!=0){
$this->kd = round($this->kills / $this->death, 2);
}else{
$this->kd = $this->kills;
}
$this->shot = $stat['shoots'];
$this->hit = stristr($stat['hits'], ';', TRUE);
$this->hit = $stat['hits_all'];
if($this->shot!=0){
$this->acc = round($this->hit * 100 / $this->shot);
}else{
$this->acc = 0;
}
$this->inhead = stristr($stat['headshots'], ';', TRUE);
$this->inhead = $stat['headshots'];
$this->help = $stat['assists'];
$this->lastgame = $stat['lastconnect'];
}
}
}

function clearRanks($server){
Expand Down
8 changes: 4 additions & 4 deletions www/includes/server/one-server.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,12 @@
<td><a href="player.php?sid=<?=$data[$i]["steam"]?>"><?=$data[$i]["name"]?></a></td>
<td><?=$data[$i]["value"]?></td>
<td><?=$data[$i]["rank"]?></td>
<td><?=stristr($data[$i]["kills"], ';', TRUE)?></td>
<td><?=$data[$i]["kills"]?></td>
<td><?=$data[$i]["deaths"]?></td>
<td><?php if($data[$i]["deaths"]!=0){echo round(stristr($data[$i]["kills"], ';', TRUE)/$data[$i]["deaths"],2);}else{echo 0;}?></td>
<td><?php if($data[$i]["deaths"]!=0){echo round($data[$i]["kills"]/$data[$i]["deaths"],2);}else{echo 0;}?></td>
<td><?=$data[$i]["shoots"]?></td>
<td><?=stristr($data[$i]["hits"], ';', TRUE)?></td>
<td><?php if($data[$i]["shoots"]!=0){echo round(stristr($data[$i]["hits"], ';', TRUE)*100/$data[$i]["shoots"]);}else{echo 0;} ?>%</td>
<td><?=$data[$i]["hits_all"]?></td>
<td><?php if($data[$i]["shoots"]!=0){echo round($data[$i]["hits_all"]*100/$data[$i]["shoots"]);}else{echo 0;} ?>%</td>
<td><?=date("d.m.y", $data[$i]["lastconnect"])?></td>
</tr>
<?php $start++; endfor; ?>
Expand Down
8 changes: 4 additions & 4 deletions www/includes/server/top.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,12 @@
<td><a href="player.php?sid=<?=$data[$index]["steam"]?>"><?=$data[$index]["name"]?></a></td>
<td><?=$data[$index]["value"]?></td>
<td><?=$data[$index]["rank"]?></td>
<td><?=stristr($data[$index]["kills"], ';',true)?></td>
<td><?=$data[$index]["kills"]?></td>
<td><?=$data[$index]["deaths"]?></td>
<td><?php if($data[$index]["deaths"]!=0) { echo round(stristr($data[$index]["kills"], ';',true)/$data[$index]["deaths"],2); }else{ echo 0; } ?></td>
<td><?php if($data[$index]["deaths"]!=0) { echo round($data[$index]["kills"]/$data[$index]["deaths"],2); }else{ echo 0; } ?></td>
<td><?=$data[$index]["shoots"]?></td>
<td><?=stristr($data[$index]["hits"], ';', TRUE)?></td>
<td><?php if($data[$index]["shoots"]!=0) { echo round(stristr($data[$index]["hits"], ';', TRUE)*100/$data[$index]["shoots"]); }else{ echo 0; } ?>%</td>
<td><?=$data[$index]["hits_all"]?></td>
<td><?php if($data[$index]["shoots"]!=0) { echo round($data[$index]["hits_all"]*100/$data[$index]["shoots"]); }else{ echo 0; } ?>%</td>
<td><?=date("d.m.y", $data[$index]["lastconnect"])?></td>
</tr>
<?php endfor; ?>
Expand Down

0 comments on commit e98c91e

Please sign in to comment.