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