Skip to content
Snippets Groups Projects
Commit 874f2563 authored by Thomas Mewily's avatar Thomas Mewily
Browse files

test refresh /eleves/gommette/ajout

parent 53a551ac
No related branches found
No related tags found
No related merge requests found
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
......@@ -8,6 +8,10 @@ import java.sql.Date;
import java.util.*;
import static spark.Spark.*;
import java.text.*;
import java.io.IOException;
import java.nio.file.Path;
import java.nio.file.Paths;
public class StartServer {
//.\gradlew run
......@@ -148,6 +152,8 @@ public class StartServer {
post("/eleves/gommette/delete", (req,res)->{
System.out.println("deleted gommette");
Core.GommetteAttrib.delete(Integer.parseInt(req.queryParams("id")));
res.redirect("/eleves");
return null;
});
......@@ -162,8 +168,13 @@ public class StartServer {
int idGommette = Integer.parseInt(req.queryParams("idGommette"));
int idEleve = Integer.parseInt(req.queryParams("idEleve"));
String url = req.url();
url = url.substring(0, url.lastIndexOf('/'));
url = url+"s?id="+idEleve+"&id=";
Core.GommetteAttrib.create(idEleve,connected.getId(),idGommette, new java.sql.Date(System.currentTimeMillis()), raison);
res.redirect("/eleves");
System.out.println("url: "+url);
res.redirect(url);
return null;
});
......
......@@ -21,7 +21,8 @@ public class _Initializer {
public static void CreateTable(String command)
{
System.out.println("Creation de la table "+command.split(" ")[0]);
//System.out.println("Creation de la table "+command.split(" ")[0]);
System.out.println(command);
command = "CREATE TABLE IF NOT EXISTS "+command;
try {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment