mirror of
https://github.com/easy-wi/developer.git
synced 2025-02-20 11:23:28 +08:00
Show icons at lend list
This commit is contained in:
parent
950684587c
commit
ffad0f5484
25
web/lend.php
25
web/lend.php
@ -439,31 +439,36 @@ if (!isset($template_file) and ((!isset($servertype) and isset($page_include) an
|
||||
$lendVoiceServers = array();
|
||||
|
||||
$query = $sql->prepare("SELECT `id`,`queryMap`,`queryNumplayers`,`queryName`,`serverip`,`port`,`slots`,`serverid` FROM `gsswitch` WHERE `lendserver`='Y' AND `active`='Y' AND `resellerid`=0");
|
||||
$query2 = $sql->prepare("SELECT `slots`,`started`,`lendtime` FROM `lendedserver` WHERE `serverid`=? AND `servertype`='g' LIMIT 1");
|
||||
$query3 = $sql->prepare("SELECT t.`shorten`,t.`description` FROM `serverlist` s LEFT JOIN `servertypes` t ON s.`servertype`=t.`id` WHERE s.`switchID`=? AND s.`resellerid`=0");
|
||||
$query2 = $sql->prepare("SELECT s.`id`,t.`shorten`,t.`description` FROM `serverlist` s LEFT JOIN `servertypes` t ON s.`servertype`=t.`id` WHERE s.`switchID`=? AND s.`resellerid`=0");
|
||||
$query3 = $sql->prepare("SELECT `slots`,`started`,`lendtime` FROM `lendedserver` WHERE `serverid`=? AND `servertype`='g' LIMIT 1");
|
||||
$query->execute(array($reseller_id));
|
||||
foreach ($query->fetchall(PDO::FETCH_ASSOC) as $row) {
|
||||
|
||||
$installedShorten = array();
|
||||
$timeleft = 0;
|
||||
$slots = $row['slots'];
|
||||
$runningGame = '';
|
||||
$slots = $row['slots'];
|
||||
$free = '16_ok.png';
|
||||
|
||||
$query2->execute(array($row['serverid']));
|
||||
$query2->execute(array($row['id']));
|
||||
foreach ($query2->fetchall(PDO::FETCH_ASSOC) as $row2) {
|
||||
$slots = $row2['slots'];
|
||||
$timeleft = round($row2['lendtime'] - (strtotime('now') - strtotime($row2['started'])) / 60);
|
||||
$installedShorten[$row2['shorten']] = $row2['description'];
|
||||
|
||||
if ($row2['id'] == $row['serverid']) {
|
||||
$runningGame = $row2['shorten'];
|
||||
}
|
||||
}
|
||||
|
||||
$query3->execute(array($row['serverid']));
|
||||
foreach ($query3->fetchall(PDO::FETCH_ASSOC) as $row3) {
|
||||
$slots = $row3['slots'];
|
||||
$timeleft = round($row3['lendtime'] - (strtotime('now') - strtotime($row3['started'])) / 60);
|
||||
$free = '16_bad.png';
|
||||
|
||||
if ($timeleft < 0) {
|
||||
$timeleft = 0;
|
||||
}
|
||||
}
|
||||
$query3->execute(array($row['id']));
|
||||
foreach ($query3->fetchall(PDO::FETCH_ASSOC) as $row3) {
|
||||
$installedShorten[$row3['shorten']] = $row3['description'];
|
||||
}
|
||||
|
||||
$lendGameServers[] = array('ip' => $row['serverip'], 'port' => (int) $row['port'], 'queryName' => htmlentities($row['queryName'], ENT_QUOTES, 'UTF-8'), 'queryMap' => htmlentities($row['queryMap'], ENT_QUOTES, 'UTF-8'), 'runningGame' => $runningGame, 'games' => $installedShorten, 'slots' => (int) $slots,'usedslots' => (int) $row['queryNumplayers'], 'timeleft' => (int) $timeleft, 'free' => $free);
|
||||
}
|
||||
|
@ -22,7 +22,7 @@
|
||||
<tbody>
|
||||
<?php foreach ($lendGameServers as $v){ ?>
|
||||
<tr>
|
||||
<td><?php if(strlen($v['runningGame'])>0){ echo '<img src="'.$page_data->pageurl.'/images/games/icons/'.$v['runningGame'].'.png" />';}; echo $v['ip'].':'.$v['port'].' '.$v['queryName'];?></td>
|
||||
<td><?php if(strlen($v['runningGame'])>0){ echo '<img src="'.$page_data->pageurl.'/images/games/icons/'.$v['runningGame'].'.png" width="18" /> ';}; echo $v['ip'].':'.$v['port'].' '.$v['queryName'];?></td>
|
||||
<td><?php echo $v['usedslots'].'/'.$v['slots'];?></td>
|
||||
<td><?php echo $v['queryMap'];?></td>
|
||||
<td><?php echo implode(', ',$v['games']);?></td>
|
||||
|
Loading…
x
Reference in New Issue
Block a user