我是靠谱客的博主 忧心哈密瓜,最近开发中收集的这篇文章主要介绍疫情防控信息管理,觉得挺不错的,现在分享给大家,希望可以做个参考。

概述

#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+(40
d),apply[d-1].cause);
outtextxy(241,1+(40d),apply[d-1].leavetime);
outtextxy(401,1+(40
d),apply[d-1].backtime);
outtextxy(561,1+(40d),apply[d-1].destination);
outtextxy(801,1+(40
d),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.uMsg
WM_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.uMsg
WM_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.uMsg
WM_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,"");
remove(“C://rujian//lixiaoshenqing.txt”);
FILE *fp;
fp=fopen(“C://rujian//lixiaoshenqing.txt”,“w”);
for(int u=0;u<32;u++)
fwrite(&apply[u],sizeof(struct Aply),1,fp);
fclose(fp);
studenttianbao();
}
}
else if(m8.x>=920&&m8.x<=1000&&m8.y>=0&&m8.y<=40)
{
setlinecolor(RED);
rectangle(920,0,1000,40);
if(m8.uMsg
WM_LBUTTONDOWN)
{
studentpage();
}
}
else//让鼠标不悬停在某一个按钮上
{
setlinecolor(WHITE);
rectangle(400,400,640,440);
rectangle(400,470,640,510);
rectangle(400,540,640,580);
rectangle(400,610,640,650);
rectangle(920,0,1000,40);
}
}
}
void studentxiugai()
{
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(920,0,1000,40);
setbkmode(OPAQUE);
settextstyle(40,0,_T(“黑体”));
outtextxy(400,400,“修改登陆密码”);
outtextxy(400,470,“修改电话号码”);
outtextxy(920,0,“返回”);
MOUSEMSG m7;
while(1)//管理员操作鼠标检测
{
m7=GetMouseMsg();//检测鼠标点击的按钮
if((m7.x>=400&&m7.y>=400&&m7.x<=640&&m7.y<=440))
{
setlinecolor(RED);
rectangle(400,400,640,440);
if(m7.uMsgWM_LBUTTONDOWN)
{
char mima[12];
InputBox(mima,12,“重新设置密码”);
strcpy(Stu[t].s_PassWord,mima);
break;
}
}
else if(m7.x>=400&&m7.y>=470&&m7.x<=640&&m7.y<=510)
{
setlinecolor(RED);
rectangle(400,470,640,510);
if(m7.uMsg
WM_LBUTTONDOWN)
{
char dianhua[12];
InputBox(dianhua,12,“重新设置电话”);
strcpy(Stu[t].s_phone,dianhua);
break;
}
}
else if(m7.x>=920&&m7.x<=1000&&m7.y>=0&&m7.y<=40)
{
setlinecolor(RED);
rectangle(920,0,1000,40);
if(m7.uMsgWM_LBUTTONDOWN)
studentpage();
}
else
{
setlinecolor(WHITE);
rectangle(400,400,640,440);//两个按钮
rectangle(400,470,640,510);
rectangle(920,0,1000,40);
}
}
FILE *fp;
remove(“C://rujian//studentjibenxinxi.txt”);//将修改后的信息存入文件
fp=fopen(“C://rujian//studentjibenxinxi.txt”,“w”);
if(fp
NULL)
{
HWND SignError=GetHWnd();
int isok=MessageBox(SignError,_T(“文件打开错误”),_T(“提示”),MB_OK);
}
for(int i=0;i<NowStudentNums;i++)
{
if(strlen(Stu[NowStudentNums-1].s_Num)!=0)
fwrite(&Stu[i],sizeof(struct Student),1,fp);
}
fclose(fp);
FirstPage();
}
void studentpage()
{
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(920,0,1000,40);
setbkmode(OPAQUE);
settextstyle(40,0,_T(“黑体”));
outtextxy(400,400,“修改学生信息”);
outtextxy(400,470,“填报健康记录”);
outtextxy(400,540,“查询申请结果”);
outtextxy(920,0,“返回”);
MOUSEMSG m6;
while(1)//管理员操作鼠标检测
{
m6=GetMouseMsg();//检测鼠标点击的按钮
if((m6.x>=400&&m6.y>=400&&m6.x<=640&&m6.y<=440))
{
setlinecolor(RED);
rectangle(400,400,640,440);
if(m6.uMsgWM_LBUTTONDOWN)
{
studentxiugai();
}
}
else if(m6.x>=400&&m6.y>=470&&m6.x<=640&&m6.y<=510)
{
setlinecolor(RED);
rectangle(400,470,640,510);
if(m6.uMsg
WM_LBUTTONDOWN)
{
studenttianbao();
}
}
else if(m6.x>=400&&m6.y>=540&&m6.x<=640&&m6.y<=580)
{
setlinecolor(RED);
rectangle(400,540,640,580);
if(m6.uMsgWM_LBUTTONDOWN)
{
studentxianshilixiao();
}
}
else if(m6.x>=920&&m6.x<=1000&&m6.y>=0&&m6.y<=40)
{
setlinecolor(RED);
rectangle(920,0,1000,40);
if(m6.uMsg
WM_LBUTTONDOWN)
FirstPage();
}
else
{
setlinecolor(WHITE);
rectangle(400,400,640,440);
rectangle(400,470,640,510);
rectangle(400,540,640,580);
rectangle(920,0,1000,40);
}
}
}
void studentinpage()
{
initgraph(1000,747);
cleardevice();
IMAGE img;
loadimage(&img,_T(“C:kangyi.jpg”));
putimage(0,0,&img);
setbkmode(TRANSPARENT);
char zanshi[12];
InputBox(zanshi,12,“请输入学号”);
if(strlen(zanshi)!=0)//登陆时学号不能为空
{
for(int g=0;g<32;g++)
{
if(strcmp(zanshi,Stu[g].s_Num)==0)//匹配学号后输入密码
{
char mima[12];
InputBox(mima,12,“请输入密码”);
if(strcmp(mima,Stu[g].s_PassWord)0)
{
t=g;
studentpage();
}
else
{
HWND hndtipsD=GetHWnd();
int isok=MessageBox(hndtipsD,“密码错误”,“提示”,MB_OK);
FirstPage();
}
}
r=g;
}
if(r
31&&t!=31)
{
HWND hndtipsD=GetHWnd();
int isok=MessageBox(hndtipsD,“查无此人”,“提示”,MB_OK);
FirstPage();
}
}
else//输入为空
{
HWND hndtipsD=GetHWnd();
int isok=MessageBox(hndtipsD,“查无此人”,“提示”,MB_OK);
FirstPage();
}
}
void lixiaoshenhe()
{
initgraph(1000,747);//加载背景
cleardevice();
IMAGE img;
loadimage(&img,_T(“C:kangyi.jpg”));
putimage(0,0,&img);
setbkmode(TRANSPARENT);
settextstyle(40,0,“黑体”);
outtextxy(421,0,“离校审核”);
fillrectangle(920,0,1000,40);
setbkmode(OPAQUE);
settextstyle(40,0,_T(“黑体”));
outtextxy(920,0,“返回”);
FILE fp;
fp=fopen(“C://rujian//lixiaoshenqing.txt”,“r”);
fread(apply,sizeof(struct Aply),32,fp);
fclose(fp);
for(int u=1;u<33;u++)
{
int v=0;
v=atof(apply[u-1].leavetimes);
if(strcmp(apply[u-1].result,“agree”)==0||strcmp(apply[u-1].result,“disagree”)0||v<1)
z=z+1;
}
if(z
32)//没有未处理
{
HWND hndtipsD=GetHWnd();
int isok=MessageBox(hndtipsD,“暂无未处理记录”,“提示”,MB_OK);
AdminPage();
}
else
{
for(int u=1;u<33;u++)
{
int v=0;
v=atof(apply[u-1].leavetimes);
char a[6]=“agree”;char b[9]=“disagree”;
if(strcmp(apply[u-1].result,a)!=0&&strcmp(apply[u-1].result,b)!=0&&v>=1)
{
setbkmode(TRANSPARENT);
settextstyle(18,0,“黑体”);
outtextxy(0,(1+40
u),Stu[u-1].s_Name);
outtextxy(351,(1+40
u),apply[u-1].cause);
setbkmode(OPAQUE);
settextstyle(18,0,“黑体”);
fillrectangle(601,1+(40
u),637,19+(40u));
fillrectangle(651,1+(40
u),705,19+(40u));
outtextxy(601,1+(40
u),“同意”);//设置审批按钮
outtextxy(651,1+(40u),“不同意”);
MOUSEMSG m5;
while(1)//管理员操作鼠标检测
{
m5=GetMouseMsg();//检测鼠标点击的按钮
if(m5.x>=601&&m5.y>=(1+40
u)&&m5.x<=637&&m5.y<=(41+40u))
{
setlinecolor(RED);
rectangle(601,1+(40
u),637,(19+40u));
if(m5.uMsg==WM_LBUTTONDOWN)
{
strcpy(apply[u-1].result,“agree”);
remove(“C://rujian//lixiaoshenqing.txt”);//审批结果存入文件
FILE fp;
fp=fopen(“C://rujian//lixiaoshenqing.txt”,“w”);
for(int u=0;u<32;u++)
fwrite(&apply[u],sizeof(struct Aply),1,fp);
fclose(fp);
}
}
else if(m5.x>=651&&m5.y>=(1+40
u)&&m5.x<=705&&m5.y<=(41+40
u))
{
setlinecolor(RED);
rectangle(651,(1+40u),705,19+(40u));
if(m5.uMsgWM_LBUTTONDOWN)
{
strcpy(apply[u-1].result,“disagree”);
remove(“C://rujian//lixiaoshenqing.txt”);
FILE *fp;
fp=fopen(“C://rujian//lixiaoshenqing.txt”,“w”);
for(int u=0;u<32;u++)
fwrite(&apply[u],sizeof(struct Aply),1,fp);
fclose(fp);
}
}
else if(m5.x>=920&&m5.x<=1000&&m5.y>=0&&m5.y<=40)
{
setlinecolor(RED);
rectangle(920,0,1000,40);
if(m5.uMsg
WM_LBUTTONDOWN)
AdminPage();
}
else//让鼠标不悬停在某一个按钮上
{
setlinecolor(WHITE);
rectangle(601,(1+40u),637,(19+40u));
rectangle(651,(1+40u),705,(19+40u));
rectangle(920,0,1000,40);
}
}
}
}
}
}
void tongjifenxi()
{
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(241,0,“疫苗小于两次”);
outtextxy(481,0,“离校申请大于三次”);
settextstyle(18,0,“黑体”);
for(int y=1;y<33;y++)//判断不符合条件的学生健康记录
{
int z=0;
z=atof(health[y-1].htimes);
if(z<5)
outtextxy(0,1+(40y),Stu[y].s_Name);
z=atof(health[y-1].times);
if(z<2)
outtextxy(241,1+(40
y),Stu[y-1].s_Name);
z=atof(apply[y-1].leavetimes);
if(z>3)
outtextxy(481,1+(40y),Stu[y-1].s_Name);
}
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.uMsg==WM_LBUTTONDOWN)
AdminPage();
}
else
{
setlinecolor(WHITE);
rectangle(920,0,1000,40);
}
}
}
void chaxun()
{
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(601,0,“咳嗽症状”);
outtextxy(741,0,“发烧症状”);
settextstyle(18,0,“黑体”);
for(int i=1;i<33;i++)//判定异常的早中晚体温
{
float x1=0;
x1=atof(health[i-1].temper1);
if(x1>37.3)
{
outtextxy(0,1+(40
i),Stu[i-1].s_Name);
outtextxy(81,1+(40i),“早”);
outtextxy(111,1+(40
i),health[i-1].temper1);
}
}
for(int e=1;e<33;e++)
{
float x1=0;
x1=atof(health[e-1].temper2);
if(x1>37.3)
{
outtextxy(201,1+(40e),Stu[e-1].s_Name);
outtextxy(281,1+(40
e),“中”);
outtextxy(311,1+(40e),health[e-1].temper2);
}
}
for(int m=1;m<33;m++)
{
float x1=0;
x1=atof(health[m-1].temper3);
if(x1>37.3)
{
outtextxy(401,1+(40
m),Stu[m-1].s_Name);
outtextxy(481,1+(40m),“晚”);
outtextxy(511,1+(40
m),health[m-1].temper3);
}
}
for(int b=1;b<33;b++)
{
if(strcmp(health[b-1].cough,“y”)0)
outtextxy(601,1+(40b),Stu[b-1].s_Name);
if(strcmp(health[b-1].fever,“y”)==0)
outtextxy(741,1+(40
b),Stu[b-1].s_Name);
}
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.uMsg
WM_LBUTTONDOWN)
AdminPage();
}
else
{
setlinecolor(WHITE);
rectangle(920,0,1000,40);
}
}
}
void xianshilixiao()
{
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+(40
d),apply[d-1].cause);
outtextxy(241,1+(40d),apply[d-1].leavetime);
outtextxy(401,1+(40
d),apply[d-1].backtime);
outtextxy(561,1+(40d),apply[d-1].destination);
outtextxy(801,1+(40
d),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.uMsg
WM_LBUTTONDOWN)
AdminPage();
}
else
{
setlinecolor(WHITE);
rectangle(920,0,1000,40);
}
}
}
void xianshiyimiao()
{
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(301,0,“接种次数”);
outtextxy(501,0,“接种时间”);
outtextxy(701,0,“接种地点”);
if(NowStudentNums
0)
{
settextstyle(100,0,“黑体”);
outtextxy(200,200,“当前记录为空”);
return;
}
else
{
for(int q=1;q<=NowStudentNums;q++)
{
settextstyle(18,0,“黑体”);
outtextxy(0,1+(40q),Stu[q-1].s_Num);
outtextxy(501,1+(40
q),health[q-1].time3);
outtextxy(701,1+(40q),health[q-1].dress3);
settextstyle(18,0,“黑体”);
outtextxy(301,1+(40
q),health[q-1].times);
}
}
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)
xianshialljilu();
}
else
{
setlinecolor(WHITE);
rectangle(920,0,1000,40);
}
}
}
void xianshihesuan()
{
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(121,0,“检测时间”);
outtextxy(341,0,“检测地点”);
outtextxy(561,0,“检测结果”);
if(NowStudentNums
0)
{
settextstyle(100,0,“黑体”);
outtextxy(200,200,“当前记录为空”);
return;
}
else
{
for(int q=1;q<=NowStudentNums;q++)
{
settextstyle(18,0,“黑体”);
outtextxy(0,1+(40q),Stu[q-1].s_Num);
outtextxy(121,1+(40
q),health[q-1].time2);
outtextxy(341,1+(40q),health[q-1].dress2);
settextstyle(18,0,“黑体”);
if(strcmp(health[q-1].exam,“n”)==0)
outtextxy(561,1+(40
q),“阴性”);
else if(strcmp(health[q-1].exam,“y”)0)
outtextxy(561,1+(40*q),“阳性”);
}
}
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.uMsg
WM_LBUTTONDOWN)
AdminPage();
}
else
{
setlinecolor(WHITE);
rectangle(920,0,1000,40);
}
}
}
void xianshijiankang()
{
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(121,0,“日期”);
outtextxy(231,0,“体温早”);
outtextxy(311,0,“体温中”);
outtextxy(391,0,“体温晚”);
outtextxy(471,0,“是否咳嗽”);
outtextxy(571,0,“是否发烧”);
outtextxy(671,0,“电话”);
if(NowStudentNums0)
{
settextstyle(100,0,“黑体”);
outtextxy(200,200,“当前记录为空”);
return;
}
else
{
for(int q=1;q<=NowStudentNums;q++)
{
settextstyle(18,0,“黑体”);
outtextxy(0,1+(40q),Stu[q-1].s_Num);
outtextxy(121,1+(40
q),health[q-1].time1);
outtextxy(231,1+(40q),health[q-1].temper1);
outtextxy(311,1+(40
q),health[q-1].temper2);
outtextxy(391,1+(40q),health[q-1].temper3);
outtextxy(671,1+(40
q),Stu[q-1].s_phone);
settextstyle(20,0,“黑体”);
if(strcmp(health[q-1].cough,“y”)0)
outtextxy(471,1+(40q),“是”);
if(strcmp(health[q-1].cough,“n”)==0)
outtextxy(471,(1+40
q),“否”);
if(strcmp(health[q-1].fever,“y”)0)
outtextxy(571,(1+40q),“是”);
if(strcmp(health[q-1].fever,“n”)==0)
outtextxy(571,(1+40
q),“否”);
}
}
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.uMsg
WM_LBUTTONDOWN)
AdminPage();
}
else
{
setlinecolor(WHITE);
rectangle(920,0,1000,40);
}
}
}
void xianshialljilu()
{
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(0,0,80,40);
setbkmode(OPAQUE);
settextstyle(40,0,_T(“黑体”));
outtextxy(400,400,“每日健康记录”);
outtextxy(400,470,“核酸检测记录”);
outtextxy(400,540,“疫苗接种记录”);
outtextxy(400,610,“离校申请记录”);
outtextxy(0,0,“返回”);
MOUSEMSG m4;
while(1)//管理员操作鼠标检测
{
m4=GetMouseMsg();//检测鼠标点击的按钮
if((m4.x>=400&&m4.y>=400&&m4.x<=640&&m4.y<=440))
{
setlinecolor(RED);
rectangle(400,400,640,440);
if(m4.uMsg
WM_LBUTTONDOWN)
{
xianshijiankang();
}
}
else if(m4.x>=400&&m4.y>=470&&m4.x<=640&&m4.y<=510)
{
setlinecolor(RED);
rectangle(400,470,640,510);
if(m4.uMsg
WM_LBUTTONDOWN)
{
xianshihesuan();
}
}
else if(m4.x>=400&&m4.y>=540&&m4.x<=640&&m4.y<=580)
{
setlinecolor(RED);
rectangle(400,540,640,580);
if(m4.uMsgWM_LBUTTONDOWN)
{
xianshiyimiao();
}
}
else if(m4.x>=400&&m4.y>=610&&m4.x<=640&&m4.y<=650)
{
setlinecolor(RED);
rectangle(400,610,640,650);
if(m4.uMsg
WM_LBUTTONDOWN)
{
xianshilixiao();
}
}
else if(m4.x>=0&&m4.x<=80&&m4.y>=0&&m4.y<=40)
{
setlinecolor(RED);
rectangle(0,0,80,40);
if(m4.uMsgWM_LBUTTONDOWN)
AdminPage();
}
else//让鼠标不悬停在某一个按钮上
{
setlinecolor(WHITE);
rectangle(400,400,640,440);
rectangle(400,470,640,510);
rectangle(400,540,640,580);
rectangle(400,610,640,650);
rectangle(0,0,80,40);
}
}
}
void zengjian()
{
initgraph(1000,747);
cleardevice();
IMAGE img;
loadimage(&img,_T(“C:kangyi.jpg”));
putimage(0,0,&img);
setbkmode(TRANSPARENT);
settextstyle(60,0,_T(“黑体”));
outtextxy(150,60,“校园疫情防控信息管理系统”);//标题
fillrectangle(440,450,600,490);
fillrectangle(440,570,600,610);
fillrectangle(0,0,80,40);
setbkmode(OPAQUE);
settextstyle(40,0,_T(“黑体”));
outtextxy(440,450,“增加学生”);
outtextxy(440,570,“删除学生”);
outtextxy(0,0,“返回”);
MOUSEMSG m3;
while(1)//检测鼠标操作
{
m3=GetMouseMsg();
if(m3.x>=440&&m3.y>=450&&m3.x<=600&&m3.y<=490)//点击增加学生
{
setlinecolor(RED);
rectangle(440,450,600,490);
if(m3.uMsg
WM_LBUTTONDOWN)
{
InputInfor();
}
}
else if(m3.x>=440&&m3.x<=600&&m3.y>=570&&m3.y<=610)//删除学生
{
setlinecolor(RED);
rectangle(440,570,600,610);
if(m3.uMsgWM_LBUTTONDOWN)
shanchu();
}
else if(m3.x>=0&&m3.x<=80&&m3.y>=0&&m3.y<=40)
{
setlinecolor(RED);
rectangle(0,0,80,40);
if(m3.uMsg
WM_LBUTTONDOWN)
AdminPage();
}
else//让鼠标不悬停在某一个按钮上
{
setlinecolor(WHITE);
rectangle(440,450,600,490);
rectangle(440,570,600,610);
rectangle(0,0,80,40);
}
}
}
void shanchu()
{
int TempDelt=ReturnPosi();//检测要删除的学号是否存在
if(TempDelt==-1)
{
HWND hndtipsD=GetHWnd();
int isok=MessageBox(hndtipsD,“查无此人”,“提示”,MB_OK);
}
else//如果按学号找到再决定是否删除
{
HWND hndtipsDs=GetHWnd();
int isok=MessageBox(hndtipsDs,“确定删除?”,“提示”,MB_OKCANCEL);
if(isokIDOK)
{
for(int d=TempDelt;d<NowStudentNums-1;d++)
{
Stu[d]=Stu[d+1];
health[d]=health[d+1];
apply[d]=apply[d+1];
}
NowStudentNums–;
SaveInforModi();
}
}
}
void SaveInforModi()//删除某一个学生之后将剩余学生重新存储
{
FILE *fp;
remove(“C://rujian//studentjibenxinxi.txt”);
fp=fopen(“C://rujian//studentjibenxinxi.txt”,“w”);
if(fp
NULL)
{
HWND SignError=GetHWnd();
int isok=MessageBox(SignError,_T(“文件打开错误”),_T(“提示”),MB_OK);
}
for(int i=0;i<NowStudentNums;i++)
{
if(strlen(Stu[NowStudentNums].s_Num)!=0)
fwrite(&Stu[i],sizeof(struct Student),1,fp);
}
fclose(fp);
fp=fopen(“C://rujian//jiankangxinxi.txt”,“w”);
if(fpNULL)
{
HWND SignError=GetHWnd();
int isok=MessageBox(SignError,_T(“健康信息文件打开错误”),_T(“提示”),MB_OK);
}
for(int i=0;i<NowStudentNums;i++)
{
fwrite(&health[i],sizeof(struct Student),1,fp);
}
fclose(fp);
fp=fopen(“C://rujian//lixiaoshenqing.txt”,“a”);
if(fp
NULL)
{
HWND SignError=GetHWnd();
int isok=MessageBox(SignError,_T(“健康信息文件打开错误”),_T(“提示”),MB_OK);
}
for(int i=0;i<NowStudentNums;i++)
{
fwrite(&apply[i],sizeof(struct Aply),1,fp);
}
fclose(fp);
}
int ReturnPosi()//按学号查找学生
{
char ReceInput[12];
InputBox(ReceInput,12,“请输入学号查找”);
for(int w=0;w<NowStudentNums;w++)
{
if(strcmp(Stu[w].s_Num,ReceInput)0)
return w;
}
return -1;
}
void InputInfor()//增加一个学生
{
while(1)
{
char jia[12];
InputBox(jia,12,“请输入该学生的学号”);
int FlagInput1=0;
for(int i=0;i<NowStudentNums;i++)
{
if(strcmp(jia,Stu[i].s_Num)0)
FlagInput1=1;
}
if(FlagInput1
1)
{
HWND hwndInput1=GetHWnd();
int isok=MessageBox(hwndInput1,_T(“该学生已经存在,请重新输入”),_T(“提示”),MB_OK);
zengjian();
}
else if(FlagInput1
0)
{
strcpy(Stu[NowStudentNums].s_Num,jia);
break;
}
}
InputBox(Stu[NowStudentNums].s_Name,9,“请输入学生姓名”);
InputBox(Stu[NowStudentNums].s_PassWord,12,“设置学生默认登陆密码”);
NowStudentNums=NowStudentNums+1;
SaveInfor();
}
void AdminSignIn()
{
initgraph(1000,747);//绘制窗口
cleardevice();
IMAGE img;//加载背景
loadimage(&img,_T(“C:kangyi.jpg”));
putimage(0,0,&img);
setbkmode(TRANSPARENT);
char ReceAcctNumber[12];
InputBox(ReceAcctNumber,12,“请输入用户名”);
char ReceAcctPassWord[12];
InputBox(ReceAcctPassWord,12,“请输入密码”);
if(strcmp(“10000000000”,ReceAcctNumber)0&&strcmp(“20000000000”,ReceAcctPassWord)0)
{
cleardevice();
AdminPage();
}
else
{
HWND SignError=GetHWnd();
int isok=MessageBox(SignError,_T(“用户名或密码错误”),_T(“提示”),MB_OK);
settextstyle(60,0,_T(“黑体”));
outtextxy(150,60,“校园疫情防控信息管理系统”);//标题
fillrectangle(440,450,600,490);//三个按钮
fillrectangle(440,510,640,550);
fillrectangle(440,570,600,610);
setbkmode(OPAQUE);
settextstyle(40,0,_T(“黑体”));
outtextxy(440,450,“学生登录”);
outtextxy(440,510,“管理员登录”);
outtextxy(440,570,“退出程序”);//上述为第一个界面
}
}
void FirstPage()//首页
{
ReadInfor();//重新读取信息
initgraph(1000,747);//绘制窗口
cleardevice();
IMAGE img;//加载背景
loadimage(&img,_T(“C:kangyi.jpg”));
putimage(0,0,&img);
setbkmode(TRANSPARENT);
settextstyle(60,0,_T(“黑体”));
outtextxy(150,60,“校园疫情防控信息管理系统”);//标题
fillrectangle(440,450,600,490);//三个按钮
fillrectangle(440,510,640,550);
fillrectangle(440,570,600,610);
setbkmode(OPAQUE);
settextstyle(40,0,_T(“黑体”));
outtextxy(440,450,“学生登录”);
outtextxy(440,510,“管理员登录”);
outtextxy(440,570,“退出程序”);//上述为第一个界面
w=1;
MOUSEMSG m1;
while(w>0)//检测鼠标操作
{
m1=GetMouseMsg();
if(m1.x>=440&&m1.y>=450&&m1.x<=600&&m1.y<=490)//点击学生登陆界面
{
setlinecolor(RED);
rectangle(440,450,600,490);
if(m1.uMsg
WM_LBUTTONDOWN)
{
cleardevice();
w=w-1;
studentinpage();
}
}
else if(m1.x>=440&&m1.y>=510&&m1.x<=600&&m1.y<=550)//点击管理员登陆界面
{
setlinecolor(RED);
rectangle(440,510,640,550);
if(m1.uMsg
WM_LBUTTONDOWN)
{
cleardevice();
w=w-1;
AdminSignIn();
}
}
else if(m1.x>=440&&m1.x<=600&&m1.y>=570&&m1.y<=610)//退出程序
{
setlinecolor(RED);
rectangle(440,570,600,610);
if(m1.uMsgWM_LBUTTONDOWN)
exit(0);
}
else//让鼠标不悬停在某一个按钮上
{
setlinecolor(WHITE);
rectangle(440,450,600,490);
rectangle(440,510,640,550);
rectangle(440,570,600,610);
}
}
}
void AdminPage()//管理员登录之后界面
{
initgraph(1000,747);
cleardevice();
IMAGE img;
loadimage(&img,_T(“C:kangyi.jpg”));
putimage(0,0,&img);
setbkmode(TRANSPARENT);
settextstyle(60,0,_T(“黑体”));
outtextxy(300,60,“管理员操作界面”);
fillrectangle(400,400,640,440);//五个按钮
fillrectangle(400,470,640,510);
fillrectangle(400,540,640,580);
fillrectangle(400,610,640,650);
fillrectangle(400,680,640,720);
fillrectangle(0,0,80,40);
setbkmode(OPAQUE);
settextstyle(40,0,_T(“黑体”));
outtextxy(400,400,“学生信息管理”);
outtextxy(400,470,“所有填报记录”);
outtextxy(400,540,“查询异常状况”);
outtextxy(400,610,“统计分析状况”);
outtextxy(400,680,“离校申请审核”);//管理员操作按钮
outtextxy(0,0,“返回”);
MOUSEMSG m2;
while(1)//管理员操作鼠标检测
{
m2=GetMouseMsg();//检测鼠标点击的按钮
if((m2.x>=400&&m2.y>=400&&m2.x<=640&&m2.y<=440))
{
setlinecolor(RED);
rectangle(400,400,640,440);
if(m2.uMsg
WM_LBUTTONDOWN)
{
zengjian();
}
}
else if(m2.x>=400&&m2.y>=470&&m2.x<=640&&m2.y<=510)
{
setlinecolor(RED);
rectangle(400,470,640,510);
if(m2.uMsgWM_LBUTTONDOWN)
{
xianshialljilu();
}
}
else if(m2.x>=400&&m2.y>=540&&m2.x<=640&&m2.y<=580)
{
setlinecolor(RED);
rectangle(400,540,640,580);
if(m2.uMsg
WM_LBUTTONDOWN)
{
chaxun();
}
}
else if(m2.x>=400&&m2.y>=610&&m2.x<=640&&m2.y<=650)
{
setlinecolor(RED);
rectangle(400,610,640,650);
if(m2.uMsgWM_LBUTTONDOWN)
{
tongjifenxi();
}
}
else if(m2.x>=400&&m2.y>=680&&m2.x<=640&&m2.y<=720)
{
setlinecolor(RED);
rectangle(400,680,640,720);
if(m2.uMsg
WM_LBUTTONDOWN)
{
lixiaoshenhe();
}
}
else if(m2.x>=0&&m2.x<=80&&m2.y>=0&&m2.y<=40)
{
setlinecolor(RED);
rectangle(0,0,80,40);
if(m2.uMsgWM_LBUTTONDOWN)
FirstPage();
}
else
{
setlinecolor(WHITE);
rectangle(400,400,640,440);//四个按钮
rectangle(400,470,640,510);
rectangle(400,540,640,580);
rectangle(400,610,640,650);
rectangle(400,680,640,720);
rectangle(0,0,80,40);
}
}
}
void SaveInfor()
{
if(strlen(Stu[NowStudentNums-1].s_Num)!=0)
{
FILE *fp;
fp=fopen(“C://rujian//studentjibenxinxi.txt”,“a”);
if(fp
NULL)
{
HWND SignError=GetHWnd();
int isok=MessageBox(SignError,_T(“文件打开错误”),_T(“提示”),MB_OK);
}
else
fwrite(&Stu[NowStudentNums-1],sizeof(struct Student),1,fp);
fclose(fp);
}
}
void ReadInfor()
{
FILE *fp;
fp=fopen(“C://rujian//studentjibenxinxi.txt”,“r”);
if(fpNULL)
{
HWND SignError=GetHWnd();
int isok=MessageBox(SignError,_T(“文件打开错误”),_T(“提示”),MB_OK);
}
fread(Stu,sizeof(struct Student),32,fp);
fclose(fp);
int Filenums=0;
for(int k=0;k<32;k++)
{
if(strlen(Stu[k].s_Name)!=0)
NowStudentNums=++Filenums;
}
fp=fopen(“C://rujian//jiankangxinxi.txt”,“r”);
if(fp
NULL)
{
HWND SignError=GetHWnd();
int isok=MessageBox(SignError,_T(“文件打开错误”),_T(“提示”),MB_OK);
}
fread(health,sizeof(struct Heal),32,fp);
fclose(fp);
fp=fopen(“C://rujian//lixiaoshenqing.txt”,“r”);
if(fp==NULL)
{
HWND SignError=GetHWnd();
int isok=MessageBox(SignError,_T(“文件打开错误”),_T(“提示”),MB_OK);
}
fread(apply,sizeof(struct Aply),32,fp);
fclose(fp);
}
int main()
{
FirstPage();
return 0;
}

最后

以上就是忧心哈密瓜为你收集整理的疫情防控信息管理的全部内容,希望文章能够帮你解决疫情防控信息管理所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(39)

评论列表共有 0 条评论

立即
投稿
返回
顶部