Example #1
0
 public static function ipVisitedToday($ip)
 {
     $db = getConnexionDB();
     $requete = "SELECT COUNT(*) as COMPTE FROM visiteur WHERE IP = '" . $ip . "' AND DATE(visiteur.DATE) = CURDATE()";
     $stmt = $db->prepare($requete);
     $res = executePDOSQPWithDebug($stmt);
     $ligne = $stmt->fetch(PDO::FETCH_ASSOC);
     if ($ligne["COMPTE"] > 0) {
         return true;
     } else {
         return false;
     }
 }
Example #2
0
 public function get_data_from_db($id)
 {
     $db = getConnexionDB();
     $requete = "SELECT * FROM news WHERE ID_NEWS = " . $id;
     foreach ($db->query($requete, PDO::FETCH_ASSOC) as $ligne) {
         $this->ID_NEWS = DatabaseManager::CastForOut($ligne['ID_NEWS']);
         $this->DATE_NEWS = DatabaseManager::CastForOut($ligne['DATE_NEWS']);
         $this->TITRE = DatabaseManager::CastForOut($ligne['TITRE']);
         $this->TEXTE = DatabaseManager::CastForOut($ligne['TEXTE']);
     }
 }
Example #3
0
 public function get_data_from_db($id)
 {
     $db = getConnexionDB();
     $requete = "SELECT * FROM user WHERE id = " . $id;
     $stmt = $db->prepare($requete);
     $stmt->execute();
     $ligne = $stmt->fetch(PDO::FETCH_ASSOC);
     foreach ($ligne as $key => $value) {
         $this->{$key} = $value;
     }
 }
Example #4
0
 public function get_data_from_db($id)
 {
     $db = getConnexionDB();
     $requete = "SELECT * FROM metier WHERE ID = " . $id;
     $stmt = $db->prepare($requete);
     $stmt->execute();
     $ligne = $stmt->fetch(PDO::FETCH_ASSOC);
     $this->ID = $ligne['ID'];
     $this->NOM = $ligne['NOM'];
     $this->EV = $ligne['EV'];
     $this->EA = $ligne['EA'];
     $this->AT = $ligne['AT'];
     $this->PRD = $ligne['PRD'];
     $this->FOMIN = $ligne['FOMIN'];
     $this->FOMAX = $ligne['FOMAX'];
     $this->ADMIN = $ligne['ADMIN'];
     $this->ADMAX = $ligne['ADMAX'];
     $this->INTMIN = $ligne['INTMIN'];
     $this->INTMAX = $ligne['INTMAX'];
     $this->CHAMIN = $ligne['CHAMIN'];
     $this->CHAMAX = $ligne['CHAMAX'];
     $this->COUMIN = $ligne['COUMIN'];
     $this->COUMAX = $ligne['COUMAX'];
     $this->RESTRICTION = $ligne['RESTRICTION'];
     $this->BONUS = $ligne['BONUS'];
     $this->PRMAX = $ligne['PRMAX'];
     $db = getConnexionDB();
     $requete = "SELECT ID_COMPETENCE FROM lien_metier_competence_native WHERE ID_METIER = " . $id;
     $stmt = $db->prepare($requete);
     $stmt->execute();
     while ($ligne = $stmt->fetch(PDO::FETCH_ASSOC)) {
         $competence = new Competence($ligne["ID_COMPETENCE"]);
         $this->COMPETENCESLIEES[] = $competence;
     }
     $requete = "SELECT ID_COMPETENCE FROM lien_metier_competence_choix WHERE ID_METIER = " . $id;
     $stmt = $db->prepare($requete);
     $stmt->execute();
     while ($ligne = $stmt->fetch(PDO::FETCH_ASSOC)) {
         $competence = new Competence($ligne["ID_COMPETENCE"]);
         $this->COMPETENCESACHOISIR[] = $competence;
     }
 }
Example #5
0
 public function get_data_from_db($id)
 {
     $db = getConnexionDB();
     $requete = "SELECT * FROM arme WHERE ID = " . $id;
     $stmt = $db->prepare($requete);
     $stmt->execute();
     $ligne = $stmt->fetch(PDO::FETCH_ASSOC);
     $this->ID = $ligne['ID'];
     $this->NOM = $ligne['NOM'];
     $this->NOM_COURT = $ligne['NOM_COURT'];
     $this->PRIX = $ligne['PRIX'];
     $this->PI = $ligne['PI'];
     $this->RUP = $ligne['RUP'];
     $this->AT = $ligne['AT'];
     $this->PRD = $ligne['PRD'];
     $this->COU = $ligne['COU'];
     $this->INT = $ligne['INT'];
     $this->CHA = $ligne['CHA'];
     $this->AD = $ligne['AD'];
     $this->FOR = $ligne['FOR'];
     $this->SPECIAL = $ligne['SPECIAL'];
     $this->JET = $ligne['JET'];
     $this->qualite = $ligne['qualite'];
     $this->type = $ligne['type'];
     $this->deuxmains = $ligne['deuxmains'];
     $this->debase = $ligne['debase'];
 }
