| |||||
| Dernière réponse | |
|---|---|
| Sujet : [TOPIK UNIK] HFR Blast! - ZE KONKOUR | |
| CrowFix | Modifiez les graphs de ce super ( :D ) jeu. le meilleur aura le droit de voir son avatar dans mon prochain jeu de la mort |
| Aperçu |
|---|
| Vue Rapide de la discussion |
|---|
| CrowFix | Modifiez les graphs de ce super ( :D ) jeu. le meilleur aura le droit de voir son avatar dans mon prochain jeu de la mort |
| bistou |
|
| CrowFix |
|
| bistou | :non: en c c printf :D |
| CrowFix |
|
| bistou | #include <conio.h>
#include <stdio.h> #include <string.h> struct entreprise { int nument; char noment[30]; char addrent[50]; int codent; char villent[20]; char phonent[11]; }; struct stagiaire { int numsta; char nomsta[30]; char prensta[20]; char addsta[50]; int codsta; char villsta[20]; char phonsta[11]; int numentrep; }; struct indexsta { int numstagiaire; char nomstagiaire[30]; int numeroentrep; }; struct indexent { int numeroent; char nament[30]; }; struct secteur { numsect; nomsect[30]; nomresp[30]; numeentr; }; void creationentrep (int); void creationstag (int); void creationindexstag(int); void affichent (struct entreprise); void affichesta (struct stagiaire); void listent (int,struct entreprise); void liststagiaire(int,struct stagiaire); int rechvident (int); int rechvidsta (int); void ajoutent(struct entreprise ,int); void ajoutsta(struct stagiaire ,int,int); int rechent(char[],int); int rechsta(char[],int); void suppent (char[],int); void suppsta (char[],int); void misajour_ind_sta (struct indexsta,struct stagiaire); void modifent (struct entreprise ,int); void modifsta (struct stagiaire,int); void creationindexent(int); void misajour_ind_ent (struct indexent,struct entreprise,int); void affichindexent (struct indexent); void affichindexsta (struct indexsta); void listindexent (int,struct indexent); void modifcletrang (struct stagiaire,struct entreprise); void listindexsta (int,struct indexsta); void creationsecteur (int); void affichsect (struct secteur); void listsect (int,struct secteur); int rechvidsect (int); void ajoutsect(struct secteur,int,int); void suppsect (char[],int); int rechsect(char [],int); void modifsect (struct secteur,int); void liststagiaire_entreprises (int,int,struct stagiaire,struct entreprise); void listsecteur_entreprises (int,int,struct secteur,struct entreprise); void liststagiairelionel (int,struct stagiaire); main() { int rep=0,comp,nbmaxent,nbmaxsta,nbmaxsect; struct entreprise vent,*pent; struct stagiaire vsta,*psta; struct indexent vi_ent; struct secteur vsect; struct indexsta vi_sta; char entrep[40]={0},stagi[40]={0},secteur[30],choix; /*//////////*/ /*/////////////////////////////MENU///////////////////////////////*/ /*//////////*/ textcolor(47); while (rep!=4) { clrscr(); printf ("\n\t\tÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»" ); printf ("\n\t\tº GESTION D'ENTREPRISE º" ); printf ("\n\t\tÌÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͹" ); printf ("\n\t\tº MENU PRINCIPAL º" ); printf ("\n\t\tÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ" ); printf ("\n\n\n\t1.Travailler sur le fichier entreprise" ); printf ("\n\t2.Travailler sur le fichier stagiaire" ); printf ("\n\t3.Travailler sur le fichier secteur\n\t4.Quitter" ); printf ("\n\nVotre choix: " ); scanf ("%d",&rep); switch (rep) { case 1: printf ("\nÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ" ); printf ("ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ" ); printf ("\n\nATTENTION Toujours s?lectionner l'option 1 avant " ); printf (" de manipuler le fichier..." ); getch(); for (comp=0;rep!=8;comp++) { rep=0; textcolor(47); clrscr(); printf ("\n\tÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»" ); printf ("\n\tº Travail sur le fichier entreprise º" ); printf ("\n\tÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ" ); printf ("\n\n1.Creer le fichier entreprise." ); printf ("\n2.Lister les fiches entreprises." ); printf ("\n3.Lister les entreprises ? l'aide de l'index." ); printf ("\n4.Ajouter une entreprise." ); printf ("\n5.Supprimer une entreprise." ); printf ("\n6.Modifier une fiche.\n7.Effectuer la requ?te 1." ); printf ("\n8.Quitter." ); printf ("\n\n\n\tVotre choix: " ); scanf ("%d",&rep); switch (rep) { case 1:clrscr(); printf("\n\nDe combien de fiches voulez-vous composer le fichier entreprise: " ); scanf ("%d",&nbmaxent); while (nbmaxent<=0) { printf ("\nEntrez un nombre correct: " ); scanf ("%d",&nbmaxent); } while (nbmaxent>9999) { printf ("\nEntrez un nombre correct: " ); scanf ("%d",&nbmaxent); } creationentrep(nbmaxent); creationindexent (nbmaxent);break; case 2:listent(nbmaxent,vent);break; case 3:listindexent(nbmaxent,vi_ent);break; case 4:ajoutent(vent,nbmaxent);break; case 5:suppent (entrep,nbmaxent);break; case 6:modifent (vent,nbmaxent);break; case 7:liststagiaire_entreprises (nbmaxent,nbmaxsta,vsta,vent);break; } }break; case 2: printf ("\nÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ" ); printf ("ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ" ); printf ("\n\nATTENTION Toujours s?lectionner l'option 1 avant " ); printf (" de manipuler le fichier..." ); getch(); for (comp=0;rep!=8;comp++) { rep=0; textcolor(47); clrscr(); printf ("\n\tÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»" ); printf ("\n\tº Travail sur le fichier stagiaire º" ); printf ("\n\tÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ" ); printf ("\n\n1.Creer le fichier stagiaire." ); printf ("\n2.Lister les fiches stagiaires." ); printf ("\n3.Lister les stagiaires ? l'aide de l'index." ); printf ("\n4.Ajouter un stagiaire." ); printf ("\n5.Supprimer un stagiaire." ); printf ("\n6.Modifier une fiche.\n7.Effectuer le requ?te nø4\n8.Quitter." ); printf ("\n\n\n\tVotre choix: " ); scanf ("%d",&rep); switch (rep) { case 1:clrscr(); printf ("\n\nDe combien de fiches voulez-vous composer le fichier stagiaire: " ); scanf ("%d",&nbmaxsta); creationstag(nbmaxsta); while (nbmaxsta<=0) { printf ("\nEntrez un nombre correct: " ); scanf ("%d",&nbmaxsta); } while (nbmaxsta>9999) { printf ("\nEntrez un nombre correct: " ); scanf ("%d",&nbmaxsta); } creationindexstag(nbmaxsta);break; case 2:liststagiaire(nbmaxsta,vsta);break; case 3:listindexsta(nbmaxsta,vi_sta);break; case 4:ajoutsta(vsta,nbmaxent,nbmaxsta);break; case 5:suppsta (stagi,nbmaxsta);break; case 6:modifsta(vsta,nbmaxsta);break; case 7:liststagiairelionel (nbmaxsta,vsta);break; } }break; case 3: printf ("\nÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ" ); printf ("ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ" ); printf ("\n\nATTENTION Toujours s?lectionner l'option 1 avant " ); printf (" de manipuler le fichier..." ); getch(); for (comp=0;rep!=7;comp++) { rep=0; textcolor(47); clrscr(); printf ("\n\tÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»" ); printf ("\n\tº Travail sur le fichier secteur º" ); printf ("\n\tÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ" ); printf ("\n\n1.Creer le fichier secteur." ); printf ("\n2.Lister les fiches secteur." ); printf ("\n3.Ajouter un secteur." ); printf ("\n4.Supprimer un secteur." ); printf ("\n5.Modifier une fiche." ); printf ("\n6.Effectuer la requ?te 2." ); printf ("\n7.Quitter." ); printf ("\n\n\n\tVotre choix: " ); scanf ("%d",&rep); switch (rep) { case 1:clrscr(); printf("\n\nDe combien de fiches voulez-vous composer le fichier secteur: " ); scanf ("%d",&nbmaxsect); while (nbmaxsect<=0) { printf ("\nEntrez un nombre correct: " ); scanf ("%d",&nbmaxsect); } while (nbmaxsect>9999) { printf ("\nEntrez un nombre correct: " ); scanf ("%d",&nbmaxsect); } creationsecteur(nbmaxsect); case 2:listsect(nbmaxsect,vsect);break; case 3:ajoutsect(vsect,nbmaxent,nbmaxsect);break; case 4:suppsect (secteur,nbmaxsect);break; case 5:modifsect (vsect,nbmaxsect);break; case 6:listsecteur_entreprises (nbmaxent,nbmaxsect,vsect,vent); } }break; } } } getch(); /*/////////////*/ /*///////////////////////////FONCTIONS//////////////////////////////*/ /*/////////////*/ /*/////////////////creation du fichier entreprise///////////////////*/ void creationentrep (int nbmaxent) { FILE *pt; struct entreprise vent={0,"","",0,"",""}; int i; char rep; if (pt!=0) { printf("\nEcraser le fichier existant(o/n): " ); rep=getche(); if (rep=='o') { printf ("\a" ); pt=fopen("c:Filent.dat","wb" ); for (i=1;i<=nbmaxent;i++) fwrite(&vent,sizeof(vent),1,pt); fclose(pt); } } } /*/////////////////creation du fichier secteur//////////////////////*/ void creationsecteur (int nbmaxsect) { FILE *pt; struct secteur vsect={0,"","",0}; int i; char rep; if (pt!=0) { printf("\nEcraser le fichier existant(o/n): " ); rep=getche(); if (rep=='o') { printf ("\a" ); pt=fopen("c:Filsect.dat","wb" ); for (i=1;i<=nbmaxsect;i++) fwrite(&vsect,sizeof(vsect),1,pt); fclose(pt); } } } /*/////////////////creation du fichier stagiaire/////////////////////*/ void creationstag(int nbmaxsta) { FILE *pt; struct stagiaire vsta={0,"","","",0,"","",0}; int i; char rep; if (pt!=0) { printf("\nEcraser le fichier existant(o/n): " ); rep=getche(); if (rep=='o') { printf ("\a" ); pt=fopen("c:Filsta.dat","wb" ); for (i=1;i<=nbmaxsta;i++) fwrite(&vsta,sizeof(vsta),1,pt); fclose(pt); } } } /*////////////////////////creation de l'index sta/////////////////////*/ void creationindexstag(int nbmaxsta) { FILE *pt; struct indexsta vi_sta={0,"",0}; int i; pt=fopen("c:Fili_sta.dat","wb" ); for (i=1;i<=nbmaxsta;i++) fwrite(&vi_sta,sizeof(vi_sta),1,pt); fclose(pt); } /*////////////////////////creation de l'index ent//////////////////////*/ void creationindexent(int nbmaxent) { FILE *pt; struct indexent vi_ent={0,""}; int i; pt=fopen("c:Fili_ent.dat","wb" ); for (i=1;i<=nbmaxent;i++) fwrite(&vi_ent,sizeof(vi_ent),1,pt); fclose(pt); } /*//////////////////////afficher entreprise////////////////////////////*/ void affichent (struct entreprise vent) { printf ("\n\nNø d'entreprise: %d",vent.nument); printf ("\nÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ" ); printf ("\nNom de l'entreprise: %s",vent.noment); printf ("\nAddresse: %s",vent.addrent); printf ("\nCode postal: %d",vent.codent); printf ("\nVille: %s",vent.villent); printf ("\nT?l?phonne: %s",vent.phonent); } /*////////////////////////afficher secteur/////////////////////////////*/ void affichsect (struct secteur vsect) { printf("\n\nNø du stagiaire: %d",vsect.numsect); printf("\nÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ" ); printf("\nNom: %s",vsect.nomsect); printf("\nNom du responsable: %s",vsect.nomresp); printf("\nÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ" ); printf("\nNø d'entreprise: %d",vsect.numeentr); } /*///////////////////////afficher stagiaire/////////////////////////////*/ void affichsta (struct stagiaire vsta) { printf("\n\nNø du stagiaire: %d",vsta.numsta); printf("\nÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ" ); printf("\nNom: %s",vsta.nomsta); printf("\nPr?nom: %s",vsta.prensta); printf("\nAdresse: %s",vsta.addsta); printf("\nCode postal: %d",vsta.codsta); printf("\nVille: %s",vsta.villsta); printf("\nT?l?phonne: %s",vsta.phonsta); printf("\nÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ" ); printf("\nNø d'entreprise: %d",vsta.numentrep); } /*////////////////////afficher index de l'entrep///////////////////////*/ void affichindexent (struct indexent vi_ent) { printf ("\n\nNø de l'entreprise: %d",vi_ent.numeroent); printf ("\nÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ" ); printf ("\nNom de l'entreprise: %s",vi_ent.nament); } /*///////////////////afficher index stagiaire//////////////////////////*/ void affichindexsta (struct indexsta vi_sta) { printf ("\n\nNø de stagiaire: %d",vi_sta.numstagiaire); printf ("\nÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ" ); printf ("\nNom du stagiaire: %s",vi_sta.nomstagiaire); printf ("\nNø d'entreprise: %d",vi_sta.numeroentrep); } /*////////////////////////Listage entreprise///////////////////////////*/ void listent (int nbmaxent,struct entreprise vent) { FILE *pt; int comp=0; pt=fopen("c:Filent.dat","rb" ); while (comp<=nbmaxent) { comp++; clrscr(); fread(&vent,sizeof(vent),1,pt); if (vent.nument!=0) { affichent(vent); printf ("\n\n/Appuyez sur Enter/" ); getch(); } } fclose(pt); } /*//////////////////listage de l'index entreprise//////////////////////*/ void listindexent (int nbmaxent,struct indexent vi_ent) { FILE *pt; int comp=0; pt=fopen("c:Fili_ent.dat","rb" ); while (comp<=nbmaxent) { comp++; clrscr(); fread(&vi_ent,sizeof(vi_ent),1,pt); if (vi_ent.numeroent!=0) { affichindexent(vi_ent); printf ("\n\n/Appuyez sur Enter/" ); getch(); } } fclose(pt); } /*////////////////listage de l'index stagiaire///////////////////////////*/ void listindexsta (int nbmaxsta,struct indexsta vi_sta) { FILE *pt; int comp=0; pt=fopen("c:Fili_sta.dat","rb" ); while (comp<=nbmaxsta) { comp++; clrscr(); fread(&vi_sta,sizeof(vi_sta),1,pt); if (vi_sta.numstagiaire!=0) { affichindexsta(vi_sta); printf ("\n\n/Appuyez sur Enter/" ); getch(); } } fclose(pt); } /*/////////////////////listage du fichier secteur////////////////////////*/ void listsect (int nbmaxsect,struct secteur vsect) { FILE *pt; int comp=0; pt=fopen("c:Filsect.dat","rb" ); while (comp<=nbmaxsect) { comp++; clrscr(); fread(&vsect,sizeof(vsect),1,pt); if (vsect.numsect!=0) { affichsect(vsect); printf ("\n\n/Appuyez sur Enter/" ); getch(); } } fclose(pt); } /*///////////////////////listage stagiaire//////////////////////////////*/ void liststagiaire (int nbmaxsta,struct stagiaire vsta) { FILE *pt; int comp=0; pt=fopen("c:Filsta.dat","rb" ); while (comp<=nbmaxsta) { comp++; clrscr(); fread(&vsta,sizeof(vsta),1,pt); if (vsta.numsta!=0) { affichsta(vsta); printf ("\n\n/Appuyez sur Enter/" ); getch(); } } fclose(pt); } /*///////////////////recherche vide entreprise///////////////////////////*/ int rechvident (int nbmaxent) { FILE *pt; int i=0,exit=1; struct entreprise vent; pt=fopen("c:Filent.dat","rb" ); for (i=0;i<nbmaxent+1 && exit>0;i++) { if (i>nbmaxent) { printf ("\n\nLe fichier est plein..." ); getch(); } else { fread(&vent,sizeof(vent),1,pt); if (vent.nument==0) exit=-1; } } fclose (pt); return (i); } /*////////////////////////recherche vide secteur/////////////////////*/ int rechvidsect (int nbmaxsect) { FILE *pt; int i=0,exit=1; struct secteur vsect; pt=fopen("c:Filsect.dat","rb" ); for (i=0;i<nbmaxsect+1 && exit>0;i++) { if (i>nbmaxsect) { printf ("\n\nLe fichier est plein..." ); getch(); } else { fread(&vsect,sizeof(vsect),1,pt); if (vsect.numsect==0) exit=-1; } } fclose (pt); return (i); } /*/////////////////////recherche vide stagiaire/////////////////////////*/ int rechvidsta (int nbmaxsta) { FILE *pt; int i=0,exit=1; struct stagiaire vsta; pt=fopen("c:Filsta.dat","rb" ); for (i=0;i<nbmaxsta+1 && exit>0;i++) { if (i>nbmaxsta) { printf ("\n\nLe fichier est plein..." ); getch(); } else { fread(&vsta,sizeof(vsta),1,pt); if (vsta.numsta==0) exit=-1; } } fclose (pt); return (i); } /*//////////////////////////ajout entrep//////////////////////////////////*/ void ajoutent (struct entreprise vent,int nbmaxent) { FILE *pt; int posi; struct indexent vi_ent; printf ("\nÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ" ); printf ("ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ" ); printf ("\n\nATTENTION. Les champs obligatoires seront pr?c?d?s de *..." ); getch(); clrscr(); printf ("\n ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»" ); printf ("\n º Vous allez maintenant remplir une fiche º" ); printf ("\n ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ " ); pt=fopen("c:Filent.dat","r+b" ); fflush (stdin); posi=rechvident (nbmaxent); fseek(pt,(posi-1)*sizeof(vent),0); vent.nument=posi; printf ("\n*Entrez le nom: " ); fflush(stdin); gets (vent.noment); while (strcmp("",vent.noment)==0) { if (strcmp("",vent.noment)==0) { textcolor(-2); clrscr(); textcolor(47); printf ("\n\n\aATTENTION. " ); getch(); clrscr(); textcolor(-2); printf ("Ce champs est obligatoire" ); printf ("\n\nR?entrez le nom: " ); fflush(stdin); gets (vent.noment); } } fflush(stdin); printf ("\n*Entrez l'adresse complete: " ); gets (vent.addrent); while (strcmp("",vent.addrent)==0) { if (strcmp("",vent.addrent)==0) { textcolor(-2); clrscr(); textcolor(47); printf ("\n\n\aATTENTION. " ); getch(); clrscr(); textcolor(-2); printf ("Ce champs est obligatoire" ); printf ("\n\nR?entrez l'adresse compl?te: " ); fflush(stdin); gets (vent.addrent); } } fflush(stdin); printf ("\n*Entrez le code postal: " ); scanf ("%d",&vent.codent); while (vent.codent<1000) { clrscr(); printf ("\nVeuillez entrer un code postal correct" ); printf ("\n\nR?entrez le code postal: " ); fflush(stdin); scanf ("%d",&vent.codent); } while (vent.codent>9999) { clrscr(); printf ("\nVeuillez entrer un code postal correct" ); printf ("\n\nR?entrez le code postal: " ); fflush(stdin); scanf ("%d",&vent.codent); } while (vent.codent==0) { if (vent.codent==0) { textcolor(-2); clrscr(); textcolor(47); printf ("\n\n\aATTENTION. " ); getch(); clrscr(); textcolor(-2); printf ("Ce champs est obligatoire" ); printf ("\n\nR?entrez le code postal: " ); fflush(stdin); scanf ("%d",&vent.codent); } } fflush(stdin); printf ("\n*Entrez la ville: " ); gets (vent.villent); while (strcmp("",vent.villent)==0) { if (strcmp("",vent.villent)==0) { textcolor(-2); clrscr(); textcolor(47); printf ("\n\n\aATTENTION. " ); getch(); clrscr(); textcolor(-2); printf ("Ce champs est obligatoire" ); printf ("\n\nR?entrez la ville: " ); fflush(stdin); gets (vent.villent); } } fflush(stdin); printf ("\n Entrez le tel: " ); gets (vent.phonent); fflush(stdin); misajour_ind_ent (vi_ent,vent,nbmaxent); fwrite (&vent,sizeof(vent),1,pt); fclose(pt); } /*/////////////////////ajout d'une fiche secteur//////////////////////////*/ void ajoutsect(struct secteur vsect,int nbmaxent,int nbmaxsect) { FILE *pt; int posi; printf ("\nÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ" ); printf ("ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ" ); printf ("\n\nATTENTION. Les champs obligatoires seront pr?c?d?s de *..." ); getch(); clrscr(); printf ("\n ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»" ); printf ("\n º Vous allez maintenant remplir une fiche º" ); printf ("\n ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ " ); pt=fopen("c:Filsect.dat","r+b" ); fflush (stdin); posi=rechvidsect (nbmaxsect); fseek(pt,(posi-1)*sizeof(vsect),0); vsect.numsect=posi; printf ("\n*Entrez le nom: " ); fflush(stdin); gets (vsect.nomsect); while (strcmp("",vsect.nomsect)==0) { if (strcmp("",vsect.nomsect)==0) { textcolor(-2); clrscr(); textcolor(47); printf ("\n\n\aATTENTION. " ); getch(); clrscr(); textcolor(-2); printf ("Ce champs est obligatoire" ); printf ("\n\nR?entrez le nom: " ); fflush(stdin); gets (vsect.nomsect); } } fflush(stdin); printf ("\n*Entrez le nom du responsable: " ); gets (vsect.nomresp); while (strcmp("",vsect.nomresp)==0) { if (strcmp("",vsect.nomresp)==0) { textcolor(-2); clrscr(); textcolor(47); printf ("\n\n\aATTENTION. " ); getch(); clrscr(); textcolor(-2); printf ("Ce champs est obligatoire" ); printf ("\n\nR?entrez le nom: " ); fflush(stdin); gets (vsect.nomresp); } } fflush (stdin); printf ("\n*Entrez le Nød'entreprise: " ); scanf ("%d",&vsect.numeentr); while (vsect.numeentr<0) { clrscr(); printf ("\nCe num?ro d'entreprise est impossible" ); printf ("\n\nR?entrez le num?ro: " ); fflush(stdin); scanf ("%d",&vsect.numeentr); } while (vsect.numeentr>nbmaxent) { clrscr(); printf ("\nCe num?ro d'entreprise est impossible" ); printf ("\n\nR?entrez le num?ro: " ); fflush(stdin); scanf ("%d",&vsect.numeentr); } while (vsect.numeentr==0) { if (vsect.numeentr==0) { textcolor(-2); clrscr(); textcolor(47); printf ("\n\n\aATTENTION. " ); getch(); clrscr(); textcolor(-2); printf ("Ce champs est obligatoire" ); printf ("\n\nR?entrez le num?ro: " ); fflush(stdin); scanf ("%d",&vsect.numeentr); } } fflush(stdin); fwrite (&vsect,sizeof(vsect),1,pt); fclose(pt); } /*/////////////////////ajout d'une fiche stagiaire///////////////////////*/ void ajoutsta (struct stagiaire vsta,int nbmaxent,int nbmaxsta) { FILE *pt; int posi; struct indexsta vi_sta; printf ("\nÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ" ); printf ("ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ" ); printf ("\n\nATTENTION. Les champs obligatoires seront pr?c?d?s de *..." ); getch(); clrscr(); printf ("\n ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»" ); printf ("\n º Vous allez maintenant remplir une fiche º" ); printf ("\n ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ " ); pt=fopen("c:Filsta.dat","r+b" ); fflush (stdin); posi=rechvidsta (nbmaxsta); fseek(pt,(posi-1)*sizeof(vsta),0); vsta.numsta=posi; printf ("\n*Entrez le nom: " ); fflush(stdin); gets (vsta.nomsta); while (strcmp("",vsta.nomsta)==0) { if (strcmp("",vsta.nomsta)==0) { clrscr(); textcolor(-2); printf ("\n\n\aATTENTION. " ); textcolor(47); printf ("Ce champs est obligatoire" ); printf ("\n\nR?entrez le nom: " ); fflush(stdin); gets (vsta.nomsta); } } fflush(stdin); printf ("\n*Entrez le pr?nom: " ); gets (vsta.prensta); while (strcmp("",vsta.prensta)==0) { if (strcmp("",vsta.prensta)==0) { textcolor(-2); clrscr(); textcolor(47); printf ("\n\n\aATTENTION. " ); getch(); clrscr(); textcolor(-2); printf ("Ce champs est obligatoire" ); printf ("\n\nR?entrez le pr?nom: " ); fflush(stdin); gets (vsta.prensta); } } fflush(stdin); printf ("\n*Entrez l'adresse complete: " ); gets(vsta.addsta); while (strcmp("",vsta.addsta)==0) { if (strcmp("",vsta.addsta)==0) { textcolor(-2); clrscr(); textcolor(47); printf ("\n\n\aATTENTION. " ); getch(); clrscr(); textcolor(-2); printf ("Ce champs est obligatoire" ); printf ("\n\nR?entrez l'adresse compl?te: " ); fflush (stdin); gets(vsta.addsta); } } fflush(stdin); printf ("\n*Entrez le code postal: " ); scanf ("%d",&vsta.codsta); while (vsta.codsta<1000) { clrscr(); printf ("\nVeuillez entrer un code postal correct" ); printf ("\n\nR?entrez le code postal: " ); fflush(stdin); scanf ("%d",&vsta.codsta); } while (vsta.codsta>9999) { clrscr(); printf ("\nVeuillez entrer un code postal correct" ); printf ("\n\nR?entrez le code postal: " ); fflush(stdin); scanf ("%d",&vsta.codsta); } while (vsta.codsta==0) { if (vsta.codsta==0) { textcolor(-2); clrscr(); textcolor(47); printf ("\n\n\aATTENTION. " ); getch(); clrscr(); textcolor(-2); printf ("Ce champs est obligatoire" ); printf ("\n\nR?entrez le code postal: " ); fflush (stdin); scanf ("%d",&vsta.codsta); } } fflush(stdin); printf ("\n*Entrez la ville: " ); gets (vsta.villsta); while (strcmp("",vsta.villsta)==0) { if (strcmp("",vsta.villsta)==0) { printf ("Ce champs est obligatoire" ); printf ("\n\nR?entrez la ville: " ); fflush(stdin); gets (vsta.villsta); } } fflush(stdin); printf ("\n Entrez le tel: " ); gets (vsta.phonsta); fflush(stdin); printf ("\n*Entrez le Nød'entreprise: " ); scanf ("%d",&vsta.numentrep); while (vsta.numentrep<0) { clrscr(); printf ("\nCe num?ro d'entreprise est impossible" ); printf ("\n\nR?entrez le code num?ro: " ); fflush(stdin); scanf ("%d",&vsta.numentrep); } while (vsta.numentrep>nbmaxent) { clrscr(); printf ("\nCe num?ro d'entreprise est impossible" ); printf ("\n\nR?entrez le num?ro: " ); fflush(stdin); scanf ("%d",&vsta.numentrep); } while (vsta.numentrep==0) { if (vsta.numentrep==0) { textcolor(-2); clrscr(); textcolor(47); printf ("\n\n\aATTENTION. " ); getch(); clrscr(); textcolor(-2); printf ("Ce champs est obligatoire" ); printf ("\n\nR?entrez le num?ro: " ); fflush(stdin); scanf ("%d",&vsta.numentrep); } } fflush(stdin); misajour_ind_sta (vi_sta,vsta); fwrite (&vsta,sizeof(vsta),1,pt); fclose(pt); } /*//////////////////suppression d'une fiche entreprise////////////////////*/ void suppent (char entrep[30],int nbmaxent) { FILE *pt; int i,rep,fich,num,posi; struct entreprise vent; struct indexent vi_ent; struct stagiaire vsta; char oui,choix; clrscr(); pt=fopen("c:Filent.dat","r+b" ); printf("\nConnaissez vous le Nø ? supprimer(o/n): " ); oui=getche(); if (oui=='o') { printf ("\nQuel est le num?ro de la fiche: " ); scanf ("%d",&fich); fseek (pt,(fich-1)*sizeof(vent),0); printf ("\n\nVoulez-vous r?ellement supprimer cette entreprise(o/n): " ); choix=getche(); if (choix=='o') { vent.nument=0; misajour_ind_ent (vi_ent,vent,nbmaxent); modifcletrang (vsta,vent); fwrite (&vent,sizeof(vent),1,pt); printf ("\nEntreprise supprim?e..." ); getch(); } else { clrscr(); printf ("\a" ); printf ("\n\nSUPPRESSION ANNULEE" ); getch(); } } else { fflush (stdin); printf ("\nVeuillez entrer le nom de l'entreprise ? supprimer: " ); gets(entrep); posi=rechent(entrep,nbmaxent); fseek (pt,(posi-1)*sizeof(vent),0); printf ("\n\nVoulez-vous r?ellement supprimer cette entreprise(o/n): " ); rep=getche(); if (rep=='o') { vent.nument=0; misajour_ind_ent (vi_ent,vent,nbmaxent); modifcletrang (vsta,vent); fwrite (&vent,sizeof(vent),1,pt); printf ("\a" ); printf ("\nEntreprise supprim?e..." ); getch(); } else printf ("SUPPRESSION ANNULEE" ); } fclose(pt); } /*////////////////////suppression d'un secteur/////////////////////////*/ void suppsect (char secteur[30],int nbmaxsect) { FILE *pt; int i,rep,fich,num,posi; struct entreprise vent; struct secteur vsect; char oui,choix; clrscr(); pt=fopen("c:Filsect.dat","r+b" ); printf("\nConnaissez vous le Nø ? supprimer(o/n): " ); oui=getche(); if (oui=='o') { printf ("\nQuel est le num?ro de la fiche: " ); scanf ("%d",&fich); fseek (pt,(fich-1)*sizeof(vsect),0); printf ("\n\nVoulez-vous r?ellement supprimer ce secteur(o/n): " ); choix=getche(); if (choix=='o') { vsect.numsect=0; fwrite (&vsect,sizeof(vsect),1,pt); printf ("\a" ); printf ("\nSecteur supprim?e..." ); getch(); } else { clrscr(); printf ("\n\nSUPPRESSION ANNULEE" ); getch(); } } else { fflush (stdin); printf ("\nVeuillez entrer le nom du secteur ? supprimer: " ); gets(secteur); posi=rechsect(secteur,nbmaxsect); fseek (pt,(posi-1)*sizeof(vsect),0); printf ("\n\nVoulez-vous r?ellement supprimer ce secteur(o/n): " ); rep=getche(); if (rep=='o') { vsect.numsect=0; fwrite (&vsect,sizeof(vsect),1,pt); printf ("\a" ); printf ("\Secteur supprim?e..." ); getch(); } else printf ("SUPPRESSION ANNULEE" ); } fclose(pt); } /*////////////////////suppression d'une fiche stagiaire//////////////////*/ void suppsta (char stagi[30],int nbmaxsta) { FILE *pt; int i,rep,fich,num,posi; struct entreprise vent; struct indexsta vi_sta; struct stagiaire vsta; char oui,choix; clrscr(); pt=fopen("c:Filsta.dat","r+b" ); printf("\nConnaissez vous le Nø ? supprimer(o/n): " ); oui=getche(); if (oui=='o') { printf ("\nQuel est le num?ro de la fiche: " ); scanf ("%d",&fich); fseek (pt,(fich-1)*sizeof(vent),0); printf ("\n\nVoulez-vous r?ellement supprimer ce stagiaire(o/n): " ); choix=getche(); if (choix=='o') { vsta.numsta=0; misajour_ind_sta (vi_sta,vsta); modifcletrang (vsta,vent); fwrite (&vsta,sizeof(vsta),1,pt); printf ("\a" ); printf ("\nStagiaire supprim?..." ); getch(); } else { clrscr(); printf ("\n\nSUPPRESSION ANNULEE" ); getch(); } } else { fflush (stdin); printf ("\nVeuillez entrer le nom du stagiaire ? supprimer: " ); gets(stagi); posi=rechsta(stagi,nbmaxsta); fseek (pt,(posi-1)*sizeof(vsta),0); printf ("\n\nVoulez-vous r?ellement supprimer ce stagiaire(o/n): " ); rep=getche(); if (rep=='o') { vsta.numsta=0; misajour_ind_sta (vi_sta,vsta); modifcletrang (vsta,vent); fwrite (&vsta,sizeof(vsta),1,pt); printf ("\a" ); printf ("\nStagiaire supprim?e..." ); getch(); } else printf ("SUPPRESSION ANNULEE" ); } fclose(pt); } /*////////////////////////recherche d'une entreprise////////////////////*/ int rechent(char entrep[30],int nbmaxent) { FILE *pt; int i,ok,numero=0,exit=0; struct entreprise vent; pt=fopen("c:Filent.dat","rb" ); for(i=0;i<=nbmaxent+1 && exit!=1;i++) { if (i==nbmaxent+1) printf ("\nL'entreprise n'existe pas." ); getch(); fread(&vent,sizeof(vent),1,pt); ok=strcmp(entrep,vent.noment); if (ok==0) { numero=i+1; exit=1; } } fclose(pt); return(numero); } /*///////////////////////////recherche d'un secteur////////////////////*/ int rechsect(char secteur[30],int nbmaxsect) { FILE *pt; int i,ok,numero=0,exit=0; struct secteur vsect; pt=fopen("c:Filsect.dat","rb" ); for(i=0;i<=nbmaxsect+1 && exit!=1;i++) { if (i==nbmaxsect+1) printf ("\nLe secteur n'existe pas." ); getch(); fread(&vsect,sizeof(vsect),1,pt); ok=strcmp(secteur,vsect.nomsect); if (ok==0) { numero=i+1; exit=1; } } fclose(pt); return(numero); } /*///////////////////////recherche d'un stagiaire//////////////////////*/ int rechsta(char stagi[30],int nbmaxsta) { FILE *pt; int i,ok,numero=0,exit=0; struct stagiaire vsta; pt=fopen("c:Filsta.dat","rb" ); for(i=0;i<=nbmaxsta+1 && exit!=1;i++) { if (i==nbmaxsta+1) printf ("\nLe stagiaire n'existe pas." ); getch(); fread(&vsta,sizeof(vsta),1,pt); ok=strcmp(stagi,vsta.nomsta); if (ok==0) { numero=i+1; exit=1; } } fclose(pt); return(numero); } /*///////////////////modification d'un stagiaire///////////////////////*/ void modifsta (struct stagiaire vsta,int nbmaxsta) { FILE *pt; char stagi[30],oui,nom[30],addr[60],ville[30],phone[30]; int posi,rep=0,num,fich,numentr,code; struct indexsta vi_sta; pt=fopen("c:Filsta.dat","rb" ); clrscr(); printf("\nConnaissez vous le Nø ? modifier(o/n): " ); oui=getche(); if (oui=='o') { printf ("\nQuel est le num?ro de la fiche: " ); scanf ("%d",&fich); fseek (pt,(fich-1)*sizeof(vsta),0); } else { fflush(stdin); printf ("\nEntrez le nom du stagiaire ? modifier: " ); gets(stagi); posi=rechsta(stagi,nbmaxsta); fseek (pt,posi*sizeof(vsta),0); } fread (&vsta,sizeof(vsta),1,pt); num=vsta.numsta; strcpy(nom,vsta.nomsta); strcpy(addr,vsta.addsta); code=vsta.codsta; strcpy(ville,vsta.villsta); strcpy(phone,vsta.phonsta); numentr=vsta.numentrep; fclose(pt); while (rep!=7) { clrscr(); printf ("\n\t\tMENU DE MODIFICATION" ); printf ("\n\t\tÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ" ); printf ("\n\n\t1.Nom\n\t2.Adresse\n\t3.Code postal\n\t4.Ville" ); printf ("\n\t5.T?l?phonne\n\t6.Nøentreprise\n\t7.Quitter" ); printf ("\n\n\tVotre coix: " ); scanf("%d",&rep); clrscr(); switch (rep) { case 1: fflush(stdin); printf ("\nNom actuel: %s",nom); printf ("\nNouveau nom: " ); gets (nom); break; case 2: fflush(stdin); printf ("\nAdresse actuelle: %s",addr); printf ("\nNouvelle adresse: " ); gets (addr); break; case 3: fflush(stdin); printf ("\nCode postal actuel: %d",code); printf ("\nNouveau code postal: " ); scanf ("%d",&code); break; case 4: fflush(stdin); printf ("\nVille actuelle: %s",ville); printf ("\nNouvelle ville: " ); gets (ville); break; case 5: fflush(stdin); printf ("\nNø de t?l?phonne actuel: %s",phone); printf ("\nNouveau Nø: " ); gets(phone); break; case 6: fflush(stdin); printf ("\nNøentreprise actuel: %d",numentr); printf ("\nNouveau num?ro: " ); scanf ("%d",&numentr); } } pt=fopen("c:Filsta.dat","r+b" ); vsta.numsta=num; strcpy(vsta.nomsta,nom); strcpy(vsta.addsta,addr); vsta.codsta=code; strcpy(vsta.villsta,ville); strcpy(vsta.phonsta,phone); vsta.numentrep=numentr; misajour_ind_sta (vi_sta,vsta); fwrite(&vsta,sizeof(vsta),1,pt); fclose(pt); } /*//////////////////////modification d'un secteur/////////////////////*/ void modifsect (struct secteur vsect,int nbmaxsect) { FILE *pt; char secteur[30],oui,nom[30],nomres[30]; int posi,rep=0,num,fich,numentr; pt=fopen("c:Filsect.dat","rb" ); clrscr(); printf("\nConnaissez vous le Nø ? modifier(o/n): " ); oui=getche(); if (oui=='o') { printf ("\nQuel est le num?ro de la fiche: " ); scanf ("%d",&fich); fseek (pt,(fich-1)*sizeof(vsect),0); } else { fflush(stdin); printf ("\nEntrez le nom du secteur ? modifier: " ); gets(secteur); posi=rechsect(secteur,nbmaxsect); fseek (pt,posi*sizeof(vsect),0); } fread (&vsect,sizeof(vsect),1,pt); num=vsect.numsect; strcpy(nom,vsect.nomsect); strcpy(nomres,vsect.nomresp); numentr=vsect.numeentr; fclose(pt); while (rep!=4) { clrscr(); printf ("\n\t\tMENU DE MODIFICATION" ); printf ("\n\t\tÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ" ); printf ("\n\n\t1.Nom\n\t2.Nom responsable" ); printf ("\n\t3.Nøentreprise\n\t4.Quitter" ); printf ("\n\n\tVotre coix: " ); scanf("%d",&rep); clrscr(); switch (rep) { case 1: fflush(stdin); printf ("\nNom actuel: %s",nom); printf ("\nNouveau nom: " ); gets (nom); break; case 2: fflush(stdin); printf ("\nNom du responsable actuel: %s",nomres); printf ("\nNouveau nom: " ); gets (nomres); break; case 3: fflush(stdin); printf ("\nNøentreprise actuel: %d",numentr); printf ("\nNouveau num?ro: " ); scanf ("%d",&numentr); } } pt=fopen("c:Filsta.dat","r+b" ); vsect.numsect=num; strcpy(vsect.nomsect,nom); strcpy(vsect.nomresp,nomres); vsect.numeentr=numentr; fwrite(&vsect,sizeof(vsect),1,pt); fclose(pt); } /*//////////////////modification d'une entreprise//////////////////////*/ void modifent (struct entreprise vent,int nbmaxent) { FILE *pt; char entrep[30],oui,nom[30],addr[60],ville[30],phone[30]; int posi,rep=0,num,fich,code; struct indexent vi_ent; pt=fopen("c:Filent.dat","rb" ); clrscr(); printf("\nConnaissez vous le Nø ? modifier(o/n): " ); oui=getche(); if (oui=='o') { printf ("\nQuel est le num?ro de la fiche: " ); scanf ("%d",&fich); fseek (pt,(fich-1)*sizeof(vent),0); } else { fflush(stdin); printf ("\nEntrez le nom de l'entreprise ? modifier: " ); gets(entrep); posi=rechent(entrep,nbmaxent); fseek (pt,posi*sizeof(vent),0); } fread (&vent,sizeof(vent),1,pt); num=vent.nument; strcpy(nom,vent.noment); strcpy(addr,vent.addrent); code=vent.codent; strcpy(ville,vent.villent); strcpy(phone,vent.phonent); fclose(pt); while (rep!=6) { clrscr(); printf ("\n\t\tMENU DE MODIFICATION" ); printf ("\n\t\tÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ" ); printf ("\n\n\t1.Nom\n\t2.Adresse\n\t3.Code postal\n\t4.Ville" ); printf ("\n\t5.T?l?phonne\n\t6.Quitter" ); printf ("\n\n\tVotre coix: " ); scanf("%d",&rep); clrscr(); switch (rep) { case 1: fflush(stdin); printf ("\nNom actuel: %s",nom); printf ("\nNouveau nom: " ); gets (nom); break; case 2: fflush(stdin); printf ("\nAdresse actuelle: %s",addr); printf ("\nNouvelle adresse: " ); gets (addr); break; case 3: fflush(stdin); printf ("\nCode postal actuel: %d",code); printf ("\nNouveau code postal: " ); scanf("%d",&code); break; case 4: fflush(stdin); printf ("\nVille actuelle: %s",ville); printf ("\nNouvelle ville: " ); gets (ville); break; case 5: fflush(stdin); printf ("\nNø de t?l?phonne actuel: %s",phone); printf ("\nNouveau Nø: " ); gets(phone); break; } } pt=fopen("c:Filent.dat","r+b" ); vent.nument=num; strcpy(vent.noment,nom); strcpy(vent.addrent,addr); vent.codent=code; strcpy(vent.villent,ville); strcpy(vent.phonent,phone); misajour_ind_ent (vi_ent,vent,nbmaxent); fwrite(&vent,sizeof(vent),1,pt); fclose(pt); } /*///////////////mise ? jour de l'index stagiaire///////////////////////*/ void misajour_ind_sta (struct indexsta vi_sta,struct stagiaire vsta) { FILE *pt; pt=fopen("c:Fili_sta.dat","r+b" ); vi_sta.numstagiaire=vsta.numsta; strcpy (vi_sta.nomstagiaire,vsta.nomsta); vi_sta.numeroentrep=vsta.numentrep; fwrite(&vi_sta,sizeof(vi_sta),1,pt); fclose(pt); } /*/////////////////mise ? jour de l'index entreprise////////////////////*/ void misajour_ind_ent (struct indexent vi_ent,struct entreprise vent,int nbmaxent) { FILE *pt; pt=fopen("c:Fili_ent.dat","r+b" ); vi_ent.numeroent=vent.nument; strcpy (vi_ent.nament,vent.noment); fwrite(&vi_ent,sizeof(vi_ent),1,pt); fclose(pt); } /*/////////////////mise ? jour des cl?s ?trangeres///////////////////////*/ void modifcletrang (struct stagiaire vsta,struct entreprise vent) { FILE *pt; pt=fopen("c:Filsta.dat","r+b" ); vsta.numentrep=vent.nument; fwrite(&vsta,sizeof(vsta),1,pt); fclose(pt); } /*//////////////////////*/ /*//////////////////////////////REQUETES////////// ///////////////////////*/ /*//////////////////////*/ /*//////////////listage des stagiaires par les entreprises///////////////*/ void liststagiaire_entreprises (int nbmaxent,int nbmaxsta,struct stagiaire vsta,struct entreprise vent) { FILE *ptr; FILE *pt; int comp=0,fich,posi; char oui,choix,entrep[30]; clrscr(); printf ("\n\tÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»" ); printf ("\n\tº º" ); printf ("\n\tº REQUETE Nø 1 º" ); printf ("\n\tº º" ); printf ("\n\tÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ" ); printf ("\n\n listage des stagiaires par le num?ro de l'entreprise" ); printf ("\n ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ ÄÄ" ); ptr=fopen("c:Filent.dat","rb" ); printf("\n\nConnaissez vous le Num?ro de l'entreprise..." ); printf ("\ndans laquelle vous d?sirez lister les stagiaires(o/n): " ); oui=getche(); if (oui=='o') { printf ("\nQuel est le num?ro de la fiche: " ); scanf ("%d",&fich); fseek (pt,(fich-1)*sizeof(vent),0); } else { fflush (stdin); printf ("\n\nVeuillez entrer le nom de l'entreprise: " ); gets(entrep); posi=rechent(entrep,nbmaxent); fseek (pt,(posi-1)*sizeof(vent),0); fich=posi; pt=fopen("c:Filsta.dat","rb" ); while (comp<=nbmaxsta) { comp++; fread(&vsta,sizeof(vsta),1,pt); if (vsta.numentrep==fich) { clrscr(); affichsta(vsta); printf ("\n\n/Appuyez sur Enter/" ); getch(); } } } fclose(pt); fclose(ptr); } /*//////////////listage des secteurs par les entreprises///////////////*/ void listsecteur_entreprises (int nbmaxent,int nbmaxsect,struct secteur vsect,struct entreprise vent) { FILE *ptr; FILE *pt; int comp=0,fich,posi; char oui,choix,entrep[30]; clrscr(); printf ("\n\tÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»" ); printf ("\n\tº º" ); printf ("\n\tº REQUETE Nø 2 º" ); printf ("\n\tº º" ); printf ("\n\tÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ" ); printf ("\n\n listage des secteurs par le num?ro de l'entreprise" ); printf ("\n ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ " ); ptr=fopen("c:Filent.dat","rb" ); printf("\n\nConnaissez vous le Num?ro de l'entreprise..." ); printf ("\ndans laquelle vous d?sirez lister les secteurs(o/n): " ); oui=getche(); if (oui=='o') { printf ("\nQuel est le num?ro de la fiche: " ); scanf ("%d",&fich); fseek (pt,(fich-1)*sizeof(vent),0); } else { fflush (stdin); printf ("\n\nVeuillez entrer le nom de l'entreprise: " ); gets(entrep); posi=rechent(entrep,nbmaxent); fseek (pt,(posi-1)*sizeof(vent),0); fich=posi; pt=fopen("c:Filsect.dat","rb" ); while (comp<=nbmaxsect) { comp++; fread(&vsect,sizeof(vsect),1,pt); if (vsect.numeentr==fich) { clrscr(); affichsect(vsect); printf ("\n\n/Appuyez sur Enter/" ); getch(); } } } fclose(pt); fclose(ptr); } /*//////////////////////////////////////////////// ////////////////////*/ void liststagiairelionel (int nbmaxsta,struct stagiaire vsta) { FILE *pt; int comp=0,fich,posi; char nom[10]="lionel"; clrscr(); printf ("\n\tÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»" ); printf ("\n\tº º" ); printf ("\n\tº REQUETE Nø 4 º" ); printf ("\n\tº º" ); printf ("\n\tÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ" ); printf ("\n\n listage des stagiaires s'appelant Lionel" ); printf ("\n ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ" ); pt=fopen("c:Filsta.dat","rb" ); while (comp<=nbmaxsta) { comp++; fread(&vsta,sizeof(vsta),1,pt); if (strcmp(vsta.prensta,nom)==0) { clrscr(); affichsta(vsta); printf ("\n\n/Appuyez sur Enter/" ); getch(); } } fclose(pt); } mon plus gros programme et en plus il est tt buggé :/ :D |
| CrowFix |
|
| fred2k |
|
| CrowFix |
|
| Stormlord | 10 mode 1:ink 0,0:ink 1,26:ink 2,24:ink 3,1:border 0
20 pen 1:locate 1,1 30 print "Moi, je suis un pro du Basic CPC, alors s'il y a des intéressés... Vous savez où me trouvez ;)" 40 goto 40 run Trop top, le Basic :D :lol: :) |
| CrowFix |
[jfdsdjhfuetppo]--Message édité par CrowFix--[/jfdsdjhfuetppo] |
| Hellgi | Bravo :D Je cherche un programmeur qui voudrait bien adapter Transport Tycoon pour Windows XP :D Quelqu'un interessé ? :)
Hellgi |
| CrowFix | merchi bokou :jap: :D |
| bistou | trop fort [:tdk04] |
| CrowFix | oui mais y a 25 ans la xbox n'était pas encore sortie ;) |
| Stormlord | Pas mal du tout, j'ai vu des écrans titres plus moches ;) Et dire que t'aurais pu connaître la gloire en le faisant 25 ans plus tôt :D |
| CrowFix | un ptit up pour Stormlord et je vais me coucher! good night :sleep: |
| CrowFix |
|
| fred2k | PTDRZZZ
par contre cai pas réaliste,les manettes sont moins grosse que le vaisseau :D |
| CrowFix |
[jfdsdjhfuetppo]--Message édité par CrowFix--[/jfdsdjhfuetppo] |
| trunks | excellent ;) |
| CrowFix | un ptit up pour le jeu de l'année :D |
| CrowFix | http://membres.lycos.fr/crowfix/bullet.bmp http://membres.lycos.fr/crowfix/ebullet.bmp [jfdsdjhfuetppo]--Message édité par CrowFix--[/jfdsdjhfuetppo] |
| CrowFix |
|
| Seyar | sinon, j'en ai eclaté bcp des xbox ^^ |
| Seyar | me suis arrete au 11
dommage q'uon puisse pas mourir ;) |
| CrowFix |
[jfdsdjhfuetppo]--Message édité par CrowFix--[/jfdsdjhfuetppo] |
| syntaxx_error | c'est koi donc ? |
| CrowFix | histoire de calmer les esprits! :D http://membres.lycos.fr/crowfix/HFRBlast.zip 632k c'est pas long à charger [jfdsdjhfuetppo]--Message édité par CrowFix--[/jfdsdjhfuetppo] |




