• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

[HELP] Adapt PHP , logs for staff

Matheuuss

New Member
Joined
Nov 20, 2018
Messages
25
Reaction score
0
MODERN ACC

Good evening, I have this PHP from staff:
PHP:
        <div class='message'>
        <div class='title'>Suporte Online</div>
        <div class='content'>
<?PHP
$ots = POT::getInstance();
$ots->connect(POT::DB_MYSQL, connection());
$SQL = POT::getInstance()->getDBHandle();
include ('config.php'); 

//Ranks
$rank[6]="ADM";
$rank[5]="CM";
$rank[4]="Game Master";
$rank[3]="Senior Tutor";
$rank[2]="Tutor";

$query = $SQL->query("SELECT group_id,name FROM players WHERE group_id > 1 ORDER BY group_id DESC");
echo '
    <table width="100%">
    <tbody>
    <tr><td><b>Rank</b></td><td width="60%"><b>Name</b></td><td><b>Status</b></td></tr>';

$aaa = 0;
foreach($query as $info)
    {
    $player = $ots->createObject('Player');
    $player->find($info['name']);
    $showRank = $rank[ $info['group_id'] ];
    echo '<tr>
        <td>'.$showRank.'</td>
        <td width="60%"><a href="/index.php/character/view/'.$info['name'].'">'.$info['name'].'</a></td>
        <td><font color="';
    echo ($player->isOnline()) ? 'green' : 'red';
    echo '">';
    echo ($player->isOnline()) ? 'Online' : 'Offline';
    echo '</font></td>
    </tr>';
    $aaa++;
    }
echo '</tbody>
</table>';
?>
</div></div>

I would like to LOG equal these from the image:
1.png 2.png

Can someone help me?
 
It's small HTML modification, you just need a new <td></td> element in your code.

Add
Code:
<tr><td><b>Rank</b></td><td width="60%"><b>Name</b></td><td><b>Status</b></td></tr>';

Add <td>Log</td> here.

This will add it to the table header. Now you need the same in the table.

To do so, just edit this line:
Change:
Code:
echo '</font></td>

To:
Code:
echo '</font></td><td><a href="yourlink"><button name="log">LOG</button></a></td>

I am unsure tho, where that "LOG" button should redirect. Thats why I named it "yourlink". Explain what this button should show, then I can make the whole script.
 
It's small HTML modification, you just need a new <td></td> element in your code.

Add
Code:
<tr><td><b>Rank</b></td><td width="60%"><b>Name</b></td><td><b>Status</b></td></tr>';

Add <td>Log</td> here.

This will add it to the table header. Now you need the same in the table.

To do so, just edit this line:
Change:
Code:
echo '</font></td>

To:
Code:
echo '</font></td><td><a href="yourlink"><button name="log">LOG</button></a></td>

I am unsure tho, where that "LOG" button should redirect. Thats why I named it "yourlink". Explain what this button should show, then I can make the whole script.

It will show the commands of the admins

example: DBOBrasil Server I
 
Back
Top