General Some Only for MH/ADMIN

General Some Only for MH/ADMIN
This commit is contained in:
novgorodschi catalin
2026-07-01 12:49:56 +03:00
parent 40e5942c25
commit 01f1965707
+8 -1
View File
@@ -205,12 +205,13 @@ if($q) while($r=mysqli_fetch_assoc($q))
// Troops // Troops
$units=[]; $units=[];
$result=mysqli_query($database->dblink,"SELECT ".implode(',',array_map(fn($i)=>"SUM(u$i) AS u$i",range(1,30)))." FROM ".TB_PREFIX."units"); $result = mysqli_query($database->dblink, "SELECT " . implode(',', array_map(fn($i) => "SUM(u$i) AS u$i",range(1,30)))." FROM ".TB_PREFIX."units");
if($result) if($result)
$units=mysqli_fetch_assoc($result); $units=mysqli_fetch_assoc($result);
function u($units,$k){ function u($units,$k){
return isset($units[$k])? (int)$units[$k] : 0; return isset($units[$k])? (int)$units[$k] : 0;
} }
$isStaff = isset($session) && $session->access >= 8; // MH si Admin
?> ?>
<?php if ($milestonesEnabled): ?> <?php if ($milestonesEnabled): ?>
@@ -377,12 +378,14 @@ $gaulPct=($users>0)?round(100*$gaul/$users,2):0;
</table> </table>
<br /> <br />
<?php if($isStaff): ?>
<!-- ================= GOLD ================= --> <!-- ================= GOLD ================= -->
<table cellpadding="1" cellspacing="1" class="world"> <table cellpadding="1" cellspacing="1" class="world">
<thead><tr><th colspan="2">Total <?= SERVER_NAME?> <img src="./<?= GP_LOCATE?>img/a/gold.gif"> Gold</th></tr></thead> <thead><tr><th colspan="2">Total <?= SERVER_NAME?> <img src="./<?= GP_LOCATE?>img/a/gold.gif"> Gold</th></tr></thead>
<tbody><tr><td><?php echo GOLD;?></td><td><?= $total_gold?></td></tr></tbody> <tbody><tr><td><?php echo GOLD;?></td><td><?= $total_gold?></td></tr></tbody>
</table> </table>
<br /> <br />
<?php endif; ?>
<!-- ================= TOP ALLIANCES ================= --> <!-- ================= TOP ALLIANCES ================= -->
<table cellpadding="1" cellspacing="1" class="world"> <table cellpadding="1" cellspacing="1" class="world">
@@ -396,6 +399,7 @@ $gaulPct=($users>0)?round(100*$gaul/$users,2):0;
</table> </table>
<br /> <br />
<?php if($isStaff): ?>
<!-- ================= TROOPS ================= --> <!-- ================= TROOPS ================= -->
<table cellpadding="1" cellspacing="1" class="world"> <table cellpadding="1" cellspacing="1" class="world">
<thead><tr><th colspan="6"><?php echo TROOPS;?></th></tr> <thead><tr><th colspan="6"><?php echo TROOPS;?></th></tr>
@@ -413,7 +417,9 @@ $gaulPct=($users>0)?round(100*$gaul/$users,2):0;
</tbody> </tbody>
</table> </table>
<br /> <br />
<?php endif; ?>
<?php if($isStaff): ?>
<!-- ================= TOP PLAYERS ================= --> <!-- ================= TOP PLAYERS ================= -->
<table cellpadding="1" cellspacing="1" class="world"> <table cellpadding="1" cellspacing="1" class="world">
<thead> <thead>
@@ -447,6 +453,7 @@ $gaulPct=($users>0)?round(100*$gaul/$users,2):0;
</tbody> </tbody>
</table> </table>
<br /> <br />
<?php endif; ?>
<!-- ================= ENDGAME ================= --> <!-- ================= ENDGAME ================= -->
<table cellpadding="1" cellspacing="1" class="world"> <table cellpadding="1" cellspacing="1" class="world">