🔍 Test Debug - API DĂ©chets List

Diagnostic complet de l'API dechets/list.php



Warning: Cannot modify header information - headers already sent by (output started at /home/softdgid/public_html/onl0/api/dechets/test_list.php:32) in /home/softdgid/public_html/onl0/api/config/database.php on line 102

Warning: Cannot modify header information - headers already sent by (output started at /home/softdgid/public_html/onl0/api/dechets/test_list.php:32) in /home/softdgid/public_html/onl0/api/config/database.php on line 103

Warning: Cannot modify header information - headers already sent by (output started at /home/softdgid/public_html/onl0/api/dechets/test_list.php:32) in /home/softdgid/public_html/onl0/api/config/database.php on line 104

Warning: Cannot modify header information - headers already sent by (output started at /home/softdgid/public_html/onl0/api/dechets/test_list.php:32) in /home/softdgid/public_html/onl0/api/config/database.php on line 105

1. Test de connexion à la base de données

✅ Connexion rĂ©ussie Ă  la base de donnĂ©es

2. Vérification des tables

✅ Table trouvĂ©e: releves_dechets

✅ Table trouvĂ©e: dechets_detail

✅ Table trouvĂ©e: utilisateurs

✅ Table trouvĂ©e: sites

3. Contenu de la table releves_dechets

📊 Nombre d'enregistrements: 11

IDCode RéférentDate RelevéSite IDUtilisateur IDStatutCréé le
12BABACAR SAMB2025-05-3033brouillon2025-05-30 12:17:06
11BABACAR SAMB2025-05-2933brouillon2025-05-29 23:17:20
10ALIOU DIA2025-05-2956valide2025-05-29 23:15:07
9ALIOU DIA2025-05-2956valide2025-05-29 22:19:35
8ALIOU DIA2025-05-2956valide2025-05-29 22:12:53

... et 6 autre(s) enregistrement(s)

4. Test des JOIN avec utilisateurs et sites

📊 RĂ©sultats avec JOIN: 3 enregistrement(s)

IDCode RéférentDateRéférentSiteRégionStatut
12BABACAR SAMB2025-05-30Babacar SAMBYoffDakarbrouillon
11BABACAR SAMB2025-05-29Babacar SAMBYoffDakarbrouillon
10ALIOU DIA2025-05-29ALIOU DIASalyThiĂšs Sudvalide

5. Test de la table dechets_detail

📊 Nombre de dĂ©tails de dĂ©chets: 16

IDRelevé IDCode RéférentCatégorieSous-catégorieArticlesPoids (kg)
32BABACAR SAMBPLPL-0212.000
42BABACAR SAMBCACA-01215.000
74SALIOU SOWCACA-0152.000
85ALIOU DIAPLPL-0210.500
95ALIOU DIAPLPL-01200.500
116ALIOU DIAPLPL-0110.500
137ALIOU DIAPLPL-0315.000
158ALIOU DIAPLPL-04201.000
179ALIOU DIAPLPL-0115.000
1911BABACAR SAMBPLPL-02201.000

6. Test de la requĂȘte complĂšte (comme dans l'API)

📊 RĂ©sultats de la requĂȘte API: 11 enregistrement(s)

✅ RequĂȘte API fonctionnelle

Premier résultat:

{
    "id": 12,
    "code_referent": "BABACAR SAMB",
    "date_releve": "2025-05-30",
    "heure_debut": "10:17:05",
    "latitude_debut": "14.731708",
    "longitude_debut": "-17.432780",
    "latitude_fin": "14.731637",
    "longitude_fin": "-17.432567",
    "orientation_plage": "04",
    "courant_dominant": "03",
    "vent_dominant": "07",
    "evenements_extremes": "\"[\\\"3\\\",\\\"5\\\"]\"",
    "autre_evenement": "",
    "statut": "brouillon",
    "created_at": "2025-05-30 12:17:06",
    "utilisateur_id": 3,
    "site_id": 3,
    "referent_nom": "SAMB",
    "referent_prenom": "Babacar",
    "nom_site": "Yoff",
    "region": "Dakar"
}

Détails des déchets pour le relevé #12:

{
    "nb_dechets": 2,
    "total_quantite": "8.000",
    "total_articles": "62",
    "categories": "CA"
}

7. Test de l'API complĂšte (simulation JSON)


Parse error: syntax error, unexpected '}', expecting end of file in /home/softdgid/public_html/onl0/api/dechets/test_list.php(282) : eval()'d code on line 16