Example #6
0
 public function get_data_from_db($id)
 {
     $db = getConnexionDB();
     $requete = "SELECT * FROM dieu WHERE ID_DIEU = " . $id;
     $stmt = $db->prepare($requete);
     $stmt->execute();
     $ligne = $stmt->fetch(PDO::FETCH_ASSOC);
     $this->ID_DIEU = $ligne['ID_DIEU'];
     $this->NOM = $ligne['NOM'];
     $this->DESCRIPTION = $ligne['DESCRIPTION'];
     $this->PALADIN = $ligne['PALADIN'];
     $this->PRETRE = $ligne['PRETRE'];
 }
Example #7
0
 public function determineCompetences()
 {
     if ($this->METIER != "" && $this->ORIGINE != "") {
         $this->COMPETENCESLIEES = fusionneCompetencesSansDoublons($this->METIER->COMPETENCESLIEES, $this->ORIGINE->COMPETENCESLIEES);
     }
     if (empty($this->ID)) {
         return;
     }
     $db = getConnexionDB();
     $requete = "SELECT * FROM lien_aventurier_competence WHERE ID_AVENTURIER = " . $this->ID;
     $stmt = $db->prepare($requete);
     $stmt->execute();
     $this->COMPETENCESCHOISIES = array();
     while ($ligne = $stmt->fetch(PDO::FETCH_ASSOC)) {
         $comp = new Competence();
         $this->COMPETENCESCHOISIES[] = $comp;
     }
     $this->competences = fusionneCompetencesSansDoublons($this->COMPETENCESCHOISIES, $this->COMPETENCESLIEES);
 }
Example #8
0
 public function get_data_from_db($id)
 {
     $db = getConnexionDB();
     $requete = "SELECT * FROM equipement WHERE ID = " . $id;
     $stmt = $db->prepare($requete);
     $stmt->execute();
     $ligne = $stmt->fetch(PDO::FETCH_ASSOC);
     $this->ID = $ligne['ID'];
     $this->NOM = $ligne['NOM'];
     $this->SPECIAL = $ligne['SPECIAL'];
     $this->PO = $ligne['PO'];
     $this->PA = $ligne['PA'];
     $this->PC = $ligne['PC'];
     $this->COU = $ligne['COU'];
     $this->INT = $ligne['INT'];
     $this->CHA = $ligne['CHA'];
     $this->AD = $ligne['AD'];
     $this->FO = $ligne['FO'];
     $this->munition = $ligne['munition'];
     $this->debase = $ligne['debase'];
     $this->type = $ligne['type'];
     $this->AT = $ligne['AT'];
     $this->PRD = $ligne['PRD'];
 }
Example #9
0
 public function get_data_from_db($id)
 {
     $db = getConnexionDB();
     $requete = "SELECT * FROM magie WHERE ID_MAGIE = " . $id;
     $stmt = $db->prepare($requete);
     $stmt->execute();
     $ligne = $stmt->fetch(PDO::FETCH_ASSOC);
     $this->ID_MAGIE = $ligne['ID_MAGIE'];
     $this->NOM = $ligne['NOM'];
     $this->disponible = $ligne['disponible'];
 }
Example #10
0
 public function get_data_from_db($id)
 {
     $db = getConnexionDB();
     $requete = "SELECT * FROM origine WHERE ID = " . $id;
     $stmt = $db->prepare($requete);
     $stmt->execute();
     $ligne = $stmt->fetch(PDO::FETCH_ASSOC);
     $this->ID = $ligne['ID'];
     $this->NOM = $ligne['NOM'];
     $this->EV = $ligne['EV'];
     $this->AT = $ligne['AT'];
     $this->PRD = $ligne['PRD'];
     $this->FOMIN = $ligne['FOMIN'];
     $this->FOMAX = $ligne['FOMAX'];
     $this->ADMIN = $ligne['ADMIN'];
     $this->ADMAX = $ligne['ADMAX'];
     $this->INTMIN = $ligne['INTMIN'];
     $this->INTMAX = $ligne['INTMAX'];
     $this->CHAMIN = $ligne['CHAMIN'];
     $this->CHAMAX = $ligne['CHAMAX'];
     $this->COUMIN = $ligne['COUMIN'];
     $this->COUMAX = $ligne['COUMAX'];
     $this->RESTRICTION = $ligne['RESTRICTION'];
     $this->BONUS = $ligne['BONUS'];
     $this->MAGIE = $ligne['MAGIE'];
     $this->PRMAX = $ligne['PRMAX'];
     $this->BOUCLIER = $ligne['BOUCLIER'];
     $this->JET = $ligne['JET'];
     $this->MALADIE = $ligne['MALADIE'];
     $this->PETITE_TAILLE = $ligne['PETITE_TAILLE'];
     $this->PR_MAX = $ligne['PR_MAX'];
     $this->COMPETENCESLIEES = array();
     $this->COMPETENCESACHOISIR = array();
     $requete = "SELECT ID_COMPETENCE FROM lien_origine_competence_native WHERE ID_ORIGINE = " . $id;
     $stmt = $db->prepare($requete);
     $stmt->execute();
     while ($ligne = $stmt->fetch(PDO::FETCH_ASSOC)) {
         $competence = new Competence($ligne["ID_COMPETENCE"]);
         $this->COMPETENCESLIEES[] = $competence;
     }
     $requete = "SELECT ID_COMPETENCE FROM lien_origine_competence_choix WHERE ID_ORIGINE = " . $id;
     $stmt = $db->prepare($requete);
     $stmt->execute();
     while ($ligne = $stmt->fetch(PDO::FETCH_ASSOC)) {
         $competence = new Competence($ligne["ID_COMPETENCE"]);
         $this->COMPETENCESACHOISIR[] = $competence;
     }
 }
Example #11
0
 public function get_data_from_db($id)
 {
     $db = getConnexionDB();
     $requete = "SELECT * FROM protection WHERE ID = " . $id;
     $stmt = $db->prepare($requete);
     $stmt->execute();
     $ligne = $stmt->fetch(PDO::FETCH_ASSOC);
     $this->ID = $ligne['ID'];
     $this->NOM = $ligne['NOM'];
     $this->NOM_COURT = $ligne['NOM_COURT'];
     $this->PR = $ligne['PR'];
     $this->RUP = $ligne['RUP'];
     $this->COU = $ligne['COU'];
     $this->INT = $ligne['INT'];
     $this->CHA = $ligne['CHA'];
     $this->AD = $ligne['AD'];
     $this->FOR = $ligne['FOR'];
     $this->SPECIAL = $ligne['SPECIAL'];
     $this->AT = $ligne['AT'];
     $this->PRD = $ligne['PRD'];
     $this->PRIX = $ligne['PRIX'];
     $this->QUALITE = $ligne['QUALITE'];
     $this->TYPE = $ligne['TYPE'];
     $this->debase = $ligne['debase'];
 }
Example #12
0
 public function get_data_from_db($id)
 {
     $db = getConnexionDB();
     $requete = "SELECT * FROM dieu WHERE DIEU_ID = " . $id;
     $stmt = $db->prepare($requete);
     $stmt->execute();
     $ligne = $stmt->fetch(PDO::FETCH_ASSOC);
     $this->loadFromArray($ligne);
 }
Example #13
0
 public function get_data_from_db($id)
 {
     $db = getConnexionDB();
     $requete = "SELECT * FROM competence WHERE ID = " . $id;
     $stmt = $db->prepare($requete);
     $stmt->execute();
     $ligne = $stmt->fetch(PDO::FETCH_ASSOC);
     $this->ID = $ligne['ID'];
     $this->NOM = $ligne['NOM'];
     $this->PR = $ligne['PR'];
     $this->AT = $ligne['AT'];
     $this->PRD = $ligne['PRD'];
     $this->COU = $ligne['COU'];
     $this->CHA = $ligne['CHA'];
     $this->INT = $ligne['INT'];
     $this->FO = $ligne['FO'];
     $this->AD = $ligne['AD'];
     $this->SPECIAL = $ligne['SPECIAL'];
     $this->REQUIS = $ligne['REQUIS'];
 }
Example #14
0
 public function get_data_from_db($id)
 {
     $db = getConnexionDB();
     $requete = "SELECT * FROM mob WHERE id_mob = " . $id;
     $stmt = $db->prepare($requete);
     $stmt->execute();
     $ligne = $stmt->fetch(PDO::FETCH_ASSOC);
     $this->id_mob = $ligne['id_mob'];
     $this->type_mob = $ligne['type_mob'];
     $this->nom = $ligne['nom'];
     $this->at = $ligne['at'];
     $this->prd = $ligne['prd'];
     $this->ev = $ligne['ev'];
     $this->pr = $ligne['pr'];
     $this->pi = $ligne['pi'];
     $this->type_arme = $ligne['type_arme'];
     $this->cou = $ligne['cou'];
     $this->rm = $ligne['rm'];
     $this->xp = $ligne['xp'];
     $this->note = $ligne['note'];
     $this->niv_min = $ligne['niv_min'];
     $this->niv_max = $ligne['niv_max'];
     $this->po = $ligne['po'];
     $this->humanoide = $ligne['humanoide'];
 }