first commit

master
456love 6 years ago
parent 7cfdf2701d
commit b132d25765

BIN
admin

Binary file not shown.

BIN
air

Binary file not shown.

@ -672,7 +672,7 @@ void adminfunction() //
printf("\t\t6 删除航班信息\n");
printf("\t\t0 返回上一层\n");
printf("\n\n\n");
printf(" 请输入你要进行的操作: ");
printf("\t\t请输入你要进行的操作: ");
scanf("%d",&i);
getchar();
switch(i)
@ -770,11 +770,11 @@ void superfunction()
HANDLE handle = GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleTextAttribute(handle, FOREGROUND_INTENSITY| FOREGROUND_RED);
printf("\n\n\n\n\n\n");
printf(" 1 添加管理员\n");
printf(" 2 删除管理员\n");
printf(" 0 返回上一层\n");
printf("\t\t1 添加管理员\n");
printf("\t\t2 删除管理员\n");
printf("\t\t0 返回上一层\n");
printf("\n\n\n");
printf(" 请输入你要进行的操作: ");
printf("\t\t请输入你要进行的操作: ");
scanf("%d",&i);
getchar();
switch(i)
@ -782,7 +782,7 @@ void superfunction()
case 1:s_add();
case 2:s_delete();
case 0:end=1;break;
default:printf(" 错误输入!请重新输入:");
default:printf("\t\t错误输入!请重新输入:");
system("pause");
continue;
}
@ -1147,32 +1147,45 @@ void deleteair()
struct airstruct *airp;
char airname[20];
int exist = 0;
int end=0;
airp = airhead;
printf(" 输入你需要删除的航班编号: ");
printf("\t\t输入你需要删除的航班编号(输入@退出): ");
while (gets(airname))
{
while (airp != NULL)
if(strcmp(airname,"@")==0)
{
if (strcmp(airname, airp->airname) == 0)
end=1;
break;
}
else
{
while (airp != NULL)
{
exist = 1;
break;
if (strcmp(airname, airp->airname) == 0)
{
exist = 1;
break;
}
airp = airp->next;
}
airp = airp->next;
}
if (!exist)
{
printf("\n 该航班不存在...\n");
printf("\n 请重新输入: ");
if (!exist)
{
printf("\n\t\t该航班不存在...\n");
printf("\n\t\t请重新输入: ");
}
else
{
printf("\n 删除成功!");
system("pause");
break;
}
else
{
printf("\n\t\t删除成功!");
system("pause");
break;
}
}
}
if(end)
{
return ;
}
deleteuser(airname);
airp = airhead;
if (strcmp(airhead->airname,airname) == 0)
@ -1188,14 +1201,14 @@ void deleteair()
}
airp = NULL;
writefile(3);
printf("\n 输入0返回管理员界面界面: ");
/*printf("\n 输入0返回管理员界面界面: ");
int n;
while (1)
{
scanf("%d", &n);
if (n == 0)
break;
}
}*/
}
void changeuser(char *s,char *s1,int a)
{
@ -1315,10 +1328,12 @@ void s_add()
{
if(admincount==0)
{
printf("请输入用户名:");
printf("\n\n\n\n\n\n\n");
printf("***************************************************************\n");
printf("\t\t请输入用户名:");
gets(adminname);
strcpy(adminhead->adminname, adminname);
printf("输入密码:");
printf("\n\t\t输入密码:");
gets(adminmm);
strcpy(adminhead->adminmm,adminmm);
adminend = adminhead;
@ -1326,21 +1341,23 @@ void s_add()
}
else
{
printf("\n\n\n\n\n\n\n");
printf("***************************************************************\n");
p=(struct adminstruct *)malloc(sizeof(struct adminstruct));
printf("请输入用户名:");
printf("\t\t请输入用户名:");
gets(adminname);
while(1)
{
if(isexist(adminname,1))
{
printf("用户名已存在,请重新输入:");
printf("\t\t用户名已存在,请重新输入:");
gets(adminname);
}
else
break;
}
strcpy(p->adminname, adminname);
printf("请输入密码:");
printf("\t\t请输入密码:");
gets(adminmm);
strcpy(p->adminmm, adminmm);
adminend->next = p;
@ -1374,30 +1391,39 @@ void s_delete()
struct adminstruct *adminp;
char adminname[20];
int exist = 0;
int end=0;
adminp = adminhead;
printf("输入你需要删除的管理员用户名: ");
printf("\t\t输入你需要删除的管理员用户名(按@退出): ");
while (gets(adminname))
{
while (adminp != NULL)
if(strcmp(adminname,"@")==0)
{
if (strcmp(adminname, adminp->adminname) == 0)
{
exist = 1;
break;
}
adminp = adminp->next;
end=1;
break;
}
if (!exist)
else
{
printf("该管理员不存在!..\n");
printf("请重新输入: ");
while (adminp != NULL)
{
if (strcmp(adminname, adminp->adminname) == 0)
{
exist = 1;
break;
}
adminp = adminp->next;
}
if (!exist)
{
printf("\t\t该管理员不存在!..\n");
printf("\t\t请重新输入: ");
}
else
break;
}
else
break;
}
adminp = adminhead;
if (strcmp(adminhead->adminname,adminname) == 0)
adminhead = adminhead->next;
adminhead = adminhead->next;
while (adminp->next != NULL)
{
if (strcmp(adminp->next->adminname, adminname) == 0)

Binary file not shown.

BIN
super

Binary file not shown.

BIN
user

Binary file not shown.
Loading…
Cancel
Save