First commit 16/08/1996
This commit is contained in:
885
C.CPP
Normal file
885
C.CPP
Normal file
@ -0,0 +1,885 @@
|
||||
//PROYECTO DE PROGRAMACION
|
||||
//BIBLIOTECAS EMPLEADAS
|
||||
#include<stdio.h>
|
||||
#include<bios.h>
|
||||
#include<conio.h>
|
||||
#include<string.h>
|
||||
#include<ctype.h>
|
||||
//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<EFBFBD>E.S.O. A");
|
||||
gotoxy(58,11);cprintf("3<EFBFBD>E.S.O. B");
|
||||
gotoxy(58,13);cprintf("4<EFBFBD>E.S.O. A");
|
||||
gotoxy(58,15);cprintf("4<EFBFBD>E.S.O. B");
|
||||
textattr(LIGHTGRAY);
|
||||
switch(subopcion1)
|
||||
{
|
||||
case 1: gotoxy(58,9);cprintf("3<EFBFBD>E.S.O. A");break;
|
||||
case 2: gotoxy(58,11);cprintf("3<EFBFBD>E.S.O. B");break;
|
||||
case 3: gotoxy(58,13);cprintf("4<EFBFBD>E.S.O. A");break;
|
||||
case 4: gotoxy(58,15);cprintf("4<EFBFBD>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<EFBFBD>B.C.N. A");
|
||||
gotoxy(58,11);cprintf("1<EFBFBD>B.C.N. B");
|
||||
gotoxy(58,13);cprintf("2<EFBFBD>B.C.N. A");
|
||||
gotoxy(58,15);cprintf("2<EFBFBD>B.C.N. B");
|
||||
textattr(LIGHTGRAY);
|
||||
switch(subopcion1)
|
||||
{
|
||||
case 1: gotoxy(58,9);cprintf("1<EFBFBD>B.C.N. A");break;
|
||||
case 2: gotoxy(58,11);cprintf("1<EFBFBD>B.C.N. B");break;
|
||||
case 3: gotoxy(58,13);cprintf("2<EFBFBD>B.C.N. A");break;
|
||||
case 4: gotoxy(58,15);cprintf("2<EFBFBD>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<EFBFBD>C.F.G.S. A");
|
||||
gotoxy(56,12);cprintf("1<EFBFBD>C.F.G.S. B");
|
||||
gotoxy(56,14);cprintf("2<EFBFBD>C.F.G.S. ");
|
||||
textattr(LIGHTGRAY);
|
||||
switch(subopcion1)
|
||||
{
|
||||
case 1: gotoxy(56,10);cprintf("1<EFBFBD>C.F.G.S. A");break;
|
||||
case 2: gotoxy(56,12);cprintf("1<EFBFBD>C.F.G.S. B");break;
|
||||
case 3: gotoxy(56,14);cprintf("2<EFBFBD>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("<EFBFBD>");
|
||||
else cprintf("<EFBFBD>");
|
||||
}
|
||||
if(o==2)
|
||||
{
|
||||
textattr(0);
|
||||
for(a=y+1;a<y1+2;a++)
|
||||
{
|
||||
gotoxy(x1+1,a);
|
||||
cprintf("<EFBFBD>");
|
||||
}
|
||||
for(a=x+1;a<x1+1;a++)
|
||||
{
|
||||
gotoxy(a,y1+1);
|
||||
cprintf("<EFBFBD>");
|
||||
}
|
||||
}
|
||||
}
|
||||
/////////////////////////////FUNCION DE ALUMNOS//////////////////////////////
|
||||
void alumnos(int subopcion,int subopcion1,int subopcion2)
|
||||
{
|
||||
//OPCION cap;
|
||||
char nombre[9],nombreb[20];
|
||||
int y=0;
|
||||
int o,i;
|
||||
FILE *eso3a,*eso3b,*eso4a,*eso4b,*bcn1a,*bcn1b,*bcn2a,*bcn2b;
|
||||
FILE *cfgs1a,*cfgs1b,*cfgs2;
|
||||
ALUMNO_E3 reg;ALUMNO_E3 busca;
|
||||
ALUMNO_E4 reg1;ALUMNO_E4 busca1;
|
||||
ALUMNO_B1 reg2;ALUMNO_B1 busca2;
|
||||
ALUMNO_B2 reg3;ALUMNO_B2 busca3;
|
||||
ALUMNO_C1 reg4;ALUMNO_C1 busca4;
|
||||
ALUMNO_C2 reg5;ALUMNO_C2 busca5;
|
||||
eso3a=fopen("eso3a.dat","a+b");
|
||||
eso3b=fopen("eso3b.dat","a+b");
|
||||
eso4a=fopen("eso4a.dat","a+b");
|
||||
eso4b=fopen("eso4b.dat","a+b");
|
||||
bcn1a=fopen("bcn1a.dat","a+b");
|
||||
bcn1b=fopen("bcn1b.dat","a+b");
|
||||
bcn2a=fopen("bcn2a.dat","a+b");
|
||||
bcn2b=fopen("bcn2b.dat","a+b");
|
||||
cfgs1a=fopen("cfgs1a.dat","a+b");
|
||||
cfgs1b=fopen("cfgs1b.dat","a+b");
|
||||
cfgs2=fopen("cfgs2.dat","a+b");
|
||||
recuadro(16,3,40,23,2);
|
||||
textattr(127);
|
||||
gotoxy(17,3);
|
||||
cprintf("NOMBRE:");
|
||||
gotoxy(24,3);
|
||||
captura(9,'c',cap,nombre);
|
||||
strcpy(reg.nombre_alumno,nombre);
|
||||
strcpy(reg1.nombre_alumno,nombre);
|
||||
strcpy(reg2.nombre_alumno,nombre);
|
||||
strcpy(reg3.nombre_alumno,nombre);
|
||||
strcpy(reg4.nombre_alumno,nombre);
|
||||
strcpy(reg5.nombre_alumno,nombre);
|
||||
if(subopcion2==1) //mete datos
|
||||
{
|
||||
switch(subopcion) //dibuja asignaturas
|
||||
{
|
||||
case 1://ALUMNOS DE ESO
|
||||
if(subopcion1==1||subopcion1==2)
|
||||
{
|
||||
for(y=6;y<22;y++)
|
||||
{
|
||||
gotoxy(19,y);
|
||||
if(y<13) cprintf("%s:",ESO3[y-6]);
|
||||
else if(y<15) cprintf("%i.-%s:",y-12,ESO3[y-6]);
|
||||
else if(y<17) cprintf("%i.-%s:",y-14,ESO3[y-6]);
|
||||
else cprintf("%i.-%s:",y-16,ESO3[y-6]);
|
||||
}
|
||||
}
|
||||
else
|
||||
for(y=4;y<24;y++)
|
||||
{
|
||||
gotoxy(19,y);
|
||||
if(y<8) cprintf("%s:",ESO4[y-4]);
|
||||
else if(y<13) cprintf("%i.-%s:",y-7,ESO4[y-4]);
|
||||
else if(y<15) cprintf("%i.-%s:",y-12,ESO4[y-4]);
|
||||
else if(y<17) cprintf("%i.-%s:",y-14,ESO4[y-4]);
|
||||
else cprintf("%i.-%s:",y-16,ESO4[y-4]);
|
||||
}
|
||||
|
||||
break;
|
||||
case 2://ALUMNOS DE BCN
|
||||
if(subopcion1==1||subopcion1==2)
|
||||
{
|
||||
for(y=7;y<22;y++)
|
||||
{
|
||||
gotoxy(19,y);
|
||||
if(y<13) cprintf("%s:",BCN1[y-7]);
|
||||
else if(y<15) cprintf("%i.-%s:",y-12,BCN1[y-7]);
|
||||
else if(y<17) cprintf("%i.-%s:",y-14,BCN1[y-7]);
|
||||
else cprintf("%i.-%s:",y-16,BCN1[y-7]);
|
||||
}
|
||||
}
|
||||
else
|
||||
for(y=5;y<23;y++)
|
||||
{
|
||||
gotoxy(19,y);
|
||||
if(y<7) cprintf("%s:",BCN2[y-5]);
|
||||
else if(y<9) cprintf("%i.-%s:",y-6,BCN2[y-5]);
|
||||
else if(y<11) cprintf("%i.-%s:",y-8,BCN2[y-5]);
|
||||
else if(y<13) cprintf("%i.-%s:",y-10,BCN2[y-5]);
|
||||
else cprintf("%i.-%s:",y-12,BCN2[y-5]);
|
||||
}
|
||||
|
||||
break;
|
||||
case 3://ALUMNOS DE CFGS
|
||||
if(subopcion1==1||subopcion1==2)
|
||||
{
|
||||
for(y=12;y<16;y++)
|
||||
{
|
||||
gotoxy(19,y);cprintf("%s:",CFGS1[y-12]);
|
||||
}
|
||||
}
|
||||
else
|
||||
for(y=11;y<16;y++)
|
||||
{
|
||||
gotoxy(19,y);cprintf("%s:",CFGS2[y-11]);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
//METE DATOS
|
||||
gotoxy(2,25);
|
||||
cprintf("RETURN[Asignatura Obligatoria],ESPACIO[Asignatura Convalidada]");
|
||||
switch(subopcion)
|
||||
{
|
||||
case 1://ALUMNOS DE ESO
|
||||
switch(subopcion1)
|
||||
{
|
||||
case 1:
|
||||
for(y=6;y<22;y++)
|
||||
{
|
||||
if(y<13) gotoxy(22,y);
|
||||
else gotoxy(25,y);
|
||||
o=bioskey(0);
|
||||
if(o==14624)
|
||||
{
|
||||
cprintf("AV");
|
||||
strcpy(reg.estado_asig[y-6],"AV");
|
||||
}
|
||||
if(o==7181)
|
||||
{
|
||||
cprintf("AO");
|
||||
strcpy(reg.estado_asig[y-6],"AO");
|
||||
}
|
||||
strcpy(reg.nombre_asig[y-6],ESO3[y-6]);
|
||||
}
|
||||
fwrite(®,sizeof(ALUMNO_E3),1,eso3a);
|
||||
break;
|
||||
case 2:
|
||||
for(y=6;y<22;y++)
|
||||
{
|
||||
if(y<13) gotoxy(22,y);
|
||||
else gotoxy(25,y);
|
||||
o=bioskey(0);
|
||||
if(o==14624)
|
||||
{
|
||||
cprintf("AV");
|
||||
strcpy(reg.estado_asig[y-6],"AV");
|
||||
}
|
||||
if(o==7181)
|
||||
{
|
||||
cprintf("AO");
|
||||
strcpy(reg.estado_asig[y-6],"AO");
|
||||
}
|
||||
strcpy(reg.nombre_asig[y-6],ESO3[y-6]);
|
||||
}
|
||||
fwrite(®,sizeof(ALUMNO_E3),1,eso3b);
|
||||
break;
|
||||
case 3:
|
||||
for(y=4;y<24;y++)
|
||||
{
|
||||
if(y<8) gotoxy(22,y);
|
||||
else gotoxy(25,y);
|
||||
o=bioskey(0);
|
||||
if(o==14624)
|
||||
{
|
||||
cprintf("AV");
|
||||
strcpy(reg1.estado_asig[y-4],"AV");
|
||||
}
|
||||
if(o==7181)
|
||||
{
|
||||
cprintf("AO");
|
||||
strcpy(reg1.estado_asig[y-4],"AO");
|
||||
}
|
||||
strcpy(reg1.nombre_asig[y-4],ESO4[y-4]);
|
||||
}
|
||||
fwrite(®1,sizeof(ALUMNO_E4),1,eso4a);
|
||||
break;
|
||||
case 4:
|
||||
for(y=4;y<24;y++)
|
||||
{
|
||||
if(y<8) gotoxy(22,y);
|
||||
else gotoxy(25,y);
|
||||
o=bioskey(0);
|
||||
if(o==14624)
|
||||
{
|
||||
cprintf("AV");
|
||||
strcpy(reg1.estado_asig[y-4],"AV");
|
||||
}
|
||||
if(o==7181)
|
||||
{
|
||||
cprintf("AO");
|
||||
strcpy(reg1.estado_asig[y-4],"AO");
|
||||
}
|
||||
strcpy(reg1.nombre_asig[y-4],ESO4[y-4]);
|
||||
}
|
||||
fwrite(®1,sizeof(ALUMNO_E4),1,eso4b);
|
||||
}
|
||||
break;
|
||||
case 2://ALUMNOS DE BCN
|
||||
switch(subopcion1)
|
||||
{
|
||||
case 1:
|
||||
for(y=7;y<22;y++)
|
||||
{
|
||||
if(y<13) gotoxy(22,y);
|
||||
else gotoxy(25,y);
|
||||
o=bioskey(0);
|
||||
if(o==14624)
|
||||
{
|
||||
cprintf("AV");
|
||||
strcpy(reg2.estado_asig[y-7],"AV");
|
||||
}
|
||||
if(o==7181)
|
||||
{
|
||||
cprintf("AO");
|
||||
strcpy(reg2.estado_asig[y-7],"AO");
|
||||
}
|
||||
strcpy(reg2.nombre_asig[y-7],BCN1[y-7]);
|
||||
}
|
||||
fwrite(®2,sizeof(ALUMNO_B1),1,bcn1a);
|
||||
break;
|
||||
case 2:
|
||||
for(y=7;y<22;y++)
|
||||
{
|
||||
if(y<13) gotoxy(22,y);
|
||||
else gotoxy(25,y);
|
||||
o=bioskey(0);
|
||||
if(o==14624)
|
||||
{
|
||||
cprintf("AV");
|
||||
strcpy(reg2.estado_asig[y-7],"AV");
|
||||
}
|
||||
if(o==7181)
|
||||
{
|
||||
cprintf("AO");
|
||||
strcpy(reg2.estado_asig[y-7],"AO");
|
||||
}
|
||||
strcpy(reg2.nombre_asig[y-7],BCN1[y-7]);
|
||||
}
|
||||
fwrite(®2,sizeof(ALUMNO_B1),1,bcn1b);
|
||||
break;
|
||||
case 3:
|
||||
for(y=5;y<23;y++)
|
||||
{
|
||||
if(y<7) gotoxy(22,y);
|
||||
else gotoxy(25,y);
|
||||
gotoxy(22,y);
|
||||
if(o==14624)
|
||||
{
|
||||
cprintf("AV");
|
||||
strcpy(reg3.estado_asig[y-5],"AV");
|
||||
}
|
||||
if(o==7181)
|
||||
{
|
||||
cprintf("AO");
|
||||
strcpy(reg3.estado_asig[y-5],"AO");
|
||||
}
|
||||
strcpy(reg3.nombre_asig[y-5],BCN2[y-5]);
|
||||
}
|
||||
fwrite(®3,sizeof(ALUMNO_B2),1,bcn2a);
|
||||
break;
|
||||
case 4:
|
||||
for(y=5;y<23;y++)
|
||||
{
|
||||
if(y<7) gotoxy(22,y);
|
||||
else gotoxy(25,y);
|
||||
o=bioskey(0);
|
||||
if(o==14624)
|
||||
{
|
||||
cprintf("AV");
|
||||
strcpy(reg3.estado_asig[y-5],"AV");
|
||||
}
|
||||
if(o==7181)
|
||||
{
|
||||
cprintf("AO");
|
||||
strcpy(reg3.estado_asig[y-5],"AO");
|
||||
}
|
||||
strcpy(reg3.nombre_asig[y-5],BCN2[y-5]);
|
||||
}
|
||||
fwrite(®3,sizeof(ALUMNO_B2),1,bcn2b);
|
||||
}
|
||||
break;
|
||||
case 3://ALUMNOS DE CFGS
|
||||
switch(subopcion1)
|
||||
{
|
||||
case 1:
|
||||
for(y=12;y<16;y++)
|
||||
{
|
||||
gotoxy(22,y);
|
||||
o=bioskey(0);
|
||||
if(o==14624)
|
||||
{
|
||||
cprintf("AV");
|
||||
strcpy(reg4.estado_asig[y-12],"AV");
|
||||
}
|
||||
if(o==7181)
|
||||
{
|
||||
cprintf("AO");
|
||||
strcpy(reg4.estado_asig[y-12],"AO");
|
||||
}
|
||||
strcpy(reg4.nombre_asig[y-12],CFGS1[y-12]);
|
||||
}
|
||||
fwrite(®4,sizeof(ALUMNO_C1),1,cfgs1a);
|
||||
break;
|
||||
case 2:
|
||||
for(y=12;y<16;y++)
|
||||
{
|
||||
gotoxy(22,y);
|
||||
o=bioskey(0);
|
||||
if(o==14624)
|
||||
{
|
||||
cprintf("AV");
|
||||
strcpy(reg4.estado_asig[y-12],"AV");
|
||||
}
|
||||
if(o==7181)
|
||||
{
|
||||
cprintf("AO");
|
||||
strcpy(reg4.estado_asig[y-12],"AO");
|
||||
}
|
||||
strcpy(reg4.nombre_asig[y-12],CFGS1[y-12]);
|
||||
}
|
||||
fwrite(®4,sizeof(ALUMNO_C1),1,cfgs1b);
|
||||
break;
|
||||
case 3:
|
||||
for(y=11;y<16;y++)
|
||||
{
|
||||
gotoxy(22,y);
|
||||
o=bioskey(0);
|
||||
if(o==14624)
|
||||
{
|
||||
cprintf("AV");
|
||||
strcpy(reg5.estado_asig[y-11],"AV");
|
||||
}
|
||||
if(o==7181)
|
||||
{
|
||||
cprintf("AO");
|
||||
strcpy(reg5.estado_asig[y-11],"AO");
|
||||
}
|
||||
strcpy(reg5.nombre_asig[y-11],CFGS2[y-11]);
|
||||
}
|
||||
fwrite(®5,sizeof(ALUMNO_C2),1,cfgs2);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
switch(subopcion) //visualiza datos
|
||||
{
|
||||
case 1://ALUMNOS DE ESO
|
||||
switch(subopcion1)
|
||||
{
|
||||
case 1:
|
||||
while(!feof(eso3a))
|
||||
{
|
||||
fread(&busca,sizeof(ALUMNO_E3),1,eso3a);
|
||||
if(strcmp(nombre,busca.nombre_alumno)==0)
|
||||
for(i=0;i<16;i++)
|
||||
{
|
||||
gotoxy(22,i+5);
|
||||
cprintf("%s:%s",busca.nombre_asig[i],busca.estado_asig[i]);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
while(!feof(eso3b))
|
||||
{
|
||||
fread(&busca,sizeof(ALUMNO_E3),1,eso3b);
|
||||
if(strcmp(nombre,busca.nombre_alumno)==0)
|
||||
for(i=0;i<16;i++)
|
||||
{
|
||||
gotoxy(22,i+5);
|
||||
cprintf("%s:%s",busca.nombre_asig[i],busca.estado_asig[i]);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
while(!feof(eso4a))
|
||||
{
|
||||
fread(&busca1,sizeof(ALUMNO_E4),1,eso4a);
|
||||
if(strcmp(nombre,busca1.nombre_alumno)==0)
|
||||
for(i=0;i<20;i++)
|
||||
{
|
||||
gotoxy(22,i+4);
|
||||
cprintf("%s:%s",busca1.nombre_asig[i],busca1.estado_asig[i]);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
while(!feof(eso4b))
|
||||
{
|
||||
fread(&busca1,sizeof(ALUMNO_E4),1,eso4b);
|
||||
if(strcmp(nombre,busca1.nombre_alumno)==0)
|
||||
for(i=0;i<20;i++)
|
||||
{
|
||||
gotoxy(22,i+4);
|
||||
cprintf("%s:%s",busca1.nombre_asig[i],busca1.estado_asig[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 2://ALUMNOS DE BCN
|
||||
switch(subopcion1)
|
||||
{
|
||||
case 1:
|
||||
while(!feof(bcn1a))
|
||||
{
|
||||
fread(&busca2,sizeof(ALUMNO_B1),1,bcn1a);
|
||||
if(strcmp(nombre,busca2.nombre_alumno)==0)
|
||||
for(i=0;i<15;i++)
|
||||
{
|
||||
gotoxy(22,i+6);
|
||||
cprintf("%s:%s",busca2.nombre_asig[i],busca2.estado_asig[i]);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
while(!feof(bcn1b))
|
||||
{
|
||||
fread(&busca2,sizeof(ALUMNO_B1),1,bcn1b);
|
||||
if(strcmp(nombre,busca2.nombre_alumno)==0)
|
||||
for(i=0;i<15;i++)
|
||||
{
|
||||
gotoxy(22,i+6);
|
||||
cprintf("%s:%s",busca2.nombre_asig[i],busca2.estado_asig[i]);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
while(!feof(bcn2a))
|
||||
{
|
||||
fread(&busca3,sizeof(ALUMNO_B2),1,bcn2a);
|
||||
if(strcmp(nombre,busca3.nombre_alumno)==0)
|
||||
for(i=0;i<18;i++)
|
||||
{
|
||||
gotoxy(22,i+5);
|
||||
cprintf("%s:%s",busca3.nombre_asig[i],busca3.estado_asig[i]);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
while(!feof(bcn2b))
|
||||
{
|
||||
fread(&busca3,sizeof(ALUMNO_B2),1,bcn2b);
|
||||
if(strcmp(nombre,busca3.nombre_alumno)==0)
|
||||
for(i=0;i<18;i++)
|
||||
{
|
||||
gotoxy(22,i+5);
|
||||
cprintf("%s:%s",busca3.nombre_asig[i],busca3.estado_asig[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 3://ALUMNOS DE CFGS
|
||||
switch(subopcion1)
|
||||
{
|
||||
case 1:
|
||||
while(!feof(cfgs1a))
|
||||
{
|
||||
fread(&busca4,sizeof(ALUMNO_C1),1,cfgs1a);
|
||||
if(strcmp(nombre,busca4.nombre_alumno)==0)
|
||||
for(i=0;i<4;i++)
|
||||
{
|
||||
gotoxy(22,i+11);
|
||||
cprintf("%s:%s",busca4.nombre_asig[i],busca4.estado_asig[i]);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
while(!feof(cfgs1b))
|
||||
{
|
||||
fread(&busca4,sizeof(ALUMNO_C1),1,cfgs1b);
|
||||
if(strcmp(nombre,busca4.nombre_alumno)==0)
|
||||
for(i=0;i<4;i++)
|
||||
{
|
||||
gotoxy(22,i+11);
|
||||
cprintf("%s:%s",busca4.nombre_asig[i],busca4.estado_asig[i]);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
while(!feof(cfgs2))
|
||||
{
|
||||
fread(&busca5,sizeof(ALUMNO_C2),1,cfgs2);
|
||||
if(strcmp(nombre,busca5.nombre_alumno)==0)
|
||||
for(i=0;i<5;i++)
|
||||
{
|
||||
gotoxy(22,i+11);
|
||||
cprintf("%s:%s",busca5.nombre_asig[i],busca5.estado_asig[i]);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
getch();
|
||||
textattr(119);
|
||||
gotoxy(2,25);
|
||||
cprintf("RETURN[Asignatura Obligatoria],ESPACIO[Asignatura Convalidada]");
|
||||
textattr(7);
|
||||
recuadro(16,3,41,24,1);
|
||||
fclose(eso3a);
|
||||
fclose(eso3b);
|
||||
fclose(eso4a);
|
||||
fclose(eso4b);
|
||||
fclose(bcn1a);
|
||||
fclose(bcn1b);
|
||||
fclose(bcn2a);
|
||||
fclose(bcn2b);
|
||||
fclose(cfgs1a);
|
||||
fclose(cfgs1b);
|
||||
fclose(cfgs2);
|
||||
}
|
||||
//CAPTURA
|
||||
void captura(int tam, char intochar, OPCION cap,char nombre[20])
|
||||
{
|
||||
int i=0,c=0;
|
||||
if (intochar=='i')
|
||||
{
|
||||
do
|
||||
{
|
||||
cap.matriz1[i]=getch();
|
||||
if (isdigit(cap.matriz1[i])==0)
|
||||
{
|
||||
i--;
|
||||
if (i==-1)
|
||||
i++;
|
||||
}
|
||||
else
|
||||
{
|
||||
cprintf("%c",cap.matriz1[i]);
|
||||
i++;
|
||||
c++;
|
||||
}
|
||||
}
|
||||
while((cap.matriz1[i]!='\r') && (c+1<tam));
|
||||
// strcpy(cap.matriz1[i+1],'\0');
|
||||
cap.matriz1[i+1]='\0';
|
||||
}
|
||||
if (intochar=='c')
|
||||
{
|
||||
do
|
||||
{
|
||||
cap.matriz2[i]=getch();
|
||||
if (isalpha(cap.matriz2[i])==0&&cap.matriz2[i]!=' '&&cap.matriz2[i]!='<EFBFBD>'&&cap.matriz2[i]!='<EFBFBD>')
|
||||
{
|
||||
i--;
|
||||
if (i==-1)
|
||||
i++;
|
||||
}
|
||||
else
|
||||
{
|
||||
cprintf("%c",cap.matriz2[i]);
|
||||
i++;
|
||||
c++;
|
||||
}
|
||||
}while((cap.matriz2[i+1]!='\r') && (c+1<tam));
|
||||
//strcpy(cap.matriz2[i+1],'\0');
|
||||
while(cap.matriz2[i+1]!='\r')
|
||||
{
|
||||
cap.matriz2[i+1]=getch();
|
||||
}
|
||||
cap.matriz2[i+1]='\0';
|
||||
}
|
||||
if (intochar=='i')
|
||||
strcpy(nombre,cap.matriz1);
|
||||
else strcpy(nombre,cap.matriz2);
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user