-
Notifications
You must be signed in to change notification settings - Fork 1
/
login.php
159 lines (122 loc) · 4.99 KB
/
login.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
<?php
session_start();
include_once 'Controller/ErrorSettings.php';
?>
<?php
include ('Connect/Connect.php');
include ('Controller/Url.php');
include('Controller/Auth.php');
if(isset($_POST['loggedin_1'])){
$post = Auth::loggedin_1($_POST);
}
if(isset($_POST['loggedin_2'])){
$post = Auth::loggedin_2($_POST);
}
if(isset($_POST['loggedin_3'])){
$post = Auth::loggedin_3($_POST);
}
?>
<?php
include('common/head.php');
include('common/navigation.php');
?>
<link rel="stylesheet" type="text/css" href="css/member.css">
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<!--<script src="js/bootstrap.min.js" type="text/javascript" charset="utf-8" async defer></script>-->
<script src="layer/layer.js" type="text/javascript" charset="utf-8" async defer></script>
<?php
$lev_value = Auth::checklev_value();
$val_id = $_SESSION['val_id'];
if($val_id==""){
return redirect ("login_entrance.php");
}
?>
<?php if($val_id=='1'){ ?>
<div class="form-box l-col-wrap">
<div class="l-col form-box__form">
<h1 class="form-box__title">Login For Tenant<p><p>請輸入房客的帳號密碼進行登入</p></h1>
<br>
<form name="loggedin" id="loggedin" method="post" class="form form--log-in" enctype="multipart/form-data">
<input type="hidden" name="loggedin_1" value="true">
<label for="account" class="form__label">房客帳號:</label>
<input id="account" name="account" type="text" class="form__field" placeholder="請輸入房客帳號" required="true" autofocus="">
<label for="password" class="form__label">房客密碼:</label>
<input id="inputPassword" name="password" type="password" class="form__field" placeholder="請輸入房客密碼" required="true">
<br>
<input name="submit" type="submit" class="form__button button" value="Login">
</form>
<small class="form-box__addon u-auto-format-text">
還尚未註冊嗎? <a href="register_entrance.php?val=1">註冊</a>
</small>
<br>
<small class="form-box__addon u-auto-format-text">
不是房客? <a href="login_entrance.php">返回</a>
</small>
</div>
</div>
<?php
}
?>
<?php if($val_id=='2'){ ?>
<div class="form-box l-col-wrap">
<div class="l-col form-box__form">
<h1 class="form-box__title">Login For Landlord<p><p>請輸入房東的帳號密碼進行登入</p></h1>
<br>
<form name="loggedin" id="loggedin" method="post" class="form form--log-in" enctype="multipart/form-data">
<input type="hidden" name="loggedin_2" value="true">
<label for="account" class="form__label">房東帳號:</label>
<input id="account" name="account" type="text" class="form__field" placeholder="請輸入房東帳號" required="true" autofocus="">
<label for="password" class="form__label">房東密碼:</label>
<input id="password" name="password" type="password" class="form__field" placeholder="請輸入房客密碼" required="true">
<br>
<input name="submit" type="submit" class="form__button button" value="Login">
</form>
<small class="form-box__addon u-auto-format-text">
還尚未註冊嗎? <a href="register_entrance.php?val=2">註冊</a>
</small>
<br>
<small class="form-box__addon u-auto-format-text">
不是房東? <a href="login_entrance.php">返回</a>
</small>
</div>
</div>
<?php
}
?>
<?php if($val_id=='3'){ ?>
<div class="form-box l-col-wrap">
<div class="l-col form-box__form">
<h1 class="form-box__title">Login For administrator<p><p>請輸入管理人員的帳號密碼進行登入</p></h1>
<br>
<form name="loggedin" id="loggedin" method="post" class="form form--sign-up" enctype="multipart/form-data">
<input type="hidden" name="loggedin_3" value="true">
<label for="account" class="form__label">管理人員帳號:</label>
<input name="account" type="account" class="form__field" placeholder="請輸入管理人員帳號" required="true" autofocus="">
<label for="password" class="form__label">管理人員密碼:</label>
<input name="password" type="password" class="form__field" placeholder="請輸入管理人員密碼" required="true" >
<br>
<input name="submit" type="submit" class="form__button button" value="Login">
</form>
<br>
<small class="form-box__addon u-auto-format-text">
不是管理人員? <a href="login_entrance.php">返回</a>
</small>
</div>
</div>
<?php
}
?>
<!-- Footer -->
<?php
include('common/footer.php');
?>
<script>
<?php if(isset($_GET['message'])){?>
<?php if($_GET['message']=='error'){ ?> //於Auth.php 進行驗證帳號不會重複
layer.alert('帳號密碼輸入錯誤,或者身分尚未審核通過', {
skin: 'layui-layer-molv' //样式类名
,closeBtn: 0
});
<?php } ?>
<?php } ?>
</script>