Correction de la saisie de notes qui était corrompue à cause de l'unification des strings des requêtes SQL
This commit is contained in:
parent
f0222656ab
commit
b3f466a8ec
|
@ -38,7 +38,7 @@ class DataBase{
|
|||
/* retourne une instance de la classe */
|
||||
public static function getInstance(){
|
||||
if( DataBase::$instance == null )
|
||||
DataBase::$instance = new DataBase("localhost", "sid2", "root", "");
|
||||
DataBase::$instance = new DataBase("localhost", "sid2", "php", "Qt358nUdyeTxLDM8");
|
||||
|
||||
return DataBase::$instance;
|
||||
}
|
||||
|
@ -586,6 +586,8 @@ class DataBase{
|
|||
// saisie de la note
|
||||
$rep = noteRepo::creer($etudiantUID, $controleInfo['id'], $controleInfo['id_semestre'], $note);
|
||||
|
||||
// var_dump( $rep );
|
||||
|
||||
if( $rep )
|
||||
return 'success';
|
||||
else
|
||||
|
|
|
@ -231,12 +231,12 @@ class noteRepo extends DBAccess{
|
|||
============================================================================*/
|
||||
if( !($noteUID=noteRepo::UID($etudiant, $controle)) ){
|
||||
|
||||
$creationNote = DataBase::getPDO()->prepare("INSERT INTO note(id_note, id_appartenance, id_controle, valeur)
|
||||
$creationNote = DataBase::getPDO()->prepare("INSERT INTO note(id_note, id_appartenance, id_controle, valeur)
|
||||
VALUES(
|
||||
DEFAULT,
|
||||
(SELECT id_appartenance FROM appartenance WHERE id_etudiant = :etudiant AND id_semestre = :semestre),
|
||||
:controle,
|
||||
:valeur.
|
||||
:valeur
|
||||
)");
|
||||
$creationNote->execute(array( ':etudiant' => $etudiant, ':semestre' => $semestre, ':controle' => $controle, ':valeur' => $valeur ));
|
||||
|
||||
|
@ -257,7 +257,7 @@ class noteRepo extends DBAccess{
|
|||
|
||||
/* [4] On vérifie que la note créée a bien la valeur qu'on a attribuée
|
||||
=================================================================================*/
|
||||
$verificationValeur = DataBase::getPDO()->prepare("SELECT note.valeur FROM note WHERE id_note = :noteUID");
|
||||
$verificationValeur = DataBase::getPDO()->prepare("SELECT valeur FROM note WHERE id_note = :noteUID");
|
||||
$verificationValeur->execute(array( ':noteUID' => $noteUID ));
|
||||
|
||||
return ( $verificationValeur->fetch()['valeur'] == $valeur );
|
||||
|
|
|
@ -154,6 +154,7 @@
|
|||
break;
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue