diff --git a/build/classes/Padeler/Test.class b/build/classes/Padeler/Test.class
deleted file mode 100644
index d145f52..0000000
Binary files a/build/classes/Padeler/Test.class and /dev/null differ
diff --git a/build/classes/entite/Club.class b/build/classes/entite/Club.class
deleted file mode 100644
index 5ace45d..0000000
Binary files a/build/classes/entite/Club.class and /dev/null differ
diff --git a/build/classes/entite/Disponibiliteterrain.class b/build/classes/entite/Disponibiliteterrain.class
deleted file mode 100644
index d425f93..0000000
Binary files a/build/classes/entite/Disponibiliteterrain.class and /dev/null differ
diff --git a/build/classes/entite/Terrain.class b/build/classes/entite/Terrain.class
deleted file mode 100644
index 306dc0e..0000000
Binary files a/build/classes/entite/Terrain.class and /dev/null differ
diff --git a/build/classes/gui/AcceuilController.class b/build/classes/gui/AcceuilController.class
deleted file mode 100644
index bc6d7ed..0000000
Binary files a/build/classes/gui/AcceuilController.class and /dev/null differ
diff --git a/build/classes/gui/FXMain.class b/build/classes/gui/FXMain.class
deleted file mode 100644
index 7f390b3..0000000
Binary files a/build/classes/gui/FXMain.class and /dev/null differ
diff --git a/build/classes/gui/acceuil.fxml b/build/classes/gui/acceuil.fxml
deleted file mode 100644
index 8ff1494..0000000
--- a/build/classes/gui/acceuil.fxml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
diff --git a/build/classes/padler/DashboardController.class b/build/classes/padler/DashboardController.class
new file mode 100644
index 0000000..a403a77
Binary files /dev/null and b/build/classes/padler/DashboardController.class differ
diff --git a/build/classes/padler/DashboardDesign.css b/build/classes/padler/DashboardDesign.css
new file mode 100644
index 0000000..665b832
--- /dev/null
+++ b/build/classes/padler/DashboardDesign.css
@@ -0,0 +1,182 @@
+/*
+To change this license header, choose License Headers in Project Properties.
+To change this template file, choose Tools | Templates
+and open the template in the editor.
+*/
+/*
+ Created on : 29 mai 2023, 00:20:08
+ Author : Esprit
+*/
+
+.top-form{
+ -fx-background-color:#fff;
+ -fx-border-color:#000;
+ -fx-border-width:.4px .4px .2px .4px;
+}
+
+.semi-top-form{
+ -fx-background-color:#efefef;
+ -fx-border-color:#000;
+ -fx-border-width:.2px .4px .8px .4px;
+}
+
+.close{
+ -fx-background-color:transparent;
+ -fx-cursor:hand;
+}
+.close:hover{
+ -fx-background-color:#ff3547;
+}
+
+.minimize{
+ -fx-background-color:transparent;
+ -fx-cursor:hand;
+}
+.minimize:hover{
+ -fx-background-color:#ddd;
+}
+
+.nav-form{
+ -fx-background-color:linear-gradient(to bottom right, #272b3f, #256b51);
+}
+
+.nav-btn{
+ -fx-background-color:transparent;
+ -fx-cursor:hand;
+ -fx-font-family:"Arial";
+ -fx-font-size:14px;
+ -fx-text-fill:#fff;
+ -fx-alignment:CENTER-LEFT;
+}
+
+.logout{
+ -fx-background-color:#6ae8b8;
+ -fx-background-radius:10px;
+ -fx-cursor:hand;
+}
+.logout:hover{
+ -fx-background-color:#18a383;
+}
+
+.shadow{
+ -fx-effect:dropshadow(three-pass-box, rgba(0,0,0,0.5), 6,0,0,0);
+}
+
+.white-bg{
+ -fx-background-color:#fff;
+ -fx-background-radius:8px;
+}
+
+.card{
+ -fx-background-color:linear-gradient(to right, #2b303c, #525968);
+ -fx-background-radius:5px;
+}
+
+.table-view{
+ -fx-background-color:transparent;
+ -fx-border-color:linear-gradient(to bottom right, #272b3f, #256b51);
+ -fx-border-radius:8px;
+ -fx-padding:0px;
+}
+.table-view .table-column{
+ -fx-alignment:CENTER;
+}
+.table-view .column-header-background{
+ -fx-background-color:linear-gradient(to bottom right, #272b3f, #256b51);
+ -fx-background-insets: 0 0 0 0;
+ -f-background-radius:8px 8px 0px 0px;
+}
+.table-view .column-header, .filter{
+ -fx-background-color: transparent;
+ -fx-size:40px;
+}
+.table-view .column-header .label{
+ -fx-text-fill:#fff;
+ -fx-font-family:"Arial";
+}
+
+.textfield{
+ -fx-background-color:linear-gradient(to bottom, #efefef, #eee);
+ -fx-border-color:linear-gradient(to bottom right, #272b3f, #256b51);
+ -fx-border-width:.8px;
+ -fx-font-family:"Tahoma";
+ -fx-border-radius:4px;
+}
+.textfield:focused{
+ -fx-border-width:1.8px;
+ -fx-background-color:#fff;
+}
+
+.search{
+ -fx-background-color:transparent;
+ -fx-border-color:linear-gradient(to bottom right, #272b3f, #256b51);
+ -fx-border-radius:5px;
+ -fx-font-size:13px;
+ -fx-font-family:"Arial";
+ -fx-border-width:1px;
+ -fx-padding:0px 0px 0px 28px;
+}
+.search:focused{
+ -fx-border-width:2px;
+}
+
+.import-btn{
+ -fx-background-color:#ddd;
+ -fx-text-fill:red;
+ -fx-cursor:hand;
+}
+
+.add-btn{
+ -fx-background-color:#304575;
+ -fx-background-radius:8px;
+ -fx-text-fill:#fff;
+ -fx-font-size:14px;
+ -fx-font-family:"Arial";
+ -fx-cursor:hand;
+}
+.add-btn:hover{
+ -fx-background-color:#3357a4;
+}
+
+.update-btn{
+ -fx-background-color:#327252;
+ -fx-background-radius:8px;
+ -fx-text-fill:#fff;
+ -fx-font-size:14px;
+ -fx-font-family:"Arial";
+ -fx-cursor:hand;
+}
+.update-btn:hover{
+ -fx-background-color:#309a65;
+}
+
+.delete-btn{
+ -fx-background-color:#86253f;
+ -fx-background-radius:8px;
+ -fx-text-fill:#fff;
+ -fx-font-size:14px;
+ -fx-font-family:"Arial";
+ -fx-cursor:hand;
+}
+.delete-btn:hover{
+ -fx-background-color:#ae1d46;
+}
+
+.clear-btn{
+ -fx-background-color:#753566;
+ -fx-background-radius:8px;
+ -fx-text-fill:#fff;
+ -fx-font-size:14px;
+ -fx-font-family:"Arial";
+ -fx-cursor:hand;
+}
+.clear-btn:hover{
+ -fx-background-color:#9d3485;
+}
+
+.label-info{
+ -fx-background-color:transparent;
+ -fx-border-color:linear-gradient(to bottom right, #272b3f, #256b51);
+ -fx-border-radius:4px;
+ -fx-padding:0px 0px 0px 8px;
+}
diff --git a/build/classes/padler/FXMLDocument.fxml b/build/classes/padler/FXMLDocument.fxml
new file mode 100644
index 0000000..ce0ae24
--- /dev/null
+++ b/build/classes/padler/FXMLDocument.fxml
@@ -0,0 +1,47 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/build/classes/padler/FXMLDocumentController.class b/build/classes/padler/FXMLDocumentController.class
new file mode 100644
index 0000000..d9294ec
Binary files /dev/null and b/build/classes/padler/FXMLDocumentController.class differ
diff --git a/build/classes/padler/LoginDesign.css b/build/classes/padler/LoginDesign.css
new file mode 100644
index 0000000..efe8aa6
--- /dev/null
+++ b/build/classes/padler/LoginDesign.css
@@ -0,0 +1,54 @@
+/*
+To change this license header, choose License Headers in Project Properties.
+To change this template file, choose Tools | Templates
+and open the template in the editor.
+*/
+/*
+ Created on : 28 mai 2023, 03:47:32
+ Author : Esprit
+*/
+.left-form{
+ -fx-background-color:linear-gradient(to bottom right, #272b3f, #256b51);
+ -fx-border-color:#000;
+ -fx-border-width:.4px 0px .4px .4px;
+}
+.right-form{
+ -fx-background-color:#fff;
+ -fx-border-color:#000;
+ -fx-border-width:.4px .4px .4px 0px;
+}
+
+.close{
+ -fx-background-color:transparent;
+ -fx-cursor:hand;
+}
+.close:hover{
+ -fx-background-color:#ff3547;
+}
+.textfield{
+ -fx-background-color:linear-gradient(to bottom, #efefef, #eee);
+ -fx-background-radius:4px;
+ -fx-border-color:#000;
+ -fx-border-width:.4px;
+ -fx-border-radius:4px;
+ -fx-font-size:13px;
+ -fx-font-family:"Arial";
+
+}
+.textfield:focused{
+ -fx-background-color:#fff;
+ -fx-border-color:linear-gradient(to bottom right, #272b3f, #256b51);
+ -fx-border-width:.8px;
+}
+
+.login-btn{
+ -fx-background-color:linear-gradient(to bottom, #278f96,#2d645f);
+ -fx-background-radius:5px;
+ -fx-text-fill:#fff;
+ -fx-font-size:14px;
+ -fx-font-family:"Arial";
+ -fx-cursor:hand;
+}
+.login-btn:hover{
+ -fx-background-color:linear-gradient(to bottom, #21a7ae,#368981);
+}
\ No newline at end of file
diff --git a/build/classes/padler/Padler.class b/build/classes/padler/Padler.class
new file mode 100644
index 0000000..187a779
Binary files /dev/null and b/build/classes/padler/Padler.class differ
diff --git a/build/classes/padler/dashboard.fxml b/build/classes/padler/dashboard.fxml
new file mode 100644
index 0000000..688f905
--- /dev/null
+++ b/build/classes/padler/dashboard.fxml
@@ -0,0 +1,280 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/build/classes/padler/database.class b/build/classes/padler/database.class
new file mode 100644
index 0000000..307aabd
Binary files /dev/null and b/build/classes/padler/database.class differ
diff --git a/build/classes/padler/getData.class b/build/classes/padler/getData.class
new file mode 100644
index 0000000..813fb9c
Binary files /dev/null and b/build/classes/padler/getData.class differ
diff --git a/build/classes/padler/userData.class b/build/classes/padler/userData.class
new file mode 100644
index 0000000..3ff45c8
Binary files /dev/null and b/build/classes/padler/userData.class differ
diff --git a/build/classes/service/ClubService.class b/build/classes/service/ClubService.class
deleted file mode 100644
index 6552422..0000000
Binary files a/build/classes/service/ClubService.class and /dev/null differ
diff --git a/build/classes/service/DiponibiliteTerrainService.class b/build/classes/service/DiponibiliteTerrainService.class
deleted file mode 100644
index 264cdd0..0000000
Binary files a/build/classes/service/DiponibiliteTerrainService.class and /dev/null differ
diff --git a/build/classes/service/Iservice.class b/build/classes/service/Iservice.class
deleted file mode 100644
index 8e62946..0000000
Binary files a/build/classes/service/Iservice.class and /dev/null differ
diff --git a/build/classes/service/TerrainService.class b/build/classes/service/TerrainService.class
deleted file mode 100644
index 918e694..0000000
Binary files a/build/classes/service/TerrainService.class and /dev/null differ
diff --git a/build/classes/utils/DataSource.class b/build/classes/utils/DataSource.class
deleted file mode 100644
index b088836..0000000
Binary files a/build/classes/utils/DataSource.class and /dev/null differ
diff --git a/nbproject/private/private.properties b/nbproject/private/private.properties
index cb4e456..0cdde42 100644
--- a/nbproject/private/private.properties
+++ b/nbproject/private/private.properties
@@ -5,4 +5,4 @@ do.jlink=false
javac.debug=true
javadoc.preview=true
jlink.strip=false
-user.properties.file=C:\\Users\\oussama.hadjahmed\\AppData\\Roaming\\NetBeans\\8.2\\build.properties
+user.properties.file=C:\\Users\\Esprit\\AppData\\Roaming\\NetBeans\\8.2\\build.properties
diff --git a/nbproject/private/private.xml b/nbproject/private/private.xml
index 90adf7d..6807a2b 100644
--- a/nbproject/private/private.xml
+++ b/nbproject/private/private.xml
@@ -2,12 +2,6 @@
-
- file:/C:/Users/oussama.hadjahmed/Desktop/ESPRIT/padelerProject/src/utils/DataSource.java
- file:/C:/Users/oussama.hadjahmed/Desktop/ESPRIT/padelerProject/src/Padeler/Test.java
- file:/C:/Users/oussama.hadjahmed/Desktop/ESPRIT/padelerProject/src/service/ClubService.java
- file:/C:/Users/oussama.hadjahmed/Desktop/ESPRIT/padelerProject/src/entite/Terrain.java
- file:/C:/Users/oussama.hadjahmed/Desktop/ESPRIT/padelerProject/src/entite/Club.java
-
+
diff --git a/src/Padeler/Test.java b/src/Padeler/Test.java
deleted file mode 100644
index cf409b0..0000000
--- a/src/Padeler/Test.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
-package Padeler;
-
-import entite.Club;
-import entite.Terrain;
-
-import java.util.List;
-
-
-import service.ClubService;
-import service.TerrainService;
-import utils.DataSource;
-/**
- *
- * @author wiemhjiri
- */
-public class Test {
-
- public static void main(String[] args) {
- DataSource ds1=DataSource.getInstance();
-
-
-
- List l = null ;
- ClubService cs = new ClubService();
- System.out.println("size"+cs.readAll().size());
-
- Club club = new Club() ;
- club.setName("club2");
- club.setAdresse("tunis");
- cs.insert(club);
-
- cs.readAll().forEach(System.out::println);
-
- cs.readById(1) ;
- Club club2 = new Club() ;
- club2=cs.readById(1) ;
-
- System.out.println("object from DB: "+ club2);
-
- TerrainService tr = new TerrainService() ;
-
- tr.readAll().forEach(System.out::println) ;
-
- System.out.println("test fin"+tr.readById(1));
-
-
- Terrain t1 = new Terrain ();
- t1.setName("terrain 2 ");
- t1.setStatus(1);
- Club club1 = new Club() ;
- club1.setIdClub(1);
- t1.setClub(club1);
-
- tr.insert(t1);
-
-
-
-
-
-
-
- }
-
-}
diff --git a/src/entite/Club.java b/src/entite/Club.java
deleted file mode 100644
index 068631e..0000000
--- a/src/entite/Club.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
-package entite;
-
-import entite.Terrain ;
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- *
- * @author oussama.hadjahmed
- */
-public class Club {
-
- private int idClub ;
- private String name;
- private String adresse;
- private List terrains = new ArrayList(0);
-
-
-
- public Club() {
- }
-
- public Club(int idClub , String name, String adresse) {
- this.idClub = idClub ;
- this.name = name;
- this.adresse = adresse;
- }
-
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public String getAdresse() {
- return adresse;
- }
-
- public void setAdresse(String adresse) {
- this.adresse = adresse;
- }
-
- public int getIdClub() {
- return idClub;
- }
-
- public void setIdClub(int idClub) {
- this.idClub = idClub;
- }
-
- public List getTerrains() {
- return terrains;
- }
-
- public void setTerrains(List terrains) {
- this.terrains = terrains;
- }
-
-
- @Override
- public String toString() {
- return "Club{" + "idClub=" + idClub + ", name=" + name + ", adresse=" + adresse + '}';
- }
-
-
-
-
-
-
-}
diff --git a/src/entite/Disponibiliteterrain.java b/src/entite/Disponibiliteterrain.java
deleted file mode 100644
index 87704d8..0000000
--- a/src/entite/Disponibiliteterrain.java
+++ /dev/null
@@ -1,214 +0,0 @@
-/*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
-package entite;
-
-import entite.Terrain;
-
-import java.sql.Date;
-
-/**
- *
- * @author oussama.hadjahmed
- */
-public class Disponibiliteterrain {
-
- private int idDisponibiliteTerrain;
- private Date Date;
- private int temps1;
- private int temps2;
- private int temps3;
- private int temps4;
- private int temps5;
- private int temps6;
- private int temps7;
- private int temps8;
- private int temps9;
- private int temps10;
- private int temps11;
- private int temps12;
- private int temps13;
- private int temps14;
- private Terrain terrain;
-
- public Disponibiliteterrain() {
- }
-
- public Disponibiliteterrain(int idDisponibiliteTerrain, Date Date, int temps1, int temps2, int temps3, int temps4, int temps5, int temps6, int temps7, int temps8, int temps9, int temps10, int temps11, int temps12, int temps13, int temps14, Terrain terrain) {
- this.idDisponibiliteTerrain = idDisponibiliteTerrain;
- this.Date = Date;
- this.temps1 = temps1;
- this.temps2 = temps2;
- this.temps3 = temps3;
- this.temps4 = temps4;
- this.temps5 = temps5;
- this.temps6 = temps6;
- this.temps7 = temps7;
- this.temps8 = temps8;
- this.temps9 = temps9;
- this.temps10 = temps10;
- this.temps11 = temps11;
- this.temps12 = temps12;
- this.temps13 = temps13;
- this.temps14 = temps14;
- this.terrain = terrain;
- }
-
- public Disponibiliteterrain(Date Date, int temps1, int temps2, int temps3, int temps4, int temps5, int temps6, int temps7, int temps8, int temps9, int temps10, int temps11, int temps12, int temps13, int temps14, Terrain terrain) {
- this.Date = Date;
- this.temps1 = temps1;
- this.temps2 = temps2;
- this.temps3 = temps3;
- this.temps4 = temps4;
- this.temps5 = temps5;
- this.temps6 = temps6;
- this.temps7 = temps7;
- this.temps8 = temps8;
- this.temps9 = temps9;
- this.temps10 = temps10;
- this.temps11 = temps11;
- this.temps12 = temps12;
- this.temps13 = temps13;
- this.temps14 = temps14;
- this.terrain = terrain;
- }
-
- public int getIdDisponibiliteTerrain() {
- return idDisponibiliteTerrain;
- }
-
- public void setIdDisponibiliteTerrain(int idDisponibiliteTerrain) {
- this.idDisponibiliteTerrain = idDisponibiliteTerrain;
- }
-
- public Date getDate() {
- return Date;
- }
-
- public void setDate(Date Date) {
- this.Date = Date;
- }
-
- public int getTemps1() {
- return temps1;
- }
-
- public void setTemps1(int temps1) {
- this.temps1 = temps1;
- }
-
- public int getTemps2() {
- return temps2;
- }
-
- public void setTemps2(int temps2) {
- this.temps2 = temps2;
- }
-
- public int getTemps3() {
- return temps3;
- }
-
- public void setTemps3(int temps3) {
- this.temps3 = temps3;
- }
-
- public int getTemps4() {
- return temps4;
- }
-
- public void setTemps4(int temps4) {
- this.temps4 = temps4;
- }
-
- public int getTemps5() {
- return temps5;
- }
-
- public void setTemps5(int temps5) {
- this.temps5 = temps5;
- }
-
- public int getTemps6() {
- return temps6;
- }
-
- public void setTemps6(int temps6) {
- this.temps6 = temps6;
- }
-
- public int getTemps7() {
- return temps7;
- }
-
- public void setTemps7(int temps7) {
- this.temps7 = temps7;
- }
-
- public int getTemps8() {
- return temps8;
- }
-
- public void setTemps8(int temps8) {
- this.temps8 = temps8;
- }
-
- public int getTemps9() {
- return temps9;
- }
-
- public void setTemps9(int temps9) {
- this.temps9 = temps9;
- }
-
- public int getTemps10() {
- return temps10;
- }
-
- public void setTemps10(int temps10) {
- this.temps10 = temps10;
- }
-
- public int getTemps11() {
- return temps11;
- }
-
- public void setTemps11(int temps11) {
- this.temps11 = temps11;
- }
-
- public int getTemps12() {
- return temps12;
- }
-
- public void setTemps12(int temps12) {
- this.temps12 = temps12;
- }
-
- public int getTemps13() {
- return temps13;
- }
-
- public void setTemps13(int temps13) {
- this.temps13 = temps13;
- }
-
- public int getTemps14() {
- return temps14;
- }
-
- public void setTemps14(int temps14) {
- this.temps14 = temps14;
- }
-
- public Terrain getTerrain() {
- return terrain;
- }
-
- public void setTerrain(Terrain terrain) {
- this.terrain = terrain;
- }
-
-}
diff --git a/src/entite/Terrain.java b/src/entite/Terrain.java
deleted file mode 100644
index 5350e04..0000000
--- a/src/entite/Terrain.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
-package entite;
-
-import entite.Club;
-import entite.Disponibiliteterrain;
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- *
- * @author oussama.hadjahmed
- */
-public class Terrain {
-
- private int idTerrain;
- private String name;
- private int status;
- private Club club;
- private List disponibiliteterrain = new ArrayList(0);
-
- public Terrain() {
- }
-
- public Terrain(int idTerrain, String name, int status, Club club) {
- this.idTerrain = idTerrain;
- this.name = name;
- this.status = status;
- this.club = club;
- }
-
- public int getIdTerrain() {
- return idTerrain;
- }
-
- public void setIdTerrain(int idTerrain) {
- this.idTerrain = idTerrain;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public int getStatus() {
- return status;
- }
-
- public void setStatus(int status) {
- this.status = status;
- }
-
- public Terrain(int idTerrain, String name, int status) {
- this.idTerrain = idTerrain;
- this.name = name;
- this.status = status;
- }
-
- public Club getClub() {
- return club;
- }
-
- public void setClub(Club club) {
- this.club = club;
- }
-
- @Override
- public String toString() {
- return "Terrain{" + "idTerrain=" + idTerrain + ", name=" + name + ", status=" + status + ", club=" + club.getIdClub() + '}';
- }
-
-}
diff --git a/src/gui/AcceuilController.java b/src/gui/AcceuilController.java
deleted file mode 100644
index b4e237c..0000000
--- a/src/gui/AcceuilController.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
-package gui;
-
-import java.net.URL;
-import java.util.ResourceBundle;
-import javafx.fxml.Initializable;
-
-/**
- * FXML Controller class
- *
- * @author oussama.hadjahmed
- */
-public class AcceuilController implements Initializable {
-
- /**
- * Initializes the controller class.
- */
- @Override
- public void initialize(URL url, ResourceBundle rb) {
- // TODO
- }
-
-}
diff --git a/src/gui/FXMain.java b/src/gui/FXMain.java
deleted file mode 100644
index 8dc2662..0000000
--- a/src/gui/FXMain.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
-package gui;
-
-import java.io.IOException;
-import javafx.application.Application;
-import javafx.scene.Parent;
-import javafx.scene.Scene;
-import javafx.stage.Stage;
-import javafx.fxml.FXMLLoader;
-
-/**
- *
- * @author oussama.hadjahmed
- */
-public class FXMain extends Application {
-
- @Override
- public void start(Stage primaryStage) throws IOException {
-
- //String filepath ="C:\\Users\\oussama.hadjahmed\\Desktop\\ESPRIT\\PIDEV\\ConnexionBD1cinfo2\\src\\gui"+;
-
- Parent root = FXMLLoader.load(getClass().getResource("acceuil.fxml"));
- Scene scene = new Scene(root);
- primaryStage.setTitle("Hello World!");
- primaryStage.setScene(scene);
- primaryStage.show();
- }
-
- /**
- * @param args the command line arguments
- */
- public static void main(String[] args) {
- launch(args);
- }
-
-}
diff --git a/src/gui/acceuil.fxml b/src/gui/acceuil.fxml
deleted file mode 100644
index 8ff1494..0000000
--- a/src/gui/acceuil.fxml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/padler/DashboardController.java b/src/padler/DashboardController.java
new file mode 100644
index 0000000..91c6b0f
--- /dev/null
+++ b/src/padler/DashboardController.java
@@ -0,0 +1,541 @@
+/*
+ * To change this license header, choose License Headers in Project Properties.
+ * To change this template file, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package padler;
+
+import java.awt.image.BufferedImage;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.File;
+import java.io.IOException;
+import java.net.URL;
+import java.sql.Blob;
+import java.sql.Connection;
+
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Statement;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Optional;
+import java.util.ResourceBundle;
+import javafx.collections.FXCollections;
+import javafx.collections.ObservableList;
+import javafx.embed.swing.SwingFXUtils;
+import javafx.event.ActionEvent;
+import javafx.fxml.FXML;
+import javafx.fxml.FXMLLoader;
+import javafx.fxml.Initializable;
+import javafx.scene.Parent;
+import javafx.scene.Scene;
+import javafx.scene.chart.BarChart;
+import javafx.scene.control.Alert;
+import javafx.scene.control.Alert.AlertType;
+import javafx.scene.control.Button;
+import javafx.scene.control.ButtonType;
+import javafx.scene.control.ComboBox;
+import javafx.scene.control.Label;
+import javafx.scene.control.TableColumn;
+import javafx.scene.control.TableView;
+import javafx.scene.control.TextField;
+import javafx.scene.control.cell.PropertyValueFactory;
+import javafx.scene.image.Image;
+import javafx.scene.image.ImageView;
+import javafx.scene.input.MouseEvent;
+import javafx.scene.layout.AnchorPane;
+import javafx.stage.FileChooser;
+import javafx.stage.Stage;
+import javafx.stage.StageStyle;
+import javax.imageio.ImageIO;
+import static javax.management.remote.JMXConnectorFactory.connect;
+
+/**
+ *
+ * @author Esprit
+ */
+public class DashboardController implements Initializable{
+
+ @FXML
+ private AnchorPane main_form;
+
+ @FXML
+ private Button close;
+
+ @FXML
+ private Button minimize;
+
+ @FXML
+ private Label username;
+
+ @FXML
+ private Button home_btn;
+
+ @FXML
+ private Button adduser_btn;
+
+ @FXML
+ private Button padler_btn;
+
+ @FXML
+ private Button logout;
+
+ @FXML
+ private AnchorPane home_form;
+
+ @FXML
+ private Label home_totaluser;
+
+ @FXML
+ private Label home_totalpresent;
+
+ @FXML
+ private Label home_totalinactive;
+
+ @FXML
+ private BarChart, ?> home_chart;
+
+ @FXML
+ private AnchorPane adduser_form;
+
+ @FXML
+ private TableView adduser_col_tableView;
+
+ @FXML
+ private TableColumn adduser_col_userID;
+
+ @FXML
+ private TableColumn adduser_col_firstName;
+
+ @FXML
+ private TableColumn adduser_col_lastName;
+
+ @FXML
+ private TableColumn adduser_col_gender;
+
+
+ @FXML
+ private TableColumn adduser_col_phoneNum;
+
+ @FXML
+ private TableColumn adduser_col_date;
+
+ @FXML
+ private TextField adduser_search;
+
+ @FXML
+ private TextField adduser_userID;
+
+ @FXML
+ private TextField adduser_firstName;
+
+ @FXML
+ private TextField adduser_lastName;
+
+ @FXML
+ private ComboBox> adduser_gender;
+
+ @FXML
+ private TextField adduser_phoneNum;
+
+ @FXML
+ private ComboBox> adduser_position;
+
+ @FXML
+ private Button adduser_importbtn;
+
+ @FXML
+ private ImageView adduser_col_image;
+
+ @FXML
+ private Button adduser_addbtn;
+
+ @FXML
+ private Button adduser_updatebtn;
+
+ @FXML
+ private Button adduser_clearbtn;
+
+ @FXML
+ private Button adduser_deletebtn;
+
+ @FXML
+ private AnchorPane padler_form;
+
+ @FXML
+ private TextField padler_id;
+
+ @FXML
+ private Label padler_fitstname;
+
+ @FXML
+ private Label padler_lastname;
+
+ @FXML
+ private Label padler_position;
+
+ @FXML
+ private Button padler_updateBtn;
+
+ @FXML
+ private Button padler_clearBtn;
+
+ @FXML
+ private TableView padler_table;
+
+ @FXML
+ private TableColumn, ?> padler_col_userID;
+
+ @FXML
+ private TableColumn, ?> padler_col_firstname;
+
+ @FXML
+ private TableColumn, ?> padler_col_lastname;
+
+ @FXML
+ private TableColumn, ?> padler_col_position;
+
+
+
+ private Connection connect;
+ private Statement statement;
+ private PreparedStatement prepare;
+ private ResultSet result;
+ private Blob imageBlob;
+ private Image image;
+
+
+ public void addUserAdd() {
+
+ Date date = new Date();
+ java.sql.Date sqlDate = new java.sql.Date(date.getTime());
+
+ String sql = "INSERT INTO user "
+ + "(idUser,firstName,lastName,gender,numTel,image,date) "
+ + "VALUES(?,?,?,?,?,?,?)";
+
+ connect = database.connectDb();
+
+ try {
+ Alert alert;
+ if (adduser_userID.getText().isEmpty()
+ || adduser_firstName.getText().isEmpty()
+ || adduser_lastName.getText().isEmpty()
+ || adduser_gender.getSelectionModel().getSelectedItem() == null
+ || adduser_phoneNum.getText().isEmpty()
+ // || getData.path == null || getData.path == ""
+ ) {
+ alert = new Alert(AlertType.ERROR);
+ alert.setTitle("Error Message");
+ alert.setHeaderText(null);
+ alert.setContentText("Please fill all blank fields");
+ alert.showAndWait();
+ } else {
+
+ String check = "SELECT idUser FROM user WHERE idUser = '"
+ + adduser_userID.getText() + "'";
+
+ statement = connect.createStatement();
+ result = statement.executeQuery(check);
+
+ if (result.next()) {
+ alert = new Alert(AlertType.ERROR);
+ alert.setTitle("Error Message");
+ alert.setHeaderText(null);
+ alert.setContentText("User ID: " + adduser_userID.getText() + " was already exist!");
+ alert.showAndWait();
+ } else {
+
+ prepare = connect.prepareStatement(sql);
+ prepare.setString(1, adduser_userID.getText());
+ prepare.setString(2, adduser_firstName.getText());
+ prepare.setString(3, adduser_lastName.getText());
+ prepare.setString(4, (String) adduser_gender.getSelectionModel().getSelectedItem());
+ prepare.setString(5, adduser_phoneNum.getText());
+ //prepare.setString(6, (String) adduser_position.getSelectionModel().getSelectedItem());
+
+ /* String uri = getData.path;
+ uri = uri.replace("\\", "\\\\");
+*/
+
+ System.out.println("string blob:"+imageBlob.toString());
+ prepare.setBlob(6, imageBlob);
+ prepare.setString(7, String.valueOf(sqlDate));
+ prepare.executeUpdate();
+
+ addUserShowListData();
+ addUserReset();
+ }
+ }
+
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+
+ }
+
+ private String[] positionList = {"Admin", "Simple user"};
+
+ public void adduserPositionList() {
+ List listP = new ArrayList<>();
+
+ for (String data : positionList) {
+ listP.add(data);
+ }
+
+ ObservableList listData = FXCollections.observableArrayList(listP);
+ adduser_position.setItems(listData);
+ }
+
+ private String[] listGender = {"Male", "Female", "Others"};
+
+ public void addUserGendernList() {
+ List listG = new ArrayList<>();
+
+ for (String data : listGender) {
+ listG.add(data);
+ }
+
+ ObservableList listData = FXCollections.observableArrayList(listG);
+ adduser_gender.setItems(listData);
+ }
+
+ public void addUserReset() {
+ adduser_userID.setText("");
+ adduser_firstName.setText("");
+ adduser_lastName.setText("");
+ adduser_gender.getSelectionModel().clearSelection();
+ //addEmployee_position.getSelectionModel().clearSelection();
+ adduser_phoneNum.setText("");
+ adduser_col_image.setImage(null);
+ getData.path = "";
+ }
+
+
+
+
+ public static Blob convertToBlob(File file) throws IOException, SQLException {
+ Image image = new Image(file.toURI().toString());
+ java.awt.Image awtImage = SwingFXUtils.fromFXImage(image, null);
+ ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
+ try {
+ ImageIO.write(SwingFXUtils.fromFXImage(image, null), "png", outputStream);
+ byte[] imageBytes = outputStream.toByteArray();
+ return new javax.sql.rowset.serial.SerialBlob(imageBytes);
+ } finally {
+ outputStream.close();
+ }
+
+
+ }
+ public Image convertBlobToImage(Blob blob) throws SQLException, IOException {
+ byte[] imageData = blob.getBytes(1, (int) blob.length());
+
+ ByteArrayInputStream inputStream = new ByteArrayInputStream(imageData);
+ BufferedImage bufferedImage = ImageIO.read(inputStream);
+
+ return SwingFXUtils.toFXImage(bufferedImage, null);
+}
+
+ public void addUserInsertImage() throws IOException, SQLException {
+
+ FileChooser open = new FileChooser();
+ File file = open.showOpenDialog(main_form.getScene().getWindow());
+
+ if (file != null) {
+ // getData.path = file.getAbsolutePath();
+
+ image = new Image(file.toURI().toString(), 101, 127, false, true);
+ adduser_col_image.setImage(image);
+ Blob blob = convertToBlob(file);
+
+ imageBlob=blob;
+ }
+
+ }
+ public ObservableList addUserListData() {
+
+ ObservableList listData = FXCollections.observableArrayList();
+ String sql = "SELECT * FROM user";
+
+ connect = database.connectDb();
+
+ try {
+ prepare = connect.prepareStatement(sql);
+ result = prepare.executeQuery();
+ userData userD;
+
+ while (result.next()) {
+ userD = new userData(result.getInt("idUser"),
+ result.getString("firstName"),
+ result.getString("lastName"),
+ result.getString("gender"),
+ result.getString("numTel"),
+ result.getString("image"),
+ result.getDate("date"));
+ listData.add(userD);
+
+ }
+
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ return listData;
+ }
+
+ private ObservableList addUserList;
+
+ public void addUserShowListData() {
+ addUserList = addUserListData();
+
+ adduser_col_userID.setCellValueFactory(new PropertyValueFactory<>("userId"));
+ adduser_col_firstName.setCellValueFactory(new PropertyValueFactory<>("firstName"));
+ adduser_col_lastName.setCellValueFactory(new PropertyValueFactory<>("lastName"));
+ adduser_col_gender.setCellValueFactory(new PropertyValueFactory<>("gender"));
+ adduser_col_phoneNum.setCellValueFactory(new PropertyValueFactory<>("numTel"));
+ adduser_col_date.setCellValueFactory(new PropertyValueFactory<>("date"));
+
+ adduser_col_tableView.setItems(addUserList);
+
+ }
+
+ public void addUserSelect() throws SQLException, IOException {
+ userData userD = adduser_col_tableView.getSelectionModel().getSelectedItem();
+ int num = adduser_col_tableView.getSelectionModel().getSelectedIndex();
+
+ if ((num - 1) < -1) {
+ return;
+ }
+
+ adduser_userID.setText(String.valueOf(userD.getUser_id()));
+ adduser_firstName.setText(userD.getFirstName());
+ adduser_lastName.setText(userD.getLastName());
+ adduser_phoneNum.setText(userD.getNumTel());
+
+ getData.path = userD.getImage();
+
+ String uri = "file:" + userD.getImage();
+
+
+ Image imageB = convertBlobToImage(imageBlob);
+
+
+// image = new Image(uri, 101, 127, false, true);
+ adduser_col_image.setImage(imageB);
+ }
+
+
+ public void switchForm(ActionEvent event) {
+
+ if (event.getSource() == home_btn) {
+ home_form.setVisible(true);
+ adduser_form.setVisible(false);
+ padler_form.setVisible(false);
+
+ home_btn.setStyle("-fx-background-color:linear-gradient(to bottom right, #3a4368, #28966c);");
+ adduser_btn.setStyle("-fx-background-color:transparent");
+ padler_btn.setStyle("-fx-background-color:transparent");
+
+ //homeTotaluser();
+ //homeEmployeeTotalPresent();
+ //homeTotalInactive();
+ //homeChart();
+
+ } else if (event.getSource() == adduser_btn) {
+ home_form.setVisible(false);
+ adduser_form.setVisible(true);
+ padler_form.setVisible(false);
+
+ adduser_btn.setStyle("-fx-background-color:linear-gradient(to bottom right, #3a4368, #28966c);");
+ home_btn.setStyle("-fx-background-color:transparent");
+ padler_btn.setStyle("-fx-background-color:transparent");
+
+ addUserGendernList();
+ //addEmployeePositionList();
+ //addEmployeeSearch();
+
+ } else if (event.getSource() == padler_btn) {
+ home_form.setVisible(false);
+ adduser_form.setVisible(false);
+ padler_form.setVisible(true);
+
+ padler_btn.setStyle("-fx-background-color:linear-gradient(to bottom right, #3a4368, #28966c);");
+ adduser_btn.setStyle("-fx-background-color:transparent");
+ home_btn.setStyle("-fx-background-color:transparent");
+
+ //salaryShowListData();
+
+ }
+
+ }
+
+ private double x = 0;
+ private double y = 0;
+
+ public void logout() {
+
+ Alert alert = new Alert(AlertType.CONFIRMATION);
+ alert.setTitle("Confirmation Message");
+ alert.setHeaderText(null);
+ alert.setContentText("Are you sure you want to logout?");
+ Optional option = alert.showAndWait();
+ try {
+ if (option.get().equals(ButtonType.OK)) {
+
+ logout.getScene().getWindow().hide();
+ Parent root = FXMLLoader.load(getClass().getResource("FXMLDocument.fxml"));
+ Stage stage = new Stage();
+ Scene scene = new Scene(root);
+
+ root.setOnMousePressed((MouseEvent event) -> {
+ x = event.getSceneX();
+ y = event.getSceneY();
+ });
+
+ root.setOnMouseDragged((MouseEvent event) -> {
+ stage.setX(event.getScreenX() - x);
+ stage.setY(event.getScreenY() - y);
+
+ stage.setOpacity(.8);
+ });
+
+ root.setOnMouseReleased((MouseEvent event) -> {
+ stage.setOpacity(1);
+ });
+
+ stage.initStyle(StageStyle.TRANSPARENT);
+
+ stage.setScene(scene);
+ stage.show();
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+
+ }
+
+ public void displayUsername() {
+ username.setText(getData.username);
+ }
+
+ public void close() {
+ System.exit(0);
+ }
+
+ public void minimize() {
+ Stage stage = (Stage) main_form.getScene().getWindow();
+ stage.setIconified(true);
+ }
+
+ @Override
+ public void initialize(URL location, ResourceBundle resources) {
+ addUserShowListData();
+ addUserGendernList();
+ }
+
+
+
+}
diff --git a/src/padler/DashboardDesign.css b/src/padler/DashboardDesign.css
new file mode 100644
index 0000000..665b832
--- /dev/null
+++ b/src/padler/DashboardDesign.css
@@ -0,0 +1,182 @@
+/*
+To change this license header, choose License Headers in Project Properties.
+To change this template file, choose Tools | Templates
+and open the template in the editor.
+*/
+/*
+ Created on : 29 mai 2023, 00:20:08
+ Author : Esprit
+*/
+
+.top-form{
+ -fx-background-color:#fff;
+ -fx-border-color:#000;
+ -fx-border-width:.4px .4px .2px .4px;
+}
+
+.semi-top-form{
+ -fx-background-color:#efefef;
+ -fx-border-color:#000;
+ -fx-border-width:.2px .4px .8px .4px;
+}
+
+.close{
+ -fx-background-color:transparent;
+ -fx-cursor:hand;
+}
+.close:hover{
+ -fx-background-color:#ff3547;
+}
+
+.minimize{
+ -fx-background-color:transparent;
+ -fx-cursor:hand;
+}
+.minimize:hover{
+ -fx-background-color:#ddd;
+}
+
+.nav-form{
+ -fx-background-color:linear-gradient(to bottom right, #272b3f, #256b51);
+}
+
+.nav-btn{
+ -fx-background-color:transparent;
+ -fx-cursor:hand;
+ -fx-font-family:"Arial";
+ -fx-font-size:14px;
+ -fx-text-fill:#fff;
+ -fx-alignment:CENTER-LEFT;
+}
+
+.logout{
+ -fx-background-color:#6ae8b8;
+ -fx-background-radius:10px;
+ -fx-cursor:hand;
+}
+.logout:hover{
+ -fx-background-color:#18a383;
+}
+
+.shadow{
+ -fx-effect:dropshadow(three-pass-box, rgba(0,0,0,0.5), 6,0,0,0);
+}
+
+.white-bg{
+ -fx-background-color:#fff;
+ -fx-background-radius:8px;
+}
+
+.card{
+ -fx-background-color:linear-gradient(to right, #2b303c, #525968);
+ -fx-background-radius:5px;
+}
+
+.table-view{
+ -fx-background-color:transparent;
+ -fx-border-color:linear-gradient(to bottom right, #272b3f, #256b51);
+ -fx-border-radius:8px;
+ -fx-padding:0px;
+}
+.table-view .table-column{
+ -fx-alignment:CENTER;
+}
+.table-view .column-header-background{
+ -fx-background-color:linear-gradient(to bottom right, #272b3f, #256b51);
+ -fx-background-insets: 0 0 0 0;
+ -f-background-radius:8px 8px 0px 0px;
+}
+.table-view .column-header, .filter{
+ -fx-background-color: transparent;
+ -fx-size:40px;
+}
+.table-view .column-header .label{
+ -fx-text-fill:#fff;
+ -fx-font-family:"Arial";
+}
+
+.textfield{
+ -fx-background-color:linear-gradient(to bottom, #efefef, #eee);
+ -fx-border-color:linear-gradient(to bottom right, #272b3f, #256b51);
+ -fx-border-width:.8px;
+ -fx-font-family:"Tahoma";
+ -fx-border-radius:4px;
+}
+.textfield:focused{
+ -fx-border-width:1.8px;
+ -fx-background-color:#fff;
+}
+
+.search{
+ -fx-background-color:transparent;
+ -fx-border-color:linear-gradient(to bottom right, #272b3f, #256b51);
+ -fx-border-radius:5px;
+ -fx-font-size:13px;
+ -fx-font-family:"Arial";
+ -fx-border-width:1px;
+ -fx-padding:0px 0px 0px 28px;
+}
+.search:focused{
+ -fx-border-width:2px;
+}
+
+.import-btn{
+ -fx-background-color:#ddd;
+ -fx-text-fill:red;
+ -fx-cursor:hand;
+}
+
+.add-btn{
+ -fx-background-color:#304575;
+ -fx-background-radius:8px;
+ -fx-text-fill:#fff;
+ -fx-font-size:14px;
+ -fx-font-family:"Arial";
+ -fx-cursor:hand;
+}
+.add-btn:hover{
+ -fx-background-color:#3357a4;
+}
+
+.update-btn{
+ -fx-background-color:#327252;
+ -fx-background-radius:8px;
+ -fx-text-fill:#fff;
+ -fx-font-size:14px;
+ -fx-font-family:"Arial";
+ -fx-cursor:hand;
+}
+.update-btn:hover{
+ -fx-background-color:#309a65;
+}
+
+.delete-btn{
+ -fx-background-color:#86253f;
+ -fx-background-radius:8px;
+ -fx-text-fill:#fff;
+ -fx-font-size:14px;
+ -fx-font-family:"Arial";
+ -fx-cursor:hand;
+}
+.delete-btn:hover{
+ -fx-background-color:#ae1d46;
+}
+
+.clear-btn{
+ -fx-background-color:#753566;
+ -fx-background-radius:8px;
+ -fx-text-fill:#fff;
+ -fx-font-size:14px;
+ -fx-font-family:"Arial";
+ -fx-cursor:hand;
+}
+.clear-btn:hover{
+ -fx-background-color:#9d3485;
+}
+
+.label-info{
+ -fx-background-color:transparent;
+ -fx-border-color:linear-gradient(to bottom right, #272b3f, #256b51);
+ -fx-border-radius:4px;
+ -fx-padding:0px 0px 0px 8px;
+}
diff --git a/src/padler/FXMLDocument.fxml b/src/padler/FXMLDocument.fxml
new file mode 100644
index 0000000..ce0ae24
--- /dev/null
+++ b/src/padler/FXMLDocument.fxml
@@ -0,0 +1,47 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/padler/FXMLDocumentController.java b/src/padler/FXMLDocumentController.java
new file mode 100644
index 0000000..eecb8ee
--- /dev/null
+++ b/src/padler/FXMLDocumentController.java
@@ -0,0 +1,132 @@
+/*
+ * To change this license header, choose License Headers in Project Properties.
+ * To change this template file, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package padler;
+
+import de.jensd.fx.glyphs.fontawesome.FontAwesomeIconView;
+import java.net.URL;
+import java.sql.Connection;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.util.ResourceBundle;
+import javafx.event.ActionEvent;
+import javafx.fxml.FXML;
+import javafx.fxml.FXMLLoader;
+import javafx.fxml.Initializable;
+import javafx.scene.Parent;
+import javafx.scene.Scene;
+import javafx.scene.control.Alert;
+import javafx.scene.control.Alert.AlertType;
+import javafx.scene.control.Button;
+import javafx.scene.control.Label;
+import javafx.scene.control.PasswordField;
+import javafx.scene.control.TextField;
+import javafx.scene.input.MouseEvent;
+import javafx.scene.layout.AnchorPane;
+import javafx.stage.Stage;
+import javafx.stage.StageStyle;
+
+/**
+ *
+ * @author Esprit
+ */
+public class FXMLDocumentController implements Initializable {
+
+ @FXML
+ private AnchorPane main_form;
+
+ @FXML
+ private TextField username;
+
+ @FXML
+ private PasswordField password;
+
+ @FXML
+ private Button loginbtn;
+
+ @FXML
+ private FontAwesomeIconView close;
+
+ private Connection connect;
+ private PreparedStatement prepare;
+ private ResultSet result;
+
+ private double x = 0;
+ private double y = 0;
+
+
+ public void loginAdmin(){
+
+ String sql = "SELECT * FROM user WHERE firstName = ? and password = ?";
+
+ connect = database.connectDb();
+
+ try{
+ prepare = connect.prepareStatement(sql);
+ prepare.setString(1, username.getText());
+ prepare.setString(2, password.getText());
+
+ result = prepare.executeQuery();
+ Alert alert;
+
+ if(username.getText().isEmpty() || password.getText().isEmpty()){
+ alert = new Alert(AlertType.ERROR);
+ alert.setTitle("Error Message");
+ alert.setHeaderText(null);
+ alert.setContentText("Please fill all blank fields");
+ alert.showAndWait();
+ }else{
+ if(result.next()){
+
+
+ alert = new Alert(AlertType.INFORMATION);
+ alert.setTitle("Information Message");
+ alert.setHeaderText(null);
+ alert.setContentText("Successfully Login");
+ alert.showAndWait();
+
+ loginbtn.getScene().getWindow().hide();
+ Parent root = FXMLLoader.load(getClass().getResource("dashboard.fxml"));
+ Stage stage = new Stage();
+ Scene scene = new Scene(root);
+
+ root.setOnMousePressed((MouseEvent event) ->{
+ x = event.getSceneX();
+ y = event.getSceneY();
+ });
+
+ root.setOnMouseDragged((MouseEvent event) ->{
+ stage.setX(event.getScreenX() - x);
+ stage.setY(event.getScreenY() - y);
+ });
+
+ stage.initStyle(StageStyle.TRANSPARENT);
+ stage.setScene(scene);
+ stage.show();
+
+ }else{
+ alert = new Alert(AlertType.ERROR);
+ alert.setTitle("Error Message");
+ alert.setHeaderText(null);
+ alert.setContentText("Wrong Username/Password");
+ alert.showAndWait();
+ }
+ }
+
+ }catch(Exception e){e.printStackTrace();}
+
+ }
+
+
+ public void close(){
+ System.exit(0);
+ }
+
+ @Override
+ public void initialize(URL url, ResourceBundle rb) {
+ // TODO
+ }
+
+}
diff --git a/src/padler/LoginDesign.css b/src/padler/LoginDesign.css
new file mode 100644
index 0000000..efe8aa6
--- /dev/null
+++ b/src/padler/LoginDesign.css
@@ -0,0 +1,54 @@
+/*
+To change this license header, choose License Headers in Project Properties.
+To change this template file, choose Tools | Templates
+and open the template in the editor.
+*/
+/*
+ Created on : 28 mai 2023, 03:47:32
+ Author : Esprit
+*/
+.left-form{
+ -fx-background-color:linear-gradient(to bottom right, #272b3f, #256b51);
+ -fx-border-color:#000;
+ -fx-border-width:.4px 0px .4px .4px;
+}
+.right-form{
+ -fx-background-color:#fff;
+ -fx-border-color:#000;
+ -fx-border-width:.4px .4px .4px 0px;
+}
+
+.close{
+ -fx-background-color:transparent;
+ -fx-cursor:hand;
+}
+.close:hover{
+ -fx-background-color:#ff3547;
+}
+.textfield{
+ -fx-background-color:linear-gradient(to bottom, #efefef, #eee);
+ -fx-background-radius:4px;
+ -fx-border-color:#000;
+ -fx-border-width:.4px;
+ -fx-border-radius:4px;
+ -fx-font-size:13px;
+ -fx-font-family:"Arial";
+
+}
+.textfield:focused{
+ -fx-background-color:#fff;
+ -fx-border-color:linear-gradient(to bottom right, #272b3f, #256b51);
+ -fx-border-width:.8px;
+}
+
+.login-btn{
+ -fx-background-color:linear-gradient(to bottom, #278f96,#2d645f);
+ -fx-background-radius:5px;
+ -fx-text-fill:#fff;
+ -fx-font-size:14px;
+ -fx-font-family:"Arial";
+ -fx-cursor:hand;
+}
+.login-btn:hover{
+ -fx-background-color:linear-gradient(to bottom, #21a7ae,#368981);
+}
\ No newline at end of file
diff --git a/src/padler/Padler.java b/src/padler/Padler.java
new file mode 100644
index 0000000..f1c991c
--- /dev/null
+++ b/src/padler/Padler.java
@@ -0,0 +1,65 @@
+/*
+ * To change this license header, choose License Headers in Project Properties.
+ * To change this template file, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package padler;
+
+import javafx.scene.input.MouseEvent;
+import javafx.application.Application;
+import javafx.fxml.FXMLLoader;
+import javafx.scene.Parent;
+import javafx.scene.Scene;
+import javafx.stage.Stage;
+import javafx.stage.StageStyle;
+
+
+/**
+ *
+ * @author Esprit
+ */
+public class Padler extends Application {
+
+ private double x = 0;
+ private double y = 0;
+
+ @Override
+ public void start(Stage stage) throws Exception {
+ Parent root = FXMLLoader.load(getClass().getResource("FXMLDocument.fxml"));
+
+
+ Scene scene = new Scene(root);
+
+ root.setOnMousePressed((MouseEvent event) ->{
+ x = event.getSceneX();
+ y = event.getSceneY();
+ });
+
+ root.setOnMouseDragged((MouseEvent event) ->{
+ stage.setX(event.getScreenX() - x);
+ stage.setY(event.getScreenY() - y);
+
+ stage.setOpacity(.8);
+ });
+
+ root.setOnMouseReleased((MouseEvent event) ->{
+ stage.setOpacity(1);
+ });
+
+ stage.initStyle(StageStyle.TRANSPARENT);
+
+ stage.setScene(scene);
+ stage.show();
+ }
+
+
+
+
+ /**
+ * @param args the command line arguments
+ */
+ public static void main(String[] args) {
+ launch(args);
+ }
+
+}
diff --git a/src/padler/dashboard.fxml b/src/padler/dashboard.fxml
new file mode 100644
index 0000000..688f905
--- /dev/null
+++ b/src/padler/dashboard.fxml
@@ -0,0 +1,280 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/padler/database.java b/src/padler/database.java
new file mode 100644
index 0000000..76f3258
--- /dev/null
+++ b/src/padler/database.java
@@ -0,0 +1,29 @@
+/*
+ * To change this license header, choose License Headers in Project Properties.
+ * To change this template file, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package padler;
+
+
+import java.sql.Connection;
+import java.sql.DriverManager;
+
+
+/**
+ *
+ * @author Esprit
+ */
+public class database {
+ public static Connection connectDb(){
+
+ try{
+
+ Class.forName("com.mysql.jdbc.Driver");
+
+ Connection connect = DriverManager.getConnection("jdbc:mysql://localhost/padeler", "root", "");
+ return connect;
+ }catch(Exception e){e.printStackTrace();}
+ return null;
+ }
+}
diff --git a/src/service/DiponibiliteTerrainService.java b/src/padler/getData.java
similarity index 62%
rename from src/service/DiponibiliteTerrainService.java
rename to src/padler/getData.java
index 3ce8fa9..93c13bd 100644
--- a/src/service/DiponibiliteTerrainService.java
+++ b/src/padler/getData.java
@@ -3,12 +3,15 @@
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
-package service;
+package padler;
/**
*
- * @author oussama.hadjahmed
+ * @author Esprit
*/
-public class DiponibiliteTerrainService {
+public class getData {
+ public static String username;
+ public static String path;
+
}
diff --git a/src/padler/userData.java b/src/padler/userData.java
new file mode 100644
index 0000000..e7e6898
--- /dev/null
+++ b/src/padler/userData.java
@@ -0,0 +1,65 @@
+/*
+ * To change this license header, choose License Headers in Project Properties.
+ * To change this template file, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package padler;
+
+import java.util.Date;
+
+/**
+ *
+ * @author Esprit
+ */
+public class userData {
+ private Integer idUser;
+ private String firstName;
+ private String lastName;
+ private String gender;
+ private String numTel;
+ private String image;
+ private Date date;
+
+ public userData(int user_id, String firstName, String lastName, String gender, String numTel, String image, Date date) {
+ this.idUser = user_id;
+ this.firstName = firstName;
+ this.lastName = lastName;
+ this.gender = gender;
+ this.numTel = numTel;
+ this.image = image;
+ this.date = date;
+ }
+
+ public int getUser_id() {
+ return idUser;
+ }
+
+
+
+ public String getFirstName() {
+ return firstName;
+ }
+
+ public String getLastName() {
+ return lastName;
+ }
+
+ public String getGender() {
+ return gender;
+ }
+
+ public String getNumTel() {
+ return numTel;
+ }
+
+ public String getImage() {
+ return image;
+ }
+
+ public Date getDate() {
+ return date;
+ }
+
+
+
+}
diff --git a/src/service/ClubService.java b/src/service/ClubService.java
deleted file mode 100644
index c56963c..0000000
--- a/src/service/ClubService.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
-package service;
-
-import entite.Club;
-import java.sql.Connection;
-import java.sql.PreparedStatement;
-import java.sql.SQLException;
-import java.sql.Statement;
-import java.sql.ResultSet;
-import java.util.ArrayList;
-
-import java.util.List;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-import utils.DataSource;
-
-/**
- *
- * @author oussama.hadjahmed
- */
-public class ClubService implements Iservice {
-
- private Connection connexion;
- private Statement ste;
- private PreparedStatement pst;
- private ResultSet rs;
-
- public ClubService() {
- connexion = DataSource.getInstance().getCnx();
-
- }
-
- @Override
- public void insert(Club c) {
- String requete = "insert into Club (name,adresse) values('" + c.getName() + "','" + c.getAdresse() + "')";
-
- try {
- ste = connexion.createStatement();
- ste.executeUpdate(requete);
- } catch (SQLException ex) {
- Logger.getLogger(ClubService.class.getName()).log(Level.SEVERE, null, ex);
- }
-
- }
-
- @Override
- public List readAll() {
- String requete = "select * from club";
- List list = new ArrayList<>();
- try {
- ste = connexion.createStatement();
- rs = ste.executeQuery(requete);
- while (rs.next()) {
- Club c = new Club(rs.getInt("idClub"), rs.getString("name"), rs.getString("adresse"));
- list.add(c);
- }
- } catch (SQLException ex) {
- Logger.getLogger(ClubService.class.getName()).log(Level.SEVERE, null, ex);
- }
- return list;
- }
-
- @Override
- public Club readById(int id) {
- Club c = new Club();
-
- try {
-
- String requete = "SELECT * FROM club WHERE idClub=" + Integer.toString(id);
- pst = connexion.prepareStatement(requete);
- rs = pst.executeQuery(requete);
-
- while (rs.next()) {
- c.setIdClub(rs.getInt("idClub"));
- c.setName(rs.getString("name"));
- c.setAdresse(rs.getString("adresse"));
- }
- } catch (SQLException ex) {
- Logger.getLogger(ClubService.class.getName()).log(Level.SEVERE, null, ex);
- }
- return c;
- }
-
- @Override
- public void delete(int id) {
- try {
- String requete = "DELETE FROM club WHERE idClub = ?";
- pst = connexion.prepareStatement(requete);
- pst.setInt(1, id);
- int rowsDeleted = pst.executeUpdate();
- if (rowsDeleted > 0) {
- System.out.println("Le club avec l'ID " + id + " a été supprimé avec succès.");
- } else {
- System.out.println("Aucun club trouvé avec l'ID " + id + ". La suppression a échoué.");
- }
-
- } catch (SQLException ex) {
- Logger.getLogger(ClubService.class.getName()).log(Level.SEVERE, null, ex);
- }
-
- }
-
- @Override
- public void update(Club t) {
- throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
- }
-
-}
diff --git a/src/service/Iservice.java b/src/service/Iservice.java
deleted file mode 100644
index 57b933b..0000000
--- a/src/service/Iservice.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
-package service;
-
-import java.util.List;
-
-/**
- *
- * @author wiemhjiri
- */
-public interface Iservice {
- void insert(T t);
- List readAll();
- T readById(int id);
- void delete(int id);
- void update(T t);
-
-}
diff --git a/src/service/TerrainService.java b/src/service/TerrainService.java
deleted file mode 100644
index ff98a4c..0000000
--- a/src/service/TerrainService.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
-package service;
-
-import entite.Club;
-import entite.Terrain;
-import java.sql.Connection;
-import java.sql.PreparedStatement;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.sql.Statement;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-import utils.DataSource;
-
-/**
- *
- * @author oussama.hadjahmed
- */
-public class TerrainService implements Iservice {
-
- private Connection connexion;
- private Statement ste;
- private PreparedStatement pst;
- private ResultSet rs;
-
- public TerrainService() {
- connexion = DataSource.getInstance().getCnx();
- }
-
- @Override
- public void insert(Terrain t) {
- String requete = "insert into Terrain (name,status,idClub) values('" + t.getName() + "','" + t.getStatus() + "','" + t.getClub().getIdClub() + "')";
-
- try {
- ste = connexion.createStatement();
- ste.executeUpdate(requete);
- } catch (SQLException ex) {
- Logger.getLogger(TerrainService.class.getName()).log(Level.SEVERE, null, ex);
- }
- }
-
- @Override
- public List readAll() {
- String requete = "select * from terrain";
- List list = new ArrayList<>();
- try {
- ste = connexion.createStatement();
- rs = ste.executeQuery(requete);
- while (rs.next()) {
- Club c = new Club();
- c.setIdClub(rs.getInt("idClub"));
- Terrain terrain = new Terrain(rs.getInt("idTerrain"), rs.getString("name"), rs.getInt("status"), c);
- list.add(terrain);
- }
- } catch (SQLException ex) {
- Logger.getLogger(TerrainService.class.getName()).log(Level.SEVERE, null, ex);
- }
- return list;
- }
-
- @Override
- public Terrain readById(int id) {
- Terrain t = new Terrain();
-
- try {
-
- String requete = "SELECT * FROM terrain WHERE idTerrain=" + Integer.toString(id);
- pst = connexion.prepareStatement(requete);
- rs = pst.executeQuery(requete);
-
- while (rs.next()) {
- t.setIdTerrain(rs.getInt("idTerrain"));
- t.setName(rs.getString("name"));
- t.setStatus(rs.getInt("status"));
- Club c = new Club();
- c.setIdClub(rs.getInt("idClub"));
- t.setClub(c);
- }
- } catch (SQLException ex) {
- Logger.getLogger(TerrainService.class.getName()).log(Level.SEVERE, null, ex);
- }
- return t;
- }
-
- @Override
- public void delete(int id) {
- try {
- String requete = "DELETE FROM terrain WHERE idTerrain = ?";
- pst = connexion.prepareStatement(requete);
- pst.setInt(1, id);
- int rowsDeleted = pst.executeUpdate();
- if (rowsDeleted > 0) {
- System.out.println("Le Terrain avec l'ID " + id + " a été supprimé avec succès.");
- } else {
- System.out.println("Aucun Terrain trouvé avec l'ID " + id + ". La suppression a échoué.");
- }
-
- } catch (SQLException ex) {
- Logger.getLogger(TerrainService.class.getName()).log(Level.SEVERE, null, ex);
- }
- }
-
- @Override
- public void update(Terrain t) {
- throw new UnsupportedOperationException("Not supporlkosdnvkjndfkjnvdkjfnvkjdfnted yet."); //To change body of generated methods, choose Tools | Templates.
- }
-
-}
diff --git a/src/utils/DataSource.java b/src/utils/DataSource.java
deleted file mode 100644
index 8b67311..0000000
--- a/src/utils/DataSource.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
-package utils;
-
-import java.sql.Connection;
-import java.sql.DriverManager;
-import java.sql.SQLException;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-/**
- *
- * @author wiemhjiri
- */
-public class DataSource {
- //port : 3306
- private String url="jdbc:mysql://localhost/padeler";
- private String username="root";
- private String password="";
-
- private Connection cnx;
-
- private static DataSource instance;
-
- private DataSource() {
- try {
- cnx=DriverManager.getConnection(url, username, password);
- System.out.println("Connexion etablie");
- } catch (SQLException ex) {
- Logger.getLogger(DataSource.class.getName()).log(Level.SEVERE, null, ex);
- }
- }
-
- public static DataSource getInstance(){
- if(instance==null)
- instance=new DataSource();
- return instance;
- }
-
- public Connection getCnx() {
- return cnx;
- }
-
-
-
-
-
-
-
-}