mirror of
https://github.com/Shadowss/TravianZ.git
synced 2026-06-28 00:24:23 +00:00
Redesign Admin Panel First Round
Redesign Admin Panel First Round
This commit is contained in:
+139
-154
@@ -1,167 +1,152 @@
|
||||
<form action="../GameEngine/Admin/Mods/addUsers.php" method="POST">
|
||||
<input type="hidden" name="id" id="id" value="<?php echo $id; ?>">
|
||||
|
||||
<center><b>Create Users and Villages</b>
|
||||
<br><br>
|
||||
<font color="Red">
|
||||
Submitting this form will create new Users and/or Villages on your server!
|
||||
</font>
|
||||
<br>
|
||||
<font color="blue">
|
||||
Includes resources, main building, rally point, warehouse, granary, wall, market, residence, troops (for hero level-up), and one cranny.
|
||||
</font>
|
||||
<p><b>Base Name</b> should be between 4 and 20 characters long</p>
|
||||
|
||||
<!-- NEW: Mode switch -->
|
||||
<b>Mode</b><br>
|
||||
<label><input type="radio" name="mode" value="many_accounts" checked> Many accounts (legacy): create X accounts with 1 village each</label><br>
|
||||
<label><input type="radio" name="mode" value="single_with_villages"> Single account: create 1 account with X villages</label>
|
||||
<br><br>
|
||||
|
||||
<!-- Legacy fields -->
|
||||
<b>How Many (accounts)</b> should be between 1 and 200<br>
|
||||
(Higher values might take a while or cause a crash!)
|
||||
<br><br>
|
||||
|
||||
<!-- Example -->
|
||||
If you want to run this more than once you should use a different Base Name each time.<br>
|
||||
<br>
|
||||
Example (legacy):<br>
|
||||
Base Name = Farm | How Many (accounts) = 5 → Users: Farm1..Farm5<br>
|
||||
Example (single):<br>
|
||||
Base Name = FarmLord | Villages = 5 → User: FarmLord with 5 villages
|
||||
<br><br>
|
||||
|
||||
<?php
|
||||
$baseNameFontColor = "Black";
|
||||
$amountFontColor = "Black";
|
||||
$villagesFontColor = "Black";
|
||||
#################################################################################
|
||||
## addUsers.tpl - REDESIGN 2025 v2 ##
|
||||
#################################################################################
|
||||
if($_SESSION['access'] < ADMIN) die("Access Denied!");
|
||||
$id = $_SESSION['id'];
|
||||
|
||||
$baseName = "Farm";
|
||||
$amount = 20; // accounts (legacy)
|
||||
$villages = 5; // villages (single account)
|
||||
$mode = "many_accounts";
|
||||
$baseName = "Farm"; $amount = 20; $villages = 5; $mode = "many_accounts";
|
||||
$errorMsg = ""; $successMsg = "";
|
||||
|
||||
if(isset($_GET['e'])) {
|
||||
$baseName = ($_GET['bn']);
|
||||
$amount = isset($_GET['am']) ? ($_GET['am']) : $amount;
|
||||
$villages = isset($_GET['vi']) ? ($_GET['vi']) : $villages;
|
||||
$mode = isset($_GET['mo']) ? ($_GET['mo']) : $mode;
|
||||
|
||||
switch ($_GET['e']) {
|
||||
case 'BN2S':
|
||||
$baseNameFontColor = "Red";
|
||||
echo '<br /><br /><font color="Red"><b>Error: Base Name is too short (min 4 chars)</b></font>';
|
||||
break;
|
||||
case 'BN2L':
|
||||
$baseNameFontColor = "Red";
|
||||
echo '<br /><br /><font color="Red"><b>Error: Base Name is too long (max 20 chars)</b></font>';
|
||||
break;
|
||||
case 'AMLO':
|
||||
$amountFontColor = "Red";
|
||||
echo '<br /><br /><font color="Red"><b>Error: Minimum of 1 for How Many (accounts)</b></font>';
|
||||
break;
|
||||
case 'AMHI':
|
||||
$amountFontColor = "Red";
|
||||
echo '<br /><br /><font color="Red"><b>Error: Maximum of 200 for How Many (accounts)</b></font>';
|
||||
break;
|
||||
case 'VILO':
|
||||
$villagesFontColor = "Red";
|
||||
echo '<br /><br /><font color="Red"><b>Error: Minimum of 1 for Villages</b></font>';
|
||||
break;
|
||||
case 'VIHI':
|
||||
$villagesFontColor = "Red";
|
||||
echo '<br /><br /><font color="Red"><b>Error: Maximum of 200 for Villages</b></font>';
|
||||
break;
|
||||
default:
|
||||
echo '<br /><br /><font color="Red"><b>Error: Unknown</b></font>';
|
||||
}
|
||||
if(isset($_GET['e'])) {
|
||||
$baseName = $_GET['bn']??$baseName;
|
||||
$amount = $_GET['am']??$amount;
|
||||
$villages = $_GET['vi']??$villages;
|
||||
$mode = $_GET['mo']??$mode;
|
||||
switch ($_GET['e']) {
|
||||
case 'BN2S': $errorMsg = "Base Name prea scurt (minim 4 caractere)"; break;
|
||||
case 'BN2L': $errorMsg = "Base Name prea lung (maxim 20 caractere)"; break;
|
||||
case 'AMLO': $errorMsg = "Minim 1 cont"; break;
|
||||
case 'AMHI': $errorMsg = "Maxim 200 conturi"; break;
|
||||
case 'VILO': $errorMsg = "Minim 1 sat"; break;
|
||||
case 'VIHI': $errorMsg = "Maxim 200 sate"; break;
|
||||
default: $errorMsg = "Eroare necunoscută";
|
||||
}
|
||||
elseif ( isset($_GET['g']) && $_GET['g'] == 'OK') {
|
||||
$baseName = ($_GET['bn']);
|
||||
$mode = ($_GET['mo']);
|
||||
$skipped = ($_GET['sk']);
|
||||
$beginnersProtection = ($_GET['bp']);
|
||||
|
||||
// interpret the tribe label
|
||||
switch ($_GET['tr']) {
|
||||
case '0': $tribe = RANDOM; break;
|
||||
case '1': $tribe = TRIBE1; break;
|
||||
case '2': $tribe = TRIBE2; break;
|
||||
case '3': $tribe = TRIBE3; break;
|
||||
default: $tribe = 'Unknown';
|
||||
}
|
||||
|
||||
if ($mode === 'many_accounts') {
|
||||
$amount = ($_GET['am']);
|
||||
echo '<br /><br /><font color="Blue"><b>'.$amount.'</b></font> Users (1 village each) added with Base Name <font color="Blue"><b>'.$baseName.'</b></font><br>';
|
||||
} else {
|
||||
$villages = ($_GET['vi']);
|
||||
echo '<br /><br />Created User <font color="Blue"><b>'.$baseName.'</b></font> with <font color="Blue"><b>'.$villages.'</b></font> villages.<br>';
|
||||
}
|
||||
|
||||
if (($mode === 'many_accounts' && $amount > 0) || ($mode === 'single_with_villages' && $villages > 0)) {
|
||||
$usersMessage = ($mode === 'many_accounts' ? (($amount > 1) ? 'these Users' : 'this User') : 'this User');
|
||||
$begMessage = 'Beginners Protection was ';
|
||||
if (!$beginnersProtection) { $begMessage .= '<font color="red"><b>NOT</b></font> '; }
|
||||
$begMessage .= 'set for '.$usersMessage.'<br>';
|
||||
echo $begMessage;
|
||||
|
||||
$tribeMessage = 'Tribe for '.$usersMessage.' was '.$tribe.'<br>';
|
||||
echo $tribeMessage;
|
||||
}
|
||||
|
||||
if ($skipped > 0) {
|
||||
echo '<font color="Red"><b>'.$skipped.'</b></font> Users not created as the user name already exists<br>';
|
||||
}
|
||||
|
||||
echo '<br>Now would be a good time to <a href="'.SERVER.'/dorf1.php">Return to the server</a> (updates rankings; may take a while)<br>'
|
||||
. 'Make sure <b>max_execution_time</b> is set high enough in php.ini<br><br>';
|
||||
$baseName = ""; $amount = ""; $villages = "";
|
||||
}
|
||||
elseif(isset($_GET['g']) && $_GET['g']=='OK'){
|
||||
$baseName = $_GET['bn']; $mode = $_GET['mo']; $skipped=(int)$_GET['sk']; $bp=(int)$_GET['bp'];
|
||||
$tribe = [0=>RANDOM,1=>TRIBE1,2=>TRIBE2,3=>TRIBE3][$_GET['tr']]??'Unknown';
|
||||
|
||||
if($mode==='many_accounts'){
|
||||
$amount=(int)$_GET['am'];
|
||||
$successMsg = "Creat <b>$amount</b> conturi cu baza <b>$baseName</b>";
|
||||
} else {
|
||||
$villages=(int)$_GET['vi'];
|
||||
$successMsg = "Creat contul <b>$baseName</b> cu <b>$villages</b> sate";
|
||||
}
|
||||
$successMsg .= "<br>Protecție: ".($bp?"<span style='color:#27ae60'>DA</span>":"<span style='color:#c0392b'>NU</span>")." | Trib: <b>$tribe</b>";
|
||||
if($skipped>0) $successMsg .= "<br><span style='color:#e67e22'>$skipped nume existente - sărite</span>";
|
||||
}
|
||||
?>
|
||||
<br>
|
||||
</center>
|
||||
<style>
|
||||
.add-wrap{max-width:520px;margin:14px auto;font-family:Tahoma,Verdana,Arial,sans-serif}
|
||||
.add-head h2{margin:0 0 8px;font-size:15px;display:flex;align-items:center;gap:5px}
|
||||
.add-card{background:#fff;border:1px solid #bbb;border-radius:5px;overflow:hidden}
|
||||
.add-top{padding:10px;background:#f5f5f5;border-bottom:1px solid #ddd;text-align:center}
|
||||
.warn-red{color:#c0392b;font-weight:bold;font-size:11px;margin:2px 0}
|
||||
.warn-blue{color:#2980b9;font-size:10px;line-height:1.2}
|
||||
.add-form{padding:14px}
|
||||
.mode-box{display:flex;gap:5px;margin-bottom:10px}
|
||||
.mode-box label{flex:1;cursor:pointer}
|
||||
.mode-box input{display:none}
|
||||
.mode-box span{display:block;text-align:center;padding:5px;border:1px solid #aaa;border-radius:3px;background:#eee;font-size:11px;font-weight:bold}
|
||||
.mode-box input:checked+span{background:#2c3e50;color:#fff;border-color:#2c3e50}
|
||||
.examples{font-size:10px;color:#555;background:#f9f9f9;border:1px dashed #ccc;padding:5px;margin:6px 0 10px;border-radius:3px;line-height:1.25}
|
||||
.row{display:flex;align-items:center;margin-bottom:8px;gap:8px}
|
||||
.row label{width:110px;font-size:11px;font-weight:bold}
|
||||
.row input[type=text]{width:150px;padding:4px;border:1px solid #999;border-radius:3px;font-size:12px}
|
||||
.hint{font-size:9px;color:#777;margin-left:118px;margin-top:-5px;margin-bottom:6px}
|
||||
.check{margin:10px 0 12px;font-size:11px}
|
||||
.check label{display:flex;align-items:center;gap:5px}
|
||||
|
||||
<!-- Base name -->
|
||||
<font color ="<?php echo $baseNameFontColor ?>">Base Name </font>
|
||||
<input type ="text" name="users_base_name" id="users_name" value="<?php echo $baseName ?>" maxlength="20">
|
||||
<br><br>
|
||||
/* TRIBURI VERTICAL */
|
||||
.tribe-wrap{margin-top:8px;}
|
||||
.tribe-title{font-size:11px;font-weight:bold;margin-bottom:4px;}
|
||||
.tribe-grid{display:flex;flex-direction:column;gap:4px;width:140px; /* poti modifica */}
|
||||
.tribe-grid label{display:flex;align-items:center;gap:6px;padding:4px 6px;border:1px solid #bbb;border-radius:3px;background:#fcfcfc;cursor:pointer;min-height:24px;font-size:11px;}
|
||||
.tribe-grid label:hover{background:#f0f0f0;}
|
||||
.tribe-grid input{width:12px;height:12px;margin:0;}
|
||||
.tribe-icon{font-size:12px;line-height:1;}
|
||||
.tribe-text{font-size:10px;color:#333;line-height:1;}
|
||||
|
||||
<!-- Accounts amount (legacy) -->
|
||||
<div id="accountsBlock">
|
||||
<font color ="<?php echo $amountFontColor ?>">How Many (accounts) </font>
|
||||
<input type ="text" name="users_amount" id="users_amount" value="<?php echo $amount ?>" maxlength="4">
|
||||
.submit{text-align:center;margin-top:12px}
|
||||
.submit button{background:#27ae60;color:#fff;border:0;padding:7px 22px;border-radius:4px;font-weight:bold;cursor:pointer;font-size:12px}
|
||||
.submit button:hover{background:#1e8449}
|
||||
.alert{padding:6px 8px;border-radius:3px;margin-bottom:8px;font-size:11px}
|
||||
.alert-err{background:#fdecea;border:1px solid #e74c3c;color:#c0392b}
|
||||
.alert-ok{background:#eafaf1;border:1px solid #27ae60;color:#145a32}
|
||||
.block-off{opacity:.4;pointer-events:none}
|
||||
</style>
|
||||
|
||||
<div class="add-wrap">
|
||||
<div class="add-head"><h2>👤 Create Users</h2></div>
|
||||
|
||||
<div class="add-card">
|
||||
<div class="add-top">
|
||||
<div class="warn-red">Submitting this form will create new Users and/or Villages on your server!</div>
|
||||
<div class="warn-blue">Includes resources, main building, rally point, warehouse, granary, wall, market, residence, troops (for hero level-up), and one cranny.</div>
|
||||
</div>
|
||||
|
||||
<form action="../GameEngine/Admin/Mods/addUsers.php" method="POST" class="add-form">
|
||||
<input type="hidden" name="id" value="<?php echo $id;?>">
|
||||
|
||||
<?php if($errorMsg){?><div class="alert alert-err">✗ <?php echo $errorMsg;?></div><?php }?>
|
||||
<?php if($successMsg){?><div class="alert alert-ok">✓ <?php echo $successMsg;?></div><?php }?>
|
||||
|
||||
<div class="mode-box">
|
||||
<label><input type="radio" name="mode" value="many_accounts" <?php echo $mode=='many_accounts'?'checked':'';?>><span>Multe conturi (1 sat)</span></label>
|
||||
<label><input type="radio" name="mode" value="single_with_villages" <?php echo $mode=='single_with_villages'?'checked':'';?>><span>1 cont (multe sate)</span></label>
|
||||
</div>
|
||||
|
||||
<div class="examples">
|
||||
<b>Base Name</b> 4-20 caractere. Ex: Farm | 5 → Farm1..Farm5. Ex single: FarmLord | 5 sate.<br>
|
||||
<b>Atenție:</b> valori mari pot bloca serverul!
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<label>Base Name</label>
|
||||
<input type="text" name="users_base_name" value="<?php echo htmlspecialchars($baseName);?>" maxlength="20">
|
||||
</div>
|
||||
|
||||
<div class="row" id="accRow">
|
||||
<label>Câte conturi</label>
|
||||
<input type="text" name="users_amount" value="<?php echo htmlspecialchars($amount);?>" maxlength="4">
|
||||
</div>
|
||||
<div class="hint">1 - 200</div>
|
||||
|
||||
<div class="row" id="vilRow">
|
||||
<label>Câte sate</label>
|
||||
<input type="text" name="villages_amount" value="<?php echo htmlspecialchars($villages);?>" maxlength="4">
|
||||
</div>
|
||||
<div class="hint">1 - 200 (doar single)</div>
|
||||
|
||||
<div class="check">
|
||||
<label><input type="checkbox" name="users_protection" checked> Activează protecție începători</label>
|
||||
</div>
|
||||
|
||||
<div class="tribe-wrap">
|
||||
<div class="tribe-title">Trib</div>
|
||||
<div class="tribe-grid">
|
||||
<label><input type="radio" name="tribe" value="0" checked><span class="tribe-icon">🎲</span><span class="tribe-text"><?php echo RANDOM;?></span></label>
|
||||
<label><input type="radio" name="tribe" value="1"><span class="tribe-icon">🏛</span><span class="tribe-text"><?php echo TRIBE1;?></span></label>
|
||||
<label><input type="radio" name="tribe" value="2"><span class="tribe-icon">🪓</span><span class="tribe-text"><?php echo TRIBE2;?></span></label>
|
||||
<label><input type="radio" name="tribe" value="3"><span class="tribe-icon">🌾</span><span class="tribe-text"><?php echo TRIBE3;?></span></label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="submit"><button type="submit">+ Create</button></div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Villages amount (single account) -->
|
||||
<div id="villagesBlock" style="margin-top:10px;">
|
||||
<font color ="<?php echo $villagesFontColor ?>">Villages (for single account) </font>
|
||||
<input type ="text" name="villages_amount" id="villages_amount" value="<?php echo $villages ?>" maxlength="4">
|
||||
</div>
|
||||
|
||||
<br>
|
||||
Beginners Protection <input type ="checkbox" name="users_protection" id="users_protection" checked>
|
||||
<br><br>
|
||||
Tribe:<br>
|
||||
<label><input type="radio" name="tribe" value="0" checked> <?php echo RANDOM; ?></label><br>
|
||||
<label><input type="radio" name="tribe" value="1"> <?php echo TRIBE1; ?></label><br>
|
||||
<label><input type="radio" name="tribe" value="2"> <?php echo TRIBE2; ?></label><br>
|
||||
<label><input type="radio" name="tribe" value="3"> <?php echo TRIBE3; ?></label><br>
|
||||
<br><br>
|
||||
<input type="submit" value="Create">
|
||||
|
||||
<script>
|
||||
// Tiny progressive disclosure (no external JS)
|
||||
(function(){
|
||||
function sync() {
|
||||
var mode = document.querySelector('input[name="mode"]:checked').value;
|
||||
document.getElementById('accountsBlock').style.opacity = (mode==='many_accounts') ? '1' : '0.3';
|
||||
document.getElementById('villagesBlock').style.opacity = (mode==='single_with_villages') ? '1' : '0.3';
|
||||
}
|
||||
var radios = document.querySelectorAll('input[name="mode"]');
|
||||
for (var i=0;i<radios.length;i++){ radios[i].addEventListener('change', sync); }
|
||||
sync();
|
||||
function sync(){
|
||||
var m=document.querySelector('input[name="mode"]:checked').value;
|
||||
document.getElementById('accRow').className='row'+(m==='many_accounts'?'':' block-off');
|
||||
document.getElementById('vilRow').className='row'+(m==='single_with_villages'?'':' block-off');
|
||||
}
|
||||
document.querySelectorAll('input[name="mode"]').forEach(r=>r.onchange=sync);
|
||||
sync();
|
||||
})();
|
||||
</script>
|
||||
</form>
|
||||
</script>
|
||||
@@ -10,38 +10,41 @@
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||
<meta http-equiv="imagetoolbar" content="no">
|
||||
<style>
|
||||
.logTable { width:100%; border-collapse:collapse; margin-top:10px; }
|
||||
.logTable th { background:#222; color:#fff; padding:6px; text-align:left; font-size:12px; }
|
||||
.logTable td { padding:6px; border-bottom:1px solid #ddd; font-size:12px; vertical-align:top; }
|
||||
.logTable tr:hover { background:#f5f5f5; }
|
||||
.logCat { font-weight:bold; padding:2px 6px; border-radius:3px; color:#fff; font-size:11px; }
|
||||
.cat-gold { background:#d4af37; } .cat-plus { background:#6a5acd; }
|
||||
.cat-ban { background:#c00; } .cat-unban { background:#090; }
|
||||
.cat-maint { background:#555; } .cat-village { background:#0073aa; }
|
||||
.cat-msg { background:#ff8800; } .cat-other { background:#888; }
|
||||
.log-wrap{max-width:100%;margin:12px;font-family:Tahoma,Verdana,Arial,sans-serif}
|
||||
.log-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px}
|
||||
.log-head h2{margin:0;font-size:16px;display:flex;align-items:center;gap:6px;color:#222}
|
||||
.log-filters{display:flex;gap:5px;flex-wrap:wrap;margin-bottom:8px}
|
||||
.log-filters button{padding:4px 10px;font-size:11px;border:1px solid #bbb;border-radius:14px;background:#f5f5f5;cursor:pointer}
|
||||
.log-filters button.active{background:#2c3e50;color:#fff;border-color:#2c3e50}
|
||||
.log-card{background:#fff;border:1px solid #bbb;border-radius:6px;overflow:hidden}
|
||||
.logTable{width:100%;border-collapse:collapse;font-size:11px}
|
||||
.logTable th{background:#3a4f63;color:#fff;padding:5px 6px;text-align:left;font-weight:bold;font-size:10px;white-space:nowrap}
|
||||
.logTable td{padding:5px 6px;border-bottom:1px solid #eee;vertical-align:top;line-height:14px}
|
||||
.logTable tr:hover{background:#f5f9ff}
|
||||
.logTable a{color:#004a9f;text-decoration:none}
|
||||
.logTable a:hover{text-decoration:underline}
|
||||
.logCat{font-weight:bold;padding:2px 6px;border-radius:3px;color:#fff;font-size:10px;white-space:nowrap}
|
||||
.cat-ban{background:#c0392b} .cat-unban{background:#27ae60}
|
||||
.cat-gold{background:#b8860b} .cat-plus{background:#6a5acd}
|
||||
.cat-maint{background:#555} .cat-village{background:#0073aa}
|
||||
.cat-msg{background:#e67e22} .cat-other{background:#7f8c8d}
|
||||
</style>
|
||||
</head>
|
||||
<?php
|
||||
|
||||
#################################################################################
|
||||
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
|
||||
## --------------------------------------------------------------------------- ##
|
||||
## Filename admin_log.tpl ##
|
||||
## Developed by: Dzoki ##
|
||||
## Refactored by: aggenkeech (2025) ##
|
||||
## Remake by: Shadow (2026) ##
|
||||
## License: TravianZ Project ##
|
||||
## Copyright: TravianZ (c) 2010-2026. All rights reserved. ##
|
||||
## ##
|
||||
## admin_log.tpl - FIX unban duplicat ##
|
||||
#################################################################################
|
||||
|
||||
if($_SESSION['access'] < ADMIN) die("Access Denied: You are not Admin!");
|
||||
|
||||
// 1. Log-uri normale
|
||||
$adminLogs = $database->getAdminLog();
|
||||
$unified = [];
|
||||
|
||||
foreach($adminLogs as $l) {
|
||||
// FIX: sărim peste unban-urile din log-ul vechi, le luăm doar din banlist
|
||||
if(stripos($l['log'], 'unbanned') !== false || stripos($l['log'], 'unban') !== false) {
|
||||
continue;
|
||||
}
|
||||
$unified[] = [
|
||||
'id' => $l['id'],
|
||||
'time' => $l['time'],
|
||||
@@ -51,7 +54,7 @@ foreach($adminLogs as $l) {
|
||||
];
|
||||
}
|
||||
|
||||
// 2. Ban-uri și Unban-uri din banlist
|
||||
// Ban-uri și Unban-uri din banlist
|
||||
$banQ = mysqli_query($GLOBALS["link"], "
|
||||
SELECT id, uid, name, reason, time, end, admin, active
|
||||
FROM ".TB_PREFIX."banlist
|
||||
@@ -61,14 +64,14 @@ $banQ = mysqli_query($GLOBALS["link"], "
|
||||
while($b = mysqli_fetch_assoc($banQ)) {
|
||||
// BAN
|
||||
$unified[] = [
|
||||
'id' => 1000000 + $b['id'], // offset ca să nu se amestece ID-urile
|
||||
'id' => 1000000 + $b['id'],
|
||||
'time' => $b['time'],
|
||||
'user' => $b['admin'] ?: 1,
|
||||
'type' => 'ban',
|
||||
'text' => "Banned user <a href='admin.php?p=player&uid={$b['uid']}'>{$b['name']}</a> (Reason: {$b['reason']})",
|
||||
'active' => $b['active']
|
||||
];
|
||||
// UNBAN - dacă e inactiv, folosim end ca timp de unban
|
||||
// UNBAN
|
||||
if($b['active'] == 0 && $b['end'] > $b['time']) {
|
||||
$unified[] = [
|
||||
'id' => 2000000 + $b['id'],
|
||||
@@ -81,28 +84,51 @@ while($b = mysqli_fetch_assoc($banQ)) {
|
||||
}
|
||||
}
|
||||
|
||||
// 3. Sortează tot după timp DESC
|
||||
usort($unified, function($a,$b){ return $b['time'] <=> $a['time']; });
|
||||
$unified = array_slice($unified, 0, 300);
|
||||
$perPage = 20;
|
||||
$page = isset($_GET['pg']) ? max(1,intval($_GET['pg'])) : 1;
|
||||
$total = count($unified);
|
||||
$totalPages = ceil($total / $perPage);
|
||||
$offset = ($page-1) * $perPage;
|
||||
$paged = array_slice($unified, $offset, $perPage);
|
||||
|
||||
function logCategory($entry) {
|
||||
if($entry['type']=='ban') return ['BAN','cat-ban','🔨'];
|
||||
if($entry['type']=='unban') return ['UNBAN','cat-unban','🔓'];
|
||||
$t = strtolower(strip_tags($entry['text']));
|
||||
// FIX: prinde orice unban din text
|
||||
if (strpos($t,'unban')!==false) return ['UNBAN','cat-unban','🔓'];
|
||||
if (strpos($t,'mass ban')!==false) return ['BAN','cat-ban','🔨'];
|
||||
if (strpos($t,'mass unban')!==false) return ['UNBAN','cat-unban','🔓'];
|
||||
if (strpos($t,'gold')!==false) return ['GOLD','cat-gold','💰'];
|
||||
if (strpos($t,'plus')!==false && strpos($t,'bonus')===false) return ['PLUS','cat-plus','⭐'];
|
||||
if (strpos($t,'bonus')!==false) return ['BONUS','cat-plus','📈'];
|
||||
if (strpos($t,'reset')!==false) return ['RESET','cat-maint','⚙️'];
|
||||
if (strpos($t,'village')!==false || strpos($t,'buildings')!==false || strpos($t,'renamed')!==false) return ['VILLAGE','cat-village','🏘️'];
|
||||
if (strpos($t,'message')!==false) return ['MESSAGE','cat-msg','✉️'];
|
||||
if (strpos($t,'reset')!==false) return ['RESET','cat-maint','⚙'];
|
||||
if (strpos($t,'village')!==false || strpos($t,'buildings')!==false || strpos($t,'renamed')!==false) return ['VILLAGE','cat-village','🏘'];
|
||||
if (strpos($t,'message')!==false) return ['MESSAGE','cat-msg','✉'];
|
||||
return ['OTHER','cat-other','📝'];
|
||||
}
|
||||
?>
|
||||
<h2>Admin Log Unificat - ultimele 300 acțiuni</h2>
|
||||
<div class="log-wrap">
|
||||
<div class="log-head">
|
||||
<h2>📋 Admin Log Unificat - ultimele 300 acțiuni</h2>
|
||||
</div>
|
||||
|
||||
<table class="logTable">
|
||||
<div class="log-filters" id="logFilters">
|
||||
<button class="active" data-filter="all">All</button>
|
||||
<button data-filter="BAN">🔨 Ban</button>
|
||||
<button data-filter="UNBAN">🔓 Unban</button>
|
||||
<button data-filter="GOLD">💰 Gold</button>
|
||||
<button data-filter="PLUS">⭐ Plus</button>
|
||||
<button data-filter="BONUS">📈 Bonus</button>
|
||||
<button data-filter="VILLAGE">🏘 Village</button>
|
||||
<button data-filter="MESSAGE">✉ Message</button>
|
||||
<button data-filter="RESET">⚙ Reset</button>
|
||||
<button data-filter="OTHER">📝 Other</button>
|
||||
</div>
|
||||
|
||||
<div class="log-card">
|
||||
<table class="logTable" id="logTable">
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="50">ID</th>
|
||||
@@ -114,7 +140,7 @@ function logCategory($entry) {
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
foreach($unified as $e) {
|
||||
foreach($paged as $e) {
|
||||
$admid = (int)$e['user'];
|
||||
$username = $database->getUserField($admid, "username", 0);
|
||||
$adminLink = $username ? '<a href="admin.php?p=player&uid='.$admid.'">'.htmlspecialchars($username).'</a>' : '<b>SYSTEM</b>';
|
||||
@@ -124,7 +150,7 @@ foreach($unified as $e) {
|
||||
$date = date("d.m.Y H:i:s", $e['time'] + 3600*2);
|
||||
$details = $e['text'];
|
||||
?>
|
||||
<tr>
|
||||
<tr data-cat="<?php echo $cat; ?>">
|
||||
<td>#<?php echo $e['id'] % 1000000; ?></td>
|
||||
<td><?php echo $adminLink; ?></td>
|
||||
<td><span class="logCat <?php echo $class; ?>"><?php echo $icon.' '.$cat; ?></span></td>
|
||||
@@ -134,7 +160,27 @@ foreach($unified as $e) {
|
||||
<?php } ?>
|
||||
</tbody>
|
||||
</table>
|
||||
<div style="text-align:center;margin:8px 0;font-size:11px">
|
||||
<?php if($page>1){ ?><a href="?p=admin_log&pg=<?php echo $page-1;?>" style="padding:3px 8px;border:1px solid #bbb;background:#f5f5f5;text-decoration:none;margin:0 2px">« Prev</a><?php } ?>
|
||||
<span style="padding:3px 8px;background:#3a4f63;color:#fff;margin:0 2px"><?php echo $page;?> / <?php echo $totalPages;?></span>
|
||||
<?php if($page<$totalPages){ ?><a href="?p=admin_log&pg=<?php echo $page+1;?>" style="padding:3px 8px;border:1px solid #bbb;background:#f5f5f5;text-decoration:none;margin:0 2px">Next »</a><?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php if($total > $limit) { ?>
|
||||
<p style="margin-top:10px;color:#777">Afișate doar ultimele <?php echo $limit; ?>. Pentru istoric complet, exportă din phpMyAdmin tabelul <code>s1_admin_log</code>.</p>
|
||||
<?php } ?>
|
||||
<script>
|
||||
(function(){
|
||||
var btns = document.querySelectorAll('#logFilters button');
|
||||
var rows = document.querySelectorAll('#logTable tbody tr');
|
||||
btns.forEach(function(b){
|
||||
b.onclick = function(){
|
||||
btns.forEach(x=>x.classList.remove('active'));
|
||||
b.classList.add('active');
|
||||
var f = b.getAttribute('data-filter');
|
||||
rows.forEach(function(r){
|
||||
r.style.display = (f==='all' || r.getAttribute('data-cat')===f) ? '' : 'none';
|
||||
});
|
||||
};
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
+130
-310
@@ -1,334 +1,154 @@
|
||||
<?php
|
||||
#################################################################################
|
||||
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
|
||||
## ban.tpl - REDESIGN 2025 ##
|
||||
#################################################################################
|
||||
if($_SESSION['access'] < ADMIN) die("Access Denied!");
|
||||
|
||||
$error = '';
|
||||
$success = '';
|
||||
|
||||
// =========================
|
||||
// HANDLE ADD BAN
|
||||
// =========================
|
||||
if(isset($_POST['action']) && $_POST['action'] == 'addBan')
|
||||
{
|
||||
$uid = isset($_POST['uid']) ? (int)$_POST['uid'] : 0;
|
||||
$reason = trim($_POST['reason'] ?? '');
|
||||
$time = isset($_POST['time']) ? (int)$_POST['time'] : 0;
|
||||
// ========================= HANDLE ADD BAN =========================
|
||||
if(isset($_POST['action']) && $_POST['action'] == 'addBan') {
|
||||
$uid = (int)($_POST['uid']??0);
|
||||
$reason = trim($_POST['reason']??'');
|
||||
$time = (int)($_POST['time']??0);
|
||||
$blocked = [1,2,3,4,5];
|
||||
|
||||
// =========================
|
||||
// ❌ BLOCK SYSTEM USERS
|
||||
// =========================
|
||||
|
||||
$blocked = array(1,2,3,4,5);
|
||||
|
||||
// =========================
|
||||
// VALIDARE UID
|
||||
// =========================
|
||||
if($uid <= 0)
|
||||
{
|
||||
$error = "Invalid User ID!";
|
||||
}
|
||||
elseif(in_array($uid, $blocked))
|
||||
{
|
||||
$error = "You cannot ban system accounts (Support / Nature / Natars / Taskmaster / Multihunter)!";
|
||||
}
|
||||
else
|
||||
{
|
||||
// =========================
|
||||
// ❌ CHECK IF USER EXISTS
|
||||
// =========================
|
||||
$userCheck = mysqli_query($database->dblink, "
|
||||
SELECT id, username
|
||||
FROM ".TB_PREFIX."users
|
||||
WHERE id = $uid
|
||||
LIMIT 1
|
||||
");
|
||||
|
||||
if(!$userCheck || mysqli_num_rows($userCheck) == 0)
|
||||
{
|
||||
$error = "This user does not exist!";
|
||||
}
|
||||
else
|
||||
{
|
||||
// =========================
|
||||
// CHECK ALREADY ACTIVE BAN
|
||||
// =========================
|
||||
$check = mysqli_query($database->dblink, "
|
||||
SELECT id
|
||||
FROM ".TB_PREFIX."banlist
|
||||
WHERE uid = $uid
|
||||
AND active = 1
|
||||
LIMIT 1
|
||||
");
|
||||
|
||||
if(mysqli_num_rows($check) > 0)
|
||||
{
|
||||
$error = "User is already banned!";
|
||||
}
|
||||
else
|
||||
{
|
||||
if($uid <= 0) $error = "Invalid User ID!";
|
||||
elseif(in_array($uid,$blocked)) $error = "You cannot ban system accounts!";
|
||||
else {
|
||||
$userCheck = mysqli_query($database->dblink,"SELECT id,username FROM ".TB_PREFIX."users WHERE id=$uid LIMIT 1");
|
||||
if(!$userCheck || mysqli_num_rows($userCheck)==0) $error = "This user does not exist!";
|
||||
else {
|
||||
$check = mysqli_query($database->dblink,"SELECT id FROM ".TB_PREFIX."banlist WHERE uid=$uid AND active=1 LIMIT 1");
|
||||
if(mysqli_num_rows($check)>0) $error = "User is already banned!";
|
||||
else {
|
||||
$user = mysqli_fetch_assoc($userCheck);
|
||||
$name = $user['username'];
|
||||
$end = ($time > 0) ? (time() + $time) : 0;
|
||||
|
||||
// =========================
|
||||
// INSERT BAN (ACTIVE)
|
||||
// =========================
|
||||
$currentTime = time();
|
||||
|
||||
$stmt = $database->dblink->prepare("
|
||||
INSERT INTO `".TB_PREFIX."banlist`
|
||||
(uid, name, reason, time, end, admin, active)
|
||||
VALUES
|
||||
(?, ?, ?, ?, ?, 0, 1)
|
||||
");
|
||||
|
||||
if ($stmt) {
|
||||
// i = integer, s = string
|
||||
$stmt->bind_param("issii", $uid, $name, $reason, $currentTime, $end);
|
||||
$stmt->execute();
|
||||
$stmt->close();
|
||||
} else {
|
||||
$error = "Database error (ban insert): " . $database->dblink->error;
|
||||
}
|
||||
|
||||
// =========================
|
||||
// BLOCK USER ACCESS
|
||||
// =========================
|
||||
if (empty($error)) {
|
||||
$stmt2 = $database->dblink->prepare("
|
||||
UPDATE `".TB_PREFIX."users`
|
||||
SET access = 0
|
||||
WHERE id = ?
|
||||
LIMIT 1
|
||||
");
|
||||
|
||||
if ($stmt2) {
|
||||
$stmt2->bind_param("i", $uid);
|
||||
$stmt2->execute();
|
||||
$stmt2->close();
|
||||
} else {
|
||||
$error = "Database error (access update): " . $database->dblink->error;
|
||||
}
|
||||
}
|
||||
if (empty($error)) {
|
||||
$success = "User has been banned successfully!";
|
||||
}
|
||||
$end = $time>0 ? time()+$time : 0;
|
||||
$stmt = $database->dblink->prepare("INSERT INTO `".TB_PREFIX."banlist` (uid,name,reason,time,end,admin,active) VALUES (?,?,?,?,?,0,1)");
|
||||
$now = time();
|
||||
$stmt->bind_param("issii",$uid,$name,$reason,$now,$end);
|
||||
$stmt->execute(); $stmt->close();
|
||||
$stmt2 = $database->dblink->prepare("UPDATE `".TB_PREFIX."users` SET access=0 WHERE id=? LIMIT 1");
|
||||
$stmt2->bind_param("i",$uid); $stmt2->execute(); $stmt2->close();
|
||||
$success = "User <b>$name</b> has been banned successfully!";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// =========================
|
||||
// ACTIVE BANS
|
||||
// =========================
|
||||
// ========================= DATA =========================
|
||||
$bannedUsers = $admin->search_banned();
|
||||
|
||||
// =========================
|
||||
// HISTORY (inactive bans)
|
||||
// =========================
|
||||
$banHistory = mysqli_query($database->dblink, "
|
||||
SELECT *
|
||||
FROM ".TB_PREFIX."banlist
|
||||
WHERE active = 0
|
||||
ORDER BY id DESC
|
||||
LIMIT 50
|
||||
");
|
||||
$banHistory = mysqli_query($database->dblink,"SELECT * FROM ".TB_PREFIX."banlist WHERE active=0 ORDER BY id DESC LIMIT 50");
|
||||
?>
|
||||
|
||||
<style>
|
||||
.del {width:12px; height:12px; background-image: url(img/admin/icon/del.gif);}
|
||||
|
||||
.errorBox {
|
||||
background:#ffdddd;
|
||||
border:1px solid #ff0000;
|
||||
color:#a10000;
|
||||
padding:10px;
|
||||
margin:10px 0;
|
||||
font-weight:bold;
|
||||
}
|
||||
|
||||
.successBox {
|
||||
background:#ddffdd;
|
||||
border:1px solid #00aa00;
|
||||
color:#006600;
|
||||
padding:10px;
|
||||
margin:10px 0;
|
||||
font-weight:bold;
|
||||
}
|
||||
.ban-wrap{max-width:1100px;margin:20px auto;font-family:Verdana}
|
||||
.ban-head{display:flex;align-items:center;gap:8px;margin-bottom:16px}
|
||||
.ban-head svg{width:24px;height:24px}
|
||||
.ban-head h2{margin:0;font-size:18px}
|
||||
.alert{padding:10px 12px;border-radius:6px;margin-bottom12px;font-size:13px}
|
||||
.alert.error{background:#ffeaea;border:1px solid #e74c3c;color:#c0392b}
|
||||
.alert.success{background:#eaf1;border:1px solid #27ae60;color:#1e8449}
|
||||
.ban-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-bottom:20px}
|
||||
@media(max-width:800px){.ban-grid{grid-template-columns:1fr}}
|
||||
.ban-card{background:#fff;border:1px solid #ddd;border-radius:8px;padding:14px;box-shadow:0 1px 3px rgba(0,0,0,.05)}
|
||||
.ban-card h3{margin:0 0 10px;font-size:14px;display:flex;align-items:center;gap:6px}
|
||||
.ban-form{display:flex;flex-direction:column;gap:8px}
|
||||
.ban-form .row{display:flex;gap:8px}
|
||||
.ban-form input,.ban-form select{flex:1;padding:8px 10px;border:1px solid #ccc;border-radius:6px;font-size:13px}
|
||||
.ban-form button{background:#c0392b;color:#fff;border:0;padding:9px;border-radius:6px;font-weight:bold;cursor:pointer}
|
||||
.ban-form button:hover{background:#a93226}
|
||||
.ban-list{display:grid;gap:8px;max-height:400px;overflow:auto;padding-right:4px}
|
||||
.ban-item{display:flex;justify-content:space-between;align-items:center;padding:8px 10px;background:#fafafa;border:1px solid #eee;border-radius:6px;font-size:12px}
|
||||
.ban-item .user a{color:#222;text-decoration:none;font-weight:bold}
|
||||
.ban-item .user a:hover{text-decoration:underline}
|
||||
.ban-item .meta{color:#666;font-size:11px}
|
||||
.ban-item .reason{padding:2px 6px;background:#eee;border-radius:3px;font-size:10px;margin:0 6px}
|
||||
.ban-item .del{color:#c0392b;text-decoration:none;font-weight:bold;padding:2px 6px}
|
||||
.ban-item .del:hover{background:#ffeaea;border-radius:3px}
|
||||
.empty{padding:20px;text-align:center;color:#999;background:#fafafa;border:1px dashed #ddd;border-radius:6px}
|
||||
</style>
|
||||
|
||||
<!-- =========================
|
||||
MESSAGES
|
||||
========================= -->
|
||||
<?php if(!empty($error)) { ?>
|
||||
<div class="errorBox"><?php echo $error; ?></div>
|
||||
<?php } ?>
|
||||
<div class="ban-wrap">
|
||||
<div class="ban-head">
|
||||
<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="12" cy="12" r="10" fill="#c0392b"/><path d="M7 7l10 10M17 7L7 17" stroke="#fff" stroke-width="2" stroke-linecap="round"/></svg>
|
||||
<h2>Ban Management</h2>
|
||||
</div>
|
||||
|
||||
<?php if(!empty($success)) { ?>
|
||||
<div class="successBox"><?php echo $success; ?></div>
|
||||
<?php } ?>
|
||||
<?php if($error){?><div class="alert error"><?php echo $error;?></div><?php }?>
|
||||
<?php if($success){?><div class="alert success"><?php echo $success;?></div><?php }?>
|
||||
|
||||
<!-- =========================
|
||||
BAN FORM
|
||||
========================= -->
|
||||
<form action="" method="post">
|
||||
<input type="hidden" name="action" value="addBan">
|
||||
<div class="ban-grid">
|
||||
<!-- ADD BAN -->
|
||||
<div class="ban-card">
|
||||
<h3>
|
||||
<svg width="16" height="16" viewBox="0 0 24 24"><path d="M12 2L2 7v10l10 5 10-5V7L12 2z" fill="#c0392b"/></svg>
|
||||
Add New Ban
|
||||
</h3>
|
||||
<form method="post" class="ban-form">
|
||||
<input type="hidden" name="action" value="addBan">
|
||||
<div class="row">
|
||||
<input type="number" name="uid" placeholder="User ID" required>
|
||||
<select name="reason">
|
||||
<?php foreach(['Pushing','Cheat','Hack','Bug','Bad Name','Multi Account','Swearing'] as $r){ echo "<option>$r</option>"; }?>
|
||||
</select>
|
||||
</div>
|
||||
<div class="row">
|
||||
<select name="time" style="flex:1">
|
||||
<?php foreach([1,2,5,10,12] as $h) echo "<option value='".($h*3600)."'>$h hour/s</option>";
|
||||
foreach([1,2,5,10,30,50,90] as $d) echo "<option value='".($d*86400)."'>$d day/s</option>"; ?>
|
||||
<option value="0">Forever</option>
|
||||
</select>
|
||||
<button type="submit">Ban User</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<table id="member" cellpadding="1" cellspacing="1">
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="6">Ban</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<!-- ACTIVE BANS -->
|
||||
<div class="ban-card">
|
||||
<h3>
|
||||
<svg width="16" height="16" viewBox="0 0 24 24"><circle cx="12" cy="12" r="9" fill="#e74c3c"/></svg>
|
||||
Active Bans (<?php echo count($bannedUsers);?>)
|
||||
</h3>
|
||||
<div class="ban-list">
|
||||
<?php if($bannedUsers){ foreach($bannedUsers as $b){
|
||||
$name = $database->getUserField($b['uid'],'username',0) ?: $b['name'];
|
||||
$end = $b['end'] ? date("d.m H:i",$b['end']) : '∞';
|
||||
?>
|
||||
<div class="ban-item">
|
||||
<div>
|
||||
<div class="user"><a href="?p=player&uid=<?php echo $b['uid'];?>"><?php echo htmlspecialchars($name);?></a></div>
|
||||
<div class="meta"><?php echo date("d.m H:i",$b['time']);?> → <?php echo $end;?></div>
|
||||
</div>
|
||||
<div>
|
||||
<span class="reason"><?php echo htmlspecialchars($b['reason']);?></span>
|
||||
<a class="del" href="?action=delBan&uid=<?php echo $b['uid'];?>&id=<?php echo $b['id'];?>" onclick="return confirm('Unban?')" title="Unban">✕</a>
|
||||
</div>
|
||||
</div>
|
||||
<?php }} else { echo '<div class="empty">No active bans</div>'; }?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>User ID</td>
|
||||
<td><input type="text" class="fm" name="uid"></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Reason</td>
|
||||
<td>
|
||||
<select name="reason" class="fm">
|
||||
<?php
|
||||
$arr = array('Pushing','Cheat','Hack','Bug','Bad Name','Multi Account','Swearing');
|
||||
foreach($arr as $r)
|
||||
{
|
||||
echo '<option value="'.$r.'">'.$r.'</option>';
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Duration</td>
|
||||
<td>
|
||||
<select name="time" class="fm">
|
||||
<?php
|
||||
$arr = array(1,2,5,10,12);
|
||||
foreach($arr as $r)
|
||||
{
|
||||
echo '<option value="'.($r*3600).'">'.$r.' hour/s</option>';
|
||||
}
|
||||
|
||||
$arr2 = array(1,2,5,10,30,50,90);
|
||||
foreach($arr2 as $r)
|
||||
{
|
||||
echo '<option value="'.($r*3600*24).'">'.$r.' day/s</option>';
|
||||
}
|
||||
|
||||
echo '<option value="0">Forever</option>';
|
||||
?>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="2" class="on">
|
||||
<input type="image" src="../img/admin/b/ok1.gif" value="submit">
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</form>
|
||||
|
||||
<!-- =========================
|
||||
ACTIVE BANS
|
||||
========================= -->
|
||||
<table id="member" cellpadding="1" cellspacing="1">
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="6">Active Bans (<?php echo count($bannedUsers); ?>)</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><b>Username</b></td>
|
||||
<td><b>Length</b></td>
|
||||
<td><b>Reason</b></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<?php
|
||||
if($bannedUsers)
|
||||
{
|
||||
foreach($bannedUsers as $b)
|
||||
{
|
||||
$name = $database->getUserField($b['uid'],'username',0);
|
||||
|
||||
if($name == '')
|
||||
{
|
||||
$name = $b['name'];
|
||||
$link = "<span class=\"c b\">[".$name."]</span>";
|
||||
}
|
||||
else
|
||||
{
|
||||
$link = '<a href="?p=player&uid='.$b['uid'].'">'.$name.'</a>';
|
||||
}
|
||||
|
||||
$end = $b['end'] ? date("d.m.y H:i",$b['end']) : '*';
|
||||
|
||||
echo '
|
||||
<tr>
|
||||
<td>'.$link.'</td>
|
||||
<td>'.date("d.m.y H:i",$b['time']).' - '.$end.'</td>
|
||||
<td>'.$b['reason'].'</td>
|
||||
<td class="on">
|
||||
<a href="?action=delBan&uid='.$b['uid'].'&id='.$b['id'].'">
|
||||
<img src="../img/admin/del.gif" class="del">
|
||||
</a>
|
||||
</td>
|
||||
</tr>';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo '<tr><td colspan="6">No active bans</td></tr>';
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<br><br>
|
||||
|
||||
<!-- =========================
|
||||
BAN HISTORY
|
||||
========================= -->
|
||||
<table id="member" cellpadding="1" cellspacing="1">
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="6">Ban History (Inactive)</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><b>Username</b></td>
|
||||
<td><b>Length</b></td>
|
||||
<td><b>Reason</b></td>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<?php
|
||||
if($banHistory && mysqli_num_rows($banHistory) > 0)
|
||||
{
|
||||
while($h = mysqli_fetch_assoc($banHistory))
|
||||
{
|
||||
$end = $h['end'] ? date("d.m.y H:i",$h['end']) : '*';
|
||||
|
||||
echo '
|
||||
<tr>
|
||||
<td>'.$h['name'].'</td>
|
||||
<td>'.date("d.m.y H:i",$h['time']).' - '.$end.'</td>
|
||||
<td>'.$h['reason'].'</td>
|
||||
</tr>';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo '<tr><td colspan="3">No ban history</td></tr>';
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
<!-- HISTORY -->
|
||||
<div class="ban-card">
|
||||
<h3>
|
||||
<svg width="16" height="16" viewBox="0 0 24 24"><path d="M12 5v7l4 2" stroke="#555" stroke-width="2" fill="none" stroke-linecap="round"/><circle cx="12" cy="12" r="9" stroke="#555" stroke-width="2" fill="none"/></svg>
|
||||
Ban History
|
||||
</h3>
|
||||
<div class="ban-list">
|
||||
<?php if($banHistory && mysqli_num_rows($banHistory)>0){ while($h=mysqli_fetch_assoc($banHistory)){
|
||||
$end = $h['end'] ? date("d.m H:i",$h['end']) : '∞';
|
||||
?>
|
||||
<div class="ban-item" style="opacity:.7">
|
||||
<div>
|
||||
<div class="user"><?php echo htmlspecialchars($h['name']);?></div>
|
||||
<div class="meta"><?php echo date("d.m H:i",$h['time']);?> → <?php echo $end;?></div>
|
||||
</div>
|
||||
<span class="reason"><?php echo htmlspecialchars($h['reason']);?></span>
|
||||
</div>
|
||||
<?php }} else { echo '<div class="empty">No history</div>'; }?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1,56 +1,54 @@
|
||||
<?php
|
||||
#################################################################################
|
||||
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
|
||||
## --------------------------------------------------------------------------- ##
|
||||
## Filename givePlus.tpl ##
|
||||
## Developed by: aggenkeech ##
|
||||
## License: TravianZ Project ##
|
||||
## Copyright: TravianZ (c) 2010-2025. All rights reserved. ##
|
||||
## ##
|
||||
## givePlus.tpl - REDESIGN 2025 ##
|
||||
#################################################################################
|
||||
|
||||
if($_SESSION['access'] < ADMIN) die("Access Denied: You are not Admin!");
|
||||
$id = $_SESSION['id']; ?>
|
||||
$id = $_SESSION['id'];
|
||||
?>
|
||||
<style>
|
||||
.plus-wrap{max-width:600px;margin:30px auto;font-family:Verdana}
|
||||
.plus-head{display:flex;align-items:center;gap:8px;margin-bottom:16px}
|
||||
.plus-head svg{width:26px;height:26px}
|
||||
.plus-head h2{margin:0;font-size:18px}
|
||||
.plus-card{background:#fff;border:1px solid #ddd;border-radius:10px;padding:20px;box-shadow:0 2px 6px rgba(0,0,0,.06);text-align:center}
|
||||
.plus-card .icon-big{width:48px;height:48px;margin:0 auto 10px;background:linear-gradient(135deg,#8e44ad,#6c3483);border-radius:50%;display:flex;align-items:center;justify-content:center;box-shadow:0 2px 4px rgba(0,0,0,.2)}
|
||||
.plus-card .icon-big svg{width:28px;height:28px;fill:#fff}
|
||||
.plus-card h3{margin:8px 0 4px;font-size:16px;color:#333}
|
||||
.plus-card p{margin:0 0 16px;color:#666;font-size:12px}
|
||||
.plus-form{display:flex;justify-content:center;align-items:center;gap:10px;margin-top:10px;flex-wrap:wrap}
|
||||
.plus-form input[type="number"]{width:90px;padding:10px;font-size:18px;text-align:center;border:2px solid #8e44ad;border-radius:8px;font-weight:bold;color:#5b2c6f;background:#f5eef8}
|
||||
.plus-form input[type="number"]:focus{outline:none;border-color:#6c3483;box-shadow:0 0 0 2px rgba(142,68,173,.3)}
|
||||
.plus-form span{font-size:13px;color:#555;font-weight:bold}
|
||||
.plus-form button{background:#8e44ad;color:#fff;border:0;padding:10px 18px;border-radius:8px;font-weight:bold;cursor:pointer;font-size:14px;display:flex;align-items:center;gap:6px}
|
||||
.plus-form button:hover{background:#6c3483}
|
||||
.plus-success{margin-top:20px;padding:12px;background:#f5eef8;border:1px solid #8e44ad;color:#5b2c6f;border-radius:6px;font-weight:bold;text-align:center}
|
||||
</style>
|
||||
|
||||
<form action="../GameEngine/Admin/Mods/givePlus.php" method="POST">
|
||||
<input type="hidden" name="admid" id="admid" value="<?php echo $_SESSION['id']; ?>">
|
||||
<table id="member" style="width:300px;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="2">Give Everyone Free Plus</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<center>
|
||||
<b>How Long?</b>
|
||||
</center>
|
||||
</td>
|
||||
<td>
|
||||
<center>
|
||||
<input class="fm" name="plus" value="1" maxlength="4"> Day
|
||||
</center>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<center>
|
||||
<input type="image" src="../img/admin/b/ok1.gif" value="submit" title="Give Players Free Gold">
|
||||
</center>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</form>
|
||||
<div class="plus-wrap">
|
||||
<div class="plus-head">
|
||||
<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M12 2l4 4-4 4-4-4 4-4zm0 8l4 4-4-4 4-4zm-8 4l4 4-4 4-4-4 4-4zm16 0l4 4-4 4-4-4 4-4z" fill="#8e44ad"/></svg>
|
||||
<h2>Plus Management</h2>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
if(isset($_GET['g']))
|
||||
{
|
||||
echo '<br /><br /><font color="Red"><b>Plus Given</font></b>';
|
||||
}
|
||||
?>
|
||||
<div class="plus-card">
|
||||
<div class="icon-big">
|
||||
<svg viewBox="0 0 24 24"><path d="M12 4v16M4 12h16" stroke="white" stroke-width="3" stroke-linecap="round"/></svg>
|
||||
</div>
|
||||
<h3>Give Everyone Free Plus</h3>
|
||||
<p>Activează Travian Plus pentru TOȚI jucătorii de pe server.</p>
|
||||
|
||||
<form action="../GameEngine/Admin/Mods/givePlus.php" method="POST" class="plus-form">
|
||||
<input type="hidden" name="admid" value="<?php echo $id; ?>">
|
||||
<input type="number" name="plus" value="1" min="1" max="365" required>
|
||||
<span>Days</span>
|
||||
<button type="submit">
|
||||
<svg width="16" height="16" viewBox="0 0 24 24" fill="none"><path d="M5 12h14M12 5l7 7-7 7" stroke="#fff" stroke-width="2" stroke-linecap="round"/></svg>
|
||||
Give Plus
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<?php if(isset($_GET['g'])){ ?>
|
||||
<div class="plus-success">✓ Plus a fost activat cu succes pentru toți jucătorii!</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
@@ -1,95 +1,79 @@
|
||||
<?php
|
||||
#################################################################################
|
||||
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
|
||||
## --------------------------------------------------------------------------- ##
|
||||
## Filename givePlusRes.tpl ##
|
||||
## Developed by: aggenkeech ##
|
||||
## License: TravianZ Project ##
|
||||
## Copyright: TravianZ (c) 2010-2025. All rights reserved. ##
|
||||
## ##
|
||||
## givePlusRes.tpl - REDESIGN 2025 ##
|
||||
#################################################################################
|
||||
|
||||
if($_SESSION['access'] < ADMIN) die("Access Denied: You are not Admin!");
|
||||
$id = $_SESSION['id']; ?>
|
||||
$id = $_SESSION['id'];
|
||||
?>
|
||||
<style>
|
||||
.resbonus-wrap{max-width:700px;margin:30px auto;font-family:Verdana}
|
||||
.resbonus-head{display:flex;align-items:center;gap:8px;margin-bottom:16px}
|
||||
.resbonus-head svg{width:26px;height:26px}
|
||||
.resbonus-head h2{margin:0;font-size:18px}
|
||||
.resbonus-card{background:#fff;border:1px solid #ddd;border-radius:10px;padding:20px;box-shadow:0 2px 6px rgba(0,0,0,.06)}
|
||||
.resbonus-card .top{text-align:center;margin-bottom:18px}
|
||||
.resbonus-card .icon-big{width:48px;height:48px;margin:0 auto 8px;background:linear-gradient(135deg,#27ae60,#16a085);border-radius:50%;display:flex;align-items:center;justify-content:center}
|
||||
.resbonus-card .icon-big svg{width:26px;height:26px;fill:#fff}
|
||||
.resbonus-card h3{margin:0;font-size:16px}
|
||||
.resbonus-card p{margin:4px 0 0;color:#666;font-size:12px}
|
||||
.res-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:12px;margin-top:12px}
|
||||
@media(max-width:600px){.res-grid{grid-template-columns:1fr}}
|
||||
.res-item{background:#fafafa;border:1px solid #eee;border-radius:8px;padding:12px;display:flex;align-items:center;justify-content:space-between}
|
||||
.res-item .left{display:flex;align-items:center;gap:8px;font-weight:bold;font-size:13px}
|
||||
.res-item img{width:18px;height:18px}
|
||||
.res-item input{width:70px;padding:6px;text-align:center;border:1px solid #ccc;border-radius:6px;font-size:14px}
|
||||
.res-item input:focus{outline:none;border-color:#27ae60;box-shadow:0 0 0 2px rgba(39,174,96,.2)}
|
||||
.resbonus-form button{margin-top:16px;width:100%;background:#27ae60;color:#fff;border:0;padding:11px;border-radius:8px;font-weight:bold;cursor:pointer;font-size:14px;display:flex;align-items:center;justify-content:center;gap:6px}
|
||||
.resbonus-form button:hover{background:#1e8449}
|
||||
.resbonus-success{margin-top:18px;padding:12px;background:#eaf1;border:1px solid #27ae60;color:#1e8449;border-radius:6px;font-weight:bold;text-align:center}
|
||||
.wood{color:#8b5a2b} .clay{color:#c0392b} .iron{color:#7f8c8d} .crop{color:#f1c40f}
|
||||
</style>
|
||||
|
||||
<form action="../GameEngine/Admin/Mods/givePlusRes.php" method="POST">
|
||||
<input type="hidden" name="admid" id="admid" value="<?php echo $_SESSION['id']; ?>">
|
||||
<table id="member" style="width:300px;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="2">Give Everyone Free Res Bonus</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="hab">Resource Bonus</td>
|
||||
<td>Duration</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<center>
|
||||
<img src="../img/admin/r/1.gif"> Wood
|
||||
</center>
|
||||
</td>
|
||||
<td>
|
||||
<center>
|
||||
<input class="fm" name="wood" value="1" maxlength="4"> Day
|
||||
</center>
|
||||
</td>
|
||||
</tr>
|
||||
<div class="resbonus-wrap">
|
||||
<div class="resbonus-head">
|
||||
<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M4 7h16v10H4z" fill="#27ae60"/><path d="M8 3v4M16 3v4" stroke="#16a085" stroke-width="2"/></svg>
|
||||
<h2>Resource Bonus</h2>
|
||||
</div>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<center>
|
||||
<img src="../img/admin/r/2.gif"> Clay
|
||||
</center>
|
||||
</td>
|
||||
<td>
|
||||
<center>
|
||||
<input class="fm" name="clay" value="1" maxlength="4"> Day
|
||||
</center>
|
||||
</td>
|
||||
</tr>
|
||||
<div class="resbonus-card">
|
||||
<div class="top">
|
||||
<div class="icon-big">
|
||||
<svg viewBox="0 0 24 24"><path d="M12 2L2 7l10 5 10-5-10-5zM2 17l10 5 10-5M2 12l10 5 10-5"/></svg>
|
||||
</div>
|
||||
<h3>Give Everyone Resource Bonus</h3>
|
||||
<p>Activează bonus 25% pentru toate resursele la TOȚI jucătorii.</p>
|
||||
</div>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<center>
|
||||
<img src="../img/admin/r/1.gif"> Iron
|
||||
</center>
|
||||
</td>
|
||||
<td>
|
||||
<center>
|
||||
<input class="fm" name="iron" value="1" maxlength="4"> Day
|
||||
</center>
|
||||
</td>
|
||||
</tr>
|
||||
<form action="../GameEngine/Admin/Mods/givePlusRes.php" method="POST" class="resbonus-form">
|
||||
<input type="hidden" name="admid" value="<?php echo $id; ?>">
|
||||
|
||||
<div class="res-grid">
|
||||
<div class="res-item">
|
||||
<div class="left wood"><img src="../img/admin/r/1.gif" alt=""> Wood</div>
|
||||
<div><input type="number" name="wood" value="1" min="0" max="365"> days</div>
|
||||
</div>
|
||||
<div class="res-item">
|
||||
<div class="left clay"><img src="../img/admin/r/2.gif" alt=""> Clay</div>
|
||||
<div><input type="number" name="clay" value="1" min="0" max="365"> days</div>
|
||||
</div>
|
||||
<div class="res-item">
|
||||
<div class="left iron"><img src="../img/admin/r/3.gif" alt=""> Iron</div>
|
||||
<div><input type="number" name="iron" value="1" min="0" max="365"> days</div>
|
||||
</div>
|
||||
<div class="res-item">
|
||||
<div class="left crop"><img src="../img/admin/r/4.gif" alt=""> Crop</div>
|
||||
<div><input type="number" name="crop" value="1" min="0" max="365"> days</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<center>
|
||||
<img src="../img/admin/r/4.gif"> Crop
|
||||
</center>
|
||||
</td>
|
||||
<td>
|
||||
<center>
|
||||
<input class="fm" name="crop" value="1" maxlength="4"> Day
|
||||
</center>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<center>
|
||||
<input type="image" src="../img/admin/b/ok1.gif" value="submit" title="Give Players Free Gold">
|
||||
</center>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</form>
|
||||
<button type="submit">
|
||||
<svg width="16" height="16" viewBox="0 0 24 24" fill="none"><path d="M5 12h14M12 5l7 7-7 7" stroke="#fff" stroke-width="2" stroke-linecap="round"/></svg>
|
||||
Give Resource Bonus
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
if(isset($_GET['g']))
|
||||
{
|
||||
echo '<br /><br /><font color="Red"><b>Resource Bonuses Given</font></b>';
|
||||
}
|
||||
?>
|
||||
<?php if(isset($_GET['g'])){ ?>
|
||||
<div class="resbonus-success">✓ Resource bonuses au fost activate pentru toți jucătorii!</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
+46
-52
@@ -1,58 +1,52 @@
|
||||
<?php
|
||||
#################################################################################
|
||||
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
|
||||
## --------------------------------------------------------------------------- ##
|
||||
## Filename gold.tpl ##
|
||||
## Developed by: aggenkeech ##
|
||||
## Refactored by: Shadow ##
|
||||
## License: TravianZ Project ##
|
||||
## Copyright: TravianZ (c) 2010-2025. All rights reserved. ##
|
||||
## ##
|
||||
## gold.tpl - REDESIGN 2025 ##
|
||||
#################################################################################
|
||||
|
||||
if($_SESSION['access'] < ADMIN) die("Access Denied: You are not Admin!");
|
||||
$id = $_SESSION['id']; ?>
|
||||
$id = $_SESSION['id'];
|
||||
?>
|
||||
<style>
|
||||
.gold-wrap{max-width:600px;margin:30px auto;font-family:Verdana}
|
||||
.gold-head{display:flex;align-items:center;gap:8px;margin-bottom:16px}
|
||||
.gold-head svg{width:26px;height:26px}
|
||||
.gold-head h2{margin:0;font-size:18px}
|
||||
.gold-card{background:#fff;border:1px solid #ddd;border-radius:10px;padding:20px;box-shadow:0 2px 6px rgba(0,0,0,.06);text-align:center}
|
||||
.gold-card .icon-big{width:48px;height:48px;margin:0 auto 10px;background:linear-gradient(135deg,#ffd700,#ffb700);border-radius:50%;display:flex;align-items:center;justify-content:center;box-shadow:0 2px 4px rgba(0,0,0,.2)}
|
||||
.gold-card .icon-big svg{width:28px;height:28px;fill:#fff}
|
||||
.gold-card h3{margin:8px 0 4px;font-size:16px;color:#333}
|
||||
.gold-card p{margin:0 0 16px;color:#666;font-size:12px}
|
||||
.gold-form{display:flex;justify-content:center;align-items:center;gap:10px;margin-top:10px}
|
||||
.gold-form input[type="number"]{width:100px;padding:10px;font-size:18px;text-align:center;border:2px solid #d4af37;border-radius:8px;font-weight:bold;color:#b8860b;background:#fffbea}
|
||||
.gold-form input[type="number"]:focus{outline:none;border-color:#ffb700;box-shadow:0 0 0 2px rgba(255,183,0,.3)}
|
||||
.gold-form button{background:#d4af37;color:#fff;border:0;padding:10px 18px;border-radius:8px;font-weight:bold;cursor:pointer;font-size:14px;display:flex;align-items:center;gap:6px}
|
||||
.gold-form button:hover{background:#b8860b}
|
||||
.gold-success{margin-top:20px;padding:12px;background:#e8f5e9;border:1px solid #4caf50;color:#2e7d32;border-radius:6px;font-weight:bold;text-align:center}
|
||||
</style>
|
||||
|
||||
<form action="../GameEngine/Admin/Mods/gold.php" method="POST">
|
||||
<input type="hidden" name="admid" id="admid" value="<?php echo $_SESSION['id']; ?>">
|
||||
<table id="member" style="width:300px;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="2">Give Everyone Free gold</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Amount</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<center>
|
||||
<b>How much gold?</b>
|
||||
</center>
|
||||
</td>
|
||||
<td>
|
||||
<center>
|
||||
<input class="give_gold" name="gold" value="20" maxlength="4">
|
||||
<img src="../img/admin/gold.gif" class="gold" alt="Gold" name="gold" title="Gold"/>
|
||||
</center>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<center>
|
||||
<input type="image" src="../img/admin/b/ok1.gif" value="submit" title="Give Players Free Gold">
|
||||
</center>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</form>
|
||||
<div class="gold-wrap">
|
||||
<div class="gold-head">
|
||||
<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="12" cy="12" r="10" fill="#d4af37"/><path d="M12 7v10M9 10h6M9 14h6" stroke="#fff" stroke-width="2" stroke-linecap="round"/></svg>
|
||||
<h2>Gold Management</h2>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
if(isset($_GET['g']))
|
||||
{
|
||||
echo '<br /><br /><font color="Red"><b>Gold Added</font></b>';
|
||||
}
|
||||
?>
|
||||
<div class="gold-card">
|
||||
<div class="icon-big">
|
||||
<svg viewBox="0 0 24 24"><path d="M12 2L9 8H3l5 4-2 6 6-4 6 4-2-6 5-4h-6z"/></svg>
|
||||
</div>
|
||||
<h3>Give Everyone Free Gold</h3>
|
||||
<p>Acest gold va fi adăugat la TOȚI jucătorii activi de pe server.</p>
|
||||
|
||||
<form action="../GameEngine/Admin/Mods/gold.php" method="POST" class="gold-form">
|
||||
<input type="hidden" name="admid" value="<?php echo $id; ?>">
|
||||
<input type="number" name="gold" value="20" min="1" max="9999" required>
|
||||
<button type="submit">
|
||||
<svg width="16" height="16" viewBox="0 0 24 24" fill="none"><path d="M5 12h14M12 5l7 7-7 7" stroke="#fff" stroke-width="2" stroke-linecap="round"/></svg>
|
||||
Give Gold
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<?php if(isset($_GET['g'])){ ?>
|
||||
<div class="gold-success">✓ Gold a fost adăugat cu succes la toți jucătorii!</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
+119
-58
@@ -1,75 +1,136 @@
|
||||
<?php
|
||||
|
||||
#################################################################################
|
||||
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
|
||||
## -= YOU MUST NOT REMOVE OR CHANGE THIS NOTICE =- ##
|
||||
## --------------------------------------------------------------------------- ##
|
||||
## Filename home.tpl ##
|
||||
## Project: TravianZ ##
|
||||
## Version: 22.05.2026 ##
|
||||
## Filename: Admin\Templates\home.php ##
|
||||
## Developed by: Dzoki ##
|
||||
## Reworked: aggenekech ##
|
||||
## Refactored by: Shadow ##
|
||||
## License: TravianZ Project ##
|
||||
## Copyright: TravianZ (c) 2010-2025. All rights reserved. ##
|
||||
## Copyright: TravianZ (c) 2010-2026. All rights reserved. ##
|
||||
## URLs: https://travianz.org ##
|
||||
## https://github.com/Shadowss/TravianZ ##
|
||||
## ##
|
||||
#################################################################################
|
||||
?>
|
||||
if($_SESSION['access'] < MULTIHUNTER) die("Access Denied!");
|
||||
|
||||
<!-- HEADER -->
|
||||
<div style="text-align:center; margin-top:20px;">
|
||||
<div style="font-size:20px; font-weight:bold; color:#333;">
|
||||
WELCOME TO
|
||||
<?php
|
||||
if ($_SESSION['access'] == MULTIHUNTER) {
|
||||
echo 'MULTIHUNTER';
|
||||
} else if ($_SESSION['access'] == ADMIN) {
|
||||
echo 'ADMINISTRATOR';
|
||||
} else {
|
||||
echo 'CONTROL';
|
||||
}
|
||||
?>
|
||||
CONTROL PANEL
|
||||
</div>
|
||||
</div>
|
||||
// ---- STATS ----
|
||||
$totalUsers = $database->query("SELECT COUNT(*) as c FROM ".TB_PREFIX."users WHERE id > 5")->fetch_assoc()['c'];
|
||||
$active24h = $database->query("SELECT COUNT(*) as c FROM ".TB_PREFIX."users WHERE timestamp > ".(time()-86400)." AND id > 5")->fetch_assoc()['c'];
|
||||
$onlineNow = $database->query("SELECT COUNT(*) as c FROM ".TB_PREFIX."users WHERE timestamp > ".(time()-300)." AND id > 5")->fetch_assoc()['c'];
|
||||
$totalVillages = $database->query("SELECT COUNT(*) as c FROM ".TB_PREFIX."vdata")->fetch_assoc()['c'];
|
||||
$totalGold = $database->query("SELECT SUM(gold) as s FROM ".TB_PREFIX."users")->fetch_assoc()['s'];
|
||||
$activePlus = $database->query("SELECT COUNT(*) as c FROM ".TB_PREFIX."users WHERE plus > ".time())->fetch_assoc()['c'];
|
||||
$activeBans = $database->query("SELECT COUNT(*) as c FROM ".TB_PREFIX."banlist WHERE active=1")->fetch_assoc()['c'];
|
||||
$lastReg = $database->query("SELECT username, id FROM ".TB_PREFIX."users WHERE id>5 ORDER BY id DESC LIMIT 1")->fetch_assoc();
|
||||
|
||||
<br /><br />
|
||||
// ---- TIMELINE ----
|
||||
$startTime = $database->query("SELECT MIN(timestamp) as t FROM ".TB_PREFIX."users WHERE id>5")->fetch_assoc()['t'];
|
||||
$serverStart = $startTime ? date('d.m.Y H:i', $startTime) : 'Unknown';
|
||||
|
||||
<!-- USER INFO -->
|
||||
<?php
|
||||
$role = '';
|
||||
$color = '#2c3e50';
|
||||
$natarsVillages = $database->query("SELECT COUNT(*) as c FROM ".TB_PREFIX."vdata WHERE owner=3")->fetch_assoc()['c'];
|
||||
$natarsStatus = $natarsVillages > 0 ? "Launched ($natarsVillages villages)" : "Not launched";
|
||||
|
||||
if ($_SESSION['access'] == MULTIHUNTER) {
|
||||
$role = 'MultiHunter';
|
||||
$color = '#e67e22';
|
||||
} else if ($_SESSION['access'] == ADMIN) {
|
||||
$role = 'Administrator';
|
||||
$color = '#c0392b';
|
||||
} else {
|
||||
$role = 'User';
|
||||
$arteCount = 0; $arteDate = null;
|
||||
if($database->dblink->query("SHOW TABLES LIKE '".TB_PREFIX."artefacts'")->num_rows){
|
||||
$a = $database->query("SELECT COUNT(*) as c, MIN(conquered) as d FROM ".TB_PREFIX."artefacts")->fetch_assoc();
|
||||
$arteCount = $a['c']; $arteDate = $a['d'];
|
||||
}
|
||||
$arteStatus = $arteCount > 0 ? "Launched ($arteCount) - ".date('d.m.Y',$arteDate) : "Not launched";
|
||||
|
||||
// PLANS din artefacts type=11
|
||||
$plans = 0; $plansDate = null;
|
||||
if($database->dblink->query("SHOW TABLES LIKE '".TB_PREFIX."artefacts'")->num_rows){
|
||||
$p = $database->query("SELECT COUNT(*) as c, MIN(conquered) as d FROM ".TB_PREFIX."artefacts WHERE type=11")->fetch_assoc();
|
||||
$plans = $p['c']; $plansDate = $p['d'];
|
||||
}
|
||||
$plansStatus = $plans > 0 ? "Launched ($plans) - ".($plansDate ? date('d.m.Y',$plansDate) : '') : "Not launched";
|
||||
|
||||
$role = $_SESSION['access'] == ADMIN ? 'Administrator' : 'MultiHunter';
|
||||
?>
|
||||
<style>
|
||||
.dashboard { max-width:1150px; margin:20px auto; font-family:Verdana; }
|
||||
.dash-head { text-align:center; margin-bottom:18px; }
|
||||
.dash-head h1 { font-size:22px; margin:0; color:#222; }
|
||||
.dash-head .sub { color:#666; font-size:12px; margin-top:4px; }
|
||||
.cards { display:grid; grid-template-columns: repeat(4,1fr); gap:12px; margin-bottom:18px; }
|
||||
.card { background:#fff; border:1px solid #ddd; border-radius:6px; padding:12px; box-shadow:0 1px 2px rgba(0,0,0,.05); }
|
||||
.card h3 { margin:0 0 6px; font-size:11px; text-transform:uppercase; color:#777; }
|
||||
.card .val { font-size:20px; font-weight:bold; color:#222; }
|
||||
.card .subv { font-size:11px; color:#999; margin-top:4px; }
|
||||
.card.green .val{color:#27ae60} .card.red .val{color:#c0392b} .card.blue .val{color:#2980b9} .card.orange .val{color:#e67e22}
|
||||
.panel { background:#fff; border:1px solid #ddd; border-radius:6px; padding:12px; margin-bottom:18px; }
|
||||
.panel h2 { margin:0 0 10px; font-size:14px; border-bottom:1px solid #eee; padding-bottom:6px; }
|
||||
.timeline { display:grid; grid-template-columns: repeat(3,1fr); gap:10px; }
|
||||
.timeline div { padding:6px; background:#f9f9f9; border-radius:4px; font-size:12px; }
|
||||
.timeline b { color:#333; }
|
||||
.grid2 { display:grid; grid-template-columns:2fr 1fr; gap:12px; }
|
||||
.logmini { font-size:11px; } .logmini div { padding:4px 0; border-bottom:1px dotted #eee; }
|
||||
.quick a { display:block; padding:7px; background:#f7f7f7; margin-bottom:5px; text-decoration:none; color:#333; border-radius:4px; font-size:12px; }
|
||||
.quick a:hover { background:#eaeaea; }
|
||||
.credits { margin-top:30px; padding:12px; border-top:1px solid #e5e5e5; text-align:center; color:#666; font-size:11px; }
|
||||
</style>
|
||||
|
||||
<div style="text-align:center; font-size:13px; color:#444;">
|
||||
Hello <b><?php echo $_SESSION['admin_username']; ?></b>,<br />
|
||||
You are logged in as:
|
||||
<b style="color:<?php echo $color; ?>">
|
||||
<?php echo $role; ?>
|
||||
</b>
|
||||
</div>
|
||||
<div class="dashboard">
|
||||
<div class="dash-head">
|
||||
<h1>WELCOME TO <?php echo strtoupper($role); ?> CONTROL PANEL</h1>
|
||||
<div class="sub">Hello <b><?php echo $_SESSION['admin_username']; ?></b> — <?php echo date('d.m.Y H:i'); ?> Server Time</div>
|
||||
</div>
|
||||
|
||||
<br /><br /><br />
|
||||
<!-- TOATE CARDURILE ORIGINALE -->
|
||||
<div class="cards">
|
||||
<div class="card blue"><h3>Total Players</h3><div class="val"><?php echo number_format($totalUsers); ?></div><div class="subv">+ <?php echo $active24h; ?> active 24h</div></div>
|
||||
<div class="card green"><h3>Online Now</h3><div class="val"><?php echo $onlineNow; ?></div><div class="subv">last 5 minutes</div></div>
|
||||
<div class="card"><h3>Villages</h3><div class="val"><?php echo number_format($totalVillages); ?></div><div class="subv">avg <?php echo $totalUsers ? round($totalVillages/$totalUsers,1) : 0; ?> / player</div></div>
|
||||
<div class="card orange"><h3>Gold in Game</h3><div class="val"><?php echo number_format($totalGold); ?></div><div class="subv"><?php echo $activePlus; ?> with Plus active</div></div>
|
||||
<div class="card red"><h3>Active Bans</h3><div class="val"><?php echo $activeBans; ?></div><div class="subv"><a href="admin.php?p=ban">manage</a></div></div>
|
||||
<div class="card"><h3>Last Registration</h3><div class="val" style="font-size:14px"><a href="admin.php?p=player&uid=<?php echo $lastReg['id']; ?>"><?php echo htmlspecialchars($lastReg['username']); ?></a></div><div class="subv">ID #<?php echo $lastReg['id']; ?></div></div>
|
||||
<div class="card"><h3>PHP / MySQL</h3><div class="val" style="font-size:14px"><?php echo PHP_VERSION; ?></div><div class="subv"><?php echo $database->dblink->server_info; ?></div></div>
|
||||
<div class="card"><h3>Server Load</h3><div class="val" style="font-size:14px"><?php echo date('H:i:s'); ?></div><div class="subv">Uptime: <?php echo @exec('uptime -p') ?: 'n/a'; ?></div></div>
|
||||
</div>
|
||||
|
||||
<!-- SPACER -->
|
||||
<div style="height:60px;"></div>
|
||||
<!-- TIMELINE NOU - IN PLUS -->
|
||||
<div class="panel">
|
||||
<h2>Server Timeline</h2>
|
||||
<div class="timeline">
|
||||
<div><b>Start Date:</b><br><?php echo $serverStart; ?></div>
|
||||
<div><b>Natars:</b><br><?php echo $natarsStatus; ?></div>
|
||||
<div><b>Artefacts:</b><br><?php echo $arteStatus; ?></div>
|
||||
<div><b>WW Plans:</b><br><?php echo $plansStatus; ?></div>
|
||||
<div><b>Server Age:</b><br><?php echo $startTime ? floor((time()-$startTime)/86400).' days' : '-'; ?></div>
|
||||
<div><b>Next Event:</b><br>—</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- CREDITS -->
|
||||
<div style="
|
||||
margin-top:60px;
|
||||
padding:12px;
|
||||
border-top:1px solid #e5e5e5;
|
||||
text-align:center;
|
||||
color:#666;
|
||||
font-size:11px;
|
||||
line-height:18px;
|
||||
">
|
||||
Credits: Akakori & Elmar<br />
|
||||
Fixed, remade and new features added by <b>Dzoki</b><br />
|
||||
Reworked by <b>aggenkeech</b><br />
|
||||
Refactored by <b>Shadow</b>
|
||||
<div class="grid2">
|
||||
<div class="panel">
|
||||
<h2>Last 5 Admin Actions</h2>
|
||||
<div class="logmini">
|
||||
<?php
|
||||
$logs = $database->query("SELECT * FROM ".TB_PREFIX."admin_log ORDER BY id DESC LIMIT 5");
|
||||
while($l = $logs->fetch_assoc()){
|
||||
$u = $database->getUserField($l['user'],'username',0);
|
||||
echo '<div>['.date('H:i',$l['time']).'] <b>'.$u.'</b> — '.strip_tags($l['log']).'</div>';
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<div style="margin-top:8px"><a href="admin.php?p=admin_log">view full log →</a></div>
|
||||
</div>
|
||||
|
||||
<div class="panel quick">
|
||||
<h2>Quick Actions</h2>
|
||||
<a href="admin.php?p=search">🔍 Search Player</a>
|
||||
<a href="admin.php?p=ban">🔨 Ban Manager</a>
|
||||
<a href="admin.php?p=map">🗺️ Map</a>
|
||||
<a href="admin.php?p=natars">🏰 Natars</a>
|
||||
<a href="admin.php?p=addUser">👤 Add User</a>
|
||||
<a href="admin.php?p=server_info">⚙️ Server Info</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="credits">
|
||||
Credits: Akakori & Elmar — Fixed by <b>Dzoki</b> — Reworked by <b>aggenkeech</b> — Dashboard v2.1 by <b>Shadow</b>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1,85 +1,104 @@
|
||||
<?php
|
||||
#################################################################################
|
||||
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
|
||||
## --------------------------------------------------------------------------- ##
|
||||
## Filename inactive.tpl ##
|
||||
## Developed by: Dzoki ##
|
||||
## Reworked: aggenkeech ##
|
||||
## Fix by: ronix ##
|
||||
## License: TravianZ Project ##
|
||||
## Copyright: TravianZ (c) 2010-2013. All rights reserved. ##
|
||||
## ##
|
||||
## inactive.tpl - FIXED 2025 ##
|
||||
#################################################################################
|
||||
if($_SESSION['access'] < MULTIHUNTER) die("Access Denied!");
|
||||
global $database;
|
||||
|
||||
function inactiveRange($daysMin, $daysMax = null){
|
||||
global $database;
|
||||
$now = time();
|
||||
$from = $now - ($daysMin * 86400);
|
||||
$to = $daysMax ? $now - ($daysMax * 86400) : 0;
|
||||
if($daysMax === null){
|
||||
$q = "SELECT * FROM ".TB_PREFIX."users WHERE timestamp < $from AND id>5 AND tribe BETWEEN 1 AND 3 ORDER BY timestamp ASC LIMIT 200";
|
||||
} else {
|
||||
$q = "SELECT * FROM ".TB_PREFIX."users WHERE timestamp <= $from AND timestamp > $to AND id>5 AND tribe BETWEEN 1 AND 3 ORDER BY timestamp ASC LIMIT 200";
|
||||
}
|
||||
$res = $database->query($q);
|
||||
return $res ? $res->fetch_all(MYSQLI_ASSOC) : [];
|
||||
}
|
||||
|
||||
$ranges = [
|
||||
'1-3 days' => inactiveRange(1,3),
|
||||
'3-7 days' => inactiveRange(3,7),
|
||||
'7+ days' => inactiveRange(7,null)
|
||||
];
|
||||
|
||||
$tribeImg = [1=>'',2=>'1',3=>'2'];
|
||||
$tribeName = [1=>'Roman',2=>'Teuton',3=>'Gaul'];
|
||||
?>
|
||||
<style>
|
||||
.del {width:12px; height:12px; background-image: url(img/admin/icon/del.gif);}
|
||||
.inactive-wrap{max-width:1100px;margin:20px auto;font-family:Verdana}
|
||||
.inactive-head{display:flex;align-items:center;gap:8px;margin-bottom:12px}
|
||||
.inactive-head h2{margin:0;font-size:18px}
|
||||
.inactive-tabs{display:flex;gap:8px;margin-bottom:12px}
|
||||
.inactive-tabs button{padding:8px 14px;border:1px solid #ddd;background:#f7f7;border-radius:6px 6px 0 0;cursor:pointer;font-size:12px}
|
||||
.inactive-tabs button.active{background:#fff;border-bottom:1px solid #fff;font-weight:bold}
|
||||
.inactive-panel{background:#fff;border:1px solid #ddd;border-radius:0 6px 6px 6px;padding:12px;display:none}
|
||||
.inactive-panel.active{display:block}
|
||||
.inactive-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:10px;align-items:stretch}
|
||||
.user-card{border:1px solid #eee;border-radius:6px;padding:8px;background:#fafafa;display:flex;flex-direction:column;justify-content:space-between;height:100%;box-sizing:border-box}
|
||||
.user-card .top{display:flex;justify-content:space-between;align-items:center}
|
||||
.user-card .name{font-weight:bold;font-size:12px}
|
||||
.user-card .name a{text-decoration:none;color:#222}
|
||||
.user-card .meta{font-size:11px;color:#666;display:flex;gap:10px;flex-wrap:wrap;margin:4px 0}
|
||||
.user-card .stats{display:flex;justify-content:space-between;font-size:11px;margin-top:6px;padding-top:4px;border-top:1px dotted #ddd}
|
||||
.badge{font-size:10px;padding:2px 5px;border-radius:3px;background:#eee}
|
||||
.badge.gold{background:#fff8e1}
|
||||
</style>
|
||||
|
||||
<table id="member">
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="7">Inactive users</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Name [access]</td>
|
||||
<td>Time</td>
|
||||
<td>Tribe</td>
|
||||
<td>Population</td>
|
||||
<td>Villages</td>
|
||||
<td>Gold</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
for ($h=1;$h<4;$h++) {
|
||||
if ($h==1) { // 24 hours and before 3 days
|
||||
$from_time=time() - 86400; $to_time = time() - (86400*3);
|
||||
$q = "SELECT * FROM ".TB_PREFIX."users where ($from_time >= timestamp AND $to_time < timestamp) AND id>5";
|
||||
}elseif ($h==2) { // 3 days and before 7 days
|
||||
$from_time=time() - (86400*3); $to_time = time() - (86400*7);
|
||||
$q = "SELECT * FROM ".TB_PREFIX."users where ($from_time >= timestamp AND $to_time < timestamp) AND id>5";
|
||||
}elseif ($h==3) { //7 days and after
|
||||
$from_time=time() - (86400*7);
|
||||
$q = "SELECT * FROM ".TB_PREFIX."users where $from_time > timestamp AND id>5";
|
||||
}
|
||||
|
||||
$result = $database->query($q);
|
||||
$active = $database->mysqli_fetch_all($result);
|
||||
for ($i = 0; $i <= count($active)-1; $i++){
|
||||
$uid = $database->getUserField($active[$i]['username'],'id',1);
|
||||
$varray = $database->getProfileVillages($uid);
|
||||
$totalpop = 0;
|
||||
foreach($varray as $vil){
|
||||
$totalpop += $vil['pop'];
|
||||
}
|
||||
if($active[$i]['tribe'] == 1){
|
||||
$tribe = "Roman";
|
||||
$img = "";
|
||||
}else if($active[$i]['tribe'] == 2){
|
||||
$tribe = "Teuton";
|
||||
$img = "1";
|
||||
}else if($active[$i]['tribe'] == 3){
|
||||
$tribe = "Gaul";
|
||||
$img = "2";
|
||||
}
|
||||
$getmin=((time()-$active[$i]['timestamp'])/60);
|
||||
$gethr=((time()-$active[$i]['timestamp'])/3600);
|
||||
$getday=intval((time()-$active[$i]['timestamp'])/86400);
|
||||
|
||||
echo "
|
||||
<tr>
|
||||
<td><a href=\"?p=player&uid=".$uid."\">".$active[$i]['username']." [".$active[$i]['access']."]</a></td>
|
||||
<td>".$getday." days ".intval($gethr-$getday*24)." hours</td>
|
||||
<td><img src=\"../gpack/travian_default/img/u/".$img."9.gif\" title=\"$tribe\" alt=\"$tribe\"></td>
|
||||
<td>".$totalpop."</td>
|
||||
<td>".count($varray)."</td>
|
||||
<td><img src=\"../img/admin/gold.gif\" class=\"gold\" alt=\"Gold\" title=\"This user has: ".$active[$i]['gold']." gold\"/> ".$active[$i]['gold']."</td>
|
||||
<td><img src=\"../gpack/travian_default/img/a/online".($h+2).".gif\"></td>
|
||||
</tr>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="inactive-wrap">
|
||||
<div class="inactive-head">
|
||||
<svg viewBox="0 0 24 24" width="22" height="22" fill="none"><circle cx="12" cy="8" r="4" fill="#777"/><path d="M4 20c0-3.3 3.6-6 8-6s8 2.7 8 6v1H4v-1z" fill="#777"/><circle cx="18" cy="18" r="4" fill="#e67e22"/><path d="M18 15v3l2 1" stroke="#fff" stroke-width="1.5" stroke-linecap="round"/></svg>
|
||||
<h2>Inactive Users</h2>
|
||||
</div>
|
||||
|
||||
<div class="inactive-tabs">
|
||||
<?php $i=0; foreach($ranges as $label=>$list){ $i++; ?>
|
||||
<button class="<?php echo $i==1?'active':''; ?>" onclick="showTab(<?php echo $i; ?>)"><?php echo $label; ?> (<?php echo count($list); ?>)</button>
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
||||
<?php $i=0; foreach($ranges as $label=>$users){ $i++; ?>
|
||||
<div class="inactive-panel <?php echo $i==1?'active':''; ?>" id="tab<?php echo $i; ?>">
|
||||
<?php if(empty($users)){ echo "<div style='color:#999;padding:20px;text-align:center'>No users in this range</div>"; } else { ?>
|
||||
<div class="inactive-grid">
|
||||
<?php foreach($users as $u){
|
||||
$uid = $u['id'];
|
||||
$varray = $database->getProfileVillages($uid);
|
||||
$totalpop = 0; foreach($varray as $v) $totalpop += $v['pop'];
|
||||
$days = floor((time()-$u['timestamp'])/86400);
|
||||
$hours = floor(((time()-$u['timestamp'])%86400)/3600);
|
||||
$tribe = $u['tribe'];
|
||||
?>
|
||||
<div class="user-card">
|
||||
<div>
|
||||
<div class="top">
|
||||
<div class="name"><a href="?p=player&uid=<?php echo $uid; ?>"><?php echo htmlspecialchars($u['username']); ?></a> <span style="color:#999">[<?php echo $u['access']; ?>]</span></div>
|
||||
<img src="../gpack/travian_default/img/u/<?php echo $tribeImg[$tribe]; ?>9.gif" title="<?php echo $tribeName[$tribe]; ?>" width="16">
|
||||
</div>
|
||||
<div class="meta">
|
||||
<span>⏱ <?php echo $days; ?>d <?php echo $hours; ?>h ago</span>
|
||||
<span>👥 <?php echo $totalpop; ?> pop</span>
|
||||
<span>🏘 <?php echo count($varray); ?> vil</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="stats">
|
||||
<span class="badge gold">💰 <?php echo $u['gold']; ?></span>
|
||||
<span><a href="?p=player&uid=<?php echo $uid; ?>&action=delete" onclick="return confirm('Delete?')" style="color:#c00;text-decoration:none">delete</a></span>
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function showTab(n){
|
||||
document.querySelectorAll('.inactive-tabs button').forEach((b,i)=>b.classList.toggle('active', i==n-1));
|
||||
document.querySelectorAll('.inactive-panel').forEach((p,i)=>p.classList.toggle('active', i==n-1));
|
||||
}
|
||||
</script>
|
||||
@@ -10,9 +10,6 @@
|
||||
## ##
|
||||
#################################################################################
|
||||
|
||||
############ Check Update #############
|
||||
//copy("http://travian.gamingcrazy.net/Update/update_latest.tpl", "Templates/update_latest.tpl");
|
||||
|
||||
?>
|
||||
<div align="center">
|
||||
<img src="../img/admin/admin.gif" width="468" height="60" border="0">
|
||||
|
||||
@@ -1,32 +1,52 @@
|
||||
<?php
|
||||
#################################################################################
|
||||
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
|
||||
## --------------------------------------------------------------------------- ##
|
||||
## Filename MaintenenceResetGold.tpl ##
|
||||
## Developed by: aggenkeech ##
|
||||
## License: TravianZ Project ##
|
||||
## Copyright: TravianZ (c) 2010-2025. All rights reserved. ##
|
||||
## ##
|
||||
## MaintenenceResetGold.tpl - REDESIGN 2025 ##
|
||||
#################################################################################
|
||||
if($_SESSION['access'] < ADMIN) die("Access Denied: You are not Admin!");
|
||||
?>
|
||||
<form action="../GameEngine/Admin/Mods/mainteneceResetGold.php" method="POST">
|
||||
<input type="hidden" name="admid" id="admid" value="<?php echo $_SESSION['id']; ?>">
|
||||
<table id="member" cellpadding="1" cellspacing="1" >
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="2">Reset All Players Gold</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="hab" colspan="2"><center><input type="image" src="../img/admin/b/ok1.gif" value="submit"></center></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</form>
|
||||
<?php
|
||||
if(isset($_GET['g']))
|
||||
{
|
||||
echo '<br><br><font color="red"><b>All Players Gold Reset</b></font>';
|
||||
}
|
||||
?>
|
||||
<style>
|
||||
.resetgold-wrap{max-width:600px;margin:30px auto;font-family:Verdana}
|
||||
.resetgold-head{display:flex;align-items:center;gap:8px;margin-bottom:16px}
|
||||
.resetgold-head svg{width:26px;height:26px}
|
||||
.resetgold-head h2{margin:0;font-size:18px}
|
||||
.resetgold-card{background:#fff;border:1px solid #e74c3c;border-radius:10px;padding:22px;box-shadow:0 2px 8px rgba(231,76,60,.15);text-align:center}
|
||||
.resetgold-card .warn-icon{width:60px;height:60px;margin:0 auto 12px;background:linear-gradient(135deg,#e74c3c,#c0392b);border-radius:50%;display:flex;align-items:center;justify-content:center;box-shadow:0 3px 6px rgba(0,0,0,.2)}
|
||||
.resetgold-card .warn-icon svg{width:32px;height:32px;fill:#fff}
|
||||
.resetgold-card h3{margin:8px 0 6px;font-size:17px;color:#c0392b}
|
||||
.resetgold-card p{margin:0 0 18px;color:#555;font-size:13px;line-height:1.4}
|
||||
.resetgold-card .danger-box{background:#ffeaea;border:1px dashed #e74c3c;padding:10px;border-radius:6px;font-size:12px;color:#a93226;margin-bottom:16px}
|
||||
.resetgold-form button{background:#e74c3c;color:#fff;border:0;padding:12px 24px;border-radius:8px;font-weight:bold;cursor:pointer;font-size:14px;display:inline-flex;align-items:center;gap:8px;transition:.2s}
|
||||
.resetgold-form button:hover{background:#c0392b;transform:translateY(-1px)}
|
||||
.resetgold-success{margin-top:18px;padding:12px;background:#ffeaea;border:1px solid #e74c3c;color:#c0392b;border-radius:6px;font-weight:bold;text-align:center}
|
||||
</style>
|
||||
|
||||
<div class="resetgold-wrap">
|
||||
<div class="resetgold-head">
|
||||
<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M12 2v10l4-4" stroke="#e74c3c" stroke-width="2" stroke-linecap="round"/><circle cx="12" cy="17" r="5" fill="#c0392b"/></svg>
|
||||
<h2>Maintenance</h2>
|
||||
</div>
|
||||
|
||||
<div class="resetgold-card">
|
||||
<div class="warn-icon">
|
||||
<svg viewBox="0 0 24 24"><path d="M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"/></svg>
|
||||
</div>
|
||||
<h3>Reset All Players Gold</h3>
|
||||
<p>Această acțiune va seta gold-ul la <b>0</b> pentru TOȚI jucătorii de pe server.</p>
|
||||
|
||||
<div class="danger-box">
|
||||
⚠️ ATENȚIE: Acțiunea este ireversibilă! Asigură-te că ai backup înainte.
|
||||
</div>
|
||||
|
||||
<form action="../GameEngine/Admin/Mods/mainteneceResetGold.php" method="POST" class="resetgold-form" onsubmit="return confirm('Ești SIGUR că vrei să resetezi gold-ul la TOȚI jucătorii?');">
|
||||
<input type="hidden" name="admid" value="<?php echo $_SESSION['id']; ?>">
|
||||
<button type="submit">
|
||||
<svg width="18" height="18" viewBox="0 0 24 24" fill="none"><path d="M3 6h18M8 6V4h8v2m-1 0v14a2 2 0 0 1-2 2H9a2 2 0 0 1-2-2V6h10z" stroke="#fff" stroke-width="2" stroke-linecap="round"/></svg>
|
||||
RESET GOLD NOW
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<?php if(isset($_GET['g'])){ ?>
|
||||
<div class="resetgold-success">✓ Gold-ul tuturor jucătorilor a fost resetat!</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
@@ -1,32 +1,52 @@
|
||||
<?php
|
||||
#################################################################################
|
||||
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
|
||||
## --------------------------------------------------------------------------- ##
|
||||
## Filename MaintenenceResetPlus.tpl ##
|
||||
## Developed by: aggenkeech ##
|
||||
## License: TravianZ Project ##
|
||||
## Copyright: TravianZ (c) 2010-2025. All rights reserved. ##
|
||||
## ##
|
||||
## MaintenenceResetPlus.tpl - REDESIGN 2025 ##
|
||||
#################################################################################
|
||||
if($_SESSION['access'] < ADMIN) die("Access Denied: You are not Admin!");
|
||||
?>
|
||||
<form action="../GameEngine/Admin/Mods/mainteneceResetPlus.php" method="POST">
|
||||
<input type="hidden" name="admid" id="admid" value="<?php echo $_SESSION['id']; ?>">
|
||||
<table id="member" cellpadding="1" cellspacing="1" >
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="2">Reset All Players Plus Bonus</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="hab" colspan="2"><center><input type="image" src="../img/admin/b/ok1.gif" value="submit"></center></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</form>
|
||||
<?php
|
||||
if(isset($_GET['g']))
|
||||
{
|
||||
echo '<br><br><font color="red"><b>All Players Plus Bonus Reset</b></font>';
|
||||
}
|
||||
?>
|
||||
<style>
|
||||
.resetplus-wrap{max-width:600px;margin:30px auto;font-family:Verdana}
|
||||
.resetplus-head{display:flex;align-items:center;gap:8px;margin-bottom:16px}
|
||||
.resetplus-head svg{width:26px;height:26px}
|
||||
.resetplus-head h2{margin:0;font-size:18px}
|
||||
.resetplus-card{background:#fff;border:1px solid #8e44ad;border-radius:10px;padding:22px;box-shadow:0 2px 8px rgba(142,68,173,.15);text-align:center}
|
||||
.resetplus-card .warn-icon{width:60px;height:60px;margin:0 auto 12px;background:linear-gradient(135deg,#8e44ad,#6c3483);border-radius:50%;display:flex;align-items:center;justify-content:center;box-shadow:0 3px 6px rgba(0,0,0,.2)}
|
||||
.resetplus-card .warn-icon svg{width:32px;height:32px;fill:#fff}
|
||||
.resetplus-card h3{margin:8px 0 6px;font-size:17px;color:#5b2c6f}
|
||||
.resetplus-card p{margin:0 0 18px;color:#555;font-size:13px;line-height:1.4}
|
||||
.resetplus-card .danger-box{background:#f5eef8;border:1px dashed #8e44ad;padding:10px;border-radius:6px;font-size:12px;color:#5b2c6f;margin-bottom:16px}
|
||||
.resetplus-form button{background:#8e44ad;color:#fff;border:0;padding:12px 24px;border-radius:8px;font-weight:bold;cursor:pointer;font-size:14px;display:inline-flex;align-items:center;gap:8px;transition:.2s}
|
||||
.resetplus-form button:hover{background:#6c3483;transform:translateY(-1px)}
|
||||
.resetplus-success{margin-top:18px;padding:12px;background:#f5eef8;border:1px solid #8e44ad;color:#5b2c6f;border-radius:6px;font-weight:bold;text-align:center}
|
||||
</style>
|
||||
|
||||
<div class="resetplus-wrap">
|
||||
<div class="resetplus-head">
|
||||
<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M12 2v10l4-4" stroke="#8e44ad" stroke-width="2" stroke-linecap="round"/><circle cx="12" cy="17" r="5" fill="#6c3483"/></svg>
|
||||
<h2>Maintenance</h2>
|
||||
</div>
|
||||
|
||||
<div class="resetplus-card">
|
||||
<div class="warn-icon">
|
||||
<svg viewBox="0 0 24 24"><path d="M12 4v16M4 12h16" stroke="white" stroke-width="3" stroke-linecap="round"/></svg>
|
||||
</div>
|
||||
<h3>Reset All Players Plus</h3>
|
||||
<p>Această acțiune va dezactiva Travian Plus pentru TOȚI jucătorii.</p>
|
||||
|
||||
<div class="danger-box">
|
||||
⚠️ Plus-ul va fi setat la 0 zile pentru toată lumea.
|
||||
</div>
|
||||
|
||||
<form action="../GameEngine/Admin/Mods/mainteneceResetPlus.php" method="POST" class="resetplus-form" onsubmit="return confirm('Ești SIGUR că vrei să resetezi Plus-ul la TOȚI jucătorii?');">
|
||||
<input type="hidden" name="admid" value="<?php echo $_SESSION['id']; ?>">
|
||||
<button type="submit">
|
||||
<svg width="18" height="18" viewBox="0 0 24 24" fill="none"><path d="M3 6h18M8 6V4h8v2m-1 0v14a2 2 0 0 1-2 2H9a2 2 0 0 1-2-2V6h10z" stroke="#fff" stroke-width="2" stroke-linecap="round"/></svg>
|
||||
RESET PLUS NOW
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<?php if(isset($_GET['g'])){ ?>
|
||||
<div class="resetplus-success">✓ Plus-ul tuturor jucătorilor a fost resetat!</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
@@ -1,32 +1,61 @@
|
||||
<?php
|
||||
#################################################################################
|
||||
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
|
||||
## --------------------------------------------------------------------------- ##
|
||||
## Filename MaintenenceResetPlusBonus.tpl ##
|
||||
## Developed by: aggenkeech ##
|
||||
## License: TravianZ Project ##
|
||||
## Copyright: TravianZ (c) 2010-2025. All rights reserved. ##
|
||||
## ##
|
||||
## MaintenenceResetPlusBonus.tpl - REDESIGN 2025 ##
|
||||
#################################################################################
|
||||
if($_SESSION['access'] < ADMIN) die("Access Denied: You are not Admin!");
|
||||
?>
|
||||
<form action="../GameEngine/Admin/Mods/mainteneceResetPlusBonus.php" method="POST">
|
||||
<input type="hidden" name="admid" id="admid" value="<?php echo $_SESSION['id']; ?>">
|
||||
<table id="member" cellpadding="1" cellspacing="1" >
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="2">Reset All Players Resource Bonus</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="hab" colspan="2"><center><input type="image" src="../img/admin/b/ok1.gif" value="submit"></center></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</form>
|
||||
<?php
|
||||
if(isset($_GET['g']))
|
||||
{
|
||||
echo '<br><br><font color="red"><b>All Players Resource Bonus Reset</b></font>';
|
||||
}
|
||||
?>
|
||||
<style>
|
||||
.resetres-wrap{max-width:600px;margin:30px auto;font-family:Verdana}
|
||||
.resetres-head{display:flex;align-items:center;gap:8px;margin-bottom:16px}
|
||||
.resetres-head svg{width:26px;height:26px}
|
||||
.resetres-head h2{margin:0;font-size:18px}
|
||||
.resetres-card{background:#fff;border:1px solid #27ae60;border-radius:10px;padding:22px;box-shadow:0 2px 8px rgba(39,174,96,.15);text-align:center}
|
||||
.resetres-card .warn-icon{width:60px;height:60px;margin:0 auto 12px;background:linear-gradient(135deg,#27ae60,#16a085);border-radius:50%;display:flex;align-items:center;justify-content:center;box-shadow:0 3px 6px rgba(0,0,0,.2)}
|
||||
.resetres-card .warn-icon svg{width:32px;height:32px;fill:#fff}
|
||||
.resetres-card h3{margin:8px 0 6px;font-size:17px;color:#145a32}
|
||||
.resetres-card p{margin:0 0 18px;color:#555;font-size:13px;line-height:1.4}
|
||||
.resetres-card .danger-box{background:#eafaf1;border:1px dashed #27ae60;padding:10px;border-radius:6px;font-size:12px;color:#145a32;margin-bottom:16px}
|
||||
.res-icons{display:flex;justify-content:center;gap:12px;margin-bottom:12px}
|
||||
.res-icons img{width:24px;height:24px;opacity:.8}
|
||||
.resetres-form button{background:#27ae60;color:#fff;border:0;padding:12px 24px;border-radius:8px;font-weight:bold;cursor:pointer;font-size:14px;display:inline-flex;align-items:center;gap:8px;transition:.2s}
|
||||
.resetres-form button:hover{background:#1e8449;transform:translateY(-1px)}
|
||||
.resetres-success{margin-top:18px;padding:12px;background:#eafaf1;border:1px solid #27ae60;color:#145a32;border-radius:6px;font-weight:bold;text-align:center}
|
||||
</style>
|
||||
|
||||
<div class="resetres-wrap">
|
||||
<div class="resetres-head">
|
||||
<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M4 7h16v10H4z" fill="#27ae60"/><path d="M8 3v4M16 3v4" stroke="#16a085" stroke-width="2"/></svg>
|
||||
<h2>Maintenance</h2>
|
||||
</div>
|
||||
|
||||
<div class="resetres-card">
|
||||
<div class="warn-icon">
|
||||
<svg viewBox="0 0 24 24"><path d="M12 2L2 7l10 5 10-5-10-5zM2 17l10 5 10-5M2 12l10 5 10-5"/></svg>
|
||||
</div>
|
||||
<h3>Reset All Resource Bonuses</h3>
|
||||
<p>Această acțiune va dezactiva bonusul de 25% pentru TOATE resursele la toți jucătorii.</p>
|
||||
|
||||
<div class="res-icons">
|
||||
<img src="../img/admin/r/1.gif" title="Wood">
|
||||
<img src="../img/admin/r/2.gif" title="Clay">
|
||||
<img src="../img/admin/r/3.gif" title="Iron">
|
||||
<img src="../img/admin/r/4.gif" title="Crop">
|
||||
</div>
|
||||
|
||||
<div class="danger-box">
|
||||
⚠️ Toate bonusurile de resurse vor fi setate la 0 zile.
|
||||
</div>
|
||||
|
||||
<form action="../GameEngine/Admin/Mods/mainteneceResetPlusBonus.php" method="POST" class="resetres-form" onsubmit="return confirm('Ești SIGUR că vrei să resetezi bonusurile de resurse?');">
|
||||
<input type="hidden" name="admid" value="<?php echo $_SESSION['id']; ?>">
|
||||
<button type="submit">
|
||||
<svg width="18" height="18" viewBox="0 0 24 24" fill="none"><path d="M3 6h18M8 6V4h8v2m-1 0v14a2 2 0 0 1-2 2H9a2 2 0 0 1-2-2V6h10z" stroke="#fff" stroke-width="2" stroke-linecap="round"/></svg>
|
||||
RESET RESOURCE BONUS
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<?php if(isset($_GET['g'])){ ?>
|
||||
<div class="resetres-success">✓ Bonusurile de resurse au fost resetate pentru toți jucătorii!</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
+138
-69
@@ -1,83 +1,152 @@
|
||||
<?php
|
||||
#################################################################################
|
||||
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
|
||||
## --------------------------------------------------------------------------- ##
|
||||
## Filename msg.tpl ##
|
||||
## Developed by: Dzoki ##
|
||||
## License: TravianZ Project ##
|
||||
## Copyright: TravianZ (c) 2010-2025. All rights reserved. ##
|
||||
## ##
|
||||
## msg.tpl - REDESIGN 2025 (stil Reports) ##
|
||||
#################################################################################
|
||||
if($_SESSION['access'] < MULTIHUNTER) die("Access Denied!");
|
||||
include_once("../GameEngine/Generator.php");
|
||||
include_once("../GameEngine/Technology.php");
|
||||
include_once("../GameEngine/Message.php");
|
||||
include_once("../GameEngine/BBCode.php");
|
||||
|
||||
$msg = [];
|
||||
$allMessages = [];
|
||||
$nid = (isset($_GET['nid']) && is_numeric($_GET['nid'])) ? (int) $_GET['nid'] : 0;
|
||||
$nid = isset($_GET['nid'])? (int)$_GET['nid'] : 0;
|
||||
$search = isset($_GET['q'])? $database->escape($_GET['q']) : '';
|
||||
$filter = isset($_GET['f'])? $_GET['f'] : 'all';
|
||||
$page = max(1, (int)($_GET['page']?? 1));
|
||||
$limit = 50;
|
||||
$offset = ($page-1)*$limit;
|
||||
|
||||
if($nid > 0) $msg = $database->getMessage($nid, 3);
|
||||
else
|
||||
{
|
||||
$sql = "SELECT * FROM " . TB_PREFIX . "mdata ORDER BY time DESC ";
|
||||
$result = mysqli_query($GLOBALS["link"], $sql);
|
||||
$allMessages = $database->mysqli_fetch_all($result);
|
||||
// ---- SINGLE MESSAGE - PĂSTRĂM VIZUALIZAREA CLASICĂ ----
|
||||
if($nid > 0){
|
||||
$msg = $database->getMessage($nid, 3);
|
||||
if(empty($msg)) die("Message ID $nid doesn't exist!");
|
||||
?>
|
||||
<link href="../<?php echo GP_LOCATE;?>lang/en/lang.css?f4b7d" rel="stylesheet" type="text/css">
|
||||
<link href="../<?php echo GP_LOCATE;?>lang/en/compact.css?f4b7i" rel="stylesheet" type="text/css">
|
||||
<link href="../<?php echo GP_LOCATE;?>travian.css?e21d2" rel="stylesheet" type="text/css">
|
||||
<div style="max-width:900px;margin:20px auto">
|
||||
<a href="?p=msg" style="font-size:12px">← Back to messages</a>
|
||||
<div style="margin:8px 0;font-size:12px"><span class="b">Sent to</span>: <?php echo $database->getUserField($msg[0]['target'],'username',0);?></div>
|
||||
<div id="content" class="messages">
|
||||
<h1>Message</h1>
|
||||
<div id="read_head" class="msg_head"></div>
|
||||
<div id="read_content" class="msg_content">
|
||||
<img src="../img/x.gif" id="label" class="read" alt="">
|
||||
<div id="heading">
|
||||
<div><?php echo $database->getUserField($msg[0]['owner'],'username',0);?></div>
|
||||
<div><?php echo htmlspecialchars($msg[0]['topic']);?></div>
|
||||
</div>
|
||||
<div id="time">
|
||||
<div><?php echo date('d.m.y',$msg[0]['time']);?></div>
|
||||
<div><?php echo date('H:i:s',$msg[0]['time']);?></div>
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
<div class="line"></div>
|
||||
<div class="message" style="min-height:10px;">
|
||||
<?php
|
||||
$input = $msg[0]['message'];
|
||||
$alliance = $msg[0]['alliance'];
|
||||
$player = $msg[0]['player'];
|
||||
$coor = $msg[0]['coor'];
|
||||
$report = $msg[0]['report'];
|
||||
echo stripslashes(nl2br($bbcoded));
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div id="read_foot" class="msg_foot"></div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
return;
|
||||
}
|
||||
|
||||
if(!empty($allMessages)){
|
||||
?>
|
||||
<link href="../<?php echo GP_LOCATE; ?>lang/en/lang.css?f4b7d" rel="stylesheet" type="text/css">
|
||||
<link href="../<?php echo GP_LOCATE; ?>lang/en/compact.css?f4b7i" rel="stylesheet" type="text/css">
|
||||
<link href="../<?php echo GP_LOCATE; ?>travian.css?e21d2" rel="stylesheet" type="text/css">
|
||||
<h1>Players Message</h1>
|
||||
<div id="content" class="messages" style="padding: 0;">
|
||||
<?php
|
||||
include("Message/inbox.tpl");
|
||||
?>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
elseif(!empty($msg)){
|
||||
// ---- LISTA MESAJE ----
|
||||
$where = "1";
|
||||
if($search) $where.= " AND (topic LIKE '%$search%' OR message LIKE '%$search%')";
|
||||
|
||||
$filterMap = [
|
||||
'inbox' => "target > 0",
|
||||
'sent' => "owner > 0",
|
||||
'system' => "owner = 0"
|
||||
];
|
||||
if(isset($filterMap[$filter])) $where.= " AND ".$filterMap[$filter];
|
||||
|
||||
$total = $database->query("SELECT COUNT(*) c FROM ".TB_PREFIX."mdata WHERE $where")->fetch_assoc()['c'];
|
||||
$msgs = $database->query("SELECT * FROM ".TB_PREFIX."mdata WHERE $where ORDER BY time DESC LIMIT $offset,$limit")->fetch_all(MYSQLI_ASSOC);
|
||||
?>
|
||||
<link href="../<?php echo GP_LOCATE; ?>lang/en/lang.css?f4b7d" rel="stylesheet" type="text/css">
|
||||
<link href="../<?php echo GP_LOCATE; ?>lang/en/compact.css?f4b7i" rel="stylesheet" type="text/css">
|
||||
<link href="../<?php echo GP_LOCATE; ?>travian.css?e21d2" rel="stylesheet" type="text/css">
|
||||
<link href="../<?php echo GP_LOCATE; ?>lang/en/lang.css?e21d2" rel="stylesheet" type="text/css">
|
||||
<style>
|
||||
.msg-wrap{max-width:1100px;margin:20px auto;font-family:Verdana}
|
||||
.msg-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:12px;flex-wrap:wrap;gap:8px}
|
||||
.msg-head h1{margin:0;font-size:18px;display:flex;align-items:center;gap:8px}
|
||||
.msg-head svg{width:22px;height:22px}
|
||||
.filters{display:flex;gap:6px}
|
||||
.filters a{padding:6px 10px;border:1px solid #ddd;background:#f7f7f7;border-radius:4px;font-size:12px;text-decoration:none;color:#333}
|
||||
.filters a.active{background:#333;color:#fff;border-color:#333}
|
||||
.search-box input{padding:6px 8px;border:1px solid #ccc;border-radius:4px;font-size:12px;width:200px}
|
||||
.msg-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(340px,1fr));gap:10px}
|
||||
.msg-card{background:#fff;border:1px solid #ddd;border-radius:6px;padding:10px;font-size:12px;box-shadow:0 1px 2px rgba(0,0,0,.04);transition:.15s;border-left:4px solid #ccc}
|
||||
.msg-card:hover{transform:translateY(-1px);box-shadow:0 2px 6px rgba(0,0,0,.1)}
|
||||
.msg-card.system{border-left-color:#9b59b6}
|
||||
.msg-card.player{border-left-color:#3498db}
|
||||
.msg-top{display:flex;justify-content:space-between;margin-bottom:6px}
|
||||
.msg-from{font-weight:bold;color:#222}
|
||||
.msg-time{color:#888;font-size:11px}
|
||||
.msg-topic{color:#333;margin:4px 0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
|
||||
.msg-preview{color:#666;font-size:11px;max-height:32px;overflow:hidden}
|
||||
.msg-foot{display:flex;justify-content:space-between;margin-top:8px;font-size:11px;color:#999}
|
||||
.pagination{margin-top:14px;text-align:center}
|
||||
.pagination a{padding:5px 9px;margin:0 2px;border:1px solid #ddd;text-decoration:none;color:#333;font-size:12px;border-radius:3px}
|
||||
.pagination a.active{background:#333;color:#fff}
|
||||
</style>
|
||||
|
||||
<div class="msg-wrap">
|
||||
<div class="msg-head">
|
||||
<h1>
|
||||
<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M4 5h16a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H7l-3 3v-3H4a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1z" fill="#3498db"/></svg>
|
||||
Players Messages (<?php echo number_format($total);?>)
|
||||
</h1>
|
||||
<div class="filters">
|
||||
<?php foreach(['all'=>'All','inbox'=>'Inbox','sent'=>'Sent','system'=>'System'] as $k=>$v){?>
|
||||
<a href="?p=msg&f=<?php echo $k;?>&q=<?php echo urlencode($search);?>" class="<?php echo $filter==$k?'active':'';?>"><?php echo $v;?></a>
|
||||
<?php }?>
|
||||
</div>
|
||||
<form class="search-box" method="get">
|
||||
<input type="hidden" name="p" value="msg">
|
||||
<input type="hidden" name="f" value="<?php echo $filter;?>">
|
||||
<input type="text" name="q" placeholder="Search..." value="<?php echo htmlspecialchars($search);?>">
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<br />
|
||||
<div class="msg-grid">
|
||||
<?php foreach($msgs as $m){
|
||||
$from = $m['owner']? $database->getUserField($m['owner'],'username',0) : 'System';
|
||||
$to = $m['target']? $database->getUserField($m['target'],'username',0) : '-';
|
||||
$time = date('d.m H:i',$m['time']);
|
||||
$preview = strip_tags($m['message']);
|
||||
$preview = mb_substr($preview,0,90);
|
||||
$cls = $m['owner']==0? 'system' : 'player';
|
||||
?>
|
||||
<a href="?p=msg&nid=<?php echo $m['id'];?>" style="text-decoration:none;color:inherit">
|
||||
<div class="msg-card <?php echo $cls;?>">
|
||||
<div class="msg-top">
|
||||
<span class="msg-from"><?php echo htmlspecialchars($from);?> → <?php echo htmlspecialchars($to);?></span>
|
||||
<span class="msg-time"><?php echo $time;?></span>
|
||||
</div>
|
||||
<div class="msg-topic"><?php echo htmlspecialchars($m['topic']?: '(no subject)');?></div>
|
||||
<div class="msg-preview"><?php echo htmlspecialchars($preview);?>...</div>
|
||||
<div class="msg-foot">
|
||||
<span>#<?php echo $m['id'];?></span>
|
||||
<span>view →</span>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
<?php }?>
|
||||
</div>
|
||||
|
||||
<span class="b">Sent to</span>: <?php echo $database->getUserField($msg[0]['target'],'username',0);?>
|
||||
|
||||
<div style="padding: 43px 0 0;" id="content" class="messages">
|
||||
<h1>Message</h1>
|
||||
<div id="read_head" class="msg_head"></div>
|
||||
<div id="read_content" class="msg_content">
|
||||
<img src="../img/x.gif" id="label" class="read" alt="">
|
||||
<div id="heading">
|
||||
<div><?php echo $database->getUserField($msg[0]['owner'],'username',0);?></div>
|
||||
<div><?php echo $msg[0]['topic'];?></div>
|
||||
</div>
|
||||
<div id="time">
|
||||
<div><?php echo date('d.m.y',$msg[0]['time']);?></div>
|
||||
<div><?php echo date('H:i:s',$msg[0]['time']);?></div>
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
<div class="line"></div>
|
||||
<div class="message" style="min-height: 10px;">
|
||||
<?php
|
||||
$input = $msg[0]['message'];
|
||||
$alliance = $msg[0]['alliance'];
|
||||
$player = $msg[0]['player'];
|
||||
$coor = $msg[0]['coor'];
|
||||
$report = $msg[0]['report'];
|
||||
include("../GameEngine/BBCode.php");
|
||||
echo stripslashes(nl2br($bbcoded));
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div id="read_foot" class="msg_foot"></div>
|
||||
</div><?php
|
||||
}
|
||||
else echo "Message ID ".$nid." doesn't exist!";
|
||||
?>
|
||||
<?php if($total > $limit){ $pages = ceil($total/$limit);?>
|
||||
<div class="pagination">
|
||||
<?php for($p=1;$p<=$pages && $p<=15;$p++){?>
|
||||
<a href="?p=msg&page=<?php echo $p;?>&f=<?php echo $filter;?>&q=<?php echo urlencode($search);?>" class="<?php echo $p==$page?'active':'';?>"><?php echo $p;?></a>
|
||||
<?php }?>
|
||||
</div>
|
||||
<?php }?>
|
||||
</div>
|
||||
@@ -1,41 +1,83 @@
|
||||
<table cellpadding="1" cellspacing="1" id="member">
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="10">Players Not Activated</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="on">#</td>
|
||||
<td class="on">ID</td>
|
||||
<td class="on">Username</td>
|
||||
<td class="on">Email</td>
|
||||
<td class="on">Tribe</td>
|
||||
<td class="on">Activation Code</td>
|
||||
<td class="on">Act 2??</td>
|
||||
<td class="on">Time</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
$sql = "SELECT * FROM ".TB_PREFIX."activate";
|
||||
$result = mysqli_query($GLOBALS["link"], $sql);
|
||||
while($row = mysqli_fetch_assoc($result))
|
||||
{
|
||||
$i++;
|
||||
if($row['tribe'] == 1) {$tribe = "Roman"; }
|
||||
elseif($row['tribe'] == 2) {$tribe = "Teuton"; }
|
||||
elseif($row['tribe'] == 3) {$tribe = "Gaul"; }
|
||||
echo "
|
||||
<tr>
|
||||
<td>".$i."</td>
|
||||
<td>".$row['id']."</td>
|
||||
<td>".$row['username']."</td>
|
||||
<td><a href=\"mailto:".$row['email']."\">".$row['email']."</a></td>
|
||||
<td>".$tribe."</td>
|
||||
<td>".$row['act']."</td>
|
||||
<td>".$row['act2']."</td>
|
||||
<td class=\"hab\">".date('d:m:Y H:i', $row['timestamp'])."</td>
|
||||
</tr>";
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php
|
||||
if(!isset($_SESSION)) session_start();
|
||||
if($_SESSION['access'] < ADMIN) die("Access Denied");
|
||||
?>
|
||||
<style>
|
||||
.notreg-wrap{max-width:980px;margin:12px auto;font-family:Tahoma,Verdana,Arial,sans-serif}
|
||||
.notreg-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:8px}
|
||||
.notreg-head h2{margin:0;font-size:16px;color:#c0392b;display:flex;align-items:center;gap:6px}
|
||||
.notreg-search input{padding:4px 8px;border:1px solid #bbb;border-radius:14px;font-size:11px;width:180px}
|
||||
.notreg-card{background:#fff;border:1px solid #bbb;border-radius:6px;overflow:hidden}
|
||||
.notreg-table{width:100%;border-collapse:collapse;font-size:11px}
|
||||
.notreg-table th{background:#3a4f63;color:#fff;padding:6px 5px;text-align:left;font-weight:bold;font-size:10px;white-space:nowrap;cursor:pointer}
|
||||
.notreg-table td{padding:5px;border-bottom:1px solid #eee;vertical-align:middle}
|
||||
.notreg-table tr:hover{background:#fff5f5}
|
||||
.notreg-table a{color:#004a9f;text-decoration:none}
|
||||
.notreg-table a:hover{text-decoration:underline}
|
||||
.badge-tribe{padding:2px 5px;border-radius:3px;color:#fff;font-size:10px;font-weight:bold}
|
||||
.tribe-1{background:#c0392b} .tribe-2{background:#2c3e50} .tribe-3{background:#27ae60}
|
||||
.code{font-family:monospace;background:#f4f4f4;padding:1px 4px;border-radius:2px;font-size:10px}
|
||||
.time{color:#666;font-size:10px}
|
||||
</style>
|
||||
|
||||
<div class="notreg-wrap">
|
||||
<div class="notreg-head">
|
||||
<h2>✉️ Players Not Activated</h2>
|
||||
<div class="notreg-search"><input type="text" id="notregSearch" placeholder="Caută username sau email..."></div>
|
||||
</div>
|
||||
|
||||
<div class="notreg-card">
|
||||
<table class="notreg-table" id="notregTable">
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="30">#</th>
|
||||
<th width="40">ID</th>
|
||||
<th>Username</th>
|
||||
<th>Email</th>
|
||||
<th width="70">Tribe</th>
|
||||
<th>Activation Code</th>
|
||||
<th width="60">Act2</th>
|
||||
<th width="110">Time</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
$sql = "SELECT * FROM ".TB_PREFIX."activate ORDER BY timestamp DESC";
|
||||
$result = mysqli_query($GLOBALS["link"], $sql);
|
||||
$i = 0;
|
||||
while($row = mysqli_fetch_assoc($result)) {
|
||||
$i++;
|
||||
$tribe = $row['tribe']==1?'Roman':($row['tribe']==2?'Teuton':'Gaul');
|
||||
$tclass = 'tribe-'.$row['tribe'];
|
||||
$time = date('d.m.Y H:i', $row['timestamp']);
|
||||
echo "<tr>
|
||||
<td>{$i}</td>
|
||||
<td>{$row['id']}</td>
|
||||
<td><b>".htmlspecialchars($row['username'])."</b></td>
|
||||
<td><a href=\"mailto:{$row['email']}\">{$row['email']}</a></td>
|
||||
<td><span class='badge-tribe {$tclass}'>{$tribe}</span></td>
|
||||
<td><span class='code'>{$row['act']}</span></td>
|
||||
<td>{$row['act2']}</td>
|
||||
<td class='time'>{$time}</td>
|
||||
</tr>";
|
||||
}
|
||||
if($i==0) echo "<tr><td colspan='8' style='text-align:center;padding:20px;color:#777'>Niciun jucător neactivat</td></tr>";
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
(function(){
|
||||
const search = document.getElementById('notregSearch');
|
||||
const rows = document.querySelectorAll('#notregTable tbody tr');
|
||||
search.onkeyup = function(){
|
||||
const q = this.value.toLowerCase();
|
||||
rows.forEach(r=>{
|
||||
const txt = r.innerText.toLowerCase();
|
||||
r.style.display = txt.includes(q) ? '' : 'none';
|
||||
});
|
||||
};
|
||||
})();
|
||||
</script>
|
||||
+69
-57
@@ -1,67 +1,79 @@
|
||||
<?php
|
||||
#################################################################################
|
||||
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
|
||||
## --------------------------------------------------------------------------- ##
|
||||
## Filename online.tpl ##
|
||||
## Developed by: Dzoki ##
|
||||
## License: TravianZ Project ##
|
||||
## Copyright: TravianZ (c) 2010-2025. All rights reserved. ##
|
||||
## ##
|
||||
## online.tpl - REDESIGN 2025 ##
|
||||
#################################################################################
|
||||
?>
|
||||
<?php
|
||||
if($_SESSION['access'] < MULTIHUNTER) die("Access Denied!");
|
||||
$active = $admin->getUserActive();
|
||||
$count = count($active);
|
||||
|
||||
$tribeName = [1=>'Roman',2=>'Teuton',3=>'Gaul'];
|
||||
$tribeColor = [1=>'#c0392b',2=>'#2980b9',3=>'#27ae60'];
|
||||
$tribeImg = [1=>'',2=>'1',3=>'2'];
|
||||
?>
|
||||
<style>
|
||||
.del {width:12px; height:12px; background-image: url(img/admin/icon/del.gif);}
|
||||
.online-wrap{max-width:1100px;margin:20px auto;font-family:Verdana}
|
||||
.online-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:12px}
|
||||
.online-head h1{margin:0;font-size:18px}
|
||||
.online-head.count{background:#27ae60;color:#fff;padding:4px 8px;border-radius:12px;font-size:12px;font-weight:bold}
|
||||
.online-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:10px}
|
||||
.user-online{background:#fff;border:1px solid #ddd;border-left:4px solid #ccc;border-radius:6px;padding:10px;box-shadow:0 1px 2px rgba(0,0,0,.05);transition:.15s}
|
||||
.user-online:hover{transform:translateY(-2px);box-shadow:0 3px 8px rgba(0,0,0,.08)}
|
||||
.user-online.roman{border-left-color:#c0392b}
|
||||
.user-online.teuton{border-left-color:#2980b9}
|
||||
.user-online.gaul{border-left-color:#27ae60}
|
||||
.uo-top{display:flex;justify-content:space-between;align-items:center;margin-bottom:6px}
|
||||
.uo-name{font-weight:bold;font-size:13px}
|
||||
.uo-name a{color:#222;text-decoration:none}
|
||||
.uo-name a:hover{text-decoration:underline}
|
||||
.uo-access{font-size:10px;color:#999;margin-left:4px}
|
||||
.uo-time{font-size:11px;color:#666}
|
||||
.uo-stats{display:flex;gap:12px;margin-top:6px;font-size:11px;color:#555;flex-wrap:wrap}
|
||||
.uo-stat{display:flex;align-items:center;gap:3px}
|
||||
.uo-gold{margin-left:auto;font-weight:bold;color:#b8860b}
|
||||
.empty-box{background:#fff;border:1px dashed #ccc;border-radius:6px;padding:40px;text-align:center;color:#999}
|
||||
</style>
|
||||
|
||||
<table id="member">
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="6">Online users (<?php echo count($active);?>)</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tr>
|
||||
<td>Name [access]</td>
|
||||
<td>Time</td>
|
||||
<td>Tribe</td>
|
||||
<td>Pop</td>
|
||||
<td>Villages</td>
|
||||
<td>Gold</td>
|
||||
</tr>
|
||||
<?php
|
||||
if($active){
|
||||
for ($i = 0; $i <= count($active)-1; $i++) {
|
||||
$uid = $database->getUserField($active[$i]['username'],'id',1);
|
||||
$varray = $database->getProfileVillages($uid);
|
||||
$totalpop = 0;
|
||||
foreach($varray as $vil) {
|
||||
$totalpop += $vil['pop'];
|
||||
}
|
||||
if($active[$i]['tribe'] == 1){
|
||||
$tribe = "Roman";
|
||||
} else if($active[$i]['tribe'] == 2){
|
||||
$tribe = "Teuton";
|
||||
} else if($active[$i]['tribe'] == 3){
|
||||
$tribe = "Gaul";
|
||||
}
|
||||
echo '
|
||||
<tr>
|
||||
<td><a href="?p=player&uid='.$uid.'">'.$active[$i]['username'].' ['.$active[$i]['access'].']</a></td>
|
||||
<td>'.date("d.m.y H:i:s",$active[$i]['timestamp']).'</td>
|
||||
<td>'.$tribe.'</td>
|
||||
<td>'.$totalpop.'</td>
|
||||
<td>'.count($varray).'</td>
|
||||
<td><img src="../img/admin/gold.gif" class="gold" alt="Gold" title="This user has: '.$active[$i]['gold'].' gold"/> '.$active[$i]['gold'].'</td>
|
||||
</tr>
|
||||
';
|
||||
}
|
||||
}else{
|
||||
echo '<tr><td colspan="6" class="hab">No online users</td></tr>';
|
||||
<div class="online-wrap">
|
||||
<div class="online-head">
|
||||
<h1>🟢 Online Users</h1>
|
||||
<div class="count"><?php echo $count;?> now</div>
|
||||
</div>
|
||||
|
||||
}
|
||||
<?php if(!$active){?>
|
||||
<div class="empty-box">No online users in last 5 minutes</div>
|
||||
<?php } else {?>
|
||||
<div class="online-grid">
|
||||
<?php foreach($active as $u){
|
||||
$uid = $database->getUserField($u['username'],'id',1);
|
||||
$varray = $database->getProfileVillages($uid);
|
||||
$totalpop = 0; foreach($varray as $v) $totalpop += $v['pop'];
|
||||
$tribe = (int)$u['tribe'];
|
||||
$class = strtolower($tribeName[$tribe]?? 'roman');
|
||||
$last = time() - $u['timestamp'];
|
||||
$mins = floor($last/60);
|
||||
?>
|
||||
<div class="user-online <?php echo $class;?>">
|
||||
<div class="uo-top">
|
||||
<div class="uo-name">
|
||||
<a href="?p=player&uid=<?php echo $uid;?>"><?php echo htmlspecialchars($u['username']);?></a>
|
||||
<span class="uo-access">[<?php echo $u['access'];?>]</span>
|
||||
</div>
|
||||
<img src="../gpack/travian_default/img/u/<?php echo $tribeImg[$tribe];?>9.gif" title="<?php echo $tribeName[$tribe];?>" width="16">
|
||||
</div>
|
||||
<div class="uo-time">Last action: <?php echo $mins<1? 'just now' : $mins.' min ago';?> — <?php echo date("H:i:s",$u['timestamp']);?></div>
|
||||
<div class="uo-stats">
|
||||
<span class="uo-stat">👥 <?php echo number_format($totalpop);?></span>
|
||||
<span class="uo-stat">🏘 <?php echo count($varray);?></span>
|
||||
<span class="uo-stat">⚔️ <?php echo $tribeName[$tribe];?></span>
|
||||
<span class="uo-gold"><img src="../img/admin/gold.gif" style="vertical-align:-2px"> <?php echo $u['gold'];?></span>
|
||||
</div>
|
||||
</div>
|
||||
<?php }?>
|
||||
</div>
|
||||
<?php }?>
|
||||
</div>
|
||||
|
||||
?>
|
||||
|
||||
</table>
|
||||
<script>
|
||||
// auto-refresh la 30 secunde
|
||||
setTimeout(()=>location.reload(), 30000);
|
||||
</script>
|
||||
+120
-45
@@ -1,60 +1,135 @@
|
||||
<?php
|
||||
|
||||
#################################################################################
|
||||
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
|
||||
## --------------------------------------------------------------------------- ##
|
||||
## Filename report.tpl ##
|
||||
## Developed by: Armando ##
|
||||
## Filename report.tpl ##
|
||||
## Developed by: Dzoki ##
|
||||
## License: TravianZ Project ##
|
||||
## Copyright: TravianZ (c) 2010-2025. All rights reserved. ##
|
||||
## ##
|
||||
## Enhanced: aggenkeech ##
|
||||
## Refactored by: Shadow ##
|
||||
#################################################################################
|
||||
|
||||
if($_SESSION['access'] < MULTIHUNTER) die("Access Denied!");
|
||||
include_once("../GameEngine/Generator.php");
|
||||
include_once("../GameEngine/Technology.php");
|
||||
include_once("../GameEngine/Message.php");
|
||||
|
||||
$rep = null;
|
||||
$rep1 = [];
|
||||
$bid = isset($_GET['bid']) ? (int) $_GET['bid'] : 0;
|
||||
$bid = isset($_GET['bid'])? (int)$_GET['bid'] : 0;
|
||||
$search = isset($_GET['q'])? $database->escape($_GET['q']) : '';
|
||||
$filter = isset($_GET['f'])? $_GET['f'] : 'all';
|
||||
$page = max(1, (int)($_GET['page']?? 1));
|
||||
$limit = 50;
|
||||
$offset = ($page-1)*$limit;
|
||||
|
||||
if ($bid > 0) {
|
||||
$rep = $database->getNotice2($bid);
|
||||
}
|
||||
else
|
||||
{
|
||||
$sql = "SELECT * FROM " . TB_PREFIX . "ndata ORDER BY time DESC ";
|
||||
$result = mysqli_query($GLOBALS["link"], $sql);
|
||||
$rep1 = $database->mysqli_fetch_all($result);
|
||||
}
|
||||
|
||||
if(!empty($rep1))
|
||||
{
|
||||
?>
|
||||
<link href="../<?php echo GP_LOCATE; ?>lang/en/lang.css?f4b7d" rel="stylesheet" type="text/css">
|
||||
<link href="../<?php echo GP_LOCATE; ?>lang/en/compact.css?f4b7i" rel="stylesheet" type="text/css">
|
||||
<link href="../<?php echo GP_LOCATE; ?>travian.css?e21d2" rel="stylesheet" type="text/css">
|
||||
<h1>Players Report</h1>
|
||||
<div id="content" class="reports" style="padding: 0;">
|
||||
<?php
|
||||
include("Notice/all.tpl");
|
||||
?>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
elseif(!empty($rep))
|
||||
{
|
||||
?>
|
||||
<link href="../<?php echo GP_LOCATE; ?>lang/en/lang.css?f4b7d" rel="stylesheet" type="text/css">
|
||||
<link href="../<?php echo GP_LOCATE; ?>lang/en/compact.css?f4b7i" rel="stylesheet" type="text/css">
|
||||
<link href="../<?php echo GP_LOCATE; ?>travian.css?e21d2" rel="stylesheet" type="text/css">
|
||||
<br />
|
||||
<span class="b" style="padding: 0 4px 0;">Report of</span>: <?php echo $database->getUserField($rep['uid'], 'username', 0); ?><br />
|
||||
<div style="padding: 43px 4px 0;" id="content" class="reports">
|
||||
<h1>Report</h1>
|
||||
<?php
|
||||
// ---- SINGLE REPORT - PĂSTRĂM VIZUALIZAREA CLASICĂ ----
|
||||
if($bid > 0){
|
||||
$rep = $database->getNotice2($bid);
|
||||
if(!$rep) die("Report ID $bid doesn't exist!");
|
||||
$isAdmin = true;
|
||||
$message = new Message();
|
||||
$message->readingNotice = $rep;
|
||||
include ("../Templates/Notice/".$message->getReportType($rep['ntype']).".tpl");
|
||||
$message = new Message();
|
||||
$message->readingNotice = $rep;
|
||||
?>
|
||||
<link href="../<?php echo GP_LOCATE;?>lang/en/lang.css?f4b7d" rel="stylesheet" type="text/css">
|
||||
<link href="../<?php echo GP_LOCATE;?>lang/en/compact.css?f4b7i" rel="stylesheet" type="text/css">
|
||||
<link href="../<?php echo GP_LOCATE;?>travian.css?e21d2" rel="stylesheet" type="text/css">
|
||||
<div style="max-width:900px;margin:20px auto">
|
||||
<a href="?p=report" style="font-size:12px">← Back to reports</a>
|
||||
<div id="content" class="reports" style="margin-top:10px">
|
||||
<h1>Report</h1>
|
||||
<?php include("../Templates/Notice/".$message->getReportType($rep['ntype']).".tpl");?>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
return;
|
||||
}
|
||||
else echo "Report ID ".$bid." doesn't exist!";
|
||||
|
||||
// ---- LISTA RAPOARTE CU FILTRE ----
|
||||
$where = "1";
|
||||
if($search) $where.= " AND (n1 LIKE '%$search%' OR n2 LIKE '%$search%')";
|
||||
|
||||
$filterMap = [
|
||||
'attacks' => "ntype IN (2,9)", // attack + artefact attack
|
||||
'defences' => "ntype IN (3)",
|
||||
'scouts' => "ntype IN (4,14)",
|
||||
'trades' => "ntype IN (5)"
|
||||
];
|
||||
if(isset($filterMap[$filter])) $where.= " AND ".$filterMap[$filter];
|
||||
|
||||
$total = $database->query("SELECT COUNT(*) c FROM ".TB_PREFIX."ndata WHERE $where")->fetch_assoc()['c'];
|
||||
$reps = $database->query("SELECT * FROM ".TB_PREFIX."ndata WHERE $where ORDER BY time DESC LIMIT $offset,$limit")->fetch_all(MYSQLI_ASSOC);
|
||||
|
||||
$typeNames = [1=>'reinforcement',2=>'attack',3=>'defence',4=>'scout',5=>'trade',6=>'wonder',7=>'settlement',8=>'oasis',9=>'artefact',10=>'adventure',14=>'spy'];
|
||||
?>
|
||||
<style>
|
||||
.reports-wrap{max-width:1100px;margin:20px auto;font-family:Verdana}
|
||||
.reports-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:12px;flex-wrap:wrap;gap:8px}
|
||||
.reports-head h1{margin:0;font-size:18px}
|
||||
.filters{display:flex;gap:6px}
|
||||
.filters a{padding:6px 10px;border:1px solid #ddd;background:#f7f7f7;border-radius:4px;font-size:12px;text-decoration:none;color:#333}
|
||||
.filters a.active{background:#333;color:#fff;border-color:#333}
|
||||
.search-box input{padding:6px 8px;border:1px solid #ccc;border-radius:4px;font-size:12px;width:200px}
|
||||
.reports-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(320px,1fr));gap:10px}
|
||||
.rep-card{background:#fff;border:1px solid #ddd;border-radius:6px;padding:10px;font-size:12px;box-shadow:0 1px 2px rgba(0,0,0,.04);transition:.15s}
|
||||
.rep-card:hover{box-shadow:0 2px 6px rgba(0,0,0,.1);transform:translateY(-1px)}
|
||||
.rep-top{display:flex;justify-content:space-between;margin-bottom:6px}
|
||||
.rep-id{font-weight:bold;color:#333}
|
||||
.rep-time{color:#888;font-size:11px}
|
||||
.rep-body{color:#444;line-height:1.4;max-height:38px;overflow:hidden}
|
||||
.rep-foot{display:flex;justify-content:space-between;margin-top:8px;font-size:11px}
|
||||
.badge{padding:2px 6px;border-radius:3px;background:#eee;font-size:10px;text-transform:uppercase}
|
||||
.badge.attack{background:#ffe0e0;color:#c00}.badge.defence{background:#e0f0ff;color:#06c}
|
||||
.badge.scout{background:#fff4e0;color:#e67e22}.badge.trade{background:#e8f5e9;color:#2e7d32}
|
||||
.pagination{margin-top:14px;text-align:center}
|
||||
.pagination a{padding:5px 9px;margin:0 2px;border:1px solid #ddd;text-decoration:none;color:#333;font-size:12px;border-radius:3px}
|
||||
.pagination a.active{background:#333;color:#fff}
|
||||
</style>
|
||||
|
||||
<div class="reports-wrap">
|
||||
<div class="reports-head">
|
||||
<h1>📜 Players Reports (<?php echo number_format($total);?>)</h1>
|
||||
<div class="filters">
|
||||
<?php foreach(['all'=>'All','attacks'=>'Attacks','defences'=>'Defences','scouts'=>'Scouts','trades'=>'Trades'] as $k=>$v){?>
|
||||
<a href="?p=report&f=<?php echo $k;?>&q=<?php echo urlencode($search);?>" class="<?php echo $filter==$k?'active':'';?>"><?php echo $v;?></a>
|
||||
<?php }?>
|
||||
</div>
|
||||
<form class="search-box" method="get">
|
||||
<input type="hidden" name="p" value="report">
|
||||
<input type="hidden" name="f" value="<?php echo $filter;?>">
|
||||
<input type="text" name="q" placeholder="Search..." value="<?php echo htmlspecialchars($search);?>">
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="reports-grid">
|
||||
<?php foreach($reps as $r){
|
||||
$type = $typeNames[$r['ntype']]?? 'report';
|
||||
$user = $database->getUserField($r['uid'],'username',0);
|
||||
$time = date('d.m H:i',$r['time']);
|
||||
$preview = strip_tags($r['topic']?? $r['n1'].' '.$r['n2']);
|
||||
$preview = mb_substr($preview,0,80);
|
||||
?>
|
||||
<a href="?p=report&bid=<?php echo $r['id'];?>" style="text-decoration:none;color:inherit">
|
||||
<div class="rep-card">
|
||||
<div class="rep-top">
|
||||
<span class="rep-id">#<?php echo $r['id'];?> — <?php echo htmlspecialchars($user);?></span>
|
||||
<span class="rep-time"><?php echo $time;?></span>
|
||||
</div>
|
||||
<div class="rep-body"><?php echo htmlspecialchars($preview);?>...</div>
|
||||
<div class="rep-foot">
|
||||
<span class="badge <?php echo $type;?>"><?php echo $type;?></span>
|
||||
<span style="color:#666">view →</span>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
<?php }?>
|
||||
</div>
|
||||
|
||||
<?php if($total > $limit){ $pages = ceil($total/$limit);?>
|
||||
<div class="pagination">
|
||||
<?php for($p=1;$p<=$pages && $p<=15;$p++){?>
|
||||
<a href="?p=report&page=<?php echo $p;?>&f=<?php echo $filter;?>&q=<?php echo urlencode($search);?>" class="<?php echo $p==$page?'active':'';?>"><?php echo $p;?></a>
|
||||
<?php }?>
|
||||
</div>
|
||||
<?php }?>
|
||||
</div>
|
||||
+77
-47
@@ -1,53 +1,83 @@
|
||||
<?php
|
||||
#################################################################################
|
||||
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
|
||||
## --------------------------------------------------------------------------- ##
|
||||
## Filename search.tpl ##
|
||||
## Developed by: Dzoki ##
|
||||
## Reworked: aggenkeech ##
|
||||
## License: TravianZ Project ##
|
||||
## Copyright: TravianZ (c) 2010-2025. All rights reserved. ##
|
||||
## ##
|
||||
## search.tpl - REDESIGN 2025 ##
|
||||
#################################################################################
|
||||
if($_SESSION['access'] < MULTIHUNTER) die("Access Denied!");
|
||||
|
||||
$types = [
|
||||
'player' => ['Search Players','👤'],
|
||||
'alliances' => ['Search Alliances','🛡️'],
|
||||
'villages' => ['Search Villages','🏘️'],
|
||||
'email' => ['Search E-mails','✉️'],
|
||||
'ip' => ['Search IPs','🌐'],
|
||||
'deleted_players' => ['Search Deleted','🗑️']
|
||||
];
|
||||
$current = $_POST['p']?? 'player';
|
||||
$search = stripslashes($_POST['s']?? '');
|
||||
?>
|
||||
<form action="" method="post">
|
||||
<br />
|
||||
<table id="member">
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="3">Search v1.0</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tr class="slr3">
|
||||
<td>
|
||||
<select name="p" size="1" class="slr3">
|
||||
<option value="player" <?php if(isset($_POST['p']) && $_POST['p']=='player'){echo "selected";}?>>Search Players</option>
|
||||
<option value="alliances" <?php if(isset($_POST['p']) && $_POST['p']=='alliances'){echo "selected";}?>>Search Alliances</option>
|
||||
<option value="villages" <?php if(isset($_POST['p']) && $_POST['p']=='villages'){echo "selected";}?>>Search Villages</option>
|
||||
<option value="email" <?php if(isset($_POST['p']) && $_POST['p']=='email'){echo "selected";}?>>Search E-mails</option>
|
||||
<option value="ip" <?php if(isset($_POST['p']) && $_POST['p']=='ip'){echo "selected";}?>>Search IPs</option>
|
||||
<option value="deleted_players" <?php if(isset($_POST['p']) && $_POST['p']=='deleted_players'){echo "selected";}?>>Search Deleted Players</option>
|
||||
</select>
|
||||
</td>
|
||||
<td>
|
||||
<input name="s" value="<?php echo stripslashes((isset($_POST['p']) ? $_POST['s'] : ''));?>">
|
||||
</td>
|
||||
<td>
|
||||
<input type="submit" value="Search" class="slr3">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
<style>
|
||||
.search-wrap{max-width:900px;margin:20px auto;font-family:Verdana}
|
||||
.search-head{display:flex;align-items:center;gap:8px;margin-bottom:16px}
|
||||
.search-head svg{width:24px;height:24px}
|
||||
.search-head h2{margin:0;font-size:18px}
|
||||
.search-card{background:#fff;border:1px solid #ddd;border-radius:8px;padding:16px;box-shadow:0 1px 3px rgba(0,0,0,.05)}
|
||||
.search-form{display:flex;gap:8px;flex-wrap:wrap;align-items:center}
|
||||
.search-form select,.search-form input{padding:8px 10px;border:1px solid #ccc;border-radius:6px;font-size:13px}
|
||||
.search-form select{min-width:180px}
|
||||
.search-form input[type="text"]{flex:1;min-width:200px}
|
||||
.search-form input[type="submit"]{background:#333;color:#fff;border:0;padding:8px 16px;border-radius:6px;cursor:pointer;font-weight:bold}
|
||||
.search-form input[type="submit"]:hover{background:#000}
|
||||
.quick-types{display:grid;grid-template-columns:repeat(auto-fill,minmax(140px,1fr));gap:8px;margin-top:14px}
|
||||
.qtype{border:1px solid #eee;border-radius:6px;padding:10px;text-align:center;cursor:pointer;background:#fafafa;transition:.15s;font-size:12px}
|
||||
.qtype:hover{background:#f0f0f0;transform:translateY(-1px)}
|
||||
.qtype.active{background:#333;color:#fff;border-color:#333}
|
||||
.qtype span{display:block;font-size:18px;margin-bottom:4px}
|
||||
.msg-box{margin-top:20px;padding:12px;background:#e8f5e9;border:1px solid #c8e6c9;border-radius:6px;text-align:center;color:#2e7d32;font-weight:bold}
|
||||
</style>
|
||||
|
||||
<?php
|
||||
if(!empty($_GET['msg']))
|
||||
{
|
||||
echo '<div style="margin-top: 50px;" class="b"><center>';
|
||||
if($_GET['msg'] == 'ursdel')
|
||||
{
|
||||
echo "User was deleted.";
|
||||
<div class="search-wrap">
|
||||
<div class="search-head">
|
||||
<!-- ICON INLINE -->
|
||||
<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<circle cx="11" cy="11" r="7" stroke="#555" stroke-width="2"/>
|
||||
<path d="M20 20l-3.5-3.5" stroke="#555" stroke-width="2" stroke-linecap="round"/>
|
||||
</svg>
|
||||
<h2>Admin Search</h2>
|
||||
</div>
|
||||
|
||||
}
|
||||
echo '</center></div>';
|
||||
}
|
||||
?>
|
||||
<div class="search-card">
|
||||
<form action="" method="post" class="search-form" id="searchForm">
|
||||
<select name="p" id="searchType">
|
||||
<?php foreach($types as $k=>$v){?>
|
||||
<option value="<?php echo $k;?>" <?php echo $current==$k?'selected':'';?>><?php echo $v[1].' '.$v[0];?></option>
|
||||
<?php }?>
|
||||
</select>
|
||||
<input type="text" name="s" placeholder="Enter name, ID, email or IP..." value="<?php echo htmlspecialchars($search);?>" autofocus>
|
||||
<input type="submit" value="Search">
|
||||
</form>
|
||||
|
||||
<div class="quick-types">
|
||||
<?php foreach($types as $k=>$v){?>
|
||||
<div class="qtype <?php echo $current==$k?'active':'';?>" onclick="setType('<?php echo $k;?>')">
|
||||
<span><?php echo $v[1];?></span>
|
||||
<?php echo str_replace('Search ','',$v[0]);?>
|
||||
</div>
|
||||
<?php }?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php if(!empty($_GET['msg'])){?>
|
||||
<div class="msg-box">
|
||||
<?php echo $_GET['msg']=='ursdel'? '✓ User was deleted successfully.' : htmlspecialchars($_GET['msg']);?>
|
||||
</div>
|
||||
<?php }?>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function setType(t){
|
||||
document.getElementById('searchType').value = t;
|
||||
document.getElementById('searchForm').querySelector('input[name="s"]').focus();
|
||||
document.querySelectorAll('.qtype').forEach(el=>el.classList.remove('active'));
|
||||
event.currentTarget.classList.add('active');
|
||||
}
|
||||
</script>
|
||||
+100
-166
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
#################################################################################
|
||||
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
|
||||
## --------------------------------------------------------------------------- ##
|
||||
@@ -7,186 +8,119 @@
|
||||
## License: TravianZ Project ##
|
||||
## Copyright: TravianZ (c) 2010-2025. All rights reserved. ##
|
||||
## Enhanced: aggenkeech ##
|
||||
## Improoved by: Shadow ##
|
||||
## Refactored by: Shadow ##
|
||||
#################################################################################
|
||||
|
||||
if($_SESSION['access'] < MULTIHUNTER) die("Access Denied!");
|
||||
|
||||
function formatNum($n) {
|
||||
$n = (int)$n;
|
||||
if ($n >= 1000000000) return round($n / 1000000000, 2).'B';
|
||||
if ($n >= 1000000) return round($n / 1000000, 2).'M';
|
||||
if ($n >= 1000) return round($n / 1000, 1).'K';
|
||||
return $n;
|
||||
}
|
||||
function q1($sql){ global $database; $r=$database->query($sql); return $r ? $r->fetch_assoc() : []; }
|
||||
|
||||
$tribe1 = mysqli_query($GLOBALS["link"], "SELECT * FROM ".TB_PREFIX."users WHERE tribe = 1");
|
||||
$tribe2 = mysqli_query($GLOBALS["link"], "SELECT * FROM ".TB_PREFIX."users WHERE tribe = 2");
|
||||
$tribe3 = mysqli_query($GLOBALS["link"], "SELECT * FROM ".TB_PREFIX."users WHERE tribe = 3");
|
||||
$tribes = Array(mysqli_num_rows($tribe1),mysqli_num_rows($tribe2),mysqli_num_rows($tribe3));
|
||||
$users = mysqli_num_rows(mysqli_query($GLOBALS["link"], "SELECT * FROM ".TB_PREFIX."users WHERE tribe > 0 AND tribe < 4"));
|
||||
// ---- DATE ----
|
||||
$users = (int)(q1("SELECT COUNT(*) c FROM ".TB_PREFIX."users WHERE tribe BETWEEN 1 AND 3")['c'] ?? 0);
|
||||
$active = (int)(q1("SELECT COUNT(*) c FROM ".TB_PREFIX."active")['c'] ?? 0);
|
||||
$online = (int)(q1("SELECT COUNT(*) c FROM ".TB_PREFIX."users WHERE timestamp > ".(time()-300)." AND tribe>0")['c'] ?? 0);
|
||||
$banned = (int)(q1("SELECT COUNT(*) c FROM ".TB_PREFIX."users WHERE access=0")['c'] ?? 0);
|
||||
$villages = (int)(q1("SELECT COUNT(*) c FROM ".TB_PREFIX."vdata")['c'] ?? 0);
|
||||
$pop = (int)(q1("SELECT SUM(pop) s FROM ".TB_PREFIX."vdata")['s'] ?? 0);
|
||||
|
||||
$tribes = [1=>0,2=>0,3=>0];
|
||||
for($t=1;$t<=3;$t++){ $tribes[$t] = (int)(q1("SELECT COUNT(*) c FROM ".TB_PREFIX."users WHERE tribe=$t")['c'] ?? 0); }
|
||||
|
||||
$gold = (int)(q1("SELECT SUM(gold) s FROM ".TB_PREFIX."users")['s'] ?? 0);
|
||||
|
||||
// ---- TRUPE ----
|
||||
$cells = ['SUM(hero) as hero'];
|
||||
for($i=1;$i<=50;$i++) $cells[] = "SUM(u$i) AS u$i";
|
||||
$uv = q1("SELECT ".implode(',',$cells)." FROM ".TB_PREFIX."units");
|
||||
$ue = q1("SELECT ".implode(',',$cells)." FROM ".TB_PREFIX."enforcement");
|
||||
?>
|
||||
<br /><br /><br /><br /><br />
|
||||
<table id="profile">
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="2">World Information</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Registered players</td>
|
||||
<td><?php echo $users; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Active players</td>
|
||||
<td><?php $result = mysqli_query($GLOBALS["link"], "SELECT * FROM ".TB_PREFIX."active"); $num_rows = mysqli_num_rows($result); echo $num_rows; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Players online</td>
|
||||
<td><?php $t =time();
|
||||
$result = mysqli_query($GLOBALS["link"], "SELECT * FROM ".TB_PREFIX."users WHERE timestamp > ".($t - 300)) or die(mysqli_error($database->dblink));
|
||||
$num_rows = mysqli_num_rows($result);
|
||||
echo $num_rows;?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Players Banned</td>
|
||||
<td><?php
|
||||
$result = mysqli_query($GLOBALS["link"], "SELECT * FROM ".TB_PREFIX."users WHERE access = 0");
|
||||
$num_rows = mysqli_num_rows($result);
|
||||
echo $num_rows; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Villages settled</td>
|
||||
<td><?php
|
||||
$result = mysqli_query($GLOBALS["link"], "SELECT Count(*) as Total FROM ".TB_PREFIX."vdata");
|
||||
$num_rows = mysqli_fetch_array($result, MYSQLI_ASSOC)['Total'];
|
||||
echo $num_rows;
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Total Population</td>
|
||||
<td><?php $pop = mysqli_query($database->dblink,"SELECT SUM(pop) AS sumofpop FROM ".TB_PREFIX."vdata"); $getpop = mysqli_fetch_assoc($pop); echo $getpop['sumofpop']; ?></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<style>
|
||||
.sinfo-wrap{max-width:1100px;margin:20px auto;font-family:Verdana}
|
||||
.sinfo-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin-bottom:18px}
|
||||
.scard{background:#fff;border:1px solid #ddd;border-radius:8px;padding:14px;box-shadow:0 1px 3px rgba(0,0,0,.05)}
|
||||
.scard h3{margin:0 0 8px;font-size:13px;color:#333;border-bottom:1px solid #eee;padding-bottom:6px}
|
||||
.scard .row{display:flex;justify-content:space-between;padding:4px 0;font-size:12px;border-bottom:1px dotted #f0f0f0}
|
||||
.scard .row:last-child{border:0}
|
||||
.scard .val{font-weight:bold}
|
||||
.tribe-bar{height:8px;background:#eee;border-radius:4px;overflow:hidden;margin:4px 0}
|
||||
.tribe-bar span{display:block;height:100%}
|
||||
.romans{background:#c0392b}.teutons{background:#2980b9}.gauls{background:#27ae60}
|
||||
.troops-wrap{background:#fff;border:1px solid #ddd;border-radius:8px;padding:14px}
|
||||
.troops-grid{display:grid;grid-template-columns:repeat(5,1fr);gap:10px}
|
||||
.tribe-box{border:1px solid #eee;border-radius:6px;padding:8px}
|
||||
.tribe-box h4{margin:0 0 6px;font-size:12px;text-align:center;color:#555}
|
||||
.unit{display:flex;align-items:center;justify-content:space-between;padding:3px 0;font-size:11px;border-bottom:1px dotted #f5f5f5}
|
||||
.unit img{width:16px;height:16px;margin-right:4px}
|
||||
.unit .cnt{font-weight:bold}
|
||||
@media(max-width:900px){.sinfo-grid{grid-template-columns:1fr}.troops-grid{grid-template-columns:repeat(2,1fr)}}
|
||||
</style>
|
||||
|
||||
<br />
|
||||
<div class="sinfo-wrap">
|
||||
|
||||
<table id="profile">
|
||||
<thead>
|
||||
<tr><th colspan="3">Player Information</th></tr>
|
||||
<td class="b">Tribe</td>
|
||||
<td class="b">Registered</td>
|
||||
<td class="b">Percent</td>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Romans</td>
|
||||
<td><?php echo $tribes[0]; ?></td>
|
||||
<td><?php echo ($users > 0) ? ($percents[0] = round(100 * ($tribes[0] / $users), 2))."%" : "---"; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Teutons</td>
|
||||
<td><?php echo $tribes[1]; ?></td>
|
||||
<td><?php echo ($users > 0) ? ($percents[1] = round(100 * ($tribes[1] / $users), 2))."%" : "---"; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Gauls</td>
|
||||
<td><?php echo $tribes[2]; ?></td>
|
||||
<td><?php echo ($users > 0) ? (100-$percents[0]-$percents[1])."%" : "---"; ?></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="sinfo-grid">
|
||||
<div class="scard">
|
||||
<h3>🌍 World Information</h3>
|
||||
<div class="row"><span>Registered players</span><span class="val"><?php echo number_format($users); ?></span></div>
|
||||
<div class="row"><span>Active players</span><span class="val"><?php echo $active; ?></span></div>
|
||||
<div class="row"><span>Players online</span><span class="val" style="color:#27ae60"><?php echo $online; ?></span></div>
|
||||
<div class="row"><span>Players banned</span><span class="val" style="color:#c0392b"><?php echo $banned; ?></span></div>
|
||||
<div class="row"><span>Villages settled</span><span class="val"><?php echo number_format($villages); ?></span></div>
|
||||
<div class="row"><span>Total population</span><span class="val"><?php echo number_format($pop); ?></span></div>
|
||||
</div>
|
||||
|
||||
<br />
|
||||
<div class="scard">
|
||||
<h3>👥 Player Distribution</h3>
|
||||
<?php $names=[1=>'Romans',2=>'Teutons',3=>'Gauls']; $colors=[1=>'romans',2=>'teutons',3=>'gauls'];
|
||||
foreach($names as $id=>$name){
|
||||
$pct = $users ? round($tribes[$id]/$users*100,1) : 0;
|
||||
echo "<div class='row'><span>$name</span><span class='val'>{$tribes[$id]} ($pct%)</span></div>";
|
||||
echo "<div class='tribe-bar'><span class='$colors[$id]' style='width:$pct%'></span></div>";
|
||||
} ?>
|
||||
</div>
|
||||
|
||||
<table id="profile">
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="3">Server Information</th>
|
||||
</tr>
|
||||
<td class="b"></td>
|
||||
<td class="b">Total</td>
|
||||
<td class="b">Average</td>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><img src="../<?php echo GP_LOCATE; ?>img/a/gold.gif" alt="Gold" title="Gold"> Gold</td>
|
||||
<td><?php $gold = mysqli_query($GLOBALS["link"], "SELECT SUM(gold) AS sumofgold FROM ".TB_PREFIX."users"); $getgold=mysqli_fetch_assoc($gold); echo $getgold['sumofgold']; ?></td>
|
||||
<td><?php $gold = mysqli_query($GLOBALS["link"], "SELECT SUM(gold) AS sumofgold FROM ".TB_PREFIX."users"); $getgold=mysqli_fetch_assoc($gold); echo round($getgold['sumofgold'] / $users);?></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="scard">
|
||||
<h3>💰 Server Economy</h3>
|
||||
<div class="row"><span><img src="../<?php echo GP_LOCATE; ?>img/a/gold.gif"> Total Gold</span><span class="val"><?php echo number_format($gold); ?></span></div>
|
||||
<div class="row"><span>Avg Gold/player</span><span class="val"><?php echo $users ? number_format($gold/$users,0) : 0; ?></span></div>
|
||||
<div class="row"><span>Server started</span><span class="val"><?php echo defined('START_DATE') ? date('d.m.Y', strtotime(START_DATE)) : '-'; ?></span></div>
|
||||
<div class="row"><span>Uptime</span><span class="val"><?php echo defined('START_DATE') ? floor((time()-strtotime(START_DATE))/86400).' days' : '-'; ?></span></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<table id="member">
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="10">Troops on the Server</th>
|
||||
</tr>
|
||||
<?php
|
||||
$cells = ['SUM(hero) as hero'];
|
||||
for($i=1; $i<51; $i++) {
|
||||
array_push($cells, 'SUM(u'.$i.') AS u'.$i);
|
||||
}
|
||||
<div class="troops-wrap">
|
||||
<h3 style="margin:0 0 10px;font-size:14px">⚔️ Troops on Server (villages + reinforcements)</h3>
|
||||
<div class="troops-grid">
|
||||
<?php
|
||||
$tribesUnits = [
|
||||
'Romans' => range(1,10),
|
||||
'Teutons' => range(11,20),
|
||||
'Gauls' => range(21,30),
|
||||
'Natars' => range(31,40),
|
||||
'Other' => range(41,50)
|
||||
];
|
||||
foreach($tribesUnits as $tribe=>$ids){
|
||||
echo "<div class='tribe-box'><h4>$tribe</h4>";
|
||||
$has=false;
|
||||
foreach($ids as $u){
|
||||
$total = (int)($uv["u$u"] ?? 0) + (int)($ue["u$u"] ?? 0);
|
||||
if($total>0){ $has=true;
|
||||
echo "<div class='unit'><span><img src='../".GP_LOCATE."img/u/$u.gif'> u$u</span><span class='cnt' title='$total'>".formatNum($total)."</span></div>";
|
||||
}
|
||||
}
|
||||
if(!$has) echo "<div class='unit'><span style='color:#999'>No troops</span></div>";
|
||||
echo "</div>";
|
||||
}
|
||||
$heroTotal = (int)($uv['hero'] ?? 0) + (int)($ue['hero'] ?? 0);
|
||||
echo "<div class='tribe-box'><h4>Heroes</h4><div class='unit'><span><img src='../".GP_LOCATE."img/u/hero.gif'> Hero</span><span class='cnt'>".formatNum($heroTotal)."</span></div></div>";
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
$units_villages = mysqli_fetch_assoc(mysqli_query($GLOBALS["link"], "SELECT ".implode(',', $cells)." FROM ".TB_PREFIX."units"));
|
||||
$units_enforcements = mysqli_fetch_assoc(mysqli_query($GLOBALS["link"], "SELECT ".implode(',', $cells)." FROM ".TB_PREFIX."enforcement"));
|
||||
|
||||
for($i=1; $i<11; $i++) {
|
||||
echo '<td class="on"><img src="../'.GP_LOCATE.'img/u/'.$i.'.gif"></td>';
|
||||
}
|
||||
|
||||
echo '</thead><tbody>';
|
||||
for($i=1; $i<11; $i++) {
|
||||
$total = ($units_villages['u'.$i] + $units_enforcements['u'.$i]);
|
||||
echo '<td class="on" title="'.$total.'">'.formatNum($total).'</td>';
|
||||
}
|
||||
|
||||
echo "</tr>";
|
||||
for($i=11; $i<21; $i++) {
|
||||
echo '<td class="on"><img src="../'.GP_LOCATE.'img/u/'.$i.'.gif"></td>';
|
||||
}
|
||||
|
||||
echo '</tr><tr>';
|
||||
for($i=11; $i<21; $i++) {
|
||||
$total = ($units_villages['u'.$i] + $units_enforcements['u'.$i]);
|
||||
echo '<td class="on" title="'.$total.'">'.formatNum($total).'</td>';
|
||||
}
|
||||
|
||||
echo "</tr>";
|
||||
for($i=21; $i<31; $i++) {
|
||||
echo '<td class="on"><img src="../'.GP_LOCATE.'img/u/'.$i.'.gif"></td>';
|
||||
}
|
||||
|
||||
echo '</tr><tr>';
|
||||
for($i=21; $i<31; $i++) {
|
||||
$total = ($units_villages['u'.$i] + $units_enforcements['u'.$i]);
|
||||
echo '<td class="on" title="'.$total.'">'.formatNum($total).'</td>';
|
||||
}
|
||||
|
||||
echo "</tr>";
|
||||
for($i=31; $i<41; $i++) {
|
||||
echo '<td class="on"><img src="../'.GP_LOCATE.'img/u/'.$i.'.gif"></td>';
|
||||
}
|
||||
|
||||
echo '</tr><tr>';
|
||||
for($i=31; $i<41; $i++) {
|
||||
$total = ($units_villages['u'.$i] + $units_enforcements['u'.$i]);
|
||||
echo '<td class="on" title="'.$total.'">'.formatNum($total).'</td>';
|
||||
}
|
||||
|
||||
echo "</tr>";
|
||||
for($i=41; $i<51; $i++) {
|
||||
echo '<td class="on"><img src="../'.GP_LOCATE.'img/u/'.$i.'.gif"></td>';
|
||||
}
|
||||
|
||||
echo '</tr><tr>';
|
||||
for($i=41; $i<51; $i++) {
|
||||
$total = ($units_villages['u'.$i] + $units_enforcements['u'.$i]);
|
||||
echo '<td class="on" title="'.$total.'">'.formatNum($total).'</td>';
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@@ -1,36 +1,70 @@
|
||||
<?php
|
||||
#################################################################################
|
||||
## Filename usergold.tpl ##
|
||||
## Developed by: aggenkeech ##
|
||||
## Refactored by: Shadow ##
|
||||
## usergold.tpl - REDESIGN 2025 ##
|
||||
#################################################################################
|
||||
if($_SESSION['access'] < ADMIN) die("Access Denied: You are not Admin!");
|
||||
$id = $_SESSION['id'];
|
||||
?>
|
||||
<form action="../GameEngine/Admin/Mods/gold_1.php" method="POST">
|
||||
<input type="hidden" name="admid" value="<?php echo $_SESSION['id']; ?>">
|
||||
<table id="member" style="width:300px;">
|
||||
<thead>
|
||||
<tr><th colspan="2">Give Free gold for specific user</th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><center><b>How much gold?</b></center></td>
|
||||
<td><center>
|
||||
<input class="give_gold" name="gold" value="20" maxlength="6">
|
||||
<img src="../img/admin/gold.gif" class="gold" alt="Gold" title="Gold"/>
|
||||
</center></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><center><b>For which user (id)?</b></center></td>
|
||||
<td><center><input class="give_gold" name="id" value=""></center></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2"><center>
|
||||
<input type="image" src="../img/admin/b/ok1.gif" value="submit" title="Give Player Free Gold">
|
||||
</center></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</form>
|
||||
<style>
|
||||
.usergold-wrap{max-width:600px;margin:30px auto;font-family:Verdana}
|
||||
.usergold-head{display:flex;align-items:center;gap:8px;margin-bottom:16px}
|
||||
.usergold-head svg{width:26px;height:26px}
|
||||
.usergold-head h2{margin:0;font-size:18px}
|
||||
.usergold-card{background:#fff;border:1px solid #ddd;border-radius:10px;padding:20px;box-shadow:0 2px 6px rgba(0,0,0,.06)}
|
||||
.usergold-card .top{display:flex;align-items:center;gap:12px;margin-bottom16px}
|
||||
.usergold-card .icon{background:linear-gradient(135deg,#3498db,#2c3e50);width:44px;height:44px;border-radius:50%;display:flex;align-items:center;justify-content:center}
|
||||
.usergold-card .icon svg{width:24px;height:24px;fill:#fff}
|
||||
.usergold-card h3{margin:0;font-size:15px}
|
||||
.usergold-card p{margin:2px 0 0;color:#666;font-size:12px}
|
||||
.usergold-form{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-top:14px}
|
||||
.usergold-form .field{display:flex;flex-direction:column;gap:4px}
|
||||
.usergold-form label{font-size:11px;color:#555;font-weight:bold}
|
||||
.usergold-form input{padding:9px 10px;border:1px solid #ccc;border-radius:6px;font-size:14px}
|
||||
.usergold-form input:focus{outline:none;border-color:#3498db;box-shadow:0 0 0 2px rgba(52,152,219,.2)}
|
||||
.usergold-form .full{grid-column:1/-1}
|
||||
.usergold-form button{grid-column:1/-1;background:#3498db;color:#fff;border:0;padding:10px;border-radius:6px;font-weight:bold;cursor:pointer;font-size:14px;display:flex;align-items:center;justify-content:center;gap:6px}
|
||||
.usergold-form button:hover{background:#2980b9}
|
||||
.usergold-success{margin-top:16px;padding:10px;background:#e8f4fd;border:1px solid #3498db;color:#1a5276;border-radius:6px;text-align:center;font-weight:bold}
|
||||
</style>
|
||||
|
||||
<?php if(isset($_GET['g'])){ echo '<br><br><font color="green"><b>Gold Added</b></font>'; } ?>
|
||||
<div class="usergold-wrap">
|
||||
<div class="usergold-head">
|
||||
<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="12" cy="8" r="4" fill="#3498db"/><path d="M4 20c0-4 4-6 8-6s8 2 8 6" fill="#2c3e50"/></svg>
|
||||
<h2>User Gold</h2>
|
||||
</div>
|
||||
|
||||
<div class="usergold-card">
|
||||
<div class="top">
|
||||
<div class="icon">
|
||||
<svg viewBox="0 0 24 24"><path d="M12 2l3 7h7l-5.5 4 2 7-6.5-4.5L5.5 20l2-7L2 9h7z"/></svg>
|
||||
</div>
|
||||
<div>
|
||||
<h3>Give Gold to Specific Player</h3>
|
||||
<p>Adaugă gold doar pentru un singur cont (după ID).</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<form action="../GameEngine/Admin/Mods/gold_1.php" method="POST" class="usergold-form">
|
||||
<input type="hidden" name="admid" value="<?php echo $id; ?>">
|
||||
|
||||
<div class="field">
|
||||
<label>User ID</label>
|
||||
<input type="number" name="id" placeholder="ex: 123" required min="1">
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<label>Amount Gold</label>
|
||||
<input type="number" name="gold" value="20" min="1" max="999999" required>
|
||||
</div>
|
||||
|
||||
<button type="submit">
|
||||
<svg width="16" height="16" viewBox="0 0 24 24" fill="none"><path d="M12 5v14M5 12h14" stroke="#fff" stroke-width="2" stroke-linecap="round"/></svg>
|
||||
Give Gold
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<?php if(isset($_GET['g'])){ ?>
|
||||
<div class="usergold-success">✓ Gold adăugat cu succes pentru user!</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
+152
-84
@@ -1,98 +1,166 @@
|
||||
<?php
|
||||
#################################################################################
|
||||
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
|
||||
## --------------------------------------------------------------------------- ##
|
||||
## Filename users.tpl ##
|
||||
## Purpose: Admin users list with pagination ##
|
||||
## ##
|
||||
## users.tpl - REDESIGN 2025 v3 (ultra-compact + tribe label) ##
|
||||
#################################################################################
|
||||
if($_SESSION['access'] < MULTIHUNTER) die("Access Denied!");
|
||||
|
||||
$page = isset($_GET['upage']) ? (int)$_GET['upage'] : 1;
|
||||
if ($page < 1) {
|
||||
$page = 1;
|
||||
}
|
||||
|
||||
$perPage = 100;
|
||||
$filter = $_GET['filter']??'all';
|
||||
$page = max(1, (int)($_GET['upage']??1));
|
||||
$perPage = 20;
|
||||
$offset = ($page - 1) * $perPage;
|
||||
|
||||
$totalRes = mysqli_query($GLOBALS['link'], "SELECT COUNT(*) AS cnt FROM " . TB_PREFIX . "users");
|
||||
$totalRow = $totalRes ? mysqli_fetch_assoc($totalRes) : ['cnt' => 0];
|
||||
$totalUsers = (int)($totalRow['cnt'] ?? 0);
|
||||
$where = "1=1";
|
||||
if($filter=='admins') $where = "access >= 8";
|
||||
elseif($filter=='normal') $where = "access = 2";
|
||||
elseif($filter=='banned') $where = "access = 0";
|
||||
elseif($filter=='online') $where = "timestamp > ".(time()-900);
|
||||
|
||||
$totalRes = mysqli_query($GLOBALS['link'], "SELECT COUNT(*) AS cnt FROM ".TB_PREFIX."users WHERE $where");
|
||||
$totalUsers = (int)(mysqli_fetch_assoc($totalRes)['cnt']??0);
|
||||
$totalPages = max(1, (int)ceil($totalUsers / $perPage));
|
||||
if($page>$totalPages){$page=$totalPages;$offset=($page-1)*$perPage;}
|
||||
|
||||
if ($page > $totalPages) {
|
||||
$page = $totalPages;
|
||||
$offset = ($page - 1) * $perPage;
|
||||
$result = mysqli_query($GLOBALS['link'], "
|
||||
SELECT id, username, email, access, tribe, gold, timestamp
|
||||
FROM ".TB_PREFIX."users
|
||||
WHERE $where
|
||||
ORDER BY id DESC
|
||||
LIMIT $perPage OFFSET $offset
|
||||
");
|
||||
|
||||
function tribeLabel($t){
|
||||
$t = (int)$t;
|
||||
switch($t){
|
||||
case 1: return array('Roman','🏛','#c0392b');
|
||||
case 2: return array('Teuton','🪓','#7f8c8d');
|
||||
case 3: return array('Gaul','🌾','#27ae60');
|
||||
case 4: return array('Nature','🌲','#16a085');
|
||||
case 5: return array('Natars','👑','#8e44ad');
|
||||
default: return array('N/A','❓','#95a5a6');
|
||||
}
|
||||
}
|
||||
|
||||
$sql = "SELECT id, username, email, access, tribe, gold, timestamp " .
|
||||
"FROM " . TB_PREFIX . "users " .
|
||||
"ORDER BY id DESC LIMIT " . (int)$perPage . " OFFSET " . (int)$offset;
|
||||
$result = mysqli_query($GLOBALS['link'], $sql);
|
||||
|
||||
function tribeLabel($tribe) {
|
||||
$tribe = (int)$tribe;
|
||||
if ($tribe === 1) return 'Roman';
|
||||
if ($tribe === 2) return 'Teuton';
|
||||
if ($tribe === 3) return 'Gaul';
|
||||
return 'N/A';
|
||||
function accessBadge($a){
|
||||
$a = (int)$a;
|
||||
if($a == 9) return array('Admin','#c0392b');
|
||||
if($a == 8) return array('MH','#e67e22');
|
||||
if($a == 2) return array('Normal','#3498db');
|
||||
if($a == 0) return array('Banned','#7f8c8d');
|
||||
return array('Lvl '.$a,'#95a5a6');
|
||||
}
|
||||
function shortEmail($e){if(!$e)return '-';if(strlen($e)>22)return substr($e,0,19).'...';return $e;}
|
||||
?>
|
||||
<style>
|
||||
.users-wrap{max-width:100%;margin:8px 0;font-family:Tahoma,Verdana,Arial,sans-serif}
|
||||
.users-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:6px}
|
||||
.users-head h2{margin:0;font-size:14px;display:flex;align-items:center;gap:4px}
|
||||
.users-filters{display:flex;gap:3px;margin-bottom:4px}
|
||||
.users-filters a{padding:2px 7px;font-size:10px;border:1px solid #bbb;border-radius:10px;text-decoration:none;color:#333;background:#f5f5f5;line-height:14px}
|
||||
.users-filters a.active{background:#2c3e50;color:#fff;border-color:#2c3e50}
|
||||
.search-box{margin-bottom:4px}
|
||||
.search-box input{width:180px;padding:3px 5px;border:1px solid #aaa;border-radius:3px;font-size:11px}
|
||||
|
||||
<table id="member" cellpadding="1" cellspacing="1">
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="7">Users list (<?php echo $totalUsers; ?>)</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>ID</td>
|
||||
<td>Username</td>
|
||||
<td>Email</td>
|
||||
<td>Access</td>
|
||||
<td>Tribe</td>
|
||||
<td>Gold</td>
|
||||
<td>Last activity</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php if ($result && mysqli_num_rows($result) > 0) { ?>
|
||||
<?php while ($row = mysqli_fetch_assoc($result)) { ?>
|
||||
<tr>
|
||||
<td><?php echo (int)$row['id']; ?></td>
|
||||
<td>
|
||||
<a href="?p=player&uid=<?php echo (int)$row['id']; ?>">
|
||||
<?php echo htmlspecialchars((string)$row['username'], ENT_QUOTES, 'UTF-8'); ?>
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
<?php if (!empty($row['email'])) { ?>
|
||||
<a href="mailto:<?php echo htmlspecialchars((string)$row['email'], ENT_QUOTES, 'UTF-8'); ?>">
|
||||
<?php echo htmlspecialchars((string)$row['email'], ENT_QUOTES, 'UTF-8'); ?>
|
||||
</a>
|
||||
<?php } else { ?>
|
||||
-
|
||||
<?php } ?>
|
||||
</td>
|
||||
<td><?php echo (int)$row['access']; ?></td>
|
||||
<td><?php echo tribeLabel($row['tribe']); ?></td>
|
||||
<td><?php echo (int)$row['gold']; ?></td>
|
||||
<td><?php echo !empty($row['timestamp']) ? date('d.m.Y H:i:s', (int)$row['timestamp']) : '-'; ?></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<?php } else { ?>
|
||||
<tr>
|
||||
<td colspan="7" class="hab">No users found.</td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
</tbody>
|
||||
</table>
|
||||
.table-wrap{overflow-x:auto;border:1px solid #bbb;background:#fff}
|
||||
.users-table{width:100%;border-collapse:collapse;border-spacing:0;font-size:11px;table-layout:fixed}
|
||||
.users-table thead th{background:#3a4f63;color:#fff;padding:2px 3px;text-align:left;white-space:nowrap;font-weight:bold;border-right:1px solid #2c3e50;font-size:10px}
|
||||
.users-table thead th:last-child{border-right:0}
|
||||
.users-table tbody td{padding:1px 3px;border-bottom:1px solid #e5e5e5;border-right:1px solid #f0f0f0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;line-height:16px}
|
||||
.users-table tbody td:last-child{border-right:0}
|
||||
.users-table tbody tr:hover{background:#eef4ff}
|
||||
.users-table a{color:#004a9f;text-decoration:none}
|
||||
.users-table a:hover{text-decoration:underline}
|
||||
|
||||
<div style="margin-top:10px;">
|
||||
<?php if ($page > 1) { ?>
|
||||
<a href="?p=users&upage=<?php echo $page - 1; ?>">« Previous</a>
|
||||
<?php } ?>
|
||||
<span style="margin:0 10px;">Page <?php echo $page; ?> / <?php echo $totalPages; ?></span>
|
||||
<?php if ($page < $totalPages) { ?>
|
||||
<a href="?p=users&upage=<?php echo $page + 1; ?>">Next »</a>
|
||||
<?php } ?>
|
||||
/* LATIMI MINIME */
|
||||
.users-table th:nth-child(1),.users-table td:nth-child(1){width:32px;text-align:center}
|
||||
.users-table th:nth-child(2),.users-table td:nth-child(2){width:85px}
|
||||
.users-table th:nth-child(3),.users-table td:nth-child(3){width:125px}
|
||||
.users-table th:nth-child(4),.users-table td:nth-child(4){width:48px;text-align:center}
|
||||
.users-table th:nth-child(5),.users-table td:nth-child(5){width:42px;text-align:center;padding:1px 2px}
|
||||
.users-table th:nth-child(6),.users-table td:nth-child(6){width:32px;text-align:right;padding-right:4px}
|
||||
.users-table th:nth-child(7),.users-table td:nth-child(7){width:72px;text-align:center}
|
||||
|
||||
.badge{display:inline-block;padding:0 3px;border-radius:2px;color:#fff;font-size:9px;line-height:12px;font-weight:normal}
|
||||
.gold{color:#8b6914;font-weight:normal}
|
||||
.last{color:#444;font-size:10px}
|
||||
.email-cell a{color:#004a9f}
|
||||
|
||||
/* TRIBE CU NUME SUB ICON */
|
||||
.tribe-box{display:flex;flex-direction:column;align-items:center;gap:1px;line-height:1}
|
||||
.tribe-icon{display:inline-block;width:16px;height:14px;line-height:14px;text-align:center;border-radius:2px;color:#fff;font-size:10px}
|
||||
.tribe-name{font-size:8px;color:#888;text-transform:uppercase;letter-spacing:0.2px}
|
||||
|
||||
.pagination{display:flex;justify-content:center;align-items:center;gap:4px;margin-top:6px;font-size:10px}
|
||||
.pagination a{padding:2px 5px;background:#f5f5f5;border:1px solid #bbb;border-radius:2px;text-decoration:none;color:#333}
|
||||
.pagination.current{padding:2px 5px;background:#3a4f63;color:#fff;border-radius:2px}
|
||||
</style>
|
||||
|
||||
<div class="users-wrap">
|
||||
<div class="users-head">
|
||||
<h2>👥 Users</h2>
|
||||
<div style="font-size:11px;color:#666"><?php echo number_format($totalUsers);?> found</div>
|
||||
</div>
|
||||
|
||||
<div class="users-filters">
|
||||
<a href="?p=users&filter=all" class="<?php echo $filter=='all'?'active':'';?>">All</a>
|
||||
<a href="?p=users&filter=admins" class="<?php echo $filter=='admins'?'active':'';?>">Admins</a>
|
||||
<a href="?p=users&filter=normal" class="<?php echo $filter=='normal'?'active':'';?>">Normal</a>
|
||||
<a href="?p=users&filter=banned" class="<?php echo $filter=='banned'?'active':'';?>">Banned</a>
|
||||
<a href="?p=users&filter=online" class="<?php echo $filter=='online'?'active':'';?>">Online</a>
|
||||
</div>
|
||||
|
||||
<div class="search-box"><input type="text" id="userSearch" placeholder="Search..." onkeyup="filterUsers()"></div>
|
||||
|
||||
<div class="table-wrap">
|
||||
<table class="users-table" id="usersTable">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<th>Username</th>
|
||||
<th>Email</th>
|
||||
<th>Access</th>
|
||||
<th>Tribe</th>
|
||||
<th>Gold</th>
|
||||
<th>Last Activity</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php while($r=mysqli_fetch_assoc($result)){
|
||||
$t=tribeLabel($r['tribe']); $a=accessBadge($r['access']);
|
||||
$last = $r['timestamp']? date('d.m H:i',$r['timestamp']) : '-';
|
||||
$isOnline = $r['timestamp'] && $r['timestamp'] > time()-900;
|
||||
$emailTitle = htmlspecialchars($r['email']??'');
|
||||
?>
|
||||
<tr>
|
||||
<td>#<?php echo (int)$r['id'];?></td>
|
||||
<td><a href="?p=player&uid=<?php echo (int)$r['id'];?>" title="<?php echo htmlspecialchars($r['username']).($emailTitle?' | '.$emailTitle:'');?>"><?php echo htmlspecialchars($r['username']);?></a><?php if($isOnline)echo ' <span style="color:#27ae60">●</span>';?></td>
|
||||
<td class="email-cell" title="<?php echo $emailTitle;?>"><?php echo $r['email']? '<a href="mailto:'.htmlspecialchars($r['email']).'">'.shortEmail($r['email']).'</a>' : '-';?></td>
|
||||
<td><span class="badge" style="background:<?php echo $a[1];?>"><?php echo $a[0];?></span></td>
|
||||
<td>
|
||||
<div class="tribe-box">
|
||||
<span class="tribe-icon" style="background:<?php echo $t[2];?>"><?php echo $t[1];?></span>
|
||||
<span class="tribe-name"><?php echo $t[0];?></span>
|
||||
</div>
|
||||
</td>
|
||||
<td class="gold"><?php echo (int)$r['gold'];?></td>
|
||||
<td class="last"><?php echo $last;?></td>
|
||||
</tr>
|
||||
<?php }?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="pagination">
|
||||
<?php if($page>1){?><a href="?p=users&filter=<?php echo $filter;?>&upage=<?php echo $page-1;?>">« Prev</a><?php }?>
|
||||
<span class="current"><?php echo $page;?> / <?php echo $totalPages;?></span>
|
||||
<?php if($page<$totalPages){?><a href="?p=users&filter=<?php echo $filter;?>&upage=<?php echo $page+1;?>">Next »</a><?php }?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function filterUsers(){
|
||||
var q=document.getElementById('userSearch').value.toLowerCase();
|
||||
var rows=document.querySelectorAll('#usersTable tbody tr');
|
||||
for(var i=0;i<rows.length;i++){
|
||||
rows[i].style.display = rows[i].innerText.toLowerCase().indexOf(q)>-1? '':'none';
|
||||
}
|
||||
}
|
||||
</script>
|
||||
Reference in New Issue
Block a user