-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
132 additions
and
909 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
src/main/java/fr/enseirb/t3/it340/servlets/creneau/InscrireCreneau.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package fr.enseirb.t3.it340.servlets.creneau; | ||
|
||
import fr.enseirb.t3.it340.bdd.BddEnregistrement; | ||
import fr.enseirb.t3.it340.servlets.authentification.Authentification; | ||
import spark.ModelAndView; | ||
import spark.Request; | ||
import spark.Response; | ||
import spark.Route; | ||
|
||
public class InscrireCreneau implements Route { | ||
|
||
|
||
public String handle(Request request, Response response) throws Exception { | ||
ModelAndView modelAndView = Authentification.checkEnseignant(request, response); | ||
if (modelAndView != null) | ||
return ""; | ||
|
||
try { | ||
Integer idEnseignant = request.session().attribute("enseignant"); | ||
Integer idCreneau = Integer.parseInt(request.params("idCreneau")); | ||
Integer nbInscrits = Integer.parseInt(request.queryParams("nbInscrits")); | ||
|
||
BddEnregistrement.enregistrement(idEnseignant, idCreneau, nbInscrits); | ||
} catch (Exception e) {} | ||
|
||
response.redirect("/enseignant"); | ||
return ""; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
src/main/java/fr/enseirb/t3/it340/servlets/creneau/VisualisationInscrireCreneau.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package fr.enseirb.t3.it340.servlets.creneau; | ||
|
||
import fr.enseirb.t3.it340.servlets.authentification.Authentification; | ||
import spark.*; | ||
|
||
import java.util.HashMap; | ||
import java.util.Map; | ||
|
||
public class VisualisationInscrireCreneau implements TemplateViewRoute { | ||
|
||
public ModelAndView handle(Request request, Response response) throws Exception { | ||
// On regarde si l'utilisateur a accès | ||
ModelAndView modelAndView = Authentification.checkEnseignant(request, response); | ||
if (modelAndView != null) | ||
return modelAndView; | ||
|
||
Map<String, Object> attributes = new HashMap<String, Object>(); | ||
attributes.put("title", "Inscription au créneau"); | ||
attributes.put("connected", (request.session().attribute("email") != null)); | ||
attributes.put("labo", (request.session().attribute("labo") != null)); | ||
attributes.put("enseignant", (request.session().attribute("enseignant") != null)); | ||
|
||
Integer idEnseignant = request.session().attribute("enseignant"); | ||
|
||
if (idEnseignant == null) | ||
response.redirect("/enseignant"); | ||
|
||
return new ModelAndView(attributes, "inscription-creneau.ftl"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.