/* ====================================================== */ /* proboles.h */ /* ====================================================== */ /* ====================================================== */ /* Sunartish epiloghs tupou probolhs */ /* ====================================================== */ void probolh(){ char choice; int flag = 0; system(clear_screen); printf(".-------------| Probolh |-------------.\n"); printf("| |\n"); printf("| 1. Probolh tou arxeiou index |\n"); printf("| 2. Probolh olwn |\n"); printf("| 3. Probolh ana eidos |\n"); printf("| 4. Probolh ana eidos k diathesimot |\n"); printf("| 5. Probolh ana titlo taksinomimena |\n"); printf("| 6. Epistrofh |\n"); printf("| |\n"); printf("|-------------------------------------'\n"); printf("| Epilogh : |\n"); printf("'-------------------------------------'\n"); do{ choice = getchar(); switch(choice){ case '1': probolh_index(); break; case '2': probolh_all(); break; case '3': prob_genre(select_genre()); break; case '4': prob_gen_av(select_genre()); break; case '5': prob_titl_taksin(); break; case '6': return; default : printf("\nLathos epilogh, ksanaprospathise\n"); flag = 1; getchar(); } }while(flag == 1); } /* ====================================================== */ /* Sunartish probolhs mias eggrafhs pairnontas ws */ /* parametro th dieuthunsh ths eggrafhs sto master arxeio */ /* ====================================================== */ void probolh_one(int deiktis){ dataf = fopen(oad, "rb"); fseek(dataf, deiktis * sizeof(struct tenies), SEEK_SET); fread(&film, sizeof(struct tenies), 1, dataf); fclose(dataf); printf("\n.-------------| Probolh |-------------.\n"); printf("| |\n"); printf("| Kwdikos tenias : "); printf("%s\n", film.code); printf("| Titlos tenias : "); printf("%s\n", film.title); printf("| Eidos tenias : "); printf("%s\n", film.genre); printf("| Skhnotheths : "); printf("%s\n", film.director); printf("| Protagwnisths 1 : "); printf("%s\n", film.actor1); printf("| Protagwnisths 2 : "); printf("%s\n", film.actor2); printf("| Etos tenias : "); printf("%d\n", film.year); printf("| Diatheshmothta : "); printf("%d\n", film.avail); printf("| |\n"); printf("'-------------------------------------'\n"); } /* ====================================================== */ /* Sunartish probolhs tou index arxeiou */ /* ====================================================== */ void probolh_index(){ struct teniesIndex temp; int i, pl = check_files(); if (pl == 0) { printf("\n\nTo arxeio einai adeio...\n\n"); getchar(); return; } indexf = fopen(oai, "rb"); fseek(indexf, 0, SEEK_SET); printf("\n.---------| Probolh index |---------.\n"); printf("| |\n"); for (i=0; i %d \n", temp.code, temp.dief); } printf("| |\n"); printf("'-------------------------------------'\n"); fclose(indexf); } /* ====================================================== */ /* Sunartish probolhs twn eggrafwn apo to master arxeio */ /* ====================================================== */ void probolh_all(){ int i, pl = check_files(); if (pl == 0) { printf("\n\nTo arxeio einai adeio...\n\n"); getchar(); return; } dataf = fopen(oad, "rb"); printf(".-----------| Probolh olwn|----------.\n"); printf("| |\n"); for (i=0;i