Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Mathieu Loiseau
GameOfWords
Commits
31a171be
Commit
31a171be
authored
May 21, 2017
by
Mathieu Loiseau
Browse files
cartes
parent
f2ab3b32
Changes
1
Hide whitespace changes
Inline
Side-by-side
models/card.class.php
View file @
31a171be
...
...
@@ -149,23 +149,22 @@ class Card
public
function
store
(
$prompt
=
false
){
if
(
$prompt
){
$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
){
//TODO : better compare with actual objects
//and check the forbidden words and all…
$msg
=
"
(
"
;
$msg
=
""
;
while
(
$row
=
$this
->
db
->
fetch_object
()){
if
(
$msg
!=
"
(
"
){
if
(
$msg
!=
""
){
$msg
.
=
", "
;
}
$msg
.
=
$row
->
idCarte
;
}
$msg
.
=
")"
;
throw
new
Exception
(
"Il y a déjà
$nb
cartes associées à “"
.
$this
->
guessWord
.
"”
$msg
."
);
throw
new
Exception
(
"Il y a déjà
$nb
carte(s) associée(s) à “"
.
$this
->
guessWord
.
"” (carte(s)
$msg
)."
);
}
}
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
//Handling the card base
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment