Sauvegarde les rapports d'espionnages

This commit is contained in:
Nigel Sheldon 2021-01-27 17:13:01 +01:00
parent 9a14ddcd8d
commit bd5e4c75c1
1 changed files with 18 additions and 5 deletions

View File

@ -96,10 +96,6 @@ class Rapport
$this->rapportA .= "</table><br />";
}
//Flottes en orbite
if ($this->var[2] > 3) {
}
//Flottes au sol
if ($this->var[2] > 4) {
$this->rapportA .= "<table style=\"margin: auto;\"><tr><th>Nombre</th><th>Vaisseaux</th></tr>";
@ -121,6 +117,16 @@ class Rapport
}
}
//On envoit le rapport d'espionnage
$temps = $this->timestamp;
$db = new BDD();
$db->escape($this->titreA);
$db->escape($this->rapportA);
$db->query("INSERT INTO ".$this->table." (destinataire, sujet, contenu, temps) VALUES(".$this->utilA->id_user.", '$this->titreA', '$this->rapportA', '$temps');");
$db->deconnexion();
//On envoit le rapport de cdontre-espionnage
if ($this->var[3] >= 1) {
$this->titreB = "Rapport de contre-espionnage";
if (!isset($this->var[0]->nom_planete)) {
@ -128,8 +134,15 @@ class Rapport
} else {
$this->rapportB = "Nous venons d'apprendre que notre planète : ".$this->var[0]->nom_planete."[".$this->var[0]->galaxie.":".$this->var[0]->ss.":".$this->var[0]->position."] a été la cible d'un espionnage de la part de ".$this->utilA->pseudo;
}
$temps = $this->timestamp;
$db = new BDD();
$db->escape($this->titreB);
$db->escape($this->rapportB);
$db->query("INSERT INTO ".$this->table." (destinataire, sujet, contenu, temps) VALUES(".$this->utilB->id_user.", '$this->titreB', '$this->rapportB', '$temps');");
$db->deconnexion();
}
$this->rapportA = $this->rapportA;
}
public function sendTransport()