parent
f01779e05d
commit
3325bab405
@ -0,0 +1,51 @@
|
|||||||
|
/**
|
||||||
|
* @file debug.c
|
||||||
|
* @brief Gestion du mode debug
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "main.h"
|
||||||
|
|
||||||
|
void displayItemList(int reference[], float weight[], float volume[], float unitPrice[], int log)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
printf("DEBUG - Affichage des articles: \n");
|
||||||
|
for (i = 0; i < log; i++)
|
||||||
|
{
|
||||||
|
printf("Référence: %d, Poids: %f, Volume: %f, Prix unitaire: %f\n", reference[i], weight[i], volume[i], unitPrice[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void displayClientList(int clientID[], float cagnotte[], int suspended[], int isAdmin[], int log)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
printf("DEBUG - Affichage des clients: \n");
|
||||||
|
for (i = 0; i < log; i++)
|
||||||
|
{
|
||||||
|
printf("Identifiant: %d, Cagnotte: %f, Suspendu: %d, Admin: %d\n", clientID[i], cagnotte[i], suspended[i], isAdmin[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void debugMenu(int tabReference[], float tabWeight[], float tabVolume[], float unitPrice[], int clientID[], float cagnotte[], int suspended[], int isAdmin[], int tlogArticle, int tlogClient)
|
||||||
|
{
|
||||||
|
int choice = -1;
|
||||||
|
while (choice != 0)
|
||||||
|
{
|
||||||
|
printf("DEBUG - Menu de debug: \n");
|
||||||
|
printf("1 - Afficher les articles\n");
|
||||||
|
printf("2 - Afficher les clients\n");
|
||||||
|
printf("Votre choix: ");
|
||||||
|
scanf("%d%*c", &choice);
|
||||||
|
|
||||||
|
switch (choice)
|
||||||
|
{
|
||||||
|
case 1:
|
||||||
|
displayItemList(tabReference, tabWeight, tabVolume, unitPrice, tlogArticle);
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
displayClientList(clientID, cagnotte, suspended, isAdmin, tlogClient);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in new issue