-
Notifications
You must be signed in to change notification settings - Fork 0
/
account.php
268 lines (246 loc) · 8.37 KB
/
account.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
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
<?php
session_start();
error_reporting(0);
include('includes/config.php');
// Code user Registration
if(isset($_POST['submit']))
{
$name=$_POST['fullname'];
$email=$_POST['emailid'];
$contactno=$_POST['contactno'];
$password=$_POST['password'];
$query=mysqli_query($con,"insert into users(name,email,contactno,password) values('$name','$email','$contactno','$password')");
if($query)
{
echo "<script>alert('You are successfully register');</script>";
}
else{
echo "<script>alert('Not register something went worng');</script>";
}
}
// Code for User login
if(isset($_POST['login']))
{
$email=$_POST['email'];
$password=$_POST['password'];
$query=mysqli_query($con,"SELECT * FROM users WHERE email='$email' and password='$password'");
$num=mysqli_fetch_array($query);
if($num>0)
{
$extra="index.php";
$_SESSION['login']=$_POST['email'];
$_SESSION['id']=$num['id'];
$_SESSION['username']=$num['name'];
$uip=$_SERVER['REMOTE_ADDR'];
$status=1;
$log=mysqli_query($con,"insert into userlog(userEmail,userip,status) values('".$_SESSION['login']."','$uip','$status')");
$host=$_SERVER['HTTP_HOST'];
$uri=rtrim(dirname($_SERVER['PHP_SELF']),'/\\');
header("location:http://$host$uri/$extra");
exit();
}
else
{
$extra="account.php";
$email=$_POST['email'];
$uip=$_SERVER['REMOTE_ADDR'];
$status=0;
$log=mysqli_query($con,"insert into userlog(userEmail,userip,status) values('$email','$uip','$status')");
$host = $_SERVER['HTTP_HOST'];
$uri = rtrim(dirname($_SERVER['PHP_SELF']),'/\\');
//header("location:http://$host$uri/$extra");
$_SESSION['errmsg']="Invalid email id or Password";
echo "<script>alert('Not register something went worng');</script>";
//exit();
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="">
<meta name="author" content="Ansonika">
<title>MECHOP | Account Page</title>
<!-- Favicons-->
<link rel="shortcut icon" href="img/favicon.png" type="image/x-icon">
<link rel="apple-touch-icon" type="image/x-icon" href="img/apple-touch-icon-57x57-precomposed.png">
<link rel="apple-touch-icon" type="image/x-icon" sizes="72x72" href="img/apple-touch-icon-72x72-precomposed.png">
<link rel="apple-touch-icon" type="image/x-icon" sizes="114x114" href="img/apple-touch-icon-114x114-precomposed.png">
<link rel="apple-touch-icon" type="image/x-icon" sizes="144x144" href="img/apple-touch-icon-144x144-precomposed.png">
<!-- GOOGLE WEB FONT -->
<link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700,900&display=swap" rel="stylesheet">
<!-- BASE CSS -->
<link href="css/bootstrap.custom.min.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">
<!-- SPECIFIC CSS -->
<link href="css/account.css" rel="stylesheet">
<!-- YOUR CUSTOM CSS -->
<link href="css/custom.css" rel="stylesheet">
<script type="text/javascript">
function valid()
{
if(document.register.password.value!= document.register.confirmpassword.value)
{
alert("Password and Confirm Password Field do not match !!");
document.register.confirmpassword.focus();
return false;
}
return true;
}
</script>
<script>
function userAvailability() {
$("#loaderIcon").show();
jQuery.ajax({
url: "check_availability.php",
data:'email='+$("#email").val(),
type: "POST",
success:function(data){
$("#user-availability-status1").html(data);
$("#loaderIcon").hide();
},
error:function (){}
});
}
</script>
</head>
<body>
<div id="page">
<header class="version_1">
<?php include('includes/Header1.php');?>
<?php include('includes/Header2.php');?>
</header>
<!-- /header -->
<main class="bg_gray">
<div class="container margin_30">
<div class="page_header">
<div class="breadcrumbs">
<ul>
<li><a href="#">Home</a></li>
<li><a href="#">Category</a></li>
<li>Page active</li>
</ul>
</div>
<h1>Sign In or Create an Account</h1>
</div>
<!-- /page_header -->
<div class="row justify-content-center">
<div class="col-xl-6 col-lg-6 col-md-8">
<div class="box_account">
<h3 class="client">Already Client</h3>
<div class="form_container">
<form method="POST">
<div class="row no-gutters">
<div class="col-lg-6 pr-lg-1">
<a href="#0" class="social_bt facebook">Login with Facebook</a>
</div>
<div class="col-lg-6 pl-lg-1">
<a href="#0" class="social_bt google">Login with Google</a>
</div>
</div>
<div class="divider"><span>Or</span></div>
<div class="form-group">
<input type="email" class="form-control" name="email" id="exampleInputEmail1" placeholder="Email*">
</div>
<div class="form-group">
<input type="password" class="form-control" name="password" id="exampleInputPassword1" value="" placeholder="Password*">
</div>
<div class="clearfix add_bottom_15">
</div>
<div class="text-center"><input type="submit" name="login" value="Log In" class="btn_1 full-width"></div>
<div id="forgot_pw">
<div class="form-group">
<input type="email" class="form-control" name="email_forgot" id="email_forgot" placeholder="Type your email">
</div>
<p>A new password will be sent shortly.</p>
<div class="text-center"><input type="submit" value="Reset Password" class="btn_1"></div>
</div>
</form>
</div>
<!-- /form_container -->
</div>
<!-- /box_account -->
<div class="row">
<div class="col-md-6 d-none d-lg-block">
<ul class="list_ok">
<li>Find Locations</li>
<li>Quality Location check</li>
<li>Data Protection</li>
</ul>
</div>
<div class="col-md-6 d-none d-lg-block">
<ul class="list_ok">
<li>Secure Payments</li>
<li>H24 Support</li>
</ul>
</div>
</div>
<!-- /row -->
</div>
<div class="col-xl-6 col-lg-6 col-md-8">
<form role="form" method="post" name="register" onSubmit="return valid();">
<div class="box_account">
<h3 class="new_client">New Client</h3> <small class="float-right pt-2">* Required Fields</small>
<div class="form_container">
<div class="form-group">
<input type="text" class="form-control" name="fullname" id="fullname" placeholder="Full Name*" required>
</div>
<div class="form-group">
<input type="email" class="form-control" name="emailid" id="email" onblur="userAvailability()" placeholder="Email*" required>
</div>
<div class="form-group">
<input type="text" class="form-control" name="contactno" id="contactno" placeholder="Contact No*" required>
</div>
<div class="form-group">
<input type="password" class="form-control" name="password" id="password" value="" placeholder="Password*" required>
</div>
<div class="form-group">
<input type="password" class="form-control" name="confirmpassword" id="confirmpassword" value="" placeholder="Confirm Password*" required>
</div>
<hr>
</div>
<!-- /company -->
<hr>
<div class="form-group">
<label class="container_check">Accept <a href="#0">Terms and conditions</a>
<input type="checkbox">
<span class="checkmark"></span>
</label>
</div>
<div class="text-center"><input type="submit" name="submit" value="submit" class="btn_1 full-width"></div>
</div>
<!-- /form_container -->
</div>
</form>
<!-- /box_account -->
</div>
</div>
<!-- /row -->
</div>
<!-- /container -->
</main>
<!--/main-->
<footer style="background-color: black">
<?php include('includes/footer.php');?>
</footer>
<!--/footer-->
</div>
<!-- page -->
<div id="toTop"></div><!-- Back to top button -->
<!-- COMMON SCRIPTS -->
<script src="js/common_scripts.min.js"></script>
<script src="js/main.js"></script>
<script>
// Client type Panel
$('input[name="client_type"]').on("click", function() {
var inputValue = $(this).attr("value");
var targetBox = $("." + inputValue);
$(".box").not(targetBox).hide();
$(targetBox).show();
});
</script>
</body>
</html>