Exemplo n.º 1
0
 public function RatingProject($_internID, $_projectID, $_value)
 {
     //Si aucune note n'avait été donné avant, la rajouter.
     if (parent::DBQuery("SELECT * FROM ratings WHERE internID=" . $_internID . " and projectID=" . $_projectID) == null) {
         parent::DBExecute("INSERT INTO ratings (score,internID, projectID)\n\t\t\t\t\t\t\t\tVALUES(\n\t\t\t\t\t\t\t\t" . $_value . ",\n\t\t\t\t\t\t\t\t" . $_internID . ",\n\t\t\t\t\t\t\t\t" . $_projectID . ")");
     } else {
         //Sinon, mettre à jour la base de donnée
         parent::DBExecute("Update ratings \n\t\t\t\t\t\t\t\tSET\n\t\t\t\t\t\t\t\tscore = " . $_value . "\n\t\t\t\t\t\t\t\tWHERE\n\t\t\t\t\t\t\t\tinternID = " . $_internID . " AND\n\t\t\t\t\t\t\t\tprojectID = " . $_projectID . ";");
     }
 }
Exemplo n.º 2
0
 public function Logout($_token)
 {
     $token = $this->TokenGen();
     //Mise à jour de l'utilisateur.
     $cmd = "UPDATE users SET token= " . $token . "WHERE token = " . $_token;
     parent::DBExecute($cmd);
 }
Exemplo n.º 3
0
 public function DeleteProject($_projectId)
 {
     parent::DBExecute("DELETE FROM ratings WHERE projectID = " . $_projectId);
     parent::DBExecute("DELETE FROM projects WHERE ID = " . $_projectId);
 }