Vous avez reçu un message "Your GitLab account has been locked ..." ? Pas d'inquiétude : lisez cet article https://docs.gricad-pages.univ-grenoble-alpes.fr/help/unlock/

Commit 31a171be authored by Mathieu Loiseau's avatar Mathieu Loiseau
Browse files

cartes

parent f2ab3b32
...@@ -149,23 +149,22 @@ class Card ...@@ -149,23 +149,22 @@ class Card
public function store($prompt=false){ public function store($prompt=false){
if($prompt){ if($prompt){
$this->db->query("SELECT `idCarte` FROM `cartes` WHERE `mot`='".$this->guessWord."' AND `langue`='".$this->lang."';"); $this->db->query("SELECT `idCarte` FROM `cartes` WHERE `mot`='".$this->guessWord."' AND `langue`='".$this->lang."';");
$nb = $this->db->num_rows() ; $nb = $this->db->num_rows() ;
if($nb > 0){ if($nb > 0){
//TODO : better compare with actual objects //TODO : better compare with actual objects
//and check the forbidden words and all… //and check the forbidden words and all…
$msg="("; $msg="";
while($row = $this->db->fetch_object()){ while($row = $this->db->fetch_object()){
if($msg!="("){ if($msg!=""){
$msg .= ", " ; $msg .= ", " ;
} }
$msg .= $row->idCarte; $msg .= $row->idCarte;
} }
$msg.=")"; throw new Exception("Il y a déjà $nb carte(s) associée(s) à “".$this->guessWord."” (carte(s) $msg).");
throw new Exception("Il y a déjà $nb cartes associées à “".$this->guessWord."” $msg.");
} }
} }
if($this->id){ if($this->id){
throw new Exception("Le programme ne sait pas encore mettre à jour les cartes…");//TODO throw new Exception("Le programme ne sait pas encore mettre à jour les cartes… (carte $this->id)");//TODO
} }
else{//Normal situation else{//Normal situation
//Handling the card base //Handling the card base
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment