稿件请假管理系统源代码doc.docx

上传人:b****0 文档编号:9914572 上传时间:2023-05-22 格式:DOCX 页数:24 大小:17.79KB
下载 相关 举报
稿件请假管理系统源代码doc.docx_第1页
第1页 / 共24页
稿件请假管理系统源代码doc.docx_第2页
第2页 / 共24页
稿件请假管理系统源代码doc.docx_第3页
第3页 / 共24页
稿件请假管理系统源代码doc.docx_第4页
第4页 / 共24页
稿件请假管理系统源代码doc.docx_第5页
第5页 / 共24页
稿件请假管理系统源代码doc.docx_第6页
第6页 / 共24页
稿件请假管理系统源代码doc.docx_第7页
第7页 / 共24页
稿件请假管理系统源代码doc.docx_第8页
第8页 / 共24页
稿件请假管理系统源代码doc.docx_第9页
第9页 / 共24页
稿件请假管理系统源代码doc.docx_第10页
第10页 / 共24页
稿件请假管理系统源代码doc.docx_第11页
第11页 / 共24页
稿件请假管理系统源代码doc.docx_第12页
第12页 / 共24页
稿件请假管理系统源代码doc.docx_第13页
第13页 / 共24页
稿件请假管理系统源代码doc.docx_第14页
第14页 / 共24页
稿件请假管理系统源代码doc.docx_第15页
第15页 / 共24页
稿件请假管理系统源代码doc.docx_第16页
第16页 / 共24页
稿件请假管理系统源代码doc.docx_第17页
第17页 / 共24页
稿件请假管理系统源代码doc.docx_第18页
第18页 / 共24页
稿件请假管理系统源代码doc.docx_第19页
第19页 / 共24页
稿件请假管理系统源代码doc.docx_第20页
第20页 / 共24页
亲,该文档总共24页,到这儿已超出免费预览范围,如果喜欢就下载吧!
下载资源
资源描述

稿件请假管理系统源代码doc.docx

《稿件请假管理系统源代码doc.docx》由会员分享,可在线阅读,更多相关《稿件请假管理系统源代码doc.docx(24页珍藏版)》请在冰点文库上搜索。

稿件请假管理系统源代码doc.docx

稿件请假管理系统源代码doc

#include

#include

#include

#include

#defineselectint

typedefstruct//账户信息

{

charname[20];//User.name

charpw[20];//User.pw

}User;

typedefstruct

{

charNum[20];

charn1[20];

charClass[20];

chartime[100];

charreason[100];

charinstructor[100];

}Leave;

typedefstruct

{

charn1[20];

charNum[20];

//charname[20];

charClass[20];

chartime[100];

charreason[100];

charinstructor[100];

charsuggest[100];

}TEACHER;

intcheck(charname[20])

{

inti=0;

Userru;

FILE*f=fopen("data.dat","rb");

rewind(f);

for(i=0;!

feof(f);i++)

{

intd=i*sizeof(User);

fseek(f,d,SEEK_SET);

fread(&ru,sizeof(User),1,f);

if(strcmp(name,ru.name)==0)

return1;

}

return-1;

}

intlogin(charname[20],charpw[20])

{

Userus;

FILE*f=fopen("data.dat","rb");

while(!

feof(f))

{

fread(&us,sizeof(User),1,f);

if(strcmp(name,us.name)==0)

{

if(strcmp(pw,us.pw)==0)return1;

}

}

return-1;

}

intmain()

{

charn[20];

charplog[20];

charnlog[20];

intc;

Useru;

FILE*f=fopen("data.dat","ab");

if(f!

=NULL)

{

fwrite(&u,sizeof(User),1,f);

}

fclose(f);

Login:

system("colorF0");

system("cls");

printf("\n\n");

printf("========================================================================\n");

printf("||\n");

printf("|-----------------------------学生请假系统-----------------------------|\n");

printf("||\n");

printf("========================================================================\n");

printf("\n");

Sleep(1000);

printf("\n");

printf("请输入帐号:

");

scanf("%s",nlog);

c=check(nlog);

if(c==1)//如果账户存在

{

strcpy(n,nlog);//复制登录帐号

if(strlen(n)==9)//如果是学生

{

inta,i;

selects=0;

printf("\n");

printf("请输入密码:

");//直接输入密码

scanf("%s",plog);

for(a=2,i=0;i<4;i++,a--)

{

if(login(nlog,plog)==-1)//密码错误

{

system("colorF0");

charplog[20]={};//登录数组初始化

system("cls");

printf("\n");

printf("************************************************************************\n");

printf("*密码错误!

*\n");

printf("************************************************************************\n");

printf("\n\n");

if(a>0)

{

printf("请重新输入密码(你还有%d次机会):

",a);

printf("\n\n");

scanf("%s",plog);

if(login(nlog,plog)==1)

gotosuccess2;

}

else

return0;

}

}

if(login(nlog,plog)==1)

{

success2:

system("colorF0");

printf("\n\n");

printf("\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\登陆成功///////////////////////\n");

Sleep(1000);

system("cls");

}

LEAVESYSTEM:

printf("\n\n");

printf("========================================================================\n");

printf("|1.提交请假申请|\n");

printf("|2.查询请假批准状态|\n");

printf("|如无需操作,可直接关闭程序|\n");

printf("========================================================================\n");

printf("\n\n");

Sleep(1000);

printf("请输入您要执行的选项:

");

scanf("%d",&s);

Sleep(1000);

while(s!

=1&&s!

=2)

{

if(s!

=1&&s!

=2)

{system("color0c");

printf("选项不存在,请重新输入(1/2):

");

s=0;

scanf("%d",&s);

}

}

if(s==1)//写入请假

{

system("colorF0");

system("cls");

printf("\n\n");

printf("========================================================================\n");

printf("||\n");

printf("|------------------------------提交请假申请----------------------------|\n");

printf("||\n");

printf("========================================================================\n");

printf("\n\n");

Leavea;

Sleep(1000);

printf("请输入班级:

\n");

scanf("%s",a.Class);

printf("请输入姓名:

\n");

scanf("%s",a.n1);

printf("请详细输入请假时间:

\n");

scanf("%s",a.time);

printf("请详细输入请假原因:

\n");

scanf("%s",a.reason);

strcpy(nlog,a.Num);

strcpy(a.instructor,"0");

FILE*t=fopen("leave.dat","ab");

fwrite(&a,sizeof(Leave),1,t);//讲以变量u的地址开始的内存区域的一个数据写到f指向的文件中,每个数据占sizeof(User)

fclose(t);

fflush(t);

//Sleep(1000);

printf("\n");

printf("\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\保存成功///////////////////////\n");

printf("请不定时来查询你的假条申请状态!

\n\n\n");

system("pause");

system("cls");

gotoLEAVESYSTEM;

}

if(s==2)//学生查询状态代码

{

system("colorF0");

system("cls");

printf("\n\n");

printf("========================================================================\n");

printf("||\n");

printf("|----------------------------查询请假批准状态--------------------------|\n");

printf("||\n");

printf("========================================================================\n");

Sleep(1000);

TEACHERb;

FILE*t=fopen("read.dat","rb");

while

(1)

{

if(!

(fread(&b,sizeof(TEACHER),1,t)))

break;

if((strcmp(nlog,b.Num))==0)

{

printf("---------------------------------------------------------------\n");

printf("|学生%s请假申请反馈信息:

\n",b.n1);

printf("|班级:

%s\n\n",b.Class);

printf("|姓名:

%s\n\n",b.n1);

printf("|请假时间:

%s\n\n",b.time);

printf("|请假原因:

%s\n\n",b.reason);

printf("---------------------------------------------------------------\n");

Sleep(1000);

printf("\n");

printf("-------------------------------------------------------------\n");

printf("申请状态:

%s\n",b.instructor);

printf("辅导员意见:

%s\n",b.suggest);

printf("-------------------------------------------------------------\n");

system("pause");

Sleep(1000);

system("cls");

gotoLEAVESYSTEM;

}

}

}

if(s==3)

{

gotoLogin;

}

}//身份学生

if(strlen(n)==4)//如果是辅导员

{

inta,i;

selects;

printf("\n");

printf("请输入密码:

");//直接输入密码

scanf("%s",plog);

for(a=2,i=0;i<4;i++,a--)

{

if(login(nlog,plog)==-1)//密码错误

{

system("color0c");

charplog[20]={};//登录数组初始化

system("cls");

printf("\n");

printf("************************************************************************\n");

printf("*密码错误!

*\n");

printf("************************************************************************\n");

printf("\n\n");

if(a>0)

{

printf("请重新输入密码(你还有%d次机会):

",a);

printf("\n\n");

scanf("%s",plog);

if(login(nlog,plog)==1)

gotosuccess3;

}

else

return0;

}

}

if(login(nlog,plog)==1)

{

success3:

system("colorF0");

printf("\n\n");

printf("\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\登陆成功///////////////////////\n");

Sleep(1000);

}

//Approvalsystem:

system("cls");

printf("\n\n");

printf("========================================================================\n");

printf("||\n");

printf("|-------------------------学生请假系统(辅导员端)-----------------------|\n");

printf("||\n");

printf("========================================================================\n");

printf("\n");

Sleep(1000);

printf("========================================================================\n");

printf("|1.查看学生请假申请|\n");

printf("|2.返回登陆界面|\n");

printf("|如无需操作,可直接关闭程序|\n");

printf("========================================================================\n");

printf("\n\n");

Sleep(1000);

printf("请输入您要执行的选项:

");

scanf("%d",&s);

while(s!

=1&&s!

=2)

{

if(s!

=1&&s!

=2)

{

printf("选项不存在,请重新输入(1/2):

");

scanf("%d",&s);

}

}

if(s==1)//辅导员读

{

system("cls");

printf("\n\n");

printf("========================================================================\n");

printf("||\n");

printf("|----------------------------查看学生请假申请--------------------------|\n");

printf("||\n");

printf("========================================================================\n");

printf("\n\n");

Sleep(1000);

Leavea;

FILE*t=fopen("leave.dat","rb");

while

(1)

{

intch;

if(!

(fread(&a,sizeof(Leave),1,t)))

break;

{

printf("-------------------------------------------------------------\n");

printf("|学生信息如下:

\n");

printf("|班级:

%s\n",a.Class);

printf("|姓名:

%s\n",a.n1);

printf("|学号:

%s\n",a.Num);

printf("|请假时间:

%s\n",a.time);

printf("|请假原因:

%s\n",a.reason);

printf("-------------------------------------------------------------\n");

Sleep(1000);

printf("\n\n\n");

printf("\n");

printf("是否批准学生请假申请\n");

printf("-----------------------------------------------------------\n");

printf("-----------------------------------------------------------\n");

printf("1.批准学生请假申请\n");

printf("2.不批准学生请假申请\n");

printf("\n\n\n");

printf("请输入您要执行的选项:

");

scanf("%d",&ch);

while(ch!

=1&&ch!

=2)

{

if(ch!

=1&&ch!

=2)

{

printf("选项不存在,请重新输入(1/2):

");

scanf("%d",&ch);

}

}

if(ch==1)

{

printf("\n\n");

printf("-------------------------------------------------------------\n");

printf("执行中....\n");

printf("-------------------------------------------------------------\n");

Sleep(1000);

TEACHERb;

FILE*F=fopen("read.dat","ab");

strcpy(b.instructor,"您的请假申请已被批准!

");

printf("\n");

printf("辅导员意见:

");

scanf("%s",b.suggest);

strcpy(b.Class,a.Class);

strcpy(b.n1,a.n1);

strcpy(b.time,a.time);

strcpy(b.reason,a.reason);

strcpy(b.Num,a.Num);

//FILE*f3=fopen("leave.dat","ab");

fwrite(&b,sizeof(TEACHER),1,F);

fclose(F);

fflush(F);

Sleep(1000);

printf("\n\n\n");

printf("\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\操作成功///////////////////////\n");

system("pause");

printf("\n\n\n\n\n");

continue;

}

if(ch==2)

{

printf("-------------------------------------------------------------\n");

printf("执行中....\n");

printf("-------------------------------------------------------------\n");

Sleep(1000);

TEACHERb;

FILE*F=fopen("read.dat","ab");

strcpy(b.instructor,"您的请假申请没有被批准,请按时上课!

");

printf("\n");

printf("辅导员意见:

");

scanf("%s",b.suggest);

strcpy(b.Class,a.Class);

strcpy(b.n1,a.n1);

strcpy(b.time,a.time);

strcpy(b.reason,a.reason);

strcpy(b.Num,a.Num);

fwrite(&b,sizeof(TEACHER),1,F);

fclose(F);

fflush(F);

Sleep(1000);

printf("\n\n\n");

printf("\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\操作成功///////////////////////\n");

system("pause");

printf("\n\n\n\n\n");

continue;

}

}

}

}

if(s==2)

{

system("cls");

gotoLogin;//修改学生请假申请状态反回

}

}//如果是辅导员

if(strlen(n)==5)//如果是老师

{

inta,i;

printf("\n");

printf

展开阅读全文
相关资源
猜你喜欢
相关搜索
资源标签

当前位置:首页 > 初中教育 > 语文

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2