- Joined
- Oct 17, 2012
- Messages
- 660
- Reaction score
- 263
Здравейте! Искам да направя бутон за търсене на герои, като при въвеждането на името в търсачката да се ъпдейтва цялата долна част и да остава само името на героя който сме написали в търсачката.
Ето го и кога. Ще съм благодарен, ако някой помогне ^^
Ето го и кога. Ще съм благодарен, ако някой помогне ^^
PHP:
<?php
include("configs/config.php");
include("mod/rankings/rank_menu.php");
$set = web_settings();
$pag = (isset($_GET['page']) && $_GET['page'] > 0) ? (int)$_GET['page'] : 1;
$page = (int)($pag);
if($set[12] > 0 ){
$selecta = $set[12] * $set[13];
$count = mssql_num_rows(mssql_query("Select TOP ". $selecta ." * from Character where CtlCode= 0"));
}
else{
$count = mssql_num_rows(mssql_query("Select * from Character where CtlCode= 0"));
}
$max_pages = ceil($count/$set[13]);
$offset = ($set[13]) * ($page - 1);
$select = mssql_query(pagination($offset, $set[13], '[Name],[cLevel],[Class],[AccountID],[Resets],[MapNumber],[MarryName],[CtlCode],[IsMarried],[Money]', 'Character', 'resets desc, cLevel desc' ,'name','CtlCode = 0'));
pagi_style("topchars",$max_pages,$set[13]);
$search_value=$_POST["Search"];
$sql="select * from Character where Name like '$search_value'";
$res=mssql_query($sql);
while($row = mssql_fetch_array($res)){
}
?>
</table>
<table class='table'>
<tbody>
// Тук е търсачката
<form action="" method="post" >
<td valign="middle" align="center" colspan="8" class="search">
<br>
Search Character <input maxlength="10" name="Search" value=""> <button class="searchinput" name="search" type="submit" value="Search button"> </button>
<br>
</form>
</td>
<tr class="title">
<td>#</td>
<td>Name</td>
<td>Class</td>
<td>Level</td>
<td>Resets</td>
<td>Location</td>
<td>Status</td>
</tr>
<?php
if($stscheck=@fsockopen($set[5], $set[6], $ERROR_NO, $ERROR_STR, (float)0.5))
{
$status= "<img src='/themes/Legend/offline.png'>" ;$nadpis = "<font color='#99ff99'>Online</font>";
fclose($stscheck);
}
else{
$status= "<img src='/themes/Legend/images/offline.png'>" ;$nadpis = "<font color='#ff4c4d'>Offline</font>";
}
$i = 0;
while($row = mssql_fetch_array($select)):
$i++;
$rank =$i+$offset;
$select_ip = mssql_fetch_array(mssql_query("Select * from [MEMB_STAT] where [memb___id] = '".$row['AccountID']."'"));
$char_class = char_class($row['Class']);
if(strtolower(geoip_country_code_by_addr(geo_data(), $select_ip['IP'])) <> NULL){
$flags = "<img width='20px' height='15px'src='http://flags.fmcdn.net/data/flags/normal/". strtolower(geoip_country_code_by_addr(geo_data(), $select_ip['IP'])).".png'/> ";
}
else{
$flags = "";
}
?>
<div class="ranktable">
<tr>
<td>
<?php echo $rank; ?>
</td>
<td>
<?php echo $flags ?> <a class="rankname" href="?p=user&character=<?php echo $row['Name'] ?>"><?php echo $row['Name']; ?></a>
</td>
<td>
<?php echo $char_class; ?>
</td>
<td>
<?php echo $row['cLevel']; ?>
</td>
<td>
<?php echo $row['Resets']; ?>
</td>
<td>
<?php echo de_map($row['MapNumber']); ?>
</td>
</td>
<td>
<?php echo $status; ?>
</td>
</tr>
</div>
<?php endwhile;
echo "</table>";
pagi_style("topchars",$max_pages,$set[13]);
?>