-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
signup.php
221 lines (187 loc) · 6.53 KB
/
signup.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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
<!DOCTYPE html>
<?php
include 'db.php';
$status = 0;
if(isset($_POST['sub'])){
$i1 = $_POST['i1'];
$i2 = $_POST['i2'];
$i3 = $_POST['i3'];
$i4 = $_POST['i4'];
$i5 = $_POST['i5'];
$i6 = $_POST['i6'];
$ps = "INSERT INTO accounts (fname, lname, email, pass, pno, role) VALUES ('$i1', '$i2', '$i3', '$i4', '$i5', '$i6')";
if(mysqli_query($conn, $ps)) {
$status = 1;
} else {
$status = -1;
}
}
?>
<html lang="en" class="full-height">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<title>Analysis and Management of Waste</title>
<!-- Font Awesome -->
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.7.1/css/all.css" integrity="sha384-fnmOCqbTlWIlj8LyTjo7mOUStjsKC4pOpQbqyi7RrhN7udi9RwhKkMHpvLbHG9Sr" crossorigin="anonymous">
<!-- Bootstrap core CSS -->
<link rel="stylesheet" href="css/bootstrap.min.css">
<!-- Material Design Bootstrap -->
<link rel="stylesheet" href="css/mdb.min.css">
<style>
.views {
background: url("https://cdn.pixabay.com/photo/2017/12/29/18/47/nature-3048299_1280.jpg")no-repeat center center;
background-size: cover;
}
.navbar {
background-color: transparent;
}
.top-nav-collapse {
background-color: #4285F4;
}
@media only screen and (max-width: 768px) {
.navbar {
background-color: #4285F4;
}
}
html,
body,
header,
.view {
height: 100%;
}
</style>
</head>
<body class="">
<!--Main Navigation-->
<header>
<!-- Navbar -->
<nav class="navbar fixed-top navbar-expand-lg navbar-dark scrolling-navbar">
<div class="container">
<a class="navbar-brand" href="#"><strong>IOT Challenge 2019</strong></a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent"
aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav mr-auto">
</ul>
<ul class="navbar-nav nav-flex-icons">
<li class="nav-item">
<a class="nav-link" href="index.php"><strong>Sign in</strong></span></a>
</li>
<li class="nav-item">
<a class="nav-link" href="#"><strong>About Us</strong></span></a>
</li>
</ul>
</div></div>
</nav>
<!-- /.Navbar -->
<!--Main Navigation-->
<!--Main layout-->
<!--Main layout-->
<div class="view views intro-2" style="">
<div class="full-bg-img">
<div class="mask rgba-purple-light flex-center">
<div class="col mt-5">
<div class="flex-center"><h3 class="display-5 text-white"> Analysis and Management of Smart Waste</h3></div>
<div class="container text-center white-text wow fadeInUp col-md-4">
<?php
if($status==1) {
header( "refresh:5;url=index.php" );?>
<div class="alert alert-success" role="alert">
Successfully Registered, Redirecting to Login Page in 5 seconds.
</div>
<?php } else if($status==-1) {?>
<div class="alert alert-danger" role="alert">
Failed to Register, Please try again later.
</div>
<?php } ?>
<!-- Material form register -->
<div class="card card-cascade narrower">
<h5 class="view view-cascade card-header info-color white-text text-center py-4">
<strong>Sign up</strong>
</h5>
<!--Card content-->
<div class="card-body px-lg-5 pt-0">
<!-- Form -->
<form class="text-center" style="color: #757575;" method="post">
<div class="form-row">
<div class="col">
<!-- First name -->
<div class="md-form">
<input type="text" id="materialRegisterFormFirstName" class="form-control" name="i1" required>
<label for="materialRegisterFormFirstName">First name</label>
</div>
</div>
<div class="col">
<!-- Last name -->
<div class="md-form">
<input type="text" id="materialRegisterFormLastName" class="form-control" name="i2" required>
<label for="materialRegisterFormLastName">Last name</label>
</div>
</div>
</div>
<!-- E-mail -->
<div class="md-form mt-0">
<input type="email" id="materialRegisterFormEmail" class="form-control" name="i3" required>
<label for="materialRegisterFormEmail">E-mail</label>
</div>
<!-- Password -->
<div class="md-form">
<input type="password" id="materialRegisterFormPassword" class="form-control" aria-describedby="materialRegisterFormPasswordHelpBlock" name="i4" required>
<label for="materialRegisterFormPassword">Password</label>
<small id="materialRegisterFormPasswordHelpBlock" class="form-text text-muted mb-4">
At least 8 characters
</small>
</div>
<!-- Phone number -->
<div class="md-form">
<input type="password" id="materialRegisterFormPhone" class="form-control" name="i5" aria-describedby="materialRegisterFormPhoneHelpBlock">
<label for="materialRegisterFormPhone">Phone number</label>
<small id="materialRegisterFormPhoneHelpBlock" class="form-text text-muted mb-4">
Optional
</small>
</div>
<div class="md-form">
<select class="mdb-select md-form" name="i6">
<option value="" disabled selected>Role</option>
<option value="user">User</option>
<option value="auth">Authority</option>
</select>
</div>
<!-- Sign up button -->
<button class="btn btn-outline-info btn-rounded btn-block my-4 waves-effect z-depth-0" type="submit" name="sub">Sign up</button>
<hr>
<!-- Terms of service -->
<p>By clicking
<em>Sign up</em> you agree to our
<a href="" target="_blank">terms of service</a>
</form>
<!-- Form -->
</div>
</div></div>
<!-- Material form register -->
</div>
</div>
</div>
</div>
</header>
<!-- SCRIPTS -->
<!-- JQuery -->
<script src="js/jquery-3.3.1.min.js"></script>
<!-- Bootstrap tooltips -->
<script type="text/javascript" src="js/popper.min.js"></script>
<!-- Bootstrap core JavaScript -->
<script type="text/javascript" src="js/bootstrap.js"></script>
<!-- MDB core JavaScript -->
<script type="text/javascript" src="js/mdb.min.js"></script>
<script type="text/javascript">
// Material Select Initialization
$(document).ready(function() {
$('.mdb-select').materialSelect();
});
</script>
</body>
</html>