valivan601
New Member
- Joined
- Apr 13, 2011
- Messages
- 365
- Reaction score
- 1
Hello i want to share my first script, as the topic says this script I made to track players in website instead of seaching in sql everytime u think someone are doing anything. If u have all the items images correcty it will show all
First you can see all the items the players are carring in backpack.
Second you can see all the items the player has in depot.
Third you can track items by ID, then it shows the players are carring it.
Fourth some info about player select need some adjustes yet.
Fifth you can search items storage in houses by ID.
This is script is very usefull for me possible it will help someone too.
First you can see all the items the players are carring in backpack.
Second you can see all the items the player has in depot.
Third you can track items by ID, then it shows the players are carring it.
Fourth some info about player select need some adjustes yet.
Fifth you can search items storage in houses by ID.
This is script is very usefull for me possible it will help someone too.
PHP:
<form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
<table border="0" cellspacing="1" cellpadding="4" width="100%">
<tr><td>SEARCH:</td>
<td><input type="text" name="name" size="30"/></td>
</tr>
<tr><td></td>
<td><button type="submit" name="submit" >Search</button></td>
</tr>
<input type='checkbox' ".set_checkbox('BP Items', '1')." value='1' name='items'/>
<b>BP Items</b>
<input type='checkbox' ".set_checkbox('Depot Items', '2')." value='2' name='depot'/>
<b>Depot Items</b>
<input type='checkbox' ".set_checkbox('ID Search', '3')." value='3' name='id'/>
<b>ID Search</b>
<input type='checkbox' ".set_checkbox('Info', '4')." value='4' name='info'/>
<b>Player Info</b>
<input type='checkbox' ".set_checkbox('House Items', '5')." value='5' name='house'/>
<b>House Items</b>
</table>
</form>
<?php
("config.php");
$ots = POT::getInstance();
$ots->connect(POT::DB_MYSQL, connection());
$SQL = $ots->getDBHandle();
if($ide->isAdmin()) {
if(isset($_POST['submit'])){
if (isset($_POST['info'])) {
$name = $_POST['name'];
echo '<div style="text-align: center; font-weight: bold;"></div>
<table border="0" cellspacing="1" cellpadding="4" width="100%">
<tr>
<tr>
<td class="white" style="text-align: center; font-weight: bold;">Name</td>
<td class="white" style="text-align: center; font-weight: bold;">Balance</td>
<td class="white" style="text-align: center; font-weight: bold;">Cap</td>
<td class="white" style="text-align: center; font-weight: bold;">VIP</td>
</tr>';
foreach($SQL->query('SELECT balance, cap ,account_id FROM players WHERE name = "'.$_POST['name'].'"')as $cap){
echo '<tr class="highlight" style="text-align: center">
<TD><b><font color="#CC3333">'.$_POST['name'].'</td>
<TD><b><font color="#CC3333">'.$cap['balance'].' kk</td>
<TD><b><font color="#CC3333">'.$cap['cap'].'</td><td>';
foreach($SQL->query('SELECT vip_time FROM accounts WHERE id = "'.$cap['account_id'].'"')as $var){
if($var['vip_time'] >= '1')
$image = 'public/images/true.gif';
else
$image = 'public/images/false.gif';
echo '<img height="16px" width="16px" src="'.WEBSITE.'/'.$image.'"/>';
echo '</td>';
echo '<tr>';
} }
echo '</table>';
}
if (isset($_POST['items'])) {
$name = $_POST['name'];
echo '<div style="text-align: center; font-weight: bold;"></div>
<table border="0" cellspacing="1" cellpadding="4" width="100%">
<tr>
<tr>
<td class="white" style="text-align: center; font-weight: bold;">Picture</td>
<td class="white" style="text-align: center; font-weight: bold;">Item Type</td>
<td class="white" style="text-align: center; font-weight: bold;">Player id</td>
<td class="white" style="text-align: center; font-weight: bold;">Count</td>
</tr>';
foreach($SQL->query('SELECT id FROM players WHERE name = "'.$_POST['name'].'"')as $id)
foreach($SQL->query('SELECT `itemtype` AS `item type`, `player_id` AS `player id`, `count` AS `count` FROM `player_items` where player_id = "'.$id['id'].'" ORDER BY `player_id` DESC LIMIT 1000') as $hist) {
echo '<tr class="highlight" style="text-align: center"> <td>';
$image = 'public/images/items/'.$hist['item type'].'.gif';
echo '<img height="32px" width="32px" src="'.WEBSITE.'/'.$image.'"/>';
echo '</td>
<td><b><font color="#CC3333">'.$hist['item type'].'</td>
<td><b><font color="#CC3333">'.$hist['player id'].'</td>
<td><b><font color="#CC3333">'.$hist['count'].'</td>';
echo '</tr>';
}
echo '</table>';
}
if (isset($_POST['depot'])) {
$name = $_POST['name'];
echo '<div style="text-align: center; font-weight: bold;"></div>
<table border="0" cellspacing="1" cellpadding="4" width="100%">
<tr>
<tr>
<td class="white" style="text-align: center; font-weight: bold;">Picture</td>
<td class="white" style="text-align: center; font-weight: bold;">Item Type</td>
<td class="white" style="text-align: center; font-weight: bold;">Player id</td>
<td class="white" style="text-align: center; font-weight: bold;">Count</td>
</tr>';
foreach($SQL->query('SELECT id FROM players WHERE name = "'.$_POST['name'].'"')as $id)
foreach($SQL->query('SELECT `itemtype` AS `item type`, `player_id` AS `player id`, `count` AS `count` FROM `player_depotitems` where player_id = "'.$id['id'].'" ORDER BY `player_id` DESC LIMIT 1000') as $hist) {
echo '<tr class="highlight" style="text-align: center"> <td>';
$image = 'public/images/items/'.$hist['item type'].'.gif';
echo '<img height="32px" width="32px" src="'.WEBSITE.'/'.$image.'"/>';
echo '</td>
<td><b><font color="#CC3333">'.$hist['item type'].'</td>
<td><b><font color="#CC3333">'.$hist['player id'].'</td>
<td><b><font color="#CC3333">'.$hist['count'].'</td>';
echo '</tr>';
}
echo '</table>';
}
if (isset($_POST['id'])) {
$name = $_POST['name'];
echo '<div style="text-align: center; font-weight: bold;"></div>
<table border="0" cellspacing="1" cellpadding="4" width="100%">
<tr>
<tr>
<td class="white" style="text-align: center; font-weight: bold;">Picture</td>
<td class="white" style="text-align: center; font-weight: bold;">Backpack Items</td>
<td class="white" style="text-align: center; font-weight: bold;">Player Name</td>
<td class="white" style="text-align: center; font-weight: bold;">Count</td>
</tr>';
foreach($SQL->query('SELECT `itemtype` AS `item type`, `player_id` AS `player id`, `count` AS `count` from player_items where itemtype = "'.$_POST['name'].'" ORDER BY `player_id` DESC LIMIT 1000') as $hist) {
foreach($SQL->query('SELECT name FROM players WHERE id = "'.$hist['player id'].'"')as $id)
echo '<tr class="highlight" style="text-align: center"> <td>';
$image = 'public/images/items/'.$hist['item type'].'.gif';
echo '<img height="32px" width="32px" src="'.WEBSITE.'/'.$image.'"/>';
echo '</td>
<td><b><font color="#CC3333">'.$hist['item type'].'</td>
<td><b><a href="/index.php/character/view/'.urlencode($id['name']).'">'.$id['name'].'</td>
<td><b><font color="#CC3333">'.$hist['count'].'</td>';
echo '</tr>';
}
echo '</table>';
}
if (isset($_POST['id'])) {
$name = $_POST['name'];
echo '<div style="text-align: center; font-weight: bold;"></div>
<table border="0" cellspacing="1" cellpadding="4" width="100%">
<tr>
<tr>
<td class="white" style="text-align: center; font-weight: bold;">Picture</td>
<td class="white" style="text-align: center; font-weight: bold;">Depot Items</td>
<td class="white" style="text-align: center; font-weight: bold;">Player Name</td>
<td class="white" style="text-align: center; font-weight: bold;">Count</td>
</tr>';
foreach($SQL->query('SELECT `itemtype` AS `item type`, `player_id` AS `player id`, `count` AS `count` from player_depotitems where itemtype = "'.$_POST['name'].'" ORDER BY `player_id` DESC LIMIT 1000') as $hist) {
foreach($SQL->query('SELECT name FROM players WHERE id = "'.$hist['player id'].'"')as $id)
echo '<tr class="highlight" style="text-align: center"> <td>';
$image = 'public/images/items/'.$hist['item type'].'.gif';
echo '<img height="32px" width="32px" src="'.WEBSITE.'/'.$image.'"/>';
echo '</td>
<td><b><font color="#CC3333">'.$hist['item type'].'</td>
<td><b><a href="/index.php/character/view/'.urlencode($id['name']).'">'.$id['name'].'</td>
<td><b><font color="#CC3333">'.$hist['count'].'</td>';
} echo '</tr>';
echo '</table>';
}
if (isset($_POST['house'])) {
$name = $_POST['name'];
echo '<div style="text-align: center; font-weight: bold;"></div>
<table border="0" cellspacing="1" cellpadding="4" width="100%">
<tr>
<tr>
<td class="white" style="text-align: center; font-weight: bold;">Picture</td>
<td class="white" style="text-align: center; font-weight: bold;">Item Type</td>
</tr>';
foreach($SQL->query('SELECT itemtype AS `item type` FROM `tile_items` where itemtype = "'.$_POST['name'].'"') as $hist) {
echo '<tr class="highlight" style="text-align: center"> <td>';
$image = 'public/images/items/'.$hist['item type'].'.gif';
echo '<img height="32px" width="32px" src="'.WEBSITE.'/'.$image.'"/>';
echo '</td>
<td><b><font color="#CC3333">'.$hist['item type'].'</td>';
} echo '</tr>';
echo '</table>';
}
}
}
?>
Last edited: