<?php header('Content-Type: text/html; charset=iso-8859-1'); require_once "../easyem_functions.php"; $tanieres = array("38965" => "La Bïblyohtek", "1646554" => "Le Relais des Abysses", "34111" => "La Taverne"); if ($_POST["type"] == "Compo") { $composant = getItemById(getComposants(), $_POST["id"]); } if ($_POST["type"] == "Champi") { $composant = getItemById(getChampignons(), $_POST["id"]); } if ($_POST["type"] == "PoPaAn") { $composant = getItemById(getParchemins(), $_POST["id"]); } echo "<h3><a href='' onClick=\"window.open('http://games.mountyhall.com/mountyhall/View/TresorHistory.php?ai_IDTresor=" . $composant->getAttribute("id") . "&as_From=Comptoir&ai_IDLieu=" . $composant->getAttribute("idTaniere") . "','_blank','toolbar=0, location=0, directories=0, status=0, scrollbars=1, resizable=1, copyhistory=0, menuBar=0, width=766, height=636');return(false);\">[" . $_POST["id"] . "]</a> <a href='http://games.mountyhall.com/mountyhall/MH_Comptoirs/Comptoir_o_Stock.php?IDLieu=" . $composant->getAttribute("idTaniere") . "&as_type=" . $_POST["type"] . "' target='_blank'>" . getTanieresById($composant->getAttribute("idTaniere")) . "</a></h3>";
function getChampignonOption() { $retour = ""; $qualités = array("Mielleux" => "0", "Sucré" => "-5", "Salé" => "-10", "Acide" => "-20"); $arrayCorrespondance = array("du Hum ..." => "Inconnu", "du Phoenix" => "Préscientus Reguis", "de la Mouche" => "Amanite Trolloïde", "du Dindon" => "Girolle Sanglante", "du Goblin" => "Horreur Des Prés", "du Démon" => "Bolet Péteur", "de la Limace" => "Pied Jaune", "du Rat" => "Agaric Sous-Terrain", "de l'Hydre" => "Suinte Cadavre", "du Ver" => "Cèpe Lumineux", "du Fungus" => "Fungus Rampant", "de la Vouivre" => "Nez Noir", "du Gnu" => "Pleurote Pleureuse", "du Scarabée" => "Phytomassus Xilénique"); $arrayChampignon = array(); $mundidey = getMundidey(time()); $xpath = new DOMXPath(getChampignons()); foreach ($xpath->query('/Elements/Element[contains(child::text(),"' . utf8_encode($arrayCorrespondance[$mundidey]) . '")]') as $champignon) { foreach ($qualités as $qualité => $value) { if (preg_match("#.*" . utf8_encode($qualité) . "#", $champignon->nodeValue)) { $arrayChampignon[] = array("id" => $champignon->getAttribute("id"), "idTaniere" => $champignon->getAttribute("idTaniere"), "ratio" => $value, "nom" => $champignon->nodeValue); break; } } } if (empty($arrayChampignon)) { $retour .= "<option onClick='updateRatio();' value='0'>Pas de champignons en Tanières !</option>"; $retour = "<td class='mh_tdpage'><select class='composant_taniere'>" . $retour . "</select></td>"; $retour .= "<td id='td_champignon' class='mh_tdpage' width='200px'><h3></h3></td>"; $retour .= "<input class='hidden_element' type='hidden' value='Pas de champignons en Tanières !'/>"; } else { usort($arrayChampignon, 'sortByRatio'); foreach ($arrayChampignon as $champignon) { $retour .= "<option onClick='updateHidden( \"hidden_champignon\", \"[" . $champignon["id"] . "] " . addslashes(utf8_decode($champignon["nom"])) . " " . getTanieresById($champignon["idTaniere"]) . "\" );updateRatio();getTaniere( \"Champi\", \"champignon\", " . $champignon["id"] . " );' value='" . $champignon["ratio"] . "'>" . utf8_decode($champignon["nom"]) . " -> " . $champignon["ratio"] . "%</option>"; } $retour = "<td class='mh_tdpage'><select class='composant_taniere'>" . $retour . "</select></td>"; $retour .= "<td id='td_champignon' class='mh_tdpage' width='200px'><h3><a href='' onClick=\"window.open('http://games.mountyhall.com/mountyhall/View/TresorHistory.php?ai_IDTresor=" . $arrayChampignon[0]["id"] . "&as_From=Comptoir&ai_IDLieu=" . $arrayChampignon[0]["idTaniere"] . "','_blank','toolbar=0, location=0, directories=0, status=0, scrollbars=1, resizable=1, copyhistory=0, menuBar=0, width=766, height=636');return(false);\">[" . $arrayChampignon[0]["id"] . "]</a> <a href='http://games.mountyhall.com/mountyhall/MH_Comptoirs/Comptoir_o_Stock.php?IDLieu=" . $arrayChampignon[0]["idTaniere"] . "&as_type=Champi' target='_blank'>" . getTanieresById($arrayChampignon[0]["idTaniere"]) . "</a></h3></td>"; $retour .= "<input id='hidden_champignon' class='hidden_element' type='hidden' value=\"[" . $arrayChampignon[0]["id"] . "] " . utf8_decode($arrayChampignon[0]["nom"]) . " " . getTanieresById($arrayChampignon[0]["idTaniere"]) . "\"/>"; } return $retour; }