?? gongneng.c
字號:
#include "bianliang.h"
#include "xinxi.h"
#include "main.h"
#include "yonghu.h"
#include "piao.h"
// // // // // // // // // // 管理員功能界面 // // // // // // // // // //
void adgn(emploe em1[10],int k)
{
FILE *f;
int n,m;
emploe em2[10];
system("cls");
loop1:printf("\n\t\t請選擇功能:\t\t\t\t\t\t管理員");
printf("\n________________________________________________________________________________");
printf("\n\n\t\t1.登錄航班");
printf("\n\t\t2.查詢航班\n");
printf("\n\t\t3.訂票");
printf("\n\t\t4.退票\n");
printf("\n\t\t5.添加用戶");
printf("\n\t\t6.修改權限\n");
printf("\n\t\t7.刪除用戶");
printf("\n\t\t8.修改密碼\n");
printf("\n\t\t9.注銷");
printf("\n\t\t0.退出\n");
printf("\n\n================================================================================");
n=-1;
fflush(stdin);
scanf("%d",&n);
switch(n)
{
// // // // // // // // // // 登 錄 航 班 信 息 // // // // // // // // // //
case 1:
loop2: system("cls");
printf("\n\t\t請選擇功能:\t\t\t\t\t\t管理員");
printf("\n________________________________________________________________________________");
printf("\n\n\n\t\t1.輸入航班信息");
printf("\n\n\n\t\t2.刪除航班信息");
printf("\n\n\n\t\t0.返回");
fflush(stdin);
scanf("%d",&m);
switch(m)
{
case 1:
system("cls");
input(em1,k);
system("cls");
goto loop2;
break;
case 2:
system("cls");
delair(em1,k);
system("cls");
goto loop2;
break;
case 0:
system("cls");
goto loop1;
break;
default:
system("cls");
printf("\n\t\t\t\t\t\t\t\t\t管理員");
printf("\n________________________________________________________________________________");
printf("\n\n\n\n\n\n\n\t\t\t您的輸入不符合要求~");
printf("\n\n\n\n\n\n\n\n\n\n\n================================================================================");
printf("\n\t\t\t\t(按任意鍵返回)");
fflush(stdin);
n=getch();
system("cls");
goto loop2;
}
break;
// // // // // // // // // // 查 詢 航 班 信 息 // // // // // // // // // //
case 2:
system("cls");
output(em1,k);
system("cls");
goto loop1;
break;
// // // // // // // // // // 訂 票 // // // // // // // // // //
case 3:
system("cls");
book(em1,k);
goto loop1;
break;
// // // // // // // // // // 退 票 // // // // // // // // // //
case 4:
system("cls");
refund(em1,k);
goto loop1;
break;
// // // // // // // // // // 添 加 新 用 戶 // // // // // // // // // //
case 5:
system("cls");
add(em1,k);
printf("\n\n\t\t新用戶注冊成功!!");
printf("\n\n\n\n================================================================================");
printf("\n\t\t\t\t(按任意鍵繼續)");
fflush(stdin);
n=getch();
system("cls");
goto loop1;
break;
// // // // // // // // // // 修 改 權 限 // // // // // // // // // //
case 6:
system("cls");
power(em1,k);
system("cls");
goto loop1;
break;
// // // // // // // // // // 刪 除 用 戶 // // // // // // // // // //
case 7:
system("cls");
del(em1,k);
system("cls");
goto loop1;
break;
// // // // // // // // // // 修 改 密 碼 // // // // // // // // // //
case 8:
changepwd(em1,k);
printf("\n\n\n\n\t\t您的密碼修改成功!!");
printf("\n\n\n\n\n\n\n\n================================================================================");
printf("\n\t\t\t\t(按任意鍵繼續)");
fflush(stdin);
n=getch();
system("cls");
goto loop1;
break;
// // // // // // // // // // 注 銷 // // // // // // // // // //
case 9:
system("cls");
if ((f=fopen("pwd.dat","r"))==NULL)
{
printf("File Can't be find!\n");
}
else
{
fread(&em2,sizeof(em2),1,f);
}
fclose(f);
if ((f=fopen("pwd.dat","w+b"))==NULL)
{
printf("File Can't be find!\n");
}
else
{
em2[k].record=0;
em2[k].first=em1[k].first;
fwrite(&em2,sizeof(em2),1,f);
}
fclose(f);
main();
break;
// // // // // // // // // // 退 出 // // // // // // // // // //
case 0:
system("cls");
if ((f=fopen("pwd.dat","r"))==NULL)
{
printf("File Can't be find!\n");
}
else
{
fread(&em2,sizeof(em2),1,f);
}
fclose(f);
if ((f=fopen("pwd.dat","w+b"))==NULL)
{
printf("File Can't be find!\n");
}
else
{
em2[k].record=0;
em2[k].first=em1[k].first;
fwrite(&em2,sizeof(em2),1,f);
}
fclose(f);
main();
break;
// // // // // // // // // // 輸 入 錯 誤 // // // // // // // // // //
default:
{
system("cls");
printf("\n\t\t\t\t\t\t\t\t\t管理員");
printf("\n________________________________________________________________________________");
printf("\n\n\n\n\n\n\n\t\t\t\t您的輸入不符合要求~");
printf("\n\n\n\n\n\n\n\n\n\n\n================================================================================");
printf("\n\t\t\t\t(按任意鍵返回)");
fflush(stdin);
n=getch();
system("cls");
goto loop1;
}
}
}
// // // // // // // // // // 用 戶 功 能 界 面 // // // // // // // // // //
void usgn(emploe em1[10],int k)
{
FILE *f;
int n;
emploe em2[10];
static char password1[6],password2[6],ch;
system("cls");
loop1:printf("\n\t\t請選擇功能:\t\t\t\t\t\t員工");
printf("\n________________________________________________________________________________");
printf("\n\n\n\n\t\t1.查詢航班");
printf("\n\t\t2.修改密碼");
printf("\n\n\t\t3.訂票");
printf("\n\t\t4.退票");
printf("\n\n\t\t9.注銷");
printf("\n\t\t0.退出");
printf("\n\n\n\n\n\n\n================================================================================");
fflush(stdin);
scanf("%d",&n);
switch(n)
{
// // // // // // // // // // 查 詢 航 班 信 息 // // // // // // // // // //
case 1:
system("cls");
output(em1,k);
system("cls");
goto loop1;
break;
// // // // // // // // // // 修 改 密 碼 // // // // // // // // // //
case 2:
changepwd(em1,k);
printf("\n\n\n\n\t\t您的密碼修改成功!!");
printf("\n\n\n\n\n\n\n\n================================================================================");
printf("\n\t\t\t\t(按任意鍵繼續)");
fflush(stdin);
n=getch();
system("cls");
goto loop1;
break;
// // // // // // // // // // 訂 票 // // // // // // // // // //
case 3:
system("cls");
book(em1,k);
goto loop1;
break;
// // // // // // // // // // 退 票 // // // // // // // // // //
case 4:
system("cls");
refund(em1,k);
goto loop1;
break;
// // // // // // // // // // 注 銷 // // // // // // // // // //
case 9:
system("cls");
if ((f=fopen("pwd.dat","r"))==NULL)
{
printf("File Can't be find!\n");
}
else
{
fread(&em2,sizeof(em2),1,f);
}
fclose(f);
if ((f=fopen("pwd.dat","w+b"))==NULL)
{
printf("File Can't be find!\n");
}
else
{
em2[k].record=0;
em2[k].first=em1[k].first;
fwrite(&em2,sizeof(em2),1,f);
}
fclose(f);
main();
break;
// // // // // // // // // // 退 出 // // // // // // // // // //
case 0:
system("cls");
if ((f=fopen("pwd.dat","r"))==NULL)
{
printf("File Can't be find!\n");
}
else
{
fread(&em2,sizeof(em2),1,f);
}
fclose(f);
if ((f=fopen("pwd.dat","w+b"))==NULL)
{
printf("File Can't be find!\n");
}
else
{
em2[k].record=0;
em2[k].first=em1[k].first;
fwrite(&em2,sizeof(em2),1,f);
}
fclose(f);
main();
break;
// // // // // // // // // // 輸 入 錯 誤 // // // // // // // // // //
default:
{
system("cls");
printf("\n\t\t\t\t\t\t\t\t\t員工");
printf("\n________________________________________________________________________________");
printf("\n\n\n\n\n\n\n\t\t\t\t您的輸入不符合要求~");
printf("\n\n\n\n\n\n\n\n\n\n\n================================================================================");
printf("\n\t\t\t\t(按任意鍵返回)");
fflush(stdin);
n=getch();
system("cls");
goto loop1;
}
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -