概述
#include <graphics.h>
#include <time.h>
#include <conio.h>
#include <windows.h>
#include <stdio.h>
#include <ctype.h>
#include <stdlib.h>
#include <string.h>
#undef UNICODE
#undef _UNICODE
int NowStudentNums=0;
int ReturnPosi();//输入学号后查找要删除的学生
void studentxianshilixiao();//学生查看离校申请
void xianshialljilu();//显示所有健康记录
void xianshijiankang();//显示健康记录
void xianshihesuan();//显示核酸记录
void xianshiyimiao();//显示疫苗记录
void xianshilixiao();//显示离校记录
void InputInfor();//输入增加学生
void shanchu();//删除学生信息
void SaveInforModi();//储存删除后的学生信息
void AdminPage();//管理员登录之后界面
void AdminSignIn();//管理员登陆界面
void studentinpage();//学生登陆界面
void studentpage();//学生界面
void ReadInfor();//重新读取信息
void SaveInfor();//储存增加的学生信息
void zengjian();//增减学生界面
void chaxun();//管理员查询功能
void tongjifenxi();//管理员统计分析功能
void lixiaoshenhe();//管理员离校审核
void studentxiugai();//学生修改信息
void studenttianbao();//学生填报健康状况
void studentchakan();//学生查看离校申请
void FirstPage();//首页
int t=0;int r=0;int z=0;
int w=1;
typedef struct Admin//创建管理员结构体
{
TCHAR UserName[12];
TCHAR PassWord[12];
}Admin;
Admin AdminUser;//创建管理员
typedef struct Student//学生基本信息结构体
{
char s_Num[12];
char s_Name[10];
char s_PassWord[12];
char s_phone[12];
}Student;
Student Stu[32];
typedef struct Heal//健康记录结构体
{
char time1[13];
char temper1[5];
char temper2[5];
char temper3[5];
char cough[2];//是否有咳嗽症状,y或n
char fever[2];//是否有发烧症状,y或n
//核酸检测结构体
char time2[13];
char dress2[10];
char exam[2];//核酸检测结果y或n
char htimes[2];
//疫苗接种结构体
char times[2];
char time3[13];
char dress3[10];
}Heal;
Heal health[32];
typedef struct Aply//离校申请结构体
{
char leavetimes[2];//第几次离校申请
char num[12];//离校学生学号
char cause[10];//离校原因
char leavetime[13];//离校时间
char backtime[13];//返校时间
char destination[10];//请输入目的地
char state[5];//审批状态
char result[9];//请输入agree或disagree!!!!!
}Aply;
Aply apply[32];
void studentxianshilixiao()
{
initgraph(1000,747);//加载背景
cleardevice();
IMAGE img;
loadimage(&img,_T(“C:kangyi.jpg”));
putimage(0,0,&img);
setbkmode(TRANSPARENT);
settextstyle(20,0,“黑体”);
outtextxy(0,0,“学号”);//输出表头
outtextxy(101,0,“离校原因”);
outtextxy(241,0,“出校时间”);
outtextxy(401,0,“返校时间”);
outtextxy(561,0,“目的地”);
outtextxy(661,0,“审核状态”);
outtextxy(801,0,“审核意见”);
for(int d=1;d<=32;d++)
{
if(strlen(apply[d-1].num)!=0)
{
settextstyle(15,0,“黑体”);
outtextxy(0,1+(40d),apply[d-1].num);//输出离校申请信息
outtextxy(101,1+(40d),apply[d-1].cause);
outtextxy(241,1+(40d),apply[d-1].leavetime);
outtextxy(401,1+(40d),apply[d-1].backtime);
outtextxy(561,1+(40d),apply[d-1].destination);
outtextxy(801,1+(40d),apply[d-1].result);
char a[6]=“agree”;char b[9]=“disagree”;
if(strcmp(apply[d-1].result,a)0||strcmp(apply[d-1].result,b)0)
outtextxy(661,1+(40*d),“完成”);
}
}
fillrectangle(920,0,1000,40);
setbkmode(OPAQUE);
settextstyle(40,0,_T(“黑体”));
outtextxy(920,0,“返回”);
MOUSEMSG m10;//设置鼠标返回按钮
while(1)
{
m10=GetMouseMsg();
if(m10.x>=920&&m10.x<=1000&&m10.y>=0&&m10.y<=40)
{
setlinecolor(RED);
rectangle(920,0,1000,40);
if(m10.uMsgWM_LBUTTONDOWN)
studentpage();
}
else//感应出红色虚框
{
setlinecolor(WHITE);
rectangle(920,0,1000,40);
}
}
}
void studenttianbao()
{
initgraph(1000,747);
cleardevice();
IMAGE img;
loadimage(&img,_T(“C:kangyi.jpg”));
putimage(0,0,&img);
setbkmode(TRANSPARENT);
fillrectangle(400,400,640,440);//四个按钮
fillrectangle(400,470,640,510);
fillrectangle(400,540,640,580);
fillrectangle(400,610,640,650);
fillrectangle(920,0,1000,40);
setbkmode(OPAQUE);
settextstyle(40,0,_T(“黑体”));
outtextxy(400,400,“每日健康记录”);
outtextxy(400,470,“核酸检测记录”);
outtextxy(400,540,“疫苗接种记录”);
outtextxy(400,610,“填报离校申请”);
outtextxy(920,0,“返回”);
MOUSEMSG m8;
while(1)//管理员操作鼠标检测
{
m8=GetMouseMsg();//检测鼠标点击的按钮
if((m8.x>=400&&m8.y>=400&&m8.x<=640&&m8.y<=440))
{
setlinecolor(RED);
rectangle(400,400,640,440);
if(m8.uMsgWM_LBUTTONDOWN)
{
InputBox(health[t].temper1,5,“请输入早上体温”);//输入健康信息
InputBox(health[t].temper2,5,“请输入中午体温”);
InputBox(health[t].temper3,5,“请输入晚上体温”);
InputBox(health[t].time1,12,“请输入时间”);
InputBox(health[t].cough,2,“是否咳嗽y或n”);
InputBox(health[t].fever,2,“是否发烧y或n”);
remove(“C://rujian//jiankangxinxi.txt”);//存入文件
FILE fp;
fp=fopen(“C://rujian//jiankangxinxi.txt”,“w”);
for(int u=0;u<32;u++)
fwrite(&health[u],sizeof(struct Heal),1,fp);
fclose(fp);
studenttianbao();
}
}
else if(m8.x>=400&&m8.y>=470&&m8.x<=640&&m8.y<=510)
{
setlinecolor(RED);
rectangle(400,470,640,510);
if(m8.uMsgWM_LBUTTONDOWN)
{
InputBox(health[t].htimes,2,“第几次检测”);//录入信息
InputBox(health[t].dress2,9,“核酸检测地点”);
InputBox(health[t].time2,12,“检测时间”);
InputBox(health[t].exam,2,“检测结果y或n”);
remove(“C://rujian//jiankangxinxi.txt”);
FILE *fp;
fp=fopen(“C://rujian//jiankangxinxi.txt”,“w”);
for(int u=0;u<32;u++)
fwrite(&health[u],sizeof(struct Heal),1,fp);
fclose(fp);
studenttianbao();
}
}
else if(m8.x>=400&&m8.y>=540&&m8.x<=640&&m8.y<=580)
{
setlinecolor(RED);
rectangle(400,540,640,580);
if(m8.uMsgWM_LBUTTONDOWN)
{
InputBox(health[t].times,9,“第几次接种疫苗”);//录入信息
InputBox(health[t].time3,9,“接种时间”);
InputBox(health[t].dress3,9,“接种地点”);
remove(“C://rujian//jiankangxinxi.txt”);
FILE fp;
fp=fopen(“C://rujian//jiankangxinxi.txt”,“w”);
for(int u=0;u<32;u++)
fwrite(&health[u],sizeof(struct Heal),1,fp);
fclose(fp);
studenttianbao();
}
}
else if(m8.x>=400&&m8.y>=610&&m8.x<=640&&m8.y<=650)
{
setlinecolor(RED);
rectangle(400,610,640,650);
if(m8.uMsgWM_LBUTTONDOWN)
{
InputBox(apply[t].num,12,“离校申请学号”);//录入信息
InputBox(apply[t].leavetimes,2,“第几次离校申请”);
InputBox(apply[t].cause,9,“原因”);
InputBox(apply[t].destination,9,“目的地”);
InputBox(apply[t].leavetime,12,“离校时间”);
InputBox(apply[t].backtime,12,“返校时间”);
strcpy(apply[t].result,"