BruNews
Messages postés21040Date d'inscriptionjeudi 23 janvier 2003StatutModérateurDernière intervention21 août 2019 16 févr. 2007 à 13:27
Je salue tout ce travail.
Il est malheureusement à noter que les écoles qui font perdre autant de temps aux élèves sur des trucs aussi obsolètes depuis si longtemps ne sont que des fabriques à futurs chomeurs.
Ce n'est assurément pas ta faute mais pense à étudier des trucs un peu plus d'actualité au dehors de l'école.
Bonne continuation.
saoudi86
Messages postés2Date d'inscriptionjeudi 18 mai 2006StatutMembreDernière intervention16 février 2007 16 févr. 2007 à 12:58
/*
** Fonction permettant l'initialisation graphique
*/
void Initialisation_graphique(void){
int GDriver = DETECT,GMode,ErrorCode;
initgraph( &GDriver, &GMode, " " );
ErrorCode = graphresult();
if( ErrorCode != grOk )
{
printf(" Graphics System Error: %s\n", grapherrormsg( ErrorCode ) );
getch();
exit( 1 );
}
}
/*
** Fonction pour dessiner par pixel dans une forme rectangulaire
*/
void dessine(int x1,int y1,int x2, int y2,int coul){
int i,j;
for(i=x1;i<=x2;i++)
for(j=y1;j<=y2;j++)
putpixel(i,j,coul);
}
/*
** Cette fonction revoie le mois en charact?re
** Corresspodant ? l'entier en param?tre.
*/
/*
** Toutes les fonctions pr?c?dentes
** sont appel'es ici.
*/
void erogonomie_centrale(void){
int i;
char*num=(char*)malloc(10*sizeof(char));
struct date la_date;
16 févr. 2007 à 13:27
Il est malheureusement à noter que les écoles qui font perdre autant de temps aux élèves sur des trucs aussi obsolètes depuis si longtemps ne sont que des fabriques à futurs chomeurs.
Ce n'est assurément pas ta faute mais pense à étudier des trucs un peu plus d'actualité au dehors de l'école.
Bonne continuation.
16 févr. 2007 à 12:58
voila mon projet:
*************************************************************
#include<stdio.h>
#include<conio.h>
#include<ctype.h>
#include<stdlib.h>
#include<string.h>
#include<stdio.h>
#include <graphics.h>
#include <stdlib.h>
#include <stdio.h>
#include <conio.h>
#include <math.h>
#include <dos.h>
#define angle M_PI/180
/*
** Fonction permettant l'initialisation graphique
*/
void Initialisation_graphique(void){
int GDriver = DETECT,GMode,ErrorCode;
initgraph( &GDriver, &GMode, " " );
ErrorCode = graphresult();
if( ErrorCode != grOk )
{
printf(" Graphics System Error: %s\n", grapherrormsg( ErrorCode ) );
getch();
exit( 1 );
}
}
/*
** Fonction pour dessiner par pixel dans une forme rectangulaire
*/
void dessine(int x1,int y1,int x2, int y2,int coul){
int i,j;
for(i=x1;i<=x2;i++)
for(j=y1;j<=y2;j++)
putpixel(i,j,coul);
}
/*
** Cette fonction revoie le mois en charact?re
** Corresspodant ? l'entier en param?tre.
*/
char * det_mois(int val){
if(val==1) return("Janvier");
if(val==2) return("F?vrier");
if(val==3) return("Mars");
if(val==4) return("Aril");
if(val==5) return("Mai");
if(val==6) return("Juin");
if(val==7) return("Juillet");
if(val==8) return("Ao?t");
if(val==9) return("Septembre");
if(val==10) return("Octobre");
if(val==11) return("Novembre");
if(val==12) return("D?cembre");
return(" ");
}
/*
** Comme son nom l'indique cette fonction
** permet d'afficher la date du jour.
*/
void affiche_date_du_jour(date la_date,char* num){
getdate(&la_date);
gcvt(la_date.da_day,3,num);
settextstyle(2,0,4);
setcolor(15);
outtextxy(240,47,num);
outtextxy(260,47,det_mois(la_date.da_mon));
gcvt(la_date.da_year,5,num);
settextstyle(2,0,4);
setcolor(15);
outtextxy(320,47,num);
}
/*
** C'est par cette fonction que les nombreux rectangles
** du programme sont construits
*/
void decoration(void){
bar3d(getmaxx()-40,20,getmaxx()-20,450,0,0);
rectangle(getmaxx()-35,25,getmaxx()-25,445);
rectangle(getmaxx()-35+2,25+2,getmaxx()-25-2,445-2);
bar3d(20,20,40,450,0,0);
rectangle(25,25,35,445);
rectangle(27,27,33,443);
bar3d(60,417,getmaxx()-60,440,0,0);
rectangle(65,422,getmaxx()-65,435);
rectangle(70,427,getmaxx()-70,430);
setfillstyle(8,9);
bar3d(95,30,550,150,4,4);
setfillstyle(1,9);
bar3d(getmaxx()-60,30,getmaxx()-80,150,0,0);
rectangle(getmaxx()-62,32,getmaxx()-78,148);
}
/*
** C'est par cette foction avec l'itulisation
** de la pr?c?dente que le plateau du programme
** prend forme.
*/
void dessine_plateau(void){
setfillstyle(7,4);
bar3d(10,10,getmaxx()-10,getmaxy()-10,0,0);
setfillstyle(11,9);
bar3d(50,20,getmaxx()-50,160,0,0);
rectangle(55,25,getmaxx()-55,155);
bar3d(50,170,getmaxx()-50,450,0,0);
rectangle(55,175,getmaxx()-55,445);
decoration();
bar3d(230,70,515,100,0,0);
rectangle(232,72,513,98);
setcolor(0);
rectangle(234,75,511,96);
setcolor(15);
setfillstyle(1,9);
bar3d(230,37,515,65,1,1);
rectangle(232,39,513,63);
setcolor(0);
rectangle(234,42,511,61);
setcolor(15);
bar3d(230,105,515,130,0,0);
rectangle(232,107,513,128);
setcolor(15);
settextstyle(4,0,1);
outtextxy(105,70,"Il est :");
outtextxy(100,40,"Date du Jour :");
outtextxy(238,138," gestion d'affectation des stages");
outtextxy(getmaxx()-76,40,"E");
outtextxy(getmaxx()-76,60,"X");
outtextxy(getmaxx()-76,80,"I");
outtextxy(getmaxx()-76,100,"T");
}
/*
** L? la montre prend forme graphiquement
** avec le cadre et le cercle
*/
void forme_montre(void){
setfillstyle(1,9);
bar3d(230,200,415,410,0,0);
bar3d(160,200,215,410,0,0);
bar3d(430,200,485,410,0,0);
rectangle(235,205,410,405);
bar3d(95,200,150,410,0,0);
bar3d(495,200,550,410,0,0);
setcolor(15);
rectangle(95,200,150,410);
rectangle(96,201,149,409);
rectangle(495,200,550,410);
rectangle(496,201,549,409);
rectangle(160,200,215,410);
rectangle(161,201,214,409);
rectangle(430,200,485,410);
rectangle(431,201,484,409);
setcolor(0);
rectangle(236,207,409,404);
setcolor(15);
circle(320,300,70);
settextstyle(2,0,4);
outtextxy(320,372,"6");
outtextxy(315,215,"12");
outtextxy(280,360,"7");
outtextxy(355,225,"1");
outtextxy(385,250,"2");
outtextxy(250,330,"8");
outtextxy(240,293,"9");
outtextxy(245,255,"10");
outtextxy(273,225,"11");
outtextxy(397,293,"3");
outtextxy(390,325,"4");
outtextxy(360,360,"5");
for(int m=1;m<=12;m++){
setcolor(0);
int tirx=320+70*sin(m*30*angle);
int tiry=292-70*cos(m*30*angle);
outtextxy(tirx,tiry,".");
}
setcolor(15);
}
/*
** Toutes les fonctions pr?c?dentes
** sont appel'es ici.
*/
void erogonomie_centrale(void){
int i;
char*num=(char*)malloc(10*sizeof(char));
struct date la_date;
dessine_plateau();
forme_montre();
settextstyle(5,1,1);
setcolor(1);
outtextxy(130,210,"SAOUDI ABDERRAZZAK ");
outtextxy(520,250,"MARZOUKI JAWAD");
settextstyle(4,0,1);
setcolor(10);
outtextxy(166,220," *");
outtextxy(435,220," *");
for(i=10;i<170;i+=20){
outtextxy(168,230+i,"* * *");
outtextxy(170,220+i," . .");
outtextxy(437,230+i,"* * *");
outtextxy(439,220+i," . .");
}
//Affichage de la date du jour
affiche_date_du_jour(la_date,num);
setlinestyle(0,0,3);
}
void montre(void){
int minutes,sec,heu,xminutes,
yminutes,xheu,yheu,xsec,
ysec,attendre,traitx,traity,
varchar,ok,nbout,xs,ys,bg,bd;
char*num=(char*)malloc(10*sizeof(char));
char chaine[3];
struct time Heure_actuelle;
xminutes=320+40*sin(minutes*6*angle);
yminutes=300-40*cos(minutes*6*angle);
xheu=320+30*sin(minutes*0.5*angle+(heu*30*angle));
yheu=300-30*cos(minutes*0.5*angle+(heu*30*angle));
erogonomie_centrale();
do{
gettime(&Heure_actuelle);
sec=Heure_actuelle.ti_sec;
minutes=Heure_actuelle.ti_min;
heu=Heure_actuelle.ti_hour;
attendre=sec;
setcolor(15);
settextstyle(4,0,1);
outtextxy(305,286,"751");
dessine(238,76,250,87,9);
gcvt(heu,3,num);
settextstyle(2,0,4);
setcolor(15);
outtextxy(240,77,num);
outtextxy(260,77,"heure(s)");
dessine(308,76,320,87,9);
gcvt(minutes,3,num);
settextstyle(2,0,4);
setcolor(15);
outtextxy(310,77,num);
outtextxy(330,77,"minute(s)");
dessine(393,76,405,87,9);
gcvt(sec,3,num);
settextstyle(2,0,4);
setcolor(15);
outtextxy(395,77,num);
outtextxy(415,77,"seconde(s)");
//Affichage aiguille des heures
setcolor(9);
line(320,300,xheu,yheu);
xheu=320+30*sin(minutes*0.5*angle+(heu*30*angle));
yheu=300-30*cos(minutes*0.5*angle+(heu*30*angle));
setcolor(4);
line(320,300,xheu,yheu);
//Affichage aiguille des minutes
setcolor(9);
line(320,300,xminutes,yminutes);
xminutes=320+40*sin(minutes*6*angle);
yminutes=300-40*cos(minutes*6*angle);
setcolor(2);
line(320,300,xminutes,yminutes);
//Affichage aiguille des secondes
xsec=320+60*sin((sec)*6*angle);
ysec=300-60*cos((sec)*6*angle);
setcolor(14);
line(320,300,xsec,ysec);
while(1){
gettime(&Heure_actuelle);
sec=Heure_actuelle.ti_sec;
if(attendre!=sec) break;
}
setcolor(9);
line(320,300,xsec,ysec);
settextstyle(2,0,4);
} while(!kbhit());
}
void m(void){
Initialisation_graphique();
montre();
closegraph();
}
/***********************structure soci?t?*************************/
int bool;
struct societe
{
char adresses[40];
char Email[20];
char tele[20];
char fax[40];
char patente[20];
char categorie[20];
char sigle[20];
};
societe so;
FILE *a,*b,*f2;
char sigle[20];char adresse[20];char Email[20];char tel[20];
char fax[40];char patente[20];char categorie[20];char choix ;
char rep;
char siglem[20];
char adressesm[20];
char Emailm[20];
char telem[20];
char faxm[40];
char patentem[20];
char categoriem[20];
/***********************structure stagiaire*************************/
struct stagiaire
{
char Prenom [20];
char nomst[20];
char ninscription[20];
char adresse[20];
char filiere[20];
char daten[20];
} st;
FILE *f,*s,*f1;
char Prenom [20];
char nomst[20];
char ninscription[20];
char filiere[20];
char daten[20];
char Prenomm [20];
char nomstm[20];
char ninscriptionm[20];
char adressem[20];
char filierem[20];
char datenm[20];
/***********************structure affectation***********************/
struct affectation
{
char numaf[20];
char dateaf[10];
char Prenom [20];
char nomst[20];
char ninscription[20];
char categorie[20];
char sigle[20];
}aff;
char numaf[20];
char dateaf[10];
char numafm[20];
char dateafm[10];
/**************************fonction menu1********************************/
void menu()
{
textbackground(1);
clrscr();
gotoxy(4,5) ;printf(" ÉÍÍÍÍ» ÉÍÍÍÍ»");
gotoxy(4 ,6);printf(" ɼ ɼ Ȼ Ȼ");
gotoxy(4 ,7);printf("ɼ º GESTION DES STAGIAIRES º È»");
gotoxy(4 ,8);printf("º È» ɼ º");
gotoxy(4 ,9);printf("º ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ º");
gotoxy(4,10);printf("º º");
gotoxy(4,11);printf("º º");
gotoxy(4,12);printf("º º");
gotoxy(4,13);printf("º ÉÍÍÍÍÍÍÍÍÍÍÍ» ÉÍÍÍÍÍÍÍÍÍÍÍ» ÉÍÍÍÍÍÍÍÍÍÍÍ» º");
gotoxy(4,14);printf("º ɼ È» ɼ È» ɼ È» º");
gotoxy(4,15);printf("º ɼ È» ɼ È» ɼ È» º");
gotoxy(4,16);printf("º º [A]® Ajoutter º º[R]® Rechercherº º [L]® Lister º º");
gotoxy(4,17);printf("º È» ɼ È» ɼ È» ɼ º");
gotoxy(4,18);printf("º È» ɼ È» ɼ È» ɼ º");
gotoxy(4,19);printf("º ÈÍÍÍÍÍÍÍÍÍÍͼ ÈÍÍÍÍÍÍÍÍÍÍͼ ÈÍÍÍÍÍÍÍÍÍÍͼ º");
gotoxy(4,20);printf("º ÉÍÍÍÍÍÍÍÍÍÍÍ» ÉÍÍÍÍÍÍÍÍÍÍÍ» ÉÍÍÍÍÍÍÍÍÍÍÍ» º");
gotoxy(4,21);printf("º ɼ È» ɼ È» ɼ È» º");
gotoxy(4,22);printf("º ɼ È» ɼ È» ɼ È» º");
gotoxy(4,23);printf("º º[M]® Modifier º º º º[S]® Supprimer º º");
gotoxy(4,24);printf("º È» ɼ È» ɼ È» ɼ º");
gotoxy(4,25);printf("º È» ɼ È» ɼ È» ɼ º");
gotoxy(4,26);printf("º ÈÍÍÍÍÍÍÍÍÍÍͼ ÈÍÍÍÍÍÍÍÍÍÍͼ ÈÍÍÍÍÍÍÍÍÍÍͼ º");
gotoxy(4,27);printf("º ÉÍÍÍÍÍÍÍÍÍÍÍ» º");
gotoxy(4,28);printf("º ɼ È» º");
gotoxy(4,29);printf("º ɼ È» º");
gotoxy(4,30);printf("º º[Q]® Quitter º º");
gotoxy(4,31);printf("º È» ɼ º");
gotoxy(4,32);printf("º È» ɼ º");
gotoxy(4,33);printf("º ÈÍÍÍÍÍÍÍÍÍÍͼ º");
gotoxy(4,34);printf("º º");
gotoxy(4,35);printf("º ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» º");
gotoxy(4,36);printf("º ɼ È» º");
gotoxy(4,37);printf("º º ®® TAPEZ VOTRE CHOIX S.V.P [ ] ¯¯ º º");
gotoxy(4,38);printf("º È» ɼ º");
gotoxy(4,39);printf("º ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ º");
gotoxy(4,40);printf("º º");
gotoxy(4,41);printf("Ȼ ɼ");
gotoxy(4,42);printf(" Ȼ ɼ");
gotoxy(4,43);printf(" ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ");
textcolor(4);
gotoxy(11,16);textcolor(14+BLINK);cprintf("A");
gotoxy(32,16);textcolor(14+BLINK);cprintf("R");
gotoxy(55,16);textcolor(14+BLINK);cprintf("L");
gotoxy(10,23);textcolor(14+BLINK);cprintf("M");
gotoxy(54,23);textcolor(14+BLINK);cprintf("S");
gotoxy(32,30);textcolor(14+BLINK);cprintf("Q");
gotoxy(34,23);textcolor(14+BLINK);cprintf("BIENVENUE");
textcolor(7);
}
/***************************************************************************/
/* GESTION DES STAGIAIRES */
/*************************************************************************/
/**********************fonction ajouter*********************/
void ajouterstg()
{
do
{
flushall();
clrscr();
f=fopen("c:\\stag.txt","a+");
if(f==NULL)
{f=fopen("c:\\stag.txt","w");}
gotoxy(13,6); printf("ÉÍËÍ» ÉÍËÍ» ÉÍËÍ» ÉÍËÍ» \n");
gotoxy(13,7); printf("ÌÍÎ͹ ÌÍÎ͹ ÌÍÎ͹ ÌÍÎ͹ \n");
gotoxy(13,8); printf("ÈÍÊͼÉÍ»ÈÍÊͼ ÈÍÊͼÉÍ»ÈÍÊͼ \n");
gotoxy(13,9); printf("ÉÍËÍ»ÈÍ»ÉÍËÍ» ÉÍËÍ»ÈÍ»ÉÍËÍ» \n");
gotoxy(13,10);printf("ÌÍÎ͹ÈͼÌÍÎ͹ ÌÍÎ͹ÈͼÌÍÎ͹ \n");
gotoxy(13,11);printf("ÈÍÊͼ ÈÍÊͼ ÈÍÊͼ ÈÍÊͼ \n");
gotoxy(6,12);printf(" ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» \n");
gotoxy(6,13);printf(" º º \n");
gotoxy(6,14);printf("ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͹ ° ° ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»\n");
gotoxy(6,15);printf("º ÉÍÍÍÍÍ º º ÍÍÍÍÍÍ» º\n");
gotoxy(6,16);printf("º º ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ º º\n");
gotoxy(6,17);printf("º º º º\n");
gotoxy(6,18);printf("º ° STAGIAIRE ° º\n");
gotoxy(6,19);printf("º ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ º\n");
gotoxy(6,20);printf("º Nø Inscription : º\n");
gotoxy(6,21);printf("º º\n");
gotoxy(6,22);printf("º Nom Stagiaire : º\n");
gotoxy(6,23);printf("º º\n");
gotoxy(6,24);printf("º Pr?nom stagiaire: º\n");
gotoxy(6,25);printf("º º\n");
gotoxy(6,26);printf("º Date Naissance : º\n");
gotoxy(6,27);printf("º º\n");
gotoxy(6,28);printf("º Adresse : º\n");
gotoxy(6,29);printf("º º\n");
gotoxy(6,30);printf("º Fili?re : º\n");
gotoxy(6,31);printf("º º º º\n");
gotoxy(6,32);printf("º º º º\n");
gotoxy(6,33);printf("º ÈÍÍÍÍÍ ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» ÍÍͼ º\n");
gotoxy(6,34);printf("ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͹ VOULEZ VOUS AJOUTER UNE AUTRE ÌÍÍÍÍÍÍÍÍÍÍÍͼ\n");
gotoxy(6,35);printf(" º O [ ] N º \n");
gotoxy(6,36);printf(" ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ \n");
gotoxy(30,34);textcolor(14+BLINK);cprintf("VOULEZ VOUS AJOUTER UN AUTRE ");
textcolor(7);
aq:
flushall();
gotoxy(29,20);scanf("%s",&st.ninscription);
bool=0;
while(!feof(f))
{flushall();
fscanf(f,"%s\t%s\t%s\t%s\t%s\t%s\n",ninscription,nomst,Prenom
,adresse,daten,filiere);
if(strcmpi(ninscription,st.ninscription)==0)
{bool=1;
break;
}
}
if(bool==1)
{
gotoxy(29,20);printf("Ce num?ro existe!!");
gotoxy(29,20);getch();
gotoxy(29,20);printf(" ");
goto aq;
}
gotoxy(29,22);scanf("%s",&st.nomst);
gotoxy(29,24);scanf("%s",&st.Prenom);
gotoxy(29,26);scanf("%s",&st.adresse);
gotoxy(29,28);scanf("%s",&st.daten);
gotoxy(29,30);scanf("%s",&st.filiere);
fprintf(f,"%s\t%s\t%s\t%s\t%s\t%s\n",st.ninscription,st.nomst,st.Prenom,st.adresse,st.daten,st.filiere);
fclose(f);
flushall();
gotoxy(45,35);scanf("%c",&rep);
rep=toupper(rep);
}while(rep!='N');
}
/**********************fonction supprimer*******************/
void supprimerstg()
{
clrscr();
f=fopen("c:\\stag.txt","r");
if(f==NULL)
{printf("le fichier est absent\n");
getch();
exit(0);
}
gotoxy(10,12);printf(" ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» \n");
gotoxy(10,13);printf(" º º \n");
gotoxy(10,14);printf("ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͹ ° Nø A SUPPRIMER ?:..... ° ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ\n");
gotoxy(10,15);printf(" º º \n");
gotoxy(10,16);printf(" ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ \n");
gotoxy(52,14);scanf("%s",&ninscription);
bool=0;
while(!feof(f))
{flushall();
fscanf(f,"%s\t%s\t%s\t%s\t%s\t%s\n",st.ninscription,st.nomst,st.Prenom,st.adresse,st.daten,st.filiere);
if(strcmpi(ninscription,st.ninscription)==0)
{bool=1;
break;
}
}
if(bool==1)
{
clrscr();
gotoxy(13,6); printf("ÉÍËÍ» ÉÍËÍ» ÉÍËÍ» ÉÍËÍ» \n");
gotoxy(13,7); printf("ÌÍÎ͹ ÌÍÎ͹ ÌÍÎ͹ ÌÍÎ͹ \n");
gotoxy(13,8); printf("ÈÍÊͼÉÍ»ÈÍÊͼ ÈÍÊͼÉÍ»ÈÍÊͼ \n");
gotoxy(13,9); printf("ÉÍËÍ»ÈÍ»ÉÍËÍ» ÉÍËÍ»ÈÍ»ÉÍËÍ» \n");
gotoxy(13,10);printf("ÌÍÎ͹ÈͼÌÍÎ͹ ÌÍÎ͹ÈͼÌÍÎ͹ \n");
gotoxy(13,11);printf("ÈÍÊͼ ÈÍÊͼ ÈÍÊͼ ÈÍÊͼ \n");
gotoxy(6,12);printf(" ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» \n");
gotoxy(6,13);printf(" º º \n");
gotoxy(6,14);printf("ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͹ ° ° ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»\n");
gotoxy(6,15);printf("º ÉÍÍÍÍÍ º º ÍÍÍÍÍÍ» º\n");
gotoxy(6,16);printf("º º ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ º º\n");
gotoxy(6,17);printf("º º º º\n");
gotoxy(6,18);printf("º ° STAGIAIRE ° º\n");
gotoxy(6,19);printf("º ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ º\n");
gotoxy(6,20);printf("º Nø Inscription : º\n");
gotoxy(6,21);printf("º º\n");
gotoxy(6,22);printf("º Nom Stagiaire : º\n");
gotoxy(6,23);printf("º º\n");
gotoxy(6,24);printf("º Pr?nom stagiaire: º\n");
gotoxy(6,25);printf("º º\n");
gotoxy(6,26);printf("º Date Naissance : º\n");
gotoxy(6,27);printf("º º\n");
gotoxy(6,28);printf("º Adresse : º\n");
gotoxy(6,29);printf("º º\n");
gotoxy(6,30);printf("º Fili?re : º\n");
gotoxy(6,31);printf("º º º º\n");
gotoxy(6,32);printf("º º º º\n");
gotoxy(6,33);printf("º ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ º\n");
gotoxy(6,34);printf("ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ\n");
gotoxy(29,20);printf("%s",st.ninscription);
gotoxy(29,22);printf("%s",st.nomst);
gotoxy(29,24);printf("%s",st.Prenom);
gotoxy(29,26);printf("%s",st.adresse);
gotoxy(29,28);printf("%s",st.daten);
gotoxy(29,30);printf("%s",st.filiere);
flushall();
gotoxy(10,40);printf("voulez-vous supprimer(O/N):.........");
gotoxy(38,40);scanf("%c",&rep);
rep=toupper(rep);
if(rep=='O')
{
f1=fopen("c:\\stag.txt","r");
s=fopen("c:\\s.txt","w");
while(!feof(f1))
{
flushall();
// fprintf(f,"%s\t%s\t%s\t%s\t%s\t%s\n",st.ninscription,st.nomst,st.Prenom,st.adresse,st.daten,st.filiere);
fscanf(f1,"%s\t%s\t%s\t%s\t%s\t%s\n",st.ninscription,st.nomst,st.Prenom,st.adresse,st.daten,st.filiere);
if(strcmpi(ninscription,st.ninscription)!=0)
fprintf(s,"%s\t%s\t%s\t%s\t%s\t%s\n",st.ninscription,st.nomst,st.Prenom,st.adresse,st.daten,st.filiere);
}
fclose(f);
f1=fopen("c:\\stag.txt","w");
s=fopen("c:\\s.txt","r");
while(!feof (s))
{
flushall();
fscanf(s,"%s\t%s\t%s\t%s\t%s\t%s\n",&st.ninscription,&st.nomst,&st.Prenom,&st.adresse,&st.daten,&st.filiere);
fprintf(f1,"%s\t%s\t%s\t%s\t%s\t%s\n",st.ninscription,st.nomst,st.Prenom,st.adresse,st.daten,st.filiere);
}
}
}
else
{
clrscr();
printf("ce numero n'existe pas\n");
getch();
}
getch();
}
/**********************fonction rechercher*****************/
void rechercherstg()
{
{clrscr();
char numst[20];
f=fopen("c:\\stag.txt","r");
if(f==NULL)
{printf("fichier inexistant\n");
getch();
exit(0);
}
flushall();
gotoxy(10,12);printf(" ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» \n");
gotoxy(10,13);printf(" º º \n");
gotoxy(10,14);printf("ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͹ ° Nø A CHERCHER:........ ° ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ\n");
gotoxy(10,15);printf(" º º \n");
gotoxy(10,16);printf(" ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ \n");
gotoxy(52,14);scanf("%s",&ninscription);
bool=0;
while(!feof(f))
{flushall();
fscanf(f,"%s\t%s\t%s\t%s\t%s\t%s\n",st.ninscription,st.nomst,st.Prenom,st.adresse,st.daten,st.filiere);
if(strcmpi(ninscription,st.ninscription)==0)
{bool=1;
break;
}
}
if(bool==1)
{
clrscr();
gotoxy(13,6); printf("ÉÍËÍ» ÉÍËÍ» ÉÍËÍ» ÉÍËÍ» \n");
gotoxy(13,7); printf("ÌÍÎ͹ ÌÍÎ͹ ÌÍÎ͹ ÌÍÎ͹ \n");
gotoxy(13,8); printf("ÈÍÊͼÉÍ»ÈÍÊͼ ÈÍÊͼÉÍ»ÈÍÊͼ \n");
gotoxy(13,9); printf("ÉÍËÍ»ÈÍ»ÉÍËÍ» ÉÍËÍ»ÈÍ»ÉÍËÍ» \n");
gotoxy(13,10);printf("ÌÍÎ͹ÈͼÌÍÎ͹ ÌÍÎ͹ÈͼÌÍÎ͹ \n");
gotoxy(13,11);printf("ÈÍÊͼ ÈÍÊͼ ÈÍÊͼ ÈÍÊͼ \n");
gotoxy(6,12);printf(" ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» \n");
gotoxy(6,13);printf(" º º \n");
gotoxy(6,14);printf("ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͹ ° ° ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»\n");
gotoxy(6,15);printf("º ÉÍÍÍÍÍ º º ÍÍÍÍÍÍ» º\n");
gotoxy(6,16);printf("º º ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ º º\n");
gotoxy(6,17);printf("º º º º\n");
gotoxy(6,18);printf("º ° STAGIAIRE ° º\n");
gotoxy(6,19);printf("º ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ º\n");
gotoxy(6,20);printf("º Nø Inscription : º\n");
gotoxy(6,21);printf("º º\n");
gotoxy(6,22);printf("º Nom Stagiaire : º\n");
gotoxy(6,23);printf("º º\n");
gotoxy(6,24);printf("º Pr?nom stagiaire: º\n");
gotoxy(6,25);printf("º º\n");
gotoxy(6,26);printf("º Date Naissance : º\n");
gotoxy(6,27);printf("º º\n");
gotoxy(6,28);printf("º Adresse : º\n");
gotoxy(6,29);printf("º º\n");
gotoxy(6,30);printf("º Fili?re : º\n");
gotoxy(6,31);printf("º º º º\n");
gotoxy(6,32);printf("º º º º\n");
gotoxy(6,33);printf("º ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ º\n");
gotoxy(6,34);printf("ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ\n");
gotoxy(29,20);printf("%s",st.ninscription);
gotoxy(29,22);printf("%s",st.nomst);
gotoxy(29,24);printf("%s",st.Prenom);
gotoxy(29,26);printf("%s",st.adresse);
gotoxy(29,28);printf("%s",st.daten);
gotoxy(29,30);printf("%s",st.filiere);
}
else
{
clrscr();
printf("ce numero n'existe pas\n");
getch();
}
getch();
fclose(f);
}
}
/**********************fonction lister*********************/
void listerstg()
{clrscr();
int j;
f=fopen("c:\\stag.txt","r");
if(f==NULL)
{
printf("le fichier inexistant");
getch();
exit(0);
}
gotoxy(6,8);printf ("ÉÍÍÍÍÍÍÍÍÍËÍÍÍÍÍÍÍÍÍÍÍËÍÍÍÍÍÍÍÍÍÍÍËÍÍÍÍÍÍÍÍÍÍËÍÍÍÍÍÍÍÍÍÍÍÍËÍÍÍÍÍÍÍÍÍÍÍ»\n");
gotoxy(6,9);printf ("ºnøinscripº nomst º pr?nomst º adressst º daten º filier º\n");
gotoxy(6,10);printf("ÌÍÍÍÍÍÍÍÍÍÎÍÍÍÍÍÍÍÍÍÍÍÎÍÍÍÍÍÍÍÍÍÍÍÎÍÍÍÍÍÍÍÍÍÍÎÍÍÍÍÍÍÍÍÍÍÍÍÎÍÍÍÍÍÍÍÍÍÍ͹\n");
gotoxy(6,11);printf("º º º º º º º\n");
gotoxy(6,12);printf("º º º º º º º\n");
gotoxy(6,13);printf("º º º º º º º\n");
gotoxy(6,14);printf("º º º º º º º\n");
gotoxy(6,15);printf("º º º º º º º\n");
gotoxy(6,16);printf("º º º º º º º\n");
gotoxy(6,17);printf("º º º º º º º\n");
gotoxy(6,18);printf("º º º º º º º\n");
gotoxy(6,19);printf("º º º º º º º\n");
gotoxy(6,20);printf("º º º º º º º\n");
gotoxy(6,21);printf("º º º º º º º\n");
gotoxy(6,22);printf("º º º º º º º\n");
gotoxy(6,23);printf("º º º º º º º\n");
gotoxy(6,24);printf("º º º º º º º\n");
gotoxy(6,25);printf("º º º º º º º\n");
gotoxy(6,26);printf("º º º º º º º\n");
gotoxy(6,27);printf("º º º º º º º\n");
gotoxy(6,28);printf("º º º º º º º\n");
gotoxy(6,29);printf("º º º º º º º\n");
gotoxy(6,30);printf("º º º º º º º\n");
gotoxy(6,31);printf("º º º º º º º\n");
gotoxy(6,32);printf("º º º º º º º\n");
gotoxy(6,33);printf("º º º º º º º\n");
gotoxy(6,34);printf("º º º º º º º\n");
gotoxy(6,35);printf("º º º º º º º\n");
gotoxy(6,36);printf("º º º º º º º\n");
gotoxy(6,37);printf("º º º º º º º\n");
gotoxy(6,38);printf("º º º º º º º\n");
gotoxy(6,39);printf("ÈÍÍÍÍÍÍÍÍÍÊÍÍÍÍÍÍÍÍÍÍÍÊÍÍÍÍÍÍÍÍÍÍÍÊÍÍÍÍÍÍÍÍÍÍÊÍÍÍÍÍÍÍÍÍÍÍÍÊÍÍÍÍÍÍÍÍÍÍͼ\n");
j=0;
while(!feof(f))
{
flushall();
fscanf(f,"%s\t%s\t%s\t%s\t%s\t%s\n",st.ninscription,st.nomst,st.Prenom,st.adresse,st.daten,st.filiere);
gotoxy(8,11+j);printf("%s",st.ninscription);
gotoxy(17,11+j);printf("%s",st.nomst);
gotoxy(29,11+j);printf("%s",st.Prenom);
gotoxy(41,11+j);printf("%s",st.adresse);
gotoxy(52,11+j);printf("%s",st.daten);
gotoxy(65,11+j);printf("%s",st.filiere);
j++;
}
getch();
}
/*********************fonction modifier********************/
void modifierstg()
{
clrscr();
f=fopen("c:\\stag.txt","r");
if(f==NULL)
{printf("fichier absent\n");
getch();
exit(0);
}
gotoxy(10,12);printf(" ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» \n");
gotoxy(10,13);printf(" º º \n");
gotoxy(10,14);printf("ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͹ ° Nø A MODIFIER:........ ° ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ\n");
gotoxy(10,15);printf(" º º \n");
gotoxy(10,16);printf(" ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ \n");
gotoxy(52,14);scanf("%s",&ninscription);
bool=0;
while(!feof(f))
{flushall();
fscanf(f,"%s\t%s\t%s\t%s\t%s\t%s\n",st.ninscription,st.nomst,st.Prenom,st.adresse,st.daten,st.filiere);
if(strcmpi(ninscription,st.ninscription)==0)
{bool=1;
break;
}
}
if(bool==1)
{
clrscr();
gotoxy(13,6); printf("ÉÍËÍ» ÉÍËÍ» ÉÍËÍ» ÉÍËÍ» \n");
gotoxy(13,7); printf("ÌÍÎ͹ ÌÍÎ͹ ÌÍÎ͹ ÌÍÎ͹ \n");
gotoxy(13,8); printf("ÈÍÊͼÉÍ»ÈÍÊͼ ÈÍÊͼÉÍ»ÈÍÊͼ \n");
gotoxy(13,9); printf("ÉÍËÍ»ÈÍ»ÉÍËÍ» ÉÍËÍ»ÈÍ»ÉÍËÍ» \n");
gotoxy(13,10);printf("ÌÍÎ͹ÈͼÌÍÎ͹ ÌÍÎ͹ÈͼÌÍÎ͹ \n");
gotoxy(13,11);printf("ÈÍÊͼ ÈÍÊͼ ÈÍÊͼ ÈÍÊͼ \n");
gotoxy(6,12);printf(" ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» \n");
gotoxy(6,13);printf(" º º \n");
gotoxy(6,14);printf("ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͹ ° ° ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»\n");
gotoxy(6,15);printf("º ÉÍÍÍÍÍ º º ÍÍÍÍÍÍ» º\n");
gotoxy(6,16);printf("º º ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ º º\n");
gotoxy(6,17);printf("º º º º\n");
gotoxy(6,18);printf("º ° STAGIAIRE ° º\n");
gotoxy(6,19);printf("º ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ º\n");
gotoxy(6,20);printf("º Nø Inscription : º\n");
gotoxy(6,21);printf("º º\n");
gotoxy(6,22);printf("º Nom Stagiaire : º\n");
gotoxy(6,23);printf("º º\n");
gotoxy(6,24);printf("º Pr?nom stagiaire: º\n");
gotoxy(6,25);printf("º º\n");
gotoxy(6,26);printf("º Date Naissance : º\n");
gotoxy(6,27);printf("º º\n");
gotoxy(6,28);printf("º Adresse : º\n");
gotoxy(6,29);printf("º º\n");
gotoxy(6,30);printf("º Fili?re : º\n");
gotoxy(6,31);printf("º º º º\n");
gotoxy(6,32);printf("º º º º\n");
gotoxy(6,33);printf("º ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ º\n");
gotoxy(6,34);printf("ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ\n");
gotoxy(29,20);printf("%s",st.ninscription);
gotoxy(29,22);printf("%s",st.nomst);
gotoxy(29,24);printf("%s",st.Prenom);
gotoxy(29,26);printf("%s",st.adresse);
gotoxy(29,28);printf("%s",st.daten);
gotoxy(29,30);printf("%s",st.filiere);
getch();
clrscr();
gotoxy(13,6); printf("ÉÍËÍ» ÉÍËÍ» ÉÍËÍ» ÉÍËÍ» \n");
gotoxy(13,7); printf("ÌÍÎ͹ ÌÍÎ͹ ÌÍÎ͹ ÌÍÎ͹ \n");
gotoxy(13,8); printf("ÈÍÊͼÉÍ»ÈÍÊͼ ÈÍÊͼÉÍ»ÈÍÊͼ \n");
gotoxy(13,9); printf("ÉÍËÍ»ÈÍ»ÉÍËÍ» ÉÍËÍ»ÈÍ»ÉÍËÍ» \n");
gotoxy(13,10);printf("ÌÍÎ͹ÈͼÌÍÎ͹ ÌÍÎ͹ÈͼÌÍÎ͹ \n");
gotoxy(13,11);printf("ÈÍÊͼ ÈÍÊͼ ÈÍÊͼ ÈÍÊͼ \n");
gotoxy(6,12);printf(" ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» \n");
gotoxy(6,13);printf(" º º \n");
gotoxy(6,14);printf("ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͹ ° MODIFICATION ° ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»\n");
gotoxy(6,15);printf("º ÉÍÍÍÍÍ º º ÍÍÍÍÍÍ» º\n");
gotoxy(6,16);printf("º º ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ º º\n");
gotoxy(6,17);printf("º º º º\n");
gotoxy(6,18);printf("º ° STAGIAIRE ° º\n");
gotoxy(6,19);printf("º ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ º\n");
gotoxy(6,20);printf("º Nø Inscription : º\n");
gotoxy(6,21);printf("º º\n");
gotoxy(6,22);printf("º Nom Stagiaire : º\n");
gotoxy(6,23);printf("º º\n");
gotoxy(6,24);printf("º Pr?nom stagiaire: º\n");
gotoxy(6,25);printf("º º\n");
gotoxy(6,26);printf("º Date Naissance : º\n");
gotoxy(6,27);printf("º º\n");
gotoxy(6,28);printf("º Adresse : º\n");
gotoxy(6,29);printf("º º\n");
gotoxy(6,30);printf("º Fili?re : º\n");
gotoxy(6,31);printf("º º º º\n");
gotoxy(6,32);printf("º º º º\n");
gotoxy(6,33);printf("º ÈÍÍÍÍÍ ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» ÍÍͼ º\n");
gotoxy(6,34);printf("ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͹ VOULEZ VOUS MODIFIER ÌÍÍÍÍÍÍÍÍÍÍÍͼ\n");
gotoxy(6,35);printf(" º O [ ] N º \n");
gotoxy(6,36);printf(" ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ \n");
gotoxy(29,20);scanf("%s",&ninscriptionm);
gotoxy(29,22);scanf("%s",&nomstm);
gotoxy(29,24);scanf("%s",&Prenomm);
gotoxy(29,26);scanf("%s",&adressem);
gotoxy(29,28);scanf("%s",&datenm);
gotoxy(29,30);scanf("%s",&filierem);
flushall();
gotoxy(45,35);scanf("%c",&rep);
rep=toupper(rep);
if(rep=='O')
{
f1=fopen("c:\\stag.txt","r");
s=fopen("c:\\s.txt","w");
while(!feof(f1))
{
flushall();
fscanf(f1,"%s\t%s\t%s\t%s\t%s\t%s\n",st.ninscription,st.nomst,st.Prenom,st.adresse,st.daten,st.filiere);
if (strcmpi(st.ninscription,ninscription)==0 )
fprintf(s,"%s\t%s\t%s\t%s\t%s\t%s\n",ninscriptionm,nomstm
,Prenomm,adressem,datenm,filierem);
else
fprintf(s,"%s\t%s\t%s\t%s\t%s\t%s\n",st.ninscription,st.nomst,st.Prenom,st.adresse,st.daten,st.filiere);
}
fclose(f1);
fclose(s);
f1=fopen("c:\\stag.txt","w");
s=fopen("c:\\s.txt","r");
while(!feof(s))
{ flushall();
flushall();
fscanf(s,"%s\t%s\t%s\t%s\t%s\t%s\n",st.ninscription,st.nomst,st.Prenom,st.adresse,st.daten,st.filiere);
fprintf(f1,"%s\t%s\t%s\t%s\t%s\t%s\n",st.ninscription,st.nomst,st.Prenom,st.adresse,st.daten,st.filiere);
}
fclose(f1);
fclose(s);
}
}
else
{
clrscr();
printf("ce numero n'existe pas\n");
getch();
}
}
/*********************programme principale*****************/
void mainstg()
{
do {
do{clrscr();
menu();
gotoxy(54,37);scanf ("%c",&choix);
choix=toupper (choix);
}while((choix=='A')&&(choix=='S')&&(choix=='l')&&(choix=='M')&&(choix=='R')
&&(choix=='Q'));
switch(choix)
{case'A':{ajouterstg();
break;
}
case'S':{supprimerstg();
break;
}
case'L':{listerstg();
break;
}
case'M':{modifierstg();
break;
}
case'R':{rechercherstg();
break;
}
}
}while(choix!='Q');
}
/***************************************************************************/
/* GESTION DES SOCIETES */
/*************************************************************************/
/**********************fonction ajouter*********************/
void ajoutersoc()
{
do
{
clrscr();
flushall();
a=fopen("c:\\sos.txt","a+");
if(a==NULL)
{a=fopen("c:\\sos.txt","w");}
gotoxy(13,6); printf("ÉÍËÍ» ÉÍËÍ» ÉÍËÍ» ÉÍËÍ» \n");
gotoxy(13,7); printf("ÌÍÎ͹ ÌÍÎ͹ ÌÍÎ͹ ÌÍÎ͹ \n");
gotoxy(13,8); printf("ÈÍÊͼÉÍ»ÈÍÊͼ ÈÍÊͼÉÍ»ÈÍÊͼ \n");
gotoxy(13,9); printf("ÉÍËÍ»ÈÍ»ÉÍËÍ» ÉÍËÍ»ÈÍ»ÉÍËÍ» \n");
gotoxy(13,10);printf("ÌÍÎ͹ÈͼÌÍÎ͹ ÌÍÎ͹ÈͼÌÍÎ͹ \n");
gotoxy(13,11);printf("ÈÍÊͼ ÈÍÊͼ ÈÍÊͼ ÈÍÊͼ \n");
gotoxy(6,12);printf(" ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» \n");
gotoxy(6,13);printf(" º º \n");
gotoxy(6,14);printf("ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͹ ° ° ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»\n");
gotoxy(6,15);printf("º ÉÍÍÍÍÍ º º ÍÍÍÍÍÍ» º\n");
gotoxy(6,16);printf("º º ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ º º\n");
gotoxy(6,17);printf("º º º º\n");
gotoxy(6,18);printf("º ° SOCIETE ° º\n");
gotoxy(6,19);printf("º ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ º\n");
gotoxy(6,20);printf("º sigle : º\n");
gotoxy(6,21);printf("º º\n");
gotoxy(6,22);printf("º adresse : º\n");
gotoxy(6,23);printf("º º\n");
gotoxy(6,24);printf("º email : º\n");
gotoxy(6,25);printf("º º\n");
gotoxy(6,26);printf("º tel : º\n");
gotoxy(6,27);printf("º º\n");
gotoxy(6,28);printf("º fax : º\n");
gotoxy(6,29);printf("º º\n");
gotoxy(6,30);printf("º patente : º\n");
gotoxy(6,31);printf("º º\n");
gotoxy(6,32);printf("º categorie : º\n");
gotoxy(6,33);printf("º º º º\n");
gotoxy(6,34);printf("º º º º\n");
gotoxy(6,35);printf("º ÈÍÍÍÍÍ ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» ÍÍͼ º\n");
gotoxy(6,36);printf("ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͹ VOULEZ VOUS AJOUTER UNE AUTRE ÌÍÍÍÍÍÍÍÍÍÍÍͼ\n");
gotoxy(6,37);printf(" º O [ ] N º \n");
gotoxy(6,38);printf(" ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ \n");
textcolor(7);
gotoxy(29,20);scanf("%s",&so.sigle);
gotoxy(29,22);scanf("%s",&so.adresses);
gotoxy(29,24);scanf("%s",&so.Email);
gotoxy(29,26);scanf("%s",&so.tele);
gotoxy(29,28);scanf("%s",&so.fax);
gotoxy(29,30);scanf("%s",&so.patente);
gotoxy(29,32);scanf("%s",&so.categorie);
fprintf(a,"%s\t%s\t%s\t%s\t%s\t%s\t%s\n",so.sigle,so.adresses,so.Email,so.tele,so.fax
,so.patente,so.categorie);
flushall();
gotoxy(44,37);scanf("%c",&rep);
rep=toupper(rep);
}
while(rep!='N');
}
//**********************fonction rechercher*****************/
void recherchersoc()
{
do
{
clrscr();
char sigle[20];
a=fopen("c:\\sos.txt","r");
if(a==NULL)
{printf("fichier inexistant\n");
getch();
exit(1);
}
gotoxy(10,12);printf(" ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» \n");
gotoxy(10,13);printf(" º º \n");
gotoxy(10,14);printf("ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͹ ° SIGLE A CHERCHER ?:.... °ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ\n");
gotoxy(10,15);printf(" º º \n");
gotoxy(10,16);printf(" ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ \n");
gotoxy(52,14);scanf("%s",&sigle);
bool=0;
while(!feof(a))
{
fscanf(a,"%s\t%s\t%s\t%s\t%s\t%s\t%s\n",so.sigle,so.adresses,so.Email,so.tele,so.fax
,so.patente,so.categorie);
if(strcmpi(sigle,so.sigle)==0)
{bool=1;
break;
}
}
if(bool==1)
{
clrscr();
gotoxy(13,6); printf("ÉÍËÍ» ÉÍËÍ» ÉÍËÍ» ÉÍËÍ» \n");
gotoxy(13,7); printf("ÌÍÎ͹ ÌÍÎ͹ ÌÍÎ͹ ÌÍÎ͹ \n");
gotoxy(13,8); printf("ÈÍÊͼÉÍ»ÈÍÊͼ ÈÍÊͼÉÍ»ÈÍÊͼ \n");
gotoxy(13,9); printf("ÉÍËÍ»ÈÍ»ÉÍËÍ» ÉÍËÍ»ÈÍ»ÉÍËÍ» \n");
gotoxy(13,10);printf("ÌÍÎ͹ÈͼÌÍÎ͹ ÌÍÎ͹ÈͼÌÍÎ͹ \n");
gotoxy(13,11);printf("ÈÍÊͼ ÈÍÊͼ ÈÍÊͼ ÈÍÊͼ \n");
gotoxy(6,12);printf(" ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» \n");
gotoxy(6,13);printf(" º º \n");
gotoxy(6,14);printf("ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͹ ° ° ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»\n");
gotoxy(6,15);printf("º ÉÍÍÍÍÍ º º ÍÍÍÍÍÍ» º\n");
gotoxy(6,16);printf("º º ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ º º\n");
gotoxy(6,17);printf("º º º º\n");
gotoxy(6,18);printf("º ° SOSIETE ° º\n");
gotoxy(6,19);printf("º ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ º\n");
gotoxy(6,20);printf("º sigle : º\n");
gotoxy(6,21);printf("º º\n");
gotoxy(6,22);printf("º adresse : º\n");
gotoxy(6,23);printf("º º\n");
gotoxy(6,24);printf("º email : º\n");
gotoxy(6,25);printf("º º\n");
gotoxy(6,26);printf("º tel : º\n");
gotoxy(6,27);printf("º º\n");
gotoxy(6,28);printf("º fax : º\n");
gotoxy(6,29);printf("º º\n");
gotoxy(6,30);printf("º patente : º\n");
gotoxy(6,31);printf("º º\n");
gotoxy(6,32);printf("º categorie : º\n");
gotoxy(6,33);printf("º º º º\n");
gotoxy(6,34);printf("º º º º\n");
gotoxy(6,35);printf("º ÈÍÍÍÍÍ ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» ÍÍͼ º\n");
gotoxy(6,36);printf("ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͹ VOULEZ VOUS CHERCHER UNE AUTRE ÌÍÍÍÍÍÍÍÍÍÍÍͼ\n");
gotoxy(6,37);printf(" º O [ ] N º \n");
gotoxy(6,38);printf(" ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ \n");
textcolor(14+BLINK);
gotoxy(33,3);cprintf("Soci?t?");
textcolor(7);
gotoxy(29,20);printf("%s",&so.sigle);
gotoxy(29,22);printf("%s",&so.adresses);
gotoxy(29,24);printf("%s",&so.Email);
gotoxy(29,26);printf("%s",&so.tele);
gotoxy(29,28);printf("%s",&so.fax);
gotoxy(29,30);printf("%s",&so.patente);
gotoxy(29,32);printf("%s",&so.categorie);
}
else
{
clrscr();
gotoxy(25,25);cprintf("ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»\n");
gotoxy(25,26);cprintf("º º\n");
gotoxy(25,27);cprintf("ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ\n");
textcolor(12+BLINK);;
gotoxy(28,26);cprintf("ce numero n'existe pas");
getch();
textcolor(7);
clrscr();
gotoxy(6,35);printf(" ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» \n");
gotoxy(6,36);printf("ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͹ VOULEZ VOUS CHERCHER UNE AUTRE ÌÍÍÍÍÍÍÍÍÍÍÍÍ \n");
gotoxy(6,37);printf(" º O [ ] N º \n");
gotoxy(6,38);printf(" ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ \n");
}
fclose(a);
flushall();
gotoxy(44,37);scanf("%c",&rep);
rep=toupper(rep);
}
while(rep!='N');
}
/**********************fonction lister*********************/
void listersoc()
{
int j;
clrscr();
a=fopen("c:\\sos.txt","r");
if(a==NULL)
{
printf("le fichier inexistant");
getch();
exit(0);
}
gotoxy(8,8); cprintf("ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍËÍÍÍÍÍÍÍÍÍÍÍÍËÍÍÍÍÍÍÍÍÍÍÍÍÍÍËÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»\n");
gotoxy(8,9); cprintf("º Sigle º Adresses º Tele º Categorie º\n");
gotoxy(8,10);cprintf("ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÎÍÍÍÍÍÍÍÍÍÍÍÍÎÍÍÍÍÍÍÍÍÍÍÍÍÍÍÎÍÍÍÍÍÍÍÍÍÍÍÍÍ͹\n");
gotoxy(8,11);cprintf("º º º º º\n");
gotoxy(8,12);cprintf("º º º º º\n");
gotoxy(8,13);cprintf("º º º º º\n");
gotoxy(8,14);cprintf("º º º º º\n");
gotoxy(8,15);cprintf("º º º º º\n");
gotoxy(8,16);cprintf("º º º º º\n");
gotoxy(8,17);cprintf("º º º º º\n");
gotoxy(8,18);cprintf("º º º º º\n");
gotoxy(8,19);cprintf("º º º º º\n");
gotoxy(8,20);cprintf("º º º º º\n");
gotoxy(8,21);cprintf("º º º º º\n");
gotoxy(8,22);cprintf("º º º º º\n");
gotoxy(8,23);cprintf("º º º º º\n");
gotoxy(8,24);cprintf("º º º º º\n");
gotoxy(8,25);cprintf("º º º º º\n");
gotoxy(8,26);cprintf("º º º º º\n");
gotoxy(8,27);cprintf("º º º º º\n");
gotoxy(8,28);cprintf("º º º º º\n");
gotoxy(8,29);cprintf("º º º º º\n");
gotoxy(8,30);cprintf("º º º º º\n");
gotoxy(8,31);cprintf("º º º º º\n");
gotoxy(8,32);cprintf("º º º º º\n");
gotoxy(8,33);cprintf("º º º º º\n");
16 févr. 2007 à 12:54
je suis saoudi abderrazzak de maroc je veux propose mon projet de la fine de l'anneé dernier en cpp
merci..
8 févr. 2007 à 13:10
8 févr. 2007 à 12:58
utilisez MSN ou tout autre moyen a votre convenance, ne polluez pas inutilement CodeS-SourceS
Merci.
Renfield - Admin CS