-
Notifications
You must be signed in to change notification settings - Fork 0
/
Admin_reg.php
180 lines (161 loc) · 5.92 KB
/
Admin_reg.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
<?php
include("connection.php");
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=, initial-scale=1.0">
<title>Admin Registration</title>
<!--font awesome-->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<!--End Here--->
</head>
<body>
<a href="offer.html"><img src="images/download.png" class="img-head" alt=""></a>
<div class="header">
<div class="container">
<div class="logo">
<h1 ><a href="index.html"><b>T<br>H<br>E</b>Big Store<span>The Best Supermarket</span></a></h1>
</div>
<div class="head-t">
</div>
</div>
<!--banner-->
<div class="banner-top">
<div class="container">
<h3 >Register</h3>
<h4><a href="index.php">Home</a><label>/</label>Register</h4>
<div class="clearfix"> </div>
</div>
</div>
<!--login-->
<div class="login">
<div class="main-agileits">
<div class="form-w3agile form1">
<h3>Register Admin</h3>
<form action="#" method="post" enctype="multipart/form-data">
<div class="key">
<i class="fa fa-user" aria-hidden="true"></i>
<input type="text" value="Username" name="username" onfocus="this.value = '';" onblur="if (this.value == '') {this.value = 'Username';}">
<div class="clearfix"></div>
</div>
<div class="key">
<i class="fa fa-envelope" aria-hidden="true"></i>
<input type="text" value="Email" name="email" onfocus="this.value = '';" onblur="if (this.value == '') {this.value = 'Email';}">
<div class="clearfix"></div>
</div>
<div class="key">
<i class="fa fa-lock" aria-hidden="true"></i>
<input type="password" value="Password" name="password" onfocus="this.value = '';" onblur="if (this.value == '') {this.value = 'Password';}" >
<div class="clearfix"></div>
</div>
<div class="key">
<i class="fa fa-user" aria-hidden="true"></i>
<input type="text" value="Role" name="role" onfocus="this.value = '';" onblur="if (this.value == '') {this.value = 'Role';}">
<div class="clearfix"></div>
</div>
<div class="key">
<i class="fa fa-address-card" aria-hidden="true"></i>
<input style="margin-top:10px;" type="file" name="txtfile" >
<div class="clearfix"></div>
</div>
<input type="submit" name="btn" value="Submit">
</form>
</div>
</div>
</div>
<!--PHP Code Start-->
<?php
if(isset($_POST['btn']))
{
$name = $_POST['username'];
$email = $_POST['email'];
$pass = $_POST['password'];
$role = $_POST['role'];
$filename = $_FILES["txtfile"]["name"];
$oldLocation = $_FILES["txtfile"]["tmp_name"];
$newlocation = "images/".$filename;
move_uploaded_file($oldLocation,$newlocation);
$query = mysqli_query($con,"insert into admin_info (name,email,password,role,img)
values ('$name','$email','$pass','$role','$filename')");
if($query > 0)
{
header("location:Admin_Login.php");
}
else
{
echo "<script>alert('Failed!')</script>";
}
}
?>
<!--End Here-->
<!--footer-->
<div class="footer">
<div class="container">
<div class="col-md-3 footer-grid">
<h3>About Us</h3>
<p>Nam libero tempore, cum soluta nobis est eligendi
optio cumque nihil impedit quo minus id quod maxime
placeat facere possimus.</p>
</div>
<div class="col-md-3 footer-grid ">
<h3>Menu</h3>
<ul>
<li><a href="index.html">Home</a></li>
<li><a href="kitchen.html">Kitchen</a></li>
<li><a href="care.html">Personal Care</a></li>
<li><a href="hold.html">Household</a></li>
<li><a href="codes.html">Short Codes</a></li>
<li><a href="contact.html">Contact</a></li>
</ul>
</div>
<div class="col-md-3 footer-grid ">
<h3>Customer Services</h3>
<ul>
<li><a href="shipping.html">Shipping</a></li>
<li><a href="terms.html">Terms & Conditions</a></li>
<li><a href="faqs.html">Faqs</a></li>
<li><a href="contact.html">Contact</a></li>
<li><a href="offer.html">Online Shopping</a></li>
</ul>
</div>
<div class="col-md-3 footer-grid">
<h3>My Account</h3>
<ul>
<li><a href="login.html">Login</a></li>
<li><a href="register.html">Register</a></li>
<li><a href="wishlist.html">Wishlist</a></li>
</ul>
</div>
<div class="clearfix"></div>
<div class="footer-bottom">
<h2 ><a href="index.html"><b>T<br>H<br>E</b>Big Store<span>The Best Supermarket</span></a></h2>
<p class="fo-para">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris</p>
<ul class="social-fo">
<li><a href="#" class=" face"><i class="fa fa-facebook" aria-hidden="true"></i></a></li>
<li><a href="#" class=" twi"><i class="fa fa-twitter" aria-hidden="true"></i></a></li>
<li><a href="#" class=" pin"><i class="fa fa-pinterest-p" aria-hidden="true"></i></a></li>
<li><a href="#" class=" dri"><i class="fa fa-dribbble" aria-hidden="true"></i></a></li>
</ul>
<div class=" address">
<div class="col-md-4 fo-grid1">
<p><i class="fa fa-home" aria-hidden="true"></i>12K Street , 45 Building Road Canada.</p>
</div>
<div class="col-md-4 fo-grid1">
<p><i class="fa fa-phone" aria-hidden="true"></i>+1234 758 839 , +1273 748 730</p>
</div>
<div class="col-md-4 fo-grid1">
<p><a href="mailto:info@example.com"><i class="fa fa-envelope-o" aria-hidden="true"></i>info@example1.com</a></p>
</div>
<div class="clearfix"></div>
</div>
</div>
<div class="copy-right">
<p> © 2016 Big store. All Rights Reserved | Design by <a href="http://w3layouts.com/"> W3layouts</a></p>
</div>
</div>
</div>
</body>
</html>