function afficherRechercheTrollsResultat($id_troll, $nom_troll, $race_troll, $nom_guilde, $niveau_troll, $is_tk_troll, $is_wanted_troll, $is_venge_troll, $x_troll, $y_troll, $z_troll, $limite, $statut_troll, $statut_guilde, $lesTrolls = "") { if (!isset($lesTrolls)) { $lesTrolls = selectDbRechercheTrolls($id_troll, $nom_troll, $race_troll, $nom_guilde, $niveau_troll, $is_tk_troll, $is_wanted_troll, $is_venge_troll, $x_troll, $y_troll, $z_troll, $limite, $statut_troll, $statut_guilde); } $nbTrolls = count($lesTrolls); ?> <br> <table border='0' cellpadding='0' cellspacing='0' class='mh_tdborder' align='center'width='100%'> <tr class='mh_tdtitre'> <td align='center' colspan='15'> <?php echo "Résultat de la recherche de trolls : {$nbTrolls} trouvé(s). Position départ : "; echo "X={$x_troll}/Y={$y_troll}/Z={$z_troll}"; ?> </td> </tr> <?php if ($nbTrolls == 0) { echo "</table>"; return; } ?> <tr class='mh_tdtitre'> <?php if (is_numeric($x_troll) && is_numeric($y_troll) && is_numeric($z_troll)) { echo "<td>Distance en PA</td>"; } ?> <td>Nom</td> <td>Guilde</td> <td>Race</td> <td>Niveau</td> <td>Tk</td> <td>Wanted</td> <td>Chatié</td> <td>Diplo Troll</td> <td>Diplo Guilde</td> <td colspan=3>Position</td> <td>Date de Mise à jour </td> <td>Accès </td> </tr> <?php usort($lesTrolls, "callbackSortDistancePa"); while (list($key, $res) = each($lesTrolls)) { $i++; if ($res[maj_groupe_spec_troll] == 'oui' && !userIsGroupSpec()) { $res[distance_pa] = '?'; $res[x_troll] = '?'; $res[y_troll] = '?'; $res[z_troll] = '?'; } echo "<tr class='mh_tdpage'>"; if (is_numeric($x_troll) && is_numeric($y_troll) && is_numeric($z_troll)) { echo "<td >{$res['distance_pa']}</a></td>"; } echo "<td>"; afficherLien("troll", "fiche", $res[id_troll], "", "", "", htmlentities($res[nom_troll]) . " ({$res['id_troll']})"); echo "</td>"; $lien_guilde = "href='/engine_view.php?guilde={$res['id_guilde']}'"; echo "<td ><a {$lien_guilde}>" . htmlentities($res[nom_guilde]) . "</a></td>"; echo "<td align=center>{$res['race_troll']}</td>"; echo "<td align=center>{$res['niveau_troll']}</td>"; echo "<td align=center>{$res['is_tk_troll']}</td>"; echo "<td align=center>{$res['is_wanted_troll']}</td>"; echo "<td align=center>{$res['is_venge_troll']}</td>"; echo "<td align=center>{$res['statut_troll']}</td>"; echo "<td align=center>{$res['statut_guilde']}</td>"; echo "<td width=10>X={$res['x_troll']}</td>"; echo "<td width=10>Y={$res['y_troll']}</td>"; echo "<td width=40>N={$res['z_troll']}</td>"; echo "<td>{$res['date_troll']}"; if ($res['is_seen_troll'] == 'non') { $title = "Disparu depuis le " . date("d/m H:i", $res['date_troll']) . ""; echo "<img src='images/puce_disparu.gif' title='{$title}'>"; } echo "</td>"; echo "<td>"; afficherLien("troll", "fiche", $res[id_troll]); afficherLien("troll", "vue2d", $res[id_troll]); afficherLien("troll", "gps", $res[id_troll]); afficherLien("troll", "mh_evenements", $res[id_troll]); echo "</td>"; echo "</tr>"; if ($i > 299) { echo "<tr><td colspan='10'><h2><b>Il n'y a que les 300 premiers résultats d'affichés, affinez votre recherche si vous voulez...</b></h2></td></tr>"; break; } } echo "</table>"; echo "</td></tr></table><br>"; }
function recherche_troll($val) { $s = split(",", $val); $x_troll = $this->troll->get_x_troll(); $y_troll = $this->troll->get_y_troll(); $z_troll = $this->troll->get_z_troll(); $t = split("=", $s[0]); if (is_numeric($s[0])) { $id_troll = $s[0]; } else { if ($t[0] == "diplo") { $statut_troll = $t[1]; if ($statut_troll == "wanted") { $statut_troll = ''; $is_wanted_troll = "oui"; } } else { if ($t[0] == "diploguilde") { $statut_guilde = $t[1]; } else { $nom_troll = $s[0]; } } } if (count($s) == 4) { $x_troll = $s[1]; $y_troll = $s[2]; $z_troll = $s[3]; } $lesTrolls = selectDbRechercheTrolls($id_troll, $nom_troll, $race_troll, $nom_guilde, $niveau_troll, $is_tk_troll, $is_wanted_troll, $is_venge_troll, $x_troll, $y_troll, $z_troll, $limite, $statut_troll, $statut_guilde); /*if (count($lesTrolls) == 1) { if (!preg_match("/cockpit.php/",$this->page)) { echo "redirect:/cockpit.php?id_troll=".$lesTrolls[1][id_troll]; } else { echo "get_map_id_troll:".$lesTrolls[1][id_troll]; } } else {*/ afficherRechercheTrollsResultat($id_troll, $nom_troll, $race_troll, $nom_guilde, $niveau_troll, $is_tk_troll, $is_wanted_troll, $is_venge_troll, $x_troll, $y_troll, $z_troll, $limite, $statut_troll, $statut_guilde, $lesTrolls); //} }