} } } } } } } } $aventurier->modifier(); $magies = Magie::Lister(); $dieux = Dieu::Lister(); include "view/ficheRapideModification.php"; } else { $message = "vous n'avez pas le bon code d'accès."; include "view/message.php"; } } } else { $armes = Arme::ListerBase(); $equipements = Equipement::ListerBase(); $protections = Protection::ListerBase(); $types_arme = Arme::ListerTypesArmeDeBase(); $types_protection = Protection::ListerTypesProtectionDeBase(); $types_equipement = Equipement::ListerTypesEquipementDeBase(); $metiers = Metier::Lister(); $origines = Origine::Lister(); $competences = Competence::Lister(); $magies = Magie::Lister(); $dieux = Dieu::Lister(); include "view/ficheRapide.php"; }
public function __set($var, $value) { if ($var == "ID_ORIGINE") { $this->ID_ORIGINE = $value; $origine = new Origine(); $origine->get_data_from_db($value); $this->ORIGINE = $origine; } else { if ($var == "ID_METIER") { $this->ID_METIER = $value; $metier = new Metier(); $metier->get_data_from_db($value); $this->METIER = $metier; } else { if ($var == "ID_DIEU") { $this->ID_DIEU = $value; $dieu = new Dieu(); $dieu->get_data_from_db($value); $this->DIEU = $dieu; } else { $this->{$var} = $value; } } } }
function printTableOrigineMetier() { $metiers = Metier::Lister(); $origines = Origine::Lister(); $tableHTML = "<table style='border-collapse:collapse;margin:auto;'>"; $tableHTML .= "<tr>"; $tableHTML .= "<td></td>"; foreach ($origines as $origine) { $tableHTML .= "<td style='border:1px #900000 solid;padding:5px'>" . $origine->NOM . "</td>"; } $tableHTML .= "</tr>"; foreach ($metiers as $metier) { $tableHTML .= "<tr>"; $tableHTML .= "<td style='padding:5px;border:1px #900000 solid;'>" . $metier->NOM . "</td>"; for ($nbrOrigine = 0; $nbrOrigine < count($origines); $nbrOrigine++) { $tableHTML .= "<td style='text-align:center;border:1px #900000 solid;'>"; if (!sontCompatibles($metier, $origines[$nbrOrigine])) { $tableHTML .= "X"; } $tableHTML .= "</td>"; } $tableHTML .= "</tr>"; } $tableHTML .= "</table>"; echo $tableHTML; }
$temp_tab[] = array($aventurier->COU, $aventurier->CHA, $aventurier->INT, $aventurier->AD, $aventurier->FO); $temp_tab[] = array($aventurier->COU, $aventurier->AD, $aventurier->CHA, $aventurier->INT, $aventurier->FO); $temp_tab[] = array($aventurier->COU, $aventurier->FO, $aventurier->CHA, $aventurier->AD, $aventurier->INT); $temp_tab[] = array($aventurier->COU, $aventurier->INT, $aventurier->AD, $aventurier->CHA, $aventurier->FO); $temp_tab[] = array($aventurier->COU, $aventurier->INT, $aventurier->FO, $aventurier->AD, $aventurier->CHA); $temp_tab[] = array($aventurier->COU, $aventurier->INT, $aventurier->CHA, $aventurier->FO, $aventurier->AD); $tableau_final = array(); foreach ($temp_tab as $tab) { if ($tab != $tableau_base && !in_array($tab, $tableau_final)) { $tableau_final[] = $tab; } } $compte = 0; foreach ($tableau_final as $tab) { echo "<div style='float:left;border:1px black solid;padding:10px;width:480px;margin:20px;' class='formulaireParchemin' ><span style='font-size:24px;' >Echange "; $listeOrigines = Origine::getOriginesPossibles($tab[0], $tab[2], $tab[1], $tab[3], $tab[4]); $listeMetiers = Metier::getMetiersPossibles($tab[0], $tab[2], $tab[1], $tab[3], $tab[4]); $a = 0; if ($tab[0] != $aventurier->COU) { if ($a > 0) { echo " et "; } $a++; echo "de COURAGE"; } if ($tab[1] != $aventurier->INT) { if ($a > 0) { echo " et "; } $a++; echo "d'INTELLIGENCE";
$aventurier->AD = rand(8, 13); $_SESSION["birdibeuk_aventurier"] = serialize($aventurier); $listeOrigines = Origine::getOriginesPossibles($aventurier->COU, $aventurier->CHA, $aventurier->INT, $aventurier->AD, $aventurier->FO); $listeMetiers = Metier::getMetiersPossibles($aventurier->COU, $aventurier->CHA, $aventurier->INT, $aventurier->AD, $aventurier->FO); include "view/nouvelAventurierOrigineEtMetier.php"; include "view/cadrePDF.php"; } } } } break; case 1: if (isset($_GET["type"])) { //On commence un nouvel aventurier $aventurier = new Aventurier(); $listeOrigines = Origine::Lister(); $listeMetiers = Metier::Lister(); $aventurier->type = $_GET["type"]; $_SESSION["birdibeuk_aventurier"] = serialize($aventurier); include "view/nouvelAventurierDesCaracs.php"; include "view/cadrePDF.php"; } else { include "view/nouvelAventurier.php"; } break; case 0: default: include "view/nouvelAventurier.php"; break; } } else {