📄 admin.cpp
字号:
#include <fstream>
#include <iostream>
#include <string>
#include"manager.h"
using namespace std;
void admin::passupdate(void){
string str1,str2;
cout<<"输入旧密码确认"<<endl;
cin>>str1;
if(str1==password){
cout<<"验证成功,输入新密码"<<endl;
cin>>str2;
password=str2;
cout<<"密码更新成功"<<endl;
}
else{
cout<<"密码验证不成功;继续(y),退出(n)"<<endl;
char c;
cin>>c;
if(c=='y')
passupdate();
}
}
void admin::user()
{
int i=7;
int j=7;
int k=7;
string pass;
manager rail;
rail.read();
while(i!=2)
{
cout<<"普通用户登录 请输入0;"<<endl;
cout<<"管理员用户登录 请输入1;"<<endl;
cout<<"退出票务管理系统 请输入2:"<<endl;
cin>>i;
cout<<endl;
if(i==0)
{
cout<<"---您已登录普通用户---"<<endl;
j=7;
while(j!=4)
{
cout<<endl;
cout<<"车次查询 请输入0;"<<endl;
cout<<"站站间查询 请输入1;"<<endl;
cout<<"订票 请输入2;"<<endl;
cout<<"退票 请输入3;"<<endl;
cout<<"退出普通用户 请输入4:"<<endl;
cin>>j;
cout<<endl;
if(j==0)
rail.getrail();
if(j==1)
rail.findway();
if(j==2)
{} ///////订票
if(j==3)
{} ///////退票
}
cout<<"---已退出普通用户---"<<endl<<endl;
}
if(i==1)
{
cout<<"请输入管理员密码:"<<endl;
cin>>pass;
cout<<endl<<endl;
if(pass==password)
{
cout<<"---您已登录管理员用户---"<<endl;
k=7;
while(k!=2)
{
cout<<endl;
cout<<"修改车次信息请输入0;"<<endl;
cout<<"更改密码请输入1;"<<endl;
cout<<"退出管理员请输入2:"<<endl;
cin>>k;
cout<<endl;
if(k==0)
{}//////////////////////////////修改车次
else
if(k==1)
passupdate();
}
cout<<"---已退出管理员用户---"<<endl<<endl;
}
else
{
cout<<"密码错误 请重新登录!"<<endl;
exit(0);
}
}
}
cout<<endl<<endl;
cout<<"---您已退出票务管理系统---"<<endl<<endl;
cout<<"谢谢使用 再见!!!"<<endl;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -