mirror of
https://github.com/Shadowss/TravianZ.git
synced 2026-09-03 17:07:17 +00:00
Redesign Admin Panel
Full frontend & backend redesign and refactor
This commit is contained in:
@@ -2,62 +2,69 @@
|
||||
#################################################################################
|
||||
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
|
||||
## --------------------------------------------------------------------------- ##
|
||||
## Filename results_ip.tpl ##
|
||||
## Developed by: Dzoki ##
|
||||
## License: TravianZ Project ##
|
||||
## Copyright: TravianZ (c) 2010-2025. All rights reserved. ##
|
||||
## ##
|
||||
## Filename : result_ip.tpl ##
|
||||
## Type : Admin Panel Frontend ##
|
||||
## --------------------------------------------------------------------------- ##
|
||||
## Developed by : Dzoki (Original) ##
|
||||
## Refactored by : Shadow ##
|
||||
## Redesign by : Shadow ##
|
||||
## --------------------------------------------------------------------------- ##
|
||||
## Contact : cata7007@gmail.com ##
|
||||
## Project : TravianZ ##
|
||||
## GitHub : https://github.com/Shadowss/TravianZ ##
|
||||
## --------------------------------------------------------------------------- ##
|
||||
## License : TravianZ Project ##
|
||||
## Copyright : TravianZ (c) 2010-2025. All rights reserved. ##
|
||||
## --------------------------------------------------------------------------- ##
|
||||
#################################################################################
|
||||
?>
|
||||
<?php
|
||||
$result = $admin->search_ip($_POST['s']);
|
||||
$newArray = array();
|
||||
function arr($arr,$el){
|
||||
global $newArray;
|
||||
for ($i = 0; $i <= count($arr)-1; $i++) {
|
||||
if(in_array($el,$newArray)){
|
||||
return false;
|
||||
}else{
|
||||
array_push($newArray,$el);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
<table id="member">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="dtbl"><a href="">1 «</a></th><th>Found IPs (<?php echo count($newArray);?>)</th><th class="dtbl"><a href="">» 100</a></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
</table>
|
||||
<table id="profile">
|
||||
<tr>
|
||||
<td class="b">IP</td>
|
||||
<td class="b">Name</td>
|
||||
</tr>
|
||||
<?php
|
||||
$seen = [];
|
||||
$rows = [];
|
||||
if($result){
|
||||
for ($i = 0; $i <= count($result)-1; $i++) {
|
||||
if(arr($result,$result[$i]["ip"].$result[$i]["uid"])){
|
||||
echo '
|
||||
<tr>
|
||||
<td>'.$result[$i]["ip"].'</td>
|
||||
<td><a href="?p=player&uid='.$result[$i]["uid"].'">'.$database->getUserField($result[$i]["uid"],'username',0).'</a></td>
|
||||
</tr>
|
||||
';
|
||||
}
|
||||
}
|
||||
}
|
||||
else{
|
||||
echo '
|
||||
<tr>
|
||||
<td colspan="4">No results</td>
|
||||
</tr>
|
||||
';
|
||||
foreach($result as $r){
|
||||
$key = $r['ip'].'_'.$r['uid'];
|
||||
if(!isset($seen[$key])){
|
||||
$seen[$key] = true;
|
||||
$rows[] = $r;
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
<style>
|
||||
.search-wrap{font-family:system-ui;margin-top:10px}
|
||||
.search-head{width:100%;background:linear-gradient(135deg,#0f172a,#1e293b);color:#fff;padding:10px 12px;font-weight:600;text-align:center;font-size:14px;border:1px solid #0f172a;border-radius:10px 10px 0 0;box-shadow:0 2px 8px rgba(0,0,0,.08);box-sizing:border-box}
|
||||
.search-table{width:100%;border-collapse:separate;border-spacing:0;background:#fff;border:1px solid #e5e7eb;border-top:0;border-radius:0 0 10px 10px;overflow:hidden;box-shadow:0 2px 8px rgba(0,0,0,.04);margin-bottom:12px}
|
||||
.search-table tr:first-child td{background:#f8fafc;color:#64748b;font-size:11px;text-transform:uppercase;padding:7px 10px;font-weight:600;border-bottom:1px solid #e5e7eb;text-align:center}
|
||||
.search-table td{padding:7px 10px;border-bottom:1px solid #f1f5f9;font-size:13px;color:#334155;text-align:center;font-family:monospace}
|
||||
.search-table tr:last-child td{border-bottom:0}
|
||||
.search-table tr:hover td{background:#f8fafc}
|
||||
.search-table a{color:#2563eb;text-decoration:none;font-weight:500;font-family:system-ui}
|
||||
.search-table a:hover{text-decoration:underline}
|
||||
.no-res{padding:20px;text-align:center;color:#94a3b8;font-style:italic;font-family:system-ui}
|
||||
</style>
|
||||
|
||||
</table>
|
||||
<div class="search-wrap">
|
||||
<div class="search-head">Found IPs (<?php echo count($rows);?>)</div>
|
||||
|
||||
<table class="search-table">
|
||||
<tr>
|
||||
<td>IP</td>
|
||||
<td>NAME</td>
|
||||
</tr>
|
||||
<?php if($rows){
|
||||
foreach($rows as $r){
|
||||
$uname = $database->getUserField($r['uid'],'username',0);
|
||||
echo '
|
||||
<tr>
|
||||
<td>'.$r['ip'].'</td>
|
||||
<td><a href="?p=player&uid='.$r['uid'].'">'.$uname.'</a></td>
|
||||
</tr>
|
||||
';
|
||||
}} else {
|
||||
echo '<tr><td colspan="2" class="no-res">No results</td></tr>';
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
</div>
|
||||
Reference in New Issue
Block a user