-
Notifications
You must be signed in to change notification settings - Fork 0
/
mob_search.php
59 lines (49 loc) · 2.2 KB
/
mob_search.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<?php
/**
* THIS PAGE DOES THE SEARCHING AND THE RESULTS ARE SENT TO
* ITEMS.PHP FOR DISPLAY...
* */
if(isset($_REQUEST['sr']))
$search_param = $_REQUEST['sr'];
//SEE IF THEY ARE SEARCHING OR BROWSING
if(isset($_REQUEST['sr'])){
/** SEARCH MODE **/
// load up the world server
$database = MANGOS_WORLD;include('dbconn.php');
// lookd for the creature name
$sql = "SELECT * FROM `creature_template` WHERE `name` LIKE '%$search_param%' OR `subname` LIKE '%$search_param%' ORDER BY `minlevel` DESC";
include('dbselect.php');
//$creature = mysql_fetch_array($query);
// loop through any findings
$count=0;//how many did we find
while ($creature = mysql_fetch_array($query) ){
$count++;
// get creature map info
$mob_map= mobMapNfo($creature['entry']);
//BUILD OUR LIST
$creature_disp[$count] = "
<td>
<a href='index.php?pt=mbv&id=".$creature['entry']."' onmouseover=\"tooltip.show('".mobPInfo($creature)."',200);\"
onmouseout=\"tooltip.hide();\">
".$creature['name']."</font></a>";
if($creature['subname'])
$creature_disp[$count] .= "<br/>(".$creature['subname'].")</td>";
$creature_disp[$count] .= "<td>".zoneName($mob_map['map'],$mob_map['position_x'],$mob_map['position_y'])."</td>";
$creature_disp[$count] .= "<td>".factionName($creature['faction_A'])."</td>";
$creature_disp[$count] .= "<td>".$creature['minlevel']."</a></td>";
}
if(!$count){
echo "No records found matching <font color='#00ff00'><b>$search_param</b></font>";
}else{
?>
<table>
<tr><td>Name</td><td>Location</td><td>Faction</td><td>Level</td></tr>
<?php
for($i=1; $i <= count($creature_disp); $i++){
echo "<tr>".$creature_disp[$i]."</tr>";
}
echo '</table>';
}
unset($_REQUEST['sr']);
}
?>