From 9fb0c0a27f286f5face76432d7be456d831804ad Mon Sep 17 00:00:00 2001 From: Ouijdane IMER Date: Wed, 13 Aug 2025 10:09:47 +0200 Subject: [PATCH] ajout du dossier php pour mettre tout les fichiers php --- project/public/{ => php}/getAllTeamRequests.php | 0 project/public/{ => php}/getLeaveCounters.php | 0 project/public/{ => php}/getPendingRequests.php | 0 project/public/{ => php}/getRequests.php | 0 project/public/{ => php}/getTeamLeaves.php | 0 project/public/{ => php}/getTeamMembers.php | 0 project/public/{ => php}/login.php | 0 project/public/{ => php}/manualResetCounters.php | 0 project/public/{ => php}/resetLeaveCounters.php | 0 project/public/{ => php}/submitLeaveRequest.php | 0 project/public/{ => php}/test_db.php | 0 project/public/{ => php}/validateRequest.php | 0 project/src/components/NewLeaveRequestModal.jsx | 2 +- project/src/context/AuthContext.jsx | 8 ++++---- project/src/pages/Calendar.jsx | 2 +- project/src/pages/Dashboard.jsx | 8 ++++---- project/src/pages/Manager.jsx | 8 ++++---- project/src/pages/Requests.jsx | 4 ++-- 18 files changed, 16 insertions(+), 16 deletions(-) rename project/public/{ => php}/getAllTeamRequests.php (100%) rename project/public/{ => php}/getLeaveCounters.php (100%) rename project/public/{ => php}/getPendingRequests.php (100%) rename project/public/{ => php}/getRequests.php (100%) rename project/public/{ => php}/getTeamLeaves.php (100%) rename project/public/{ => php}/getTeamMembers.php (100%) rename project/public/{ => php}/login.php (100%) rename project/public/{ => php}/manualResetCounters.php (100%) rename project/public/{ => php}/resetLeaveCounters.php (100%) rename project/public/{ => php}/submitLeaveRequest.php (100%) rename project/public/{ => php}/test_db.php (100%) rename project/public/{ => php}/validateRequest.php (100%) diff --git a/project/public/getAllTeamRequests.php b/project/public/php/getAllTeamRequests.php similarity index 100% rename from project/public/getAllTeamRequests.php rename to project/public/php/getAllTeamRequests.php diff --git a/project/public/getLeaveCounters.php b/project/public/php/getLeaveCounters.php similarity index 100% rename from project/public/getLeaveCounters.php rename to project/public/php/getLeaveCounters.php diff --git a/project/public/getPendingRequests.php b/project/public/php/getPendingRequests.php similarity index 100% rename from project/public/getPendingRequests.php rename to project/public/php/getPendingRequests.php diff --git a/project/public/getRequests.php b/project/public/php/getRequests.php similarity index 100% rename from project/public/getRequests.php rename to project/public/php/getRequests.php diff --git a/project/public/getTeamLeaves.php b/project/public/php/getTeamLeaves.php similarity index 100% rename from project/public/getTeamLeaves.php rename to project/public/php/getTeamLeaves.php diff --git a/project/public/getTeamMembers.php b/project/public/php/getTeamMembers.php similarity index 100% rename from project/public/getTeamMembers.php rename to project/public/php/getTeamMembers.php diff --git a/project/public/login.php b/project/public/php/login.php similarity index 100% rename from project/public/login.php rename to project/public/php/login.php diff --git a/project/public/manualResetCounters.php b/project/public/php/manualResetCounters.php similarity index 100% rename from project/public/manualResetCounters.php rename to project/public/php/manualResetCounters.php diff --git a/project/public/resetLeaveCounters.php b/project/public/php/resetLeaveCounters.php similarity index 100% rename from project/public/resetLeaveCounters.php rename to project/public/php/resetLeaveCounters.php diff --git a/project/public/submitLeaveRequest.php b/project/public/php/submitLeaveRequest.php similarity index 100% rename from project/public/submitLeaveRequest.php rename to project/public/php/submitLeaveRequest.php diff --git a/project/public/test_db.php b/project/public/php/test_db.php similarity index 100% rename from project/public/test_db.php rename to project/public/php/test_db.php diff --git a/project/public/validateRequest.php b/project/public/php/validateRequest.php similarity index 100% rename from project/public/validateRequest.php rename to project/public/php/validateRequest.php diff --git a/project/src/components/NewLeaveRequestModal.jsx b/project/src/components/NewLeaveRequestModal.jsx index 7dbbf26..daae10d 100644 --- a/project/src/components/NewLeaveRequestModal.jsx +++ b/project/src/components/NewLeaveRequestModal.jsx @@ -290,7 +290,7 @@ const NewLeaveRequestModal = ({ formDataToSend.append(`medicalDocuments[]`, file); }); - const response = await fetch('http://localhost/GTA/project/public/submitLeaveRequest.php', { + const response = await fetch('http://localhost/GTA/project/public/php/submitLeaveRequest.php', { method: 'POST', body: formDataToSend }); diff --git a/project/src/context/AuthContext.jsx b/project/src/context/AuthContext.jsx index 81d8f55..76a76cc 100644 --- a/project/src/context/AuthContext.jsx +++ b/project/src/context/AuthContext.jsx @@ -52,10 +52,10 @@ export const AuthProvider = ({ children }) => { const login = async (email, password) => { try { const possibleUrls = [ - 'http://localhost/GTA/project/public/login.php', - 'http://localhost:80/GTA/project/public/login.php', - 'http://localhost/GTA/public/login.php', - 'http://localhost/public/login.php' + 'http://localhost/GTA/project/public/php/login.php', + 'http://localhost:80/GTA/project/public/php/login.php', + 'http://localhost/GTA/public/php/login.php', + 'http://localhost/public/php/login.php' ]; let response = null; diff --git a/project/src/pages/Calendar.jsx b/project/src/pages/Calendar.jsx index 882fe9c..306a3dc 100644 --- a/project/src/pages/Calendar.jsx +++ b/project/src/pages/Calendar.jsx @@ -88,7 +88,7 @@ const Calendar = () => { const loadTeamLeaves = async () => { if (user?.id) { try { - const response = await fetch(`http://localhost/GTA/project/public/getTeamLeaves.php?user_id=${user.id}`); + const response = await fetch(`http://localhost/GTA/project/public/php/getTeamLeaves.php?user_id=${user.id}`); const data = await response.json(); if (data.success) { setTeamLeaves(data.leaves || []); diff --git a/project/src/pages/Dashboard.jsx b/project/src/pages/Dashboard.jsx index e7cbedc..3577fad 100644 --- a/project/src/pages/Dashboard.jsx +++ b/project/src/pages/Dashboard.jsx @@ -29,7 +29,7 @@ const Dashboard = () => { const fetchLeaveCounters = async () => { try { - const url = `http://localhost/GTA/project/public/getLeaveCounters.php?user_id=${user.id}`; + const url = `http://localhost/GTA/project/public/php/getLeaveCounters.php?user_id=${user.id}`; console.log(' Dashboard - Récupération des compteurs:', url); console.log(' Dashboard - User ID utilisé:', user.id); @@ -84,7 +84,7 @@ const Dashboard = () => { console.log(' Dashboard - Début fetchAllRequests pour user:', user?.id); try { - const url = `http://localhost/GTA/project/public/getRequests.php?user_id=${user.id}`; + const url = `http://localhost/GTA/project/public/php/getRequests.php?user_id=${user.id}`; console.log(' Dashboard - URL appelée:', url); const response = await fetch(url); @@ -121,7 +121,7 @@ const Dashboard = () => { } try { - const response = await fetch('http://localhost/GTA/project/public/resetLeaveCounters.php', { + const response = await fetch('http://localhost/GTA/project/public/php/resetLeaveCounters.php', { method: 'POST', headers: { 'Content-Type': 'application/json', @@ -144,7 +144,7 @@ const Dashboard = () => { }; const openManualResetPage = () => { - window.open('http://localhost/GTA/project/public/manualResetCounters.php', '_blank'); + window.open('http://localhost/GTA/project/public/php/manualResetCounters.php', '_blank'); }; const getStatusColor = (status) => { diff --git a/project/src/pages/Manager.jsx b/project/src/pages/Manager.jsx index e74b901..a0f8bd0 100644 --- a/project/src/pages/Manager.jsx +++ b/project/src/pages/Manager.jsx @@ -44,7 +44,7 @@ const Manager = () => { const fetchTeamMembers = async () => { try { - const response = await fetch(`http://localhost/GTA/project/public/getTeamMembers.php?manager_id=${user.id}`); + const response = await fetch(`http://localhost/GTA/project/public/php/getTeamMembers.php?manager_id=${user.id}`); const text = await response.text(); console.log('Réponse équipe:', text); @@ -60,7 +60,7 @@ const Manager = () => { const fetchPendingRequests = async () => { try { - const response = await fetch(`http://localhost/GTA/project/public/getPendingRequests.php?manager_id=${user.id}`); + const response = await fetch(`http://localhost/GTA/project/public/php/getPendingRequests.php?manager_id=${user.id}`); const text = await response.text(); console.log('Réponse demandes en attente:', text); @@ -76,7 +76,7 @@ const Manager = () => { const fetchAllTeamRequests = async () => { try { - const response = await fetch(`http://localhost/GTA/project/public/getAllTeamRequests.php?SuperieurId=${user.id}`); + const response = await fetch(`http://localhost/GTA/project/public/php/getAllTeamRequests.php?SuperieurId=${user.id}`); const text = await response.text(); console.log('Réponse toutes demandes équipe:', text); @@ -94,7 +94,7 @@ const Manager = () => { const handleValidateRequest = async (requestId, action, comment = '') => { try { - const response = await fetch('http://localhost/GTA/project/public/validateRequest.php', { + const response = await fetch('http://localhost/GTA/project/public/php/validateRequest.php', { method: 'POST', headers: { 'Content-Type': 'application/json', diff --git a/project/src/pages/Requests.jsx b/project/src/pages/Requests.jsx index 1bb1afd..9a7b677 100644 --- a/project/src/pages/Requests.jsx +++ b/project/src/pages/Requests.jsx @@ -69,7 +69,7 @@ const Requests = () => { const fetchLeaveCounters = async () => { try { - const response = await fetch(`http://localhost/GTA/project/public/getLeaveCounters.php?user_id=${user.id}`); + const response = await fetch(`http://localhost/GTA/project/public/php/getLeaveCounters.php?user_id=${user.id}`); const text = await response.text(); let data; try { @@ -89,7 +89,7 @@ const Requests = () => { const fetchAllRequests = async () => { try { - const url = `http://localhost/GTA/project/public/getRequests.php?user_id=${user.id}`; + const url = `http://localhost/GTA/project/public/php/getRequests.php?user_id=${user.id}`; const response = await fetch(url); const text = await response.text(); let data;