web语言做航班系统--登录界面
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<style type="text/css">
#box{
width: 500px;
height: 300px;
border: solid 1px;
margin: 100px auto auto auto;
}
#box1{
width: 300px;
height: 120px;
border: solid 1px red;
float: left;
}
#box2{
width: 190px;
height: 120px;
margin-left: 0em;
border: solid 1px red;
float: left;
}
#box3{
width: 500px;
height: 120px;
margin-right: 0em;
background: #55aaff;
border: solid 1px red;
margin-top: 20px;
float: left;
}
#text{
width: 190px;
height: 120px;
border: solid 1px red;
margin-left: 100px;
}
#box4{
width: 190px;
height: 150px;
border: solid 1px red;
margin-left: 10px;
float: left;
background: #dbe4ee;
text-align: center;
}
</style>
</head>
<body>
<div id="box">
<div id="box1">
这是第一个box
</div>
<div id="box2">
这是第二个box
</div>
<div id="box3">
<div id="box4">
</div>
<div id="box4">
<form action=""><br /><b>登录</b><br />
用户:
<input type="text" name="user" id="name" size="10" />
<br />
密码:
<input type="password" name="passw" id="passw" size="10"/>
<br />
<input type="radio" name="user" id="choose" value="顾客" onclick="O_use()"/>顾客
<input type="radio" name="user" id="choos2" value="管理员" onclick="M_use()"/>管理员
<br />
<input type="reset" name="Clear Order" value="重置"/>
<input type="submit" name="SignIn" value="登录" onclick="check()"/>
</form>
</div>
</div>
</div>
<script type="text/javascript">
var Customer="zd";
var Cust_Psw="zd";
var Cust_use="顾客";
var Manager="LLL";
var Man_Paw="123";
var Mana_use="管理员";
var uselayer="";
function M_use(){
uselayer=document.getElementById("choos2").value;
}
function O_use(){
uselayer=document.getElementById("choose").value;
}
function check(){
var string_N=document.getElementById("name").value;
var string_P=document.getElementById("passw").value;
if(uselayer==Cust_use){
if(string_N==Customer){
if(string_P==Customer){
alert("欢迎使用本系统!");
window.open("Ordinary.html");
}else{
alert("密码或用户名出错");
}
}else{
alert("密码或用户名出错");
}
}else if(uselayer==Mana_use){
if(string_N==Manager){
if(string_P==Man_Paw){
alert("欢迎使用本系统!");
window.open("Manager.html");
}else{
alert("密码或用户名出错");
}
}else{
alert("密码或用户名出错");
}
}else{
alert("身份错误!");
}
}
</script>
</body>
</html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<style type="text/css">
#box{
width: 500px;
height: 300px;
border: solid 1px;
margin: 100px auto auto auto;
}
#box1{
width: 300px;
height: 120px;
border: solid 1px red;
float: left;
}
#box2{
width: 190px;
height: 120px;
margin-left: 0em;
border: solid 1px red;
float: left;
}
#box3{
width: 500px;
height: 120px;
margin-right: 0em;
background: #55aaff;
border: solid 1px red;
margin-top: 20px;
float: left;
}
#text{
width: 190px;
height: 120px;
border: solid 1px red;
margin-left: 100px;
}
#box4{
width: 190px;
height: 150px;
border: solid 1px red;
margin-left: 10px;
float: left;
background: #dbe4ee;
text-align: center;
}
</style>
</head>
<body>
<div id="box">
<div id="box1">
这是第一个box
</div>
<div id="box2">
这是第二个box
</div>
<div id="box3">
<div id="box4">
</div>
<div id="box4">
<form action=""><br /><b>登录</b><br />
用户:
<input type="text" name="user" id="name" size="10" />
<br />
密码:
<input type="password" name="passw" id="passw" size="10"/>
<br />
<input type="radio" name="user" id="choose" value="顾客" onclick="O_use()"/>顾客
<input type="radio" name="user" id="choos2" value="管理员" onclick="M_use()"/>管理员
<br />
<input type="reset" name="Clear Order" value="重置"/>
<input type="submit" name="SignIn" value="登录" onclick="check()"/>
</form>
</div>
</div>
</div>
<script type="text/javascript">
var Customer="zd";
var Cust_Psw="zd";
var Cust_use="顾客";
var Manager="LLL";
var Man_Paw="123";
var Mana_use="管理员";
var uselayer="";
function M_use(){
uselayer=document.getElementById("choos2").value;
}
function O_use(){
uselayer=document.getElementById("choose").value;
}
function check(){
var string_N=document.getElementById("name").value;
var string_P=document.getElementById("passw").value;
if(uselayer==Cust_use){
if(string_N==Customer){
if(string_P==Customer){
alert("欢迎使用本系统!");
window.open("Ordinary.html");
}else{
alert("密码或用户名出错");
}
}else{
alert("密码或用户名出错");
}
}else if(uselayer==Mana_use){
if(string_N==Manager){
if(string_P==Man_Paw){
alert("欢迎使用本系统!");
window.open("Manager.html");
}else{
alert("密码或用户名出错");
}
}else{
alert("密码或用户名出错");
}
}else{
alert("身份错误!");
}
}
</script>
</body>
</html>