Advertisement
Guest User

Untitled

a guest
Nov 18th, 2018
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 30.54 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <string.h>
  4. int ajoutseul(int n,int Idreser[65],char Numpass[65][10],char Nomvoy[65][20],char Datenaissv[65][11],char Datedep[65][11],char Datear[65][11],char Villedest[65][10],char Paysdest[65][15],char Engrp[65],int Numgrp[65])
  5. {
  6. int v,d,k,c=0,i,j,pays[65],ville[65];
  7. char villed[10],nom[20],datep[11],dater[11],date[11],paysd[15],num[10];
  8.  
  9.  
  10. for(i=0;i<=n;i++)
  11. {
  12. pays[i]=0;
  13. }
  14. do
  15. {
  16. printf("Donner le numero de passeport : ");
  17. scanf("%s", num);
  18. v=1;
  19. for(i=0;i<strlen(num);i++)
  20. {
  21. if(num[i]==' ')
  22. {
  23. v=0;
  24. }
  25. }
  26. }while ((strlen(num)!=9)||(num[0]<'A')||(num[0]>'Z')||(v==0));
  27.  
  28. for (i=0;i<n;i++)
  29. {
  30.  
  31. if (strcmp(num,Numpass[i])==0)
  32. {
  33. c++;
  34. printf("%d ",Idreser[i]);
  35. printf("%s ",Numpass[i]);
  36. printf(" ");
  37. for(j=0;j<=19;j++)
  38. {
  39. printf("%c",Nomvoy[i][j]);
  40. }
  41.  
  42. for(j=0;j<=10;j++)
  43. {
  44. printf("%c",Datenaissv[i][j]);
  45. }
  46. for(j=0;j<=10;j++)
  47. {
  48. printf("%c",Datedep[i][j]);
  49. }
  50. for(j=0;j<=10;j++)
  51. {
  52. printf("%c",Datear[i][j]);
  53. }
  54. for(j=0;j<=9;j++)
  55. {
  56. printf("%c",Villedest[i][j]);
  57. }
  58. for(j=0;j<=14;j++)
  59. {
  60. printf("%c",Paysdest[i][j]);
  61. }
  62. printf("%c ",Engrp[i]);
  63. printf("%d",Numgrp[i]);
  64. printf("\n");
  65. }
  66. }
  67.  
  68. n++;
  69. Idreser[n]=Idreser[i-1]+1;
  70. if(c==0)
  71. {
  72. printf("Pas de voyages pour ce client!\n");
  73. Idreser[n]=Idreser[n-1]+1;
  74. for(j=0;j<10;j++)
  75. {
  76. Numpass[n][j]=num[j];
  77. }
  78.  
  79. do{
  80. printf("Donner votre date de naissance : ");
  81. gets(date);
  82. }while((isdigit(date[0])==0)||(isdigit(date[1])==0)
  83. ||(isdigit(date[3])==0)||(isdigit(date[4])==0)
  84. ||(isdigit(date[6])==0)||(isdigit(date[7])==0)
  85. ||(isdigit(date[8])==0)||(isdigit(date[9])==0)||(date[2]!='/')||(date[5])!='/'||strlen(date)!=10);
  86.  
  87.  
  88. do{
  89. printf("Donner votre nom : ");
  90. gets(nom);
  91. v=1;
  92. for(i=0;i<strlen(nom);i++)
  93. {
  94. if(nom[i]!=' ')
  95. {
  96. if((isalpha(nom[i])==0)||(nom[i]<'A')||(nom[i]>'Z'))
  97. {
  98. v=0;
  99. }
  100. }
  101. }
  102. }while(v==0);
  103. for(j=0;j<=19;j++)
  104. {
  105. Nomvoy[n][j]=nom[j];
  106. }
  107.  
  108. for(j=0;j<=10;j++)
  109. {
  110. Datenaissv[n][j]=date[j];
  111. }
  112. for(i=0;i<n;i++)
  113. {
  114.  
  115.  
  116. if(pays[i]==0)
  117. {
  118. for(j=0;j<=14;j++)
  119. {
  120. printf("%c",Paysdest[i][j]);
  121. }
  122. for(k=i+1;k<n;k++)
  123. {
  124. d=0;
  125. v=1;
  126. while((d<=14)&&(v==1))
  127. {
  128. if(Paysdest[i][d]!=Paysdest[k][d])
  129. {
  130. v=0;
  131. }
  132. d++;
  133. }
  134. if(v==1)
  135. {
  136. pays[k]=1;
  137. }
  138. }
  139. }
  140. }
  141. printf("\n");
  142. do
  143. {
  144. printf("Donner votre pays de destination : ");
  145. gets(paysd);
  146. v=0;
  147. for(i=0;i<n;i++)
  148. {
  149. if(strcmp(Paysdest[i],paysd)==0)
  150. {
  151. v=1;
  152. }
  153. }
  154. }while(v==0);
  155. for(j=0;j<=14;j++)
  156. {
  157. Paysdest[n][j]=paysd[j];
  158. }
  159.  
  160.  
  161. for (i=0;i<n;i++)
  162. {
  163.  
  164. if (strcmp(Paysdest[i],paysd)==0)
  165. {
  166. printf("-%s \n",Villedest[i]);
  167. }
  168. }
  169.  
  170.  
  171. i=0;
  172. do
  173. {
  174. printf("Donner votre ville de destination maintenant : ");
  175. gets(villed);
  176. v=0;
  177. for(i=0;i<n;i++)
  178. {
  179. if(strcmp(Villedest[i],villed)==0)
  180. {
  181. v=1;
  182. }
  183. }
  184. }while(v==0);
  185.  
  186. for(j=0;j<=9;j++)
  187. {
  188. Villedest[n][j]=villed[j];
  189. }
  190.  
  191. do{
  192. printf("Donner la date de depart : ");
  193. gets(datep);
  194. }while((isdigit(datep[0])==0)||(isdigit(datep[1])==0)
  195. ||(isdigit(datep[3])==0)||(isdigit(datep[4])==0)
  196. ||(isdigit(datep[6])==0)||(isdigit(datep[7])==0)
  197. ||(isdigit(datep[8])==0)||(isdigit(datep[9])==0)||(datep[2]!='/')||(datep[5])!='/'||strlen(datep)!=10);
  198. for(j=0;j<=10;j++)
  199. {
  200. Datedep[n][j]=datep[j];
  201. }
  202. do{
  203. printf("Donner la date d'arrivee : ");
  204. gets(dater);
  205. }while((isdigit(dater[0])==0)||(isdigit(dater[1])==0)
  206. ||(isdigit(dater[3])==0)||(isdigit(dater[4])==0)
  207. ||(isdigit(dater[6])==0)||(isdigit(dater[7])==0)
  208. ||(isdigit(dater[8])==0)||(isdigit(dater[9])==0)||(dater[2]!='/')||(dater[5]!='/')||(strlen(dater)!=10));
  209. for(j=0;j<=10;j++)
  210. {
  211. Datear[n][j]=dater[j];
  212. }
  213. }
  214. AfficheVoyage(n,Idreser,Numpass,Nomvoy,Datenaissv,Datedep,Datear,Villedest,Paysdest,Engrp,Numgrp);
  215.  
  216.  
  217.  
  218.  
  219. return n ;
  220. }
  221.  
  222.  
  223. void listevoy(int n,int Idreser[65],char Numpass[65][10],char Nomvoy[65][20],char Datenaissv[65][11],char Datedep[65][11],char Datear[65][11],char Villedest[65][10],char Paysdest[65][15],char Engrp[65],int Numgrp[65])
  224. {
  225. int d,v,c,i,j,x,pays[64];
  226. for(i=0;i<=n;i++)
  227. {
  228. pays[i]=0;
  229. }
  230. for(i=0;i<=n;i++)
  231. {
  232. if(pays[i]==0)
  233. {
  234. for(x=0;x<=14;x++)
  235. {
  236. printf("%c",Paysdest[i][x]);
  237. }
  238. if(Idreser[i]!=0)
  239. {
  240. printf(":\n");
  241. for(c=0;c<=64;c++)
  242. {
  243. d=0;
  244. v=1;
  245. while((d<=14)&&(v==1))
  246. {
  247. if(Paysdest[c][d]!=Paysdest[i][d])
  248. {
  249. v=0;
  250. }
  251. d++;
  252. }
  253. if(v==1)
  254. {
  255. pays[c]=1;
  256.  
  257. printf("%d ",Idreser[c]);
  258. printf("%s ",Numpass[c]);
  259.  
  260. printf(" ");
  261. for(j=0;j<=19;j++)
  262. {
  263. printf("%c",Nomvoy[c][j]);
  264. }
  265.  
  266. for(j=0;j<=10;j++)
  267. {
  268. printf("%c",Datenaissv[c][j]);
  269. }
  270. for(j=0;j<=10;j++)
  271. {
  272. printf("%c",Datedep[c][j]);
  273. }
  274. for(j=0;j<=10;j++)
  275. {
  276. printf("%c",Datear[c][j]);
  277. }
  278. for(j=0;j<=9;j++)
  279. {
  280. printf("%c",Villedest[c][j]);
  281. }
  282. for(j=0;j<=14;j++)
  283. {
  284. printf("%c",Paysdest[c][j]);
  285. }
  286. printf("%c ",Engrp[c]);
  287. printf("%d",Numgrp[c]);
  288. printf("\n");
  289.  
  290. }
  291. }
  292. }
  293. }
  294. }
  295.  
  296.  
  297. }
  298.  
  299.  
  300.  
  301.  
  302.  
  303.  
  304.  
  305.  
  306. void retarderV(int n,int Idreser[65],int Numpass[65],char Nomvoy[65][20],char Datenaissv[65][11],char Datedep[65][11],char Datear[65][11],char Villedest[65][10],char Paysdest[65][15],char Engrp[65],int Numgrp[65])
  307. {
  308. char ndate[11],date[11];
  309. int i,j,v;
  310.  
  311. printf("Donner la date a retarder: ");
  312. scanf("%s", date);
  313. printf("Donner la nouvelle date: ");
  314. scanf("%s", ndate);
  315. for(i=0;i<=n;i++)
  316. {
  317. v=1;
  318. j=0;
  319. while((j<=10)&&(v==1))
  320. {
  321. if (Datedep[i][j]!=date[j])
  322. {
  323. v=0;
  324. }
  325. j++;
  326. }
  327. if(v==1)
  328. {
  329. for(j=0;j<=10;j++)
  330. {
  331. Datedep[i][j]=ndate[j];
  332. }
  333.  
  334. printf("%d ",Idreser[i]);
  335.  
  336.  
  337. printf(" ");
  338.  
  339. printf("%s ",Nomvoy[i]);
  340.  
  341.  
  342. for(j=0;j<=10;j++)
  343. {
  344. printf("%c",Datenaissv[i][j]);
  345. }
  346. for(j=0;j<=10;j++)
  347. {
  348. printf("%c",Datedep[i][j]);
  349. }
  350. for(j=0;j<=10;j++)
  351. {
  352. printf("%c",Datear[i][j]);
  353. }
  354. for(j=0;j<=9;j++)
  355. {
  356. printf("%c",Villedest[i][j]);
  357. }
  358. for(j=0;j<=14;j++)
  359. {
  360. printf("%c",Paysdest[i][j]);
  361. }
  362. printf("%c ",Engrp[i]);
  363. printf("%d",Numgrp[i]);
  364. printf("\n");
  365. }
  366. }
  367. }
  368.  
  369. int rechercheIDRES(int n,int Idreser[65])
  370. {
  371. int i=0,numid;
  372. do
  373. {
  374. printf("Donner le numero de l'IDRESER (6chiffres): ");
  375. scanf("%d",&numid);
  376. }while ((numid<100000) || (numid>999999));
  377. do
  378. {
  379. if (numid==Idreser[i])
  380. {
  381. return i;
  382. break;
  383. }
  384. i++;
  385.  
  386. }while (i<n);
  387. }
  388. void suppression(int n,int Idreser[65],char Numpass[65][10],char Nomvoy[65][20],char Datenaissv[65][11],char Datedep[65][11],char Datear[65][11],char Villedest[65][10],char Paysdest[65][15],char Engrp[65],int Numgrp[65])
  389. {
  390. int i,k,j;
  391.  
  392. AfficheVoyage(n,Idreser,Numpass,Nomvoy,Datenaissv,Datedep,Datear,Villedest,Paysdest,Engrp,Numgrp);
  393. printf("\n");
  394. k=rechercheIDRES(n,Idreser);
  395. for(i=k;i<n;i++)
  396. {
  397. Idreser[i]=Idreser[i+1];
  398.  
  399. for(j=0;j<=9;j++)
  400. {
  401. Numpass[i][j]=Numpass[i+1][j];
  402. }
  403. for(j=0;j<=19;j++)
  404. {
  405. Nomvoy[i][j]=Nomvoy[i+1][j];
  406. }
  407.  
  408. for(j=0;j<=10;j++)
  409. {
  410. Datenaissv[i][j]=Datenaissv[i+1][j];
  411. }
  412. for(j=0;j<=10;j++)
  413. {
  414. Datedep[i][j]=Datedep[i+1][j];
  415. }
  416. for(j=0;j<=10;j++)
  417. {
  418. Datear[i][j]=Datear[i+1][j];
  419. }
  420. for(j=0;j<=9;j++)
  421. {
  422. Villedest[i][j]=Villedest[i+1][j];
  423. }
  424. for(j=0;j<=14;j++)
  425. {
  426. Paysdest[i][j]=Paysdest[i+1][j];
  427. }
  428. Engrp[i]=Engrp[i+1];
  429. Numgrp[i]=Numgrp[i+1];
  430. }
  431. AfficheVoyage(n,Idreser,Numpass,Nomvoy,Datenaissv,Datedep,Datear,Villedest,Paysdest,Engrp,Numgrp);
  432.  
  433. }
  434. void recherchev(int n,int Idreser[65],char Numpass[65][10],char Nomvoy[65][20],char Datenaissv[65][11],char Datedep[65][11],char Datear[65][11],char Villedest[65][10],char Paysdest[65][15],char Engrp[65],int Numgrp[65])
  435. {
  436. int c=0,i,j;
  437. char num[10];
  438. do
  439. {
  440. printf("Donner le numero de passeport : ");
  441. scanf("%s", num);
  442. }while ((strlen(num)!=9)||((num[0]<'A')||(num[0]>'Z')));
  443. for (i=0;i<=n;i++)
  444. {
  445. if (num==Numpass[i])
  446. {
  447. c++;
  448. printf("%d ",Idreser[i]);
  449.  
  450.  
  451. for(j=0;j<=9;j++)
  452. {
  453. printf("%c",Numpass[i][j]);
  454. };
  455.  
  456. printf(" ");
  457. for(j=0;j<=19;j++)
  458. {
  459. printf("%c",Nomvoy[i][j]);
  460. }
  461.  
  462. for(j=0;j<=10;j++)
  463. {
  464. printf("%c",Datenaissv[i][j]);
  465. }
  466. for(j=0;j<=10;j++)
  467. {
  468. printf("%c",Datedep[i][j]);
  469. }
  470. for(j=0;j<=10;j++)
  471. {
  472. printf("%c",Datear[i][j]);
  473. }
  474. for(j=0;j<=9;j++)
  475. {
  476. printf("%c",Villedest[i][j]);
  477. }
  478. for(j=0;j<=14;j++)
  479. {
  480. printf("%c",Paysdest[i][j]);
  481. }
  482. printf("%c ",Engrp[i]);
  483. printf("%d",Numgrp[i]);
  484. printf("\n");
  485. }
  486.  
  487. }
  488. if(c==0)
  489. {
  490. printf("Pas de voyages pour ce client! \n");
  491. }
  492. }
  493.  
  494.  
  495.  
  496.  
  497. void AfficheVoyage(int n,int Idreser[65],char Numpass[65][10],char Nomvoy[65][20],char Datenaissv[65][11],char Datedep[65][11],char Datear[65][11],char Villedest[65][10],char Paysdest[65][15],char Engrp[65],int Numgrp[65])
  498. {
  499. int i,j;
  500.  
  501. for(i=0;i<=64;i++)
  502. {
  503. if(Idreser[i]!=0)
  504. {
  505.  
  506. printf("%d ",Idreser[i]);
  507.  
  508.  
  509. for(j=0;j<=9;j++)
  510. {
  511. printf("%c",Numpass[i][j]);
  512. }
  513. printf(" ");
  514. for(j=0;j<=19;j++)
  515. {
  516. printf("%c",Nomvoy[i][j]);
  517. }
  518.  
  519. for(j=0;j<=10;j++)
  520. {
  521. printf("%c",Datenaissv[i][j]);
  522. }
  523. for(j=0;j<=10;j++)
  524. {
  525. printf("%c",Datedep[i][j]);
  526. }
  527. for(j=0;j<=10;j++)
  528. {
  529. printf("%c",Datear[i][j]);
  530. }
  531. for(j=0;j<=9;j++)
  532. {
  533. printf("%c",Villedest[i][j]);
  534. }
  535. printf(" ");
  536. for(j=0;j<=14;j++)
  537. {
  538. printf("%c",Paysdest[i][j]);
  539. }
  540. printf("%c ",Engrp[i]);
  541. printf("%d",Numgrp[i]);
  542. printf("\n");
  543. }
  544. }
  545. }
  546.  
  547.  
  548.  
  549.  
  550.  
  551.  
  552.  
  553.  
  554.  
  555.  
  556. void main()
  557. {
  558.  
  559. int i,choix;
  560.  
  561. printf("||");
  562. for(i=1;i<=115;i++)
  563. {
  564. printf("-");
  565. }
  566. printf("|| ");
  567. printf("||");
  568. for(i=1;i<=37;i++)
  569. {
  570. printf(" ");
  571. }
  572. printf("MENU PRINCIPAL DE NOTRE AGENCE DE VOYAGE");
  573. for(i=1;i<=38;i++)
  574. {
  575. printf(" ");
  576. }
  577. printf("||\n");
  578. printf("||");
  579. for(i=1;i<=115;i++)
  580. {
  581. printf("-");
  582. }
  583. printf("|| \n\n\n\n");
  584. printf("||");
  585.  
  586. for(i=1;i<=115;i++)
  587. {
  588. printf("-");
  589. }
  590. printf("|| ");
  591. printf("||");
  592. for(i=1;i<=115;i++)
  593. {
  594. printf("-");
  595. }
  596. printf("|| ");
  597. printf("||");
  598. for(i=1;i<=36;i++)
  599. {
  600. printf("-");
  601. }
  602. printf("BIENVENUE AU MENU PRINCIPAL DE NOTRE AGENCE");
  603. for(i=1;i<=36;i++)
  604. {
  605. printf("-");
  606. }
  607. printf("|| ");
  608. printf("||");
  609. for(i=1;i<=115;i++)
  610. {
  611. printf("-");
  612. }
  613. printf("|| ");
  614. printf("||");
  615. for(i=1;i<=115;i++)
  616. {
  617. printf("-");
  618. }
  619. printf("|| ");
  620. printf("||");
  621. for(i=1;i<=36;i++)
  622. {
  623. printf("-");
  624. }
  625. printf("Veuillez choisir l'objectif de votre operation");
  626. for(i=1;i<=33;i++)
  627. {
  628. printf("-");
  629. }
  630. printf("|| ");
  631. printf("||");
  632. for(i=1;i<=115;i++)
  633. {
  634. printf("-");
  635. }
  636. printf("|| ");
  637. printf("||");
  638. for(i=1;i<=115;i++)
  639. {
  640. printf("-");
  641. }
  642. printf("|| ");
  643. printf("||");
  644. for(i=1;i<=37;i++)
  645. {
  646. printf(" ");
  647. }
  648. printf("1. GESTION DES VOYAGES");
  649. for(i=1;i<=56;i++)
  650. {
  651. printf(" ");
  652. }
  653. printf("||\n");
  654. printf("||");
  655. for(i=1;i<=37;i++)
  656. {
  657. printf(" ");
  658. }
  659. printf("2. STATISTIQUES POUR L'AGENCE");
  660. for(i=1;i<=49;i++)
  661. {
  662. printf(" ");
  663. }
  664. printf("||\n");
  665. printf("||");
  666. for(i=1;i<=115;i++)
  667. {
  668. printf("-");
  669. }
  670. printf("|| ");
  671. printf("||");
  672. for(i=1;i<=115;i++)
  673. {
  674. printf("-");
  675. }
  676. printf("|| ");
  677. printf("||");
  678. for(i=1;i<=37;i++)
  679. {
  680. printf(" ");
  681. }
  682. printf("3. QUITTER L'APPLICATION");
  683. for(i=1;i<=54;i++)
  684. {
  685. printf(" ");
  686. }
  687. printf("||\n");
  688. printf("||");
  689. for(i=1;i<=115;i++)
  690. {
  691. printf("-");
  692. }
  693. printf("|| ");
  694. do{
  695. printf("Entrez votre choix :");
  696. scanf("%d",&choix);
  697. }while((choix<1)||(choix>3));
  698. system("cls");
  699. switch (choix)
  700. {
  701. case 1 :{
  702. gestion();
  703. }
  704. break;
  705. case 2 :;
  706. case 3 :return 0;
  707. }
  708. }
  709.  
  710. void gestion()
  711. {
  712.  
  713. //partie declarative et remplissage de la base de données de l'agence de voyage
  714. int n=60,i,choix,Numgrp[65]={5,2,0,4,0,6,1,5,9,16,11,12,14,9,15,10,17,18,19,20,5,2,0,4,0,0,2,0,5,1,11,12,14,9,15,17,18,19,20,5,5,9,16,11,12,14,9,15,10,17,19,20,5,2,0,4,0,0,2,0};
  715. int Idreser[65]={542551 ,400888, 804529, 969720 ,138779, 594827, 128054, 185495, 340100, 314182 ,723712, 306832, 836302, 468316, 392971, 407463, 956978, 914495, 117765, 421101, 603208, 671388, 189109, 976645, 370316, 290945 ,489617, 639078, 696510, 731852, 462520, 254179, 588137, 416444, 102874, 276991, 320935, 739447, 800562, 969448, 171271, 855945, 167110, 470661, 818684, 560427, 879812, 668721, 993643, 306141, 943013, 215501, 217649, 683591 ,475282,824287,696274,739485,493934,269958};
  716. char Nomvoy[65][20]={"JAMES EVANSON\0","ACHREF DAHMEN\0","YASMINE SEHLI\0","YASSINE BOUMEDIEN\0","ROBERTO CAVALLI\0","AHMED JORMENA\0","LOTFI BOUCHNAK\0","SABRI MOSBAH\0","SAMIRA MAGROUN\0","KARIM GHARBI\0","SHAKIRA PIQUE\0","DUA LIPA\0","MASTER SINA\0","NABIL MAALOUL\0","YOSRA MAHNOUCH\0","KADHEM SEHER\0","AASI LHELANI\0","BRAD PITT\0","ANGELINA JOLIE\0","MOHAMED IDRIS DAHMEN\0","JAMES EVANSON\0","ACHREF DAHMEN\0","YASMINE SEHLI\0","YASSINE BOUMEDIEN\0","ROBERTO CAVALLI\0","AHMED JORMENA\0","LOTFI BOUCHNAK\0","SABRI MOSBAH\0","SAMIRA MAGROUN\0","KARIM GHARBI\0","SHAKIRA PIQUE\0","DUA LIPA\0","MASTER SINA\0","NABIL MAALOUL\0","YOSRA MAHNOUCH\0","KADHEM SEHER\0","AASI LHELANI\0","BRAD PITT\0","ANGELINA JOLIE\0","MOHAMED IDRIS DAHMEN\0","JAMES EVANSON\0","ACHREF DAHMEN\0","YASMINE SEHLI\0","YASSINE BOUMEDIEN\0","ROBERTO CAVALLI\0","AHMED JORMENA\0","LOTFI BOUCHNAK\0","SABRI MOSBAH\0","SAMIRA MAGROUN\0","KARIM GHARBI\0","SHAKIRA PIQUE\0","DUA LIPA\0","MASTER SINA\0","NABIL MAALOUL\0","YOSRA MAHNOUCH\0","KADHEM SEHER\0","AASI LHELANI\0","BRAD PITT\0","ANGELINA JOLIE\0","MOHAMED IDRIS DAHMEN\0"},
  717. Datenaissv[65][11]={"15/02/1980\0","02/05/2000\0","17/03/2000\0","31/05/1999\0","20/11/1992\0","15/02/1980\0","12/06/2003\0","20/02/1996\0","15/07/1958","14/09/1952\0","22/03/1958\0","09/04/1962\0","19/07/1975\0","22/05/2001\0","16/08/1963\0","15/07/1980\0","31/03/1965\0","15/04/1990\0","02/07/1988\0","03/01/1985\0","15/02/1980\0","02/05/2000\0","17/03/2000\0","31/05/1999\0","20/11/1992\0","15/02/1980\0","12/06/2003\0","20/02/1996\0","15/07/1958","14/09/1952\0","22/03/1958\0","09/04/1962\0","19/07/1975\0","22/05/2001\0","16/08/1963\0","15/07/1980\0","31/03/1965\0","15/04/1990\0","02/07/1988\0","03/01/1985\0","15/02/1980\0","02/05/2000\0","17/03/2000\0","31/05/1999\0","20/11/1992\0","15/02/1980\0","12/06/2003\0","20/02/1996\0","15/07/1958","14/09/1952\0","22/03/1958\0","09/04/1962\0","19/07/1975\0","22/05/2001\0","16/08/1963\0","15/07/1980\0","31/03/1965\0","15/04/1990\0","02/07/1988\0","03/01/1985\0"},
  718. Datedep[65][11]={"12/08/2017\0","31/09/2015\0","14/12/2004\0","17/02/2009\0","07/02/2017\0","18/03/2019\0","20/01/2018\0","15/11/2019\0","18/09/2017\0","13/03/2013\0","22/03/2017\0","01/01/2015\0","09/09/2018\0","10/10/2017\0","17/03/2018\0","29/11/2018\0","14/02/2017\0","15/04/2016\0","22/05/2014\0","18/01/2018\0","19/07/2017\0","03/04/2017\0","19/06/2018\0","22/07/2016\0","06/08/2010\0","02/08/2018\0","15/07/2017\0","22/08/2018\0","03/04/2015\0","14/09/2010\0","22/03/2006\0","09/04/2018\0","07/07/2017\0","09/08/2016\0","18/07/2015\0","27/07/2007\0","17/09/2019\0","25/03/2015\0","22/05/2016\0","29/03/2018\0","03/04/2019\0","16/05/2018\0","27/03/2017\0","09/11/2011\0","19/07/2018\0","07/10/2017\0","23/05/2015\0","29/03/2018\0","15/09/2019\0","08/11/2018\0","18/02/2014\0","05/11/2011\0","19/03/2016\0","28/06/2016\0","05/07/2017\0","15/07/2018\0","29/04/2018\0","18/12/2018\0","26/03/2016\0","06/03/2015\0"},
  719. Datear[65][11]={"12/09/2017\0","31/10/2015\0","14/01/2005\0","12/03/2009\0","08/04/2017\0","18/04/2019\0","30/01/2018\0","19/11/2019\0","30/09/2017\0","16/03/2013\0","23/04/2017\0","05/01/2015\0","09/10/2018\0","15/10/2017\0","23/03/2018\0","15/12/2018\0","24/03/2017\0","30/04/2016\0","27/05/2014\0","16/02/2018\0","22/08/2017\0","03/05/2017\0","27/06/2018\0","16/08/2016\0","18/08/2010\0","03/09/2018\0","20/07/2017\0","30/08/2018\0","06/05/2015\0","22/09/2010\0","30/03/2006\0","15/04/2018\0","14/07/2017\0","10/09/2016\0","22/07/2015\0","28/07/2007\0","18/10/2019\0","30/03/2015\0","30/05/2016\0","04/04/2018\0","10/04/2019\0","30/05/2018\0","30/03/2017\0","11/11/2011\0","25/07/2018\0","15/10/2017\0","26/07/2015\0","07/03/2018\0","30/09/2019\0","19/12/2018\0","22/02/2014\0","15/11/2011\0","25/03/2016\0","05/07/2016\0","15/07/2017\0","30/07/2018\0","17/03/2018\0","27/12/2018\0","05/04/2016\0","27/03/2015\0"},
  720. Paysdest[65][15]={"USA\0","FRANCE\0","PAYS BAS\0","THAILAND\0","CANADA\0","MEXIQUE\0","ESPAGNE\0","ARGENTINE\0","TUNISIE\0","COREE DE SUD\0","EGYPTE\0","PHILIPPINES\0","JORDANIE\0","ALLEMAGNE\0","FRANCE\0","USA\0","ALLEMAGNE\0","FRANCE\0","UK\0","TUNISIE\0","COREE DE SUD\0","EGYPTE\0","PHILIPPINES\0","CHINE\0","PAYS BAS\0","CHINE\0","NIGERIA\0","SUEDE\0","CUBA\0","MAROC\0","THAILAND\0","CANADA\0","TUNISIE\0","ESPAGNE\0","ARGENTINE\0","NIGERIA\0","SUEDE\0","CUBA\0","MAROC\0","ALLEMAGNE\0","FRANCE\0","USA\0","UK\0","TUNISIE\0","COREE DE SUD\0","EGYPTE\0","PHILIPPINES\0","CHINE\0","PAYS BAS\0","THAILAND\0","CANADA\0","MEXIQUE\0","ESPAGNE\0","ARGENTINE\0","NIGERIA\0","SUEDE\0","CUBA\0","MAROC\0","JORDANIE\0","ITALIE\0"},
  721. Villedest[65][10]={"NYC\0","PARIS\0","AMESTERDAM\0","BANGKOK\0","MONTREAL\0","MONTERREY\0","MADRID\0","ROSARIO\0","HAMMAMET\0","SEOUL\0","ALEXANDRIE\0","MANILA\0","AMMAN\0","MUNICH\0","LYON\0","LAS VEGAS\0","MUNICH\0","MARSEILLE\0","MANCHESTER\0","SOUSSE\0","BUSAN\0","CAIRO\0","CEBU\0","SHANGHAI\0","ROTTERDAM\0","BEJING\0","ABUJA\0","MALMO\0","HAVANA\0","CASABLANCA\0","PATTAYA\0","QUEBEC\0","HAMMAMET\0","BARCELONE\0","MENDOZA\0","ABUJA\0","STOCKHOLM\0","HAVANA\0","CASABLANCA\0","BERLIN\0","NICE\0","CALIFORNIA\0","LONDON\0","TUNIS\0","SEOUL\0","CAIRO\0","MANILA\0","SHANGHAI\0","AMESTERDAM\0","BANGKOK\0","MONTREAL\0","MONTERREY\0","SEVILLE\0","ROSARIO\0","ABUJA\0","MALMO\0","HAVANA\0","CASABLANCA\0","AMMAN\0","VATICAN\0"},
  722. Engrp[65],
  723. Numpass[65][10]={"A54233735\0" ,"C71837287\0" ,"B27525342\0" ,"D32451931\0" ,"E51670475\0" ,"K29763194\0" ,"F92977343\0" ,"W27345493\0" ,"M13044265\0" ,"X96020623\0" ,"H54572459\0" ,"A73986679\0" ,"Z84573009\0" ,"S92865681\0" ,"P74765317\0" ,"B80309454\0" ,"X57781035\0" ,"Z37433452\0" ,"F92793111\0", "C38783333\0","A54233735\0" ,"C71837287\0" ,"B27525342\0" ,"D32451931\0" ,"E51670475\0" ,"K29763194\0" ,"F92977343\0" ,"W27345493\0" ,"M13044265\0" ,"X96020623\0" ,"H54572459\0" ,"A73986679\0" ,"Z84573009\0" ,"S92865681\0" ,"P74765317\0" ,"B80309454\0" ,"X57781035\0" ,"Z37433452\0" ,"F92793111\0", "C38783333\0","A54233735\0" ,"C71837287\0" ,"B27525342\0" ,"D32451931\0" ,"E51670475\0" ,"K29763194\0" ,"F92977343\0" ,"W27345493\0" ,"M13044265\0" ,"X96020623\0" ,"H54572459\0" ,"A73986679\0" ,"Z84573009\0" ,"S92865681\0" ,"P74765317\0" ,"B80309454\0" ,"X57781035\0" ,"Z37433452\0" ,"F92793111\0", "C38783333\0"};
  724.  
  725. for(i=0;i<=64;i++)
  726. {
  727. if(Numgrp[i]==0)
  728. {
  729. Engrp[i]='F';
  730. }
  731. else
  732. {
  733. Engrp[i]='V';
  734. }
  735. }
  736.  
  737.  
  738.  
  739.  
  740.  
  741.  
  742.  
  743.  
  744. //Affichage du menu
  745. printf("||");
  746. for(i=1;i<=115;i++)
  747. {
  748. printf("-");
  749. }
  750. printf("|| ");
  751. printf("||");
  752. for(i=1;i<=115;i++)
  753. {
  754. printf("-");
  755. }
  756. printf("|| ");
  757. printf("||");
  758. for(i=1;i<=26;i++)
  759. {
  760. printf("-");
  761. }
  762. printf("BIENVENUE DANS LE MENU DE LA GESTION DES VOYAGES DE L'AGENCE");
  763. for(i=1;i<=29;i++)
  764. {
  765. printf("-");
  766. }
  767. printf("||\n");
  768. printf("||");
  769. for(i=1;i<=115;i++)
  770. {
  771. printf("-");
  772. }
  773. printf("|| ");
  774. printf("||");
  775. for(i=1;i<=115;i++)
  776. {
  777. printf("-");
  778. }
  779. printf("|| ");
  780. printf("||");
  781. for(i=1;i<=45;i++)
  782. {
  783. printf("-");
  784. }
  785.  
  786. printf("Veuillez choisir une action");
  787. for(i=1;i<=43;i++)
  788. {
  789. printf("-");
  790. }
  791. printf("|| ");
  792. printf("||");
  793. for(i=1;i<=115;i++)
  794. {
  795. printf("-");
  796. }
  797. printf("|| ");
  798.  
  799. printf("||");
  800. for(i=1;i<=42;i++)
  801. {
  802. printf(" ");
  803. }
  804. printf("1. Afficher tous les voyages");
  805. for(i=1;i<=45;i++)
  806. {
  807. printf(" ");
  808. }
  809. printf("|| ");
  810. printf("||");
  811. for(i=1;i<=42;i++)
  812. {
  813. printf(" ");
  814. }
  815. printf("2. Rechercher les voyages d'un client");
  816. for(i=1;i<=36;i++)
  817. {
  818. printf(" ");
  819. }
  820. printf("|| ");
  821. printf("||");
  822. for(i=1;i<=42;i++)
  823. {
  824. printf(" ");
  825. }
  826. printf("3. Supprimer un voyage");
  827. for(i=1;i<=51;i++)
  828. {
  829. printf(" ");
  830. }
  831. printf("|| ");
  832. printf("||");
  833. for(i=1;i<=42;i++)
  834. {
  835. printf(" ");
  836. }
  837. printf("4. Modifier la date d'un voyage");
  838. for(i=1;i<=42;i++)
  839. {
  840. printf(" ");
  841. }
  842. printf("|| ");
  843. printf("||");
  844. for(i=1;i<=42;i++)
  845. {
  846. printf(" ");
  847. }
  848. printf("5. Afficher les voyages vers chaque pays");
  849. for(i=1;i<=33;i++)
  850. {
  851. printf(" ");
  852. }
  853. printf("|| ");
  854. printf("||");
  855. for(i=1;i<=115;i++)
  856. {
  857. printf("-");
  858. }
  859. printf("|| ");
  860.  
  861. printf("||");
  862. for(i=1;i<=41;i++)
  863. {
  864. printf("=");
  865. }
  866. printf(" ****** Ajouter un voyage ****** ");
  867. for(i=1;i<=41;i++)
  868. {
  869. printf("=");
  870. }
  871. printf("||\n");
  872. printf("||");
  873. for(i=1;i<=115;i++)
  874. {
  875. printf("-");
  876. }
  877. printf("|| ");
  878. printf("||");
  879. for(i=1;i<=42;i++)
  880. {
  881. printf(" ");
  882. }
  883. printf("6. Voyage d'un seul client");
  884. for(i=1;i<=47;i++)
  885. {
  886. printf(" ");
  887. }
  888. printf("||\n");
  889. printf("||");
  890. for(i=1;i<=42;i++)
  891. {
  892. printf(" ");
  893. }
  894. printf("7. Voyage organise");
  895. for(i=1;i<=55;i++)
  896. {
  897. printf(" ");
  898. }
  899. printf("||\n");
  900. printf("||");
  901. for(i=1;i<=115;i++)
  902. {
  903. printf("-");
  904. }
  905. printf("|| ");
  906. printf("||");
  907. for(i=1;i<=115;i++)
  908. {
  909. printf("-");
  910. }
  911. printf("|| ");
  912. printf("||");
  913. for(i=1;i<=42;i++)
  914. {
  915. printf(" ");
  916. }
  917. printf("8. Tirage au sort du gagnant");
  918. for(i=1;i<=45;i++)
  919. {
  920. printf(" ");
  921. }
  922. printf("||\n");
  923. printf("||");
  924. for(i=1;i<=115;i++)
  925. {
  926. printf("-");
  927. }
  928. printf("|| ");
  929. printf("||");
  930. for(i=1;i<=42;i++)
  931. {
  932. printf(" ");
  933. }
  934. printf("9. RETOUR AU MENU PRINCIPAL");
  935. for(i=1;i<=46;i++)
  936. {
  937. printf(" ");
  938. }
  939. printf("||\n");
  940. printf("||");
  941. for(i=1;i<=42;i++)
  942. {
  943. printf(" ");
  944. }
  945. printf("10. QUITTER L'APPLICATION");
  946. for(i=1;i<=48;i++)
  947. {
  948. printf(" ");
  949. }
  950. printf("||\n");
  951. printf("||");
  952. for(i=1;i<=115;i++)
  953. {
  954. printf("-");
  955. }
  956. printf("|| ");
  957. printf("||");
  958. for(i=1;i<=115;i++)
  959. {
  960. printf("-");
  961. }
  962. printf("|| ");
  963. //saisie du choix d'après le menu
  964. do{
  965. printf("Entrez votre choix :");
  966. scanf("%d",&choix);
  967. }while((choix<1)||(choix>10));
  968. system("cls");
  969.  
  970. switch (choix)
  971. {
  972. case 1 :
  973. {
  974.  
  975. AfficheVoyage(n,Idreser,Numpass,Nomvoy,Datenaissv,Datedep,Datear,Villedest,Paysdest,Engrp,Numgrp);
  976. printf("\n1. RETOUR AU MENU PRINCIPAL\n");
  977. printf("2. QUITTER LE PROGRAMME\n");
  978. do{
  979. printf("Donner votre choix : ");
  980. scanf("%d",&choix);
  981. }while((choix<1)||(choix>2));
  982. if(choix==1)
  983. {
  984. system("cls");
  985. gestion();
  986. }else
  987. {
  988. system("cls");
  989. return 0;
  990. }
  991. }
  992. break;
  993. case 2 :{
  994. recherchev(n,Idreser,Numpass,Nomvoy,Datenaissv,Datedep,Datear,Villedest,Paysdest,Engrp,Numgrp);
  995. printf("\n1. RETOUR AU MENU PRINCIPAL\n");
  996. printf("2. QUITTER LE PROGRAMME\n");
  997. do{
  998. printf("Donner votre choix : ");
  999. scanf("%d",&choix);
  1000. }while((choix<1)||(choix>2));
  1001. if(choix==1)
  1002. {
  1003. system("cls");
  1004. gestion();
  1005. }else
  1006. {
  1007. system("cls");
  1008. return 0;
  1009. }
  1010. }
  1011. break;
  1012. case 3 :
  1013. {
  1014. suppression(n,Idreser,Numpass,Nomvoy,Datenaissv,Datedep,Datear,Villedest,Paysdest,Engrp,Numgrp);
  1015. printf("\n1. RETOUR AU MENU PRINCIPAL\n");
  1016. printf("2. QUITTER LE PROGRAMME\n");
  1017. do{
  1018. printf("Donner votre choix : ");
  1019. scanf("%d",&choix);
  1020. }while((choix<1)||(choix>2));
  1021. if(choix==1)
  1022. {
  1023. system("cls");
  1024. gestion();
  1025. }else
  1026. {
  1027. system("cls");
  1028. return 0;
  1029. }
  1030. }
  1031. break;
  1032. case 4 :
  1033. {
  1034. retarderV(n,Idreser,Numpass,Nomvoy,Datenaissv,Datedep,Datear,Villedest,Paysdest,Engrp,Numgrp);
  1035. printf("\n1. RETOUR AU MENU PRINCIPAL\n");
  1036. printf("2. QUITTER LE PROGRAMME\n");
  1037. do{
  1038. printf("Donner votre choix : ");
  1039. scanf("%d",&choix);
  1040. }while((choix<1)||(choix>2));
  1041. if(choix==1)
  1042. {
  1043. system("cls");
  1044. gestion();
  1045. }else
  1046. {
  1047. system("cls");
  1048. return 0;
  1049. }
  1050. }
  1051. break;
  1052. case 5 :
  1053. {
  1054. listevoy(n,Idreser,Numpass,Nomvoy,Datenaissv,Datedep,Datear,Villedest,Paysdest,Engrp,Numgrp);
  1055. printf("\n1. RETOUR AU MENU PRINCIPAL\n");
  1056. printf("2. QUITTER LE PROGRAMME\n");
  1057. do{
  1058. printf("Donner votre choix : ");
  1059. scanf("%d",&choix);
  1060. }while((choix<1)||(choix>2));
  1061. if(choix==1)
  1062. {
  1063. system("cls");
  1064. gestion();
  1065. }else
  1066. {
  1067. system("cls");
  1068. return 0;
  1069. }
  1070. }
  1071. break;
  1072. case 6 :
  1073. {
  1074. ajoutseul(n,Idreser,Numpass,Nomvoy,Datenaissv,Datedep,Datear,Villedest,Paysdest,Engrp,Numgrp);
  1075. printf("\n1. RETOUR AU MENU PRINCIPAL\n");
  1076. printf("2. QUITTER LE PROGRAMME\n");
  1077. do{
  1078. printf("Donner votre choix : ");
  1079. scanf("%d",&choix);
  1080. }while((choix<1)||(choix>2));
  1081. if(choix==1)
  1082. {
  1083. system("cls");
  1084. gestion();
  1085. }else
  1086. {
  1087. system("cls");
  1088. return 0;
  1089. }
  1090.  
  1091. }
  1092. break;
  1093. case 7 :;
  1094. case 8 :;
  1095. case 9 :{
  1096. main();
  1097. }
  1098. break;
  1099. case 10 : return 0;
  1100. }
  1101. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement