//PROYECTO DE PROGRAMACION //BIBLIOTECAS EMPLEADAS #include #include #include #include #include //DECLARACION DE FUNCIONES typedef union guarda{ char matriz1[4]; char matriz2[74]; } OPCION; OPCION cap; void captura(int tam, char intochar, OPCION cap,char nombre[20]); void recuadro(int x,int y,int x1,int y1,int o); void dibujaeleccion(int opcion); void dibujasubmenu1(int opcion); void alumnos(int subopcion,int subopcion1,int subopcion2); void menu(); //VARIABLES GLOBALES typedef struct reg { char apellido_alumno[20]; char nombre_alumno[15]; int n_matricula; char nombre_asig[16][3]; char estado_asig[16][3]; int notas[16]; int fj[16]; int fn[16]; } ALUMNO_E3; typedef struct reg1{ char apellido_alumno[20]; char nombre_alumno[15]; int n_matricula; char nombre_asig[21][3]; char estado_asig[21][3]; int notas[21]; int fj[21]; int fn[21]; } ALUMNO_E4; typedef struct reg2{ char apellido_alumno[20]; char nombre_alumno[15]; int n_matricula; char nombre_asig[15][3]; char estado_asig[15][3]; int notas[15]; int fj[15]; int fn[15]; } ALUMNO_B1; typedef struct reg3{ char apellido_alumno[20]; char nombre_alumno[15]; int n_matricula; char nombre_asig[18][3]; char estado_asig[18][3]; int notas[18]; int fj[18]; int fn[18]; } ALUMNO_B2; typedef struct reg4{ char apellido_alumno[20]; char nombre_alumno[15]; int n_matricula; char nombre_asig[4][3]; char estado_asig[4][3]; int notas[4]; int fj[4]; int fn[4]; } ALUMNO_C1; typedef struct reg5{ char apellido_alumno[20]; char nombre_alumno[15]; int n_matricula; char nombre_asig[5][3]; char estado_asig[5][3]; int notas[5]; int fj[5]; int fn[5]; } ALUMNO_C2; char ESO3[16][3]={"CN","CS","EF","PM","LC","I1","F1","MA","TE","RE","AE","I2", "F2","EC","PC","TA"}; char ESO4[21][3]={"FQ","CN","CS","VM","EF","EP","LC","I1","F1","MA","MU","TE", "RE","AE","I2","F2","CC","OE","IA","TX","IC"}; char BCN1[15][3]={"LC","I1","F1","FL","EF","RE","AR","BG","FQ","MA","I1","F2", "MC","IA","EC"}; char BCN2[18][3]={"LC","I1","F1","HI","RE","AR","DI","FI","MA","BI","CI","QU", "I2","F2","ES","GE","BC","HP"}; char CFGS1[4][3]={"SI","AD","PL","IA"}; char CFGS2[5][3]={"DA","DR","RE","FO","PF"}; char busca[1][3]; //FUNCION PRINCIPAL void main() { int a=0,opcion=1; textbackground(0); _setcursortype(_NOCURSOR); menu(); while(opcion!=6||a!=7181) { dibujaeleccion(opcion); if(a==7181) dibujasubmenu1(opcion); a=bioskey(0); if(a==19712) opcion++; if(a==19200) opcion--; if(opcion==0) opcion=6; if(opcion==7) opcion=1; } clrscr(); } /////////////////////////////////FUNCIONES/////////////////////////////////// //DIBUJA EL INTERFAZ GENERAL void menu() { clrscr(); textattr(LIGHTGRAY); recuadro(2,2,79,24,1); recuadro(2,1,79,1,0); recuadro(2,25,79,25,0); } //DIBUJA LA ELECCION DE MENU GENERAL void dibujaeleccion(int opcion) { //clrscr(); textcolor(LIGHTGRAY); textattr(127); gotoxy(3,1); cprintf("ALUMNOS CALIFICACIONES Y FALTAS BOLETINES ACTA DE E. SESION DE E. FINALIZAR"); gotoxy(3,25); cprintf("F1 ayuda"); textattr(LIGHTGRAY); switch(opcion) { case 1:gotoxy(3,1);cprintf("ALUMNOS");break; case 2:gotoxy(11,1);cprintf("CALIFICACIONES Y FALTAS");break; case 3:gotoxy(35,1);cprintf("BOLETINES");break; case 4:gotoxy(45,1);cprintf("ACTA DE E.");break; case 5:gotoxy(56,1);cprintf("SESION DE E.");break; case 6:gotoxy(69,1);cprintf("FINALIZAR");break; } } //DIBUJA SUBMENUS void dibujasubmenu1(int opcion) { int a=0,subopcion=1,subopcion1=1,subopcion2=1; recuadro(30,8,50,16,2); while(a!=7181) { textattr(127); gotoxy(38,9); cprintf("E.S.O."); gotoxy(38,12); cprintf("B.C.N."); gotoxy(37,15); cprintf("C.F.G.S."); textattr(LIGHTGRAY); switch(subopcion) { case 1:gotoxy(38,9);cprintf("E.S.O.");break; case 2:gotoxy(38,12);cprintf("B.C.N.");break; case 3:gotoxy(37,15);cprintf("C.F.G.S.");break; } a=bioskey(0); if(a==20480) subopcion++; if(a==18432) subopcion--; if(subopcion==0) subopcion=3; if(subopcion==4) subopcion=1; } a=0; recuadro(52,8,72,16,2); switch(subopcion) { case 1: while(a!=7181) { textattr(127); gotoxy(58,9);cprintf("3§E.S.O. A"); gotoxy(58,11);cprintf("3§E.S.O. B"); gotoxy(58,13);cprintf("4§E.S.O. A"); gotoxy(58,15);cprintf("4§E.S.O. B"); textattr(LIGHTGRAY); switch(subopcion1) { case 1: gotoxy(58,9);cprintf("3§E.S.O. A");break; case 2: gotoxy(58,11);cprintf("3§E.S.O. B");break; case 3: gotoxy(58,13);cprintf("4§E.S.O. A");break; case 4: gotoxy(58,15);cprintf("4§E.S.O. B");break; } a=bioskey(0); if(a==20480) subopcion1++; if(a==18432) subopcion1--; if(subopcion1==0) subopcion1=4; if(subopcion1==5) subopcion1=1; } break; case 2: while(a!=7181) { textattr(127); gotoxy(58,9);cprintf("1§B.C.N. A"); gotoxy(58,11);cprintf("1§B.C.N. B"); gotoxy(58,13);cprintf("2§B.C.N. A"); gotoxy(58,15);cprintf("2§B.C.N. B"); textattr(LIGHTGRAY); switch(subopcion1) { case 1: gotoxy(58,9);cprintf("1§B.C.N. A");break; case 2: gotoxy(58,11);cprintf("1§B.C.N. B");break; case 3: gotoxy(58,13);cprintf("2§B.C.N. A");break; case 4: gotoxy(58,15);cprintf("2§B.C.N. B");break; } a=bioskey(0); if(a==20480) subopcion1++; if(a==18432) subopcion1--; if(subopcion1==0) subopcion1=4; if(subopcion1==5) subopcion1=1; } break; case 3: while(a!=7181) { textattr(127); gotoxy(56,10);cprintf("1§C.F.G.S. A"); gotoxy(56,12);cprintf("1§C.F.G.S. B"); gotoxy(56,14);cprintf("2§C.F.G.S. "); textattr(LIGHTGRAY); switch(subopcion1) { case 1: gotoxy(56,10);cprintf("1§C.F.G.S. A");break; case 2: gotoxy(56,12);cprintf("1§C.F.G.S. B");break; case 3: gotoxy(56,14);cprintf("2§C.F.G.S. ");break; } a=bioskey(0); if(a==20480) subopcion1++; if(a==18432) subopcion1--; if(subopcion1==0) subopcion1=3; if(subopcion1==4) subopcion1=1; } break; } //getch(); textattr(LIGHTGRAY); recuadro(20,6,73,20,1); a=0; switch(opcion) { case 1:recuadro(3,3,14,6,2); while(a!=7181) { textattr(127); gotoxy(4,4);cprintf("INTRODUCIR"); gotoxy(4,5);cprintf("VISUALIZAR"); textattr(LIGHTGRAY); switch(subopcion2) { case 1: gotoxy(4,4);cprintf("INTRODUCIR");break; case 2: gotoxy(4,5);cprintf("VISUALIZAR");break; } a=bioskey(0); if(a==20480) subopcion2++; if(a==18432) subopcion2--; if(subopcion2==0) subopcion2=2; if(subopcion2==3) subopcion2=1; } alumnos(subopcion,subopcion1,subopcion2); textattr(LIGHTGRAY);recuadro(3,3,15,7,1); break; case 2:recuadro(11,3,33,6,2); while(a!=7181) { textattr(127); gotoxy(17,4);cprintf("EVALUACIONES"); gotoxy(17,5);cprintf("FINAL DE E."); textattr(LIGHTGRAY); switch(subopcion2) { case 1: gotoxy(17,4);cprintf("EVALUACIONES");break; case 2: gotoxy(17,5);cprintf("FINAL DE E.");break; } a=bioskey(0); if(a==20480) subopcion2++; if(a==18432) subopcion2--; if(subopcion2==0) subopcion2=2; if(subopcion2==3) subopcion2=1; } textattr(LIGHTGRAY);recuadro(11,3,34,7,1); break; } } //FUNCION PARA CREAR UN RECUADRO EN LAS COORDENADAS INDICADAS void recuadro(int x,int y,int x1,int y1,int o) { int a,b; for(a=x;a!=x1+1;a++) for(b=y;b!=y1+1;b++) { gotoxy(a,b); if(o==0||o==2) cprintf("Û"); else cprintf("²"); } if(o==2) { textattr(0); for(a=y+1;a