function getCrapComposant() { $retour = ""; $xpathCompo = new DOMXPath(getComposant()); $xpath = new DOMXPath(getEMRecettes()); foreach ($xpath->query("/Recettes/Recette/composant[not(@mundidey)]") as $composantFixe) { $composantsFixe[] = $composantFixe->getAttribute("nom"); } $xpath = new DOMXPath(getEMComposantVariable()); foreach ($xpath->query("/Elements/Element") as $composantFixe) { $composantsFixe[] = $composantFixe->nodeValue; } $xpath = new DOMXPath(getCompotrolls()); foreach ($xpath->query("/Elements/Element") as $composantFixe) { $composantsFixe[] = $composantFixe->nodeValue; } $composantsFixe = implode("|", $composantsFixe); $xpath = new DOMXPath(getComposants()); foreach ($xpath->query(utf8_encode("/Elements/Element[contains(child::text(),'Mauvaise')]")) as $composant) { if (!preg_match("#" . $composantsFixe . ".*#", $composant->nodeValue)) { $niveau = $xpathCompo->query('/Elements/Element[contains("' . $composant->nodeValue . '",child::text())]')->item(0); $niveau = $niveau->nodeValue == NULL ? "?" : $niveau->getAttribute("niveau"); $arrayComposants[preg_replace("#.*Qualité (.*) \\[.*#", "\$1", utf8_decode($composant->nodeValue))][utf8_decode($composant->nodeValue)][] = array("nom" => utf8_decode($composant->nodeValue), "niveau" => $niveau, "id" => $composant->getAttribute("id"), "idTaniere" => $composant->getAttribute("idTaniere")); } } usort($arrayComposants["Très Mauvaise"], 'sortByNumber'); usort($arrayComposants["Mauvaise"], 'sortByNumber'); $arrayComposants = array_reverse($arrayComposants); foreach ($arrayComposants as $arrayQualité) { foreach ($arrayQualité as $composants) { foreach ($composants as $composant) { $retour .= "[" . $composant["id"] . "] " . $composant["nom"] . " " . getTanieresById($composant["idTaniere"]) . " niveau:" . $composant["niveau"] . "\n"; } } } return "<textarea rows='25' cols='200'>{$retour}</textarea>"; }
<?php header('Content-Type: text/html; charset=utf-8'); include_once "../functions_auth.php"; include_once "../easyem/easyem_functions.php"; if (userIsGuilde() || userIsGroupSpec()) { echo "try { \n"; $url = "http://outilsrm.free.fr/images/firemago"; $index = $_REQUEST["index"]; $nomCompos = $_REQUEST["nomCompos"]; $array = array("Œ" => "Oe", "œ" => "oe"); $compotrolls = getCompotrolls(); $recettes = getEMRecettes(); foreach ($nomCompos as $i => $nom) { $nom = strtr($nom, $array); if ($sort = getCompoFixeByCompo($nom, $recettes)) { echo "\$('>tr:eq({$i})>td:eq(1)>a',compos).after('" . addslashes(" <img align='ABSMIDDLE' title='Composant fixe de " . $sort->parentNode->getAttribute("nom") . " de Qualité " . $sort->getAttribute("qualité") . "' src='{$url}/emFixe.png'/>") . "');"; } if ($mundidey = getCompoVar($nom)) { echo "\$('>tr:eq({$i})>td:eq(1)>a',compos).after(' " . addslashes("<img align='ABSMIDDLE' title='Composant Variable Mundidey " . $mundidey . "' src='{$url}/emV.png'/>") . "');"; } if ($compotroll = getCompoTrollByCompo($nom, $compotrolls)) { echo "\$('>tr:eq({$i})>td:eq(1)>a',compos).after('" . addslashes(" <img align='ABSMIDDLE' title=\"Compotroll de " . $compotroll->getAttribute("troll") . " de Qualité " . $compotroll->getAttribute("qualité") . "\" src='{$url}/emCT.png'/>") . "');"; } } echo "} catch ( e ) { \n\t\talert ( e, 'Compo Equipement error' );\n\t\t} \n"; }