-
Notifications
You must be signed in to change notification settings - Fork 54
/
admin.html
137 lines (130 loc) · 7.7 KB
/
admin.html
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
<!DOCTYPE html>
<html>
<head>
<title>Admin Area | ShopOnline</title>
<link href="https://unpkg.com/tailwindcss@^1.0/dist/tailwind.min.css" rel="stylesheet">
<link rel="stylesheet" href="./css/admin-navbar.css">
<link rel="icon" type="image/png" href="https://user-images.githubusercontent.com/86606251/135616573-fa6b14ce-1ffc-46e1-b322-44c4d2a307df.jpeg">
<script>
const masterPassword = "helloAdmin";
var enterMasterPwd = prompt("Enter the master password");
if(enterMasterPwd!=masterPassword)
{
alert("Wrong Master Password");
location.replace("index.html");
}
</script>
</head>
<body>
<!---navigation bar--->
<header class="text-gray-700 body-font">
<div class="container mx-auto flex flex-wrap p-5 flex-col md:flex-row items-center">
<a class="logo-img-top flex title-font font-medium items-center text-gray-900 mb-4 md:mb-0">
<img class="ml-3 text-xl logo-img-top" src="https://cdn3.iconfinder.com/data/icons/small/512/buy_cart_ecommerce_shopping_online_store-512.png" style="height: 50px;"></img>
<span class="ml-3 text-xl logo-text-top"><text style="font-size: 50px; font-family:'Montserrat', sans-serif;color: #000000;">ShopOnline</text></span>
</a>
<nav class="nav-items md:ml-auto flex flex-wrap items-center text-base justify-center font-bold">
<a class="mr-5 hover:text-gray-900" href="index.html">Home</a>
<a class="mr-5 hover:text-gray-900" href="login.html">Login</a>
<a class="mr-5 hover:text-gray-900" href="index.html#signup">Sign Up</a>
<a class="mr-5 hover:text-gray-900" href="admin.html">Admin</a>
<a class="mr-5 hover:text-gray-900" href="cart.html">Manage Delivery</a>
</nav>
</div>
</header>
<!--Hero-->
<section class="text-gray-700 body-font" id="login">
<div
class="container px-5 py-24 mx-auto flex flex-wrap items-center"
>
<div class="lg:w-3/5 md:w-1/2 md:pr-16 lg:pr-0 pr-0">
<h1 class="title-font font-medium text-3xl text-gray-900">
<text
style="
font-size: 50px;
font-family: 'Montserrat', sans-serif;
color: #00296b;
"
>Admin Login</text
>
</h1>
</div>
<form action="With PHP/backend/adminLogin.php" method="POST" class="lg:w-2/6 md:w-1/2 bg-gray-200 rounded-lg p-8 flex flex-col md:ml-auto w-full mt-10 md:mt-0">
<h2
class="text-gray-900 text-lg font-medium title-font mb-5"
>
Admin Login
</h2>
<input
class="bg-white rounded border border-gray-400 focus:outline-none focus:border-indigo-500 text-base px-4 py-2 mb-4"
placeholder="Email"
id="adminEmail"
required
name="adminEmail"
type="email"
/>
<input
class="bg-white rounded border border-gray-400 focus:outline-none focus:border-indigo-500 text-base px-4 py-2 mb-4"
placeholder="Password"
id="adminPass"
name="adminPassword"
required
type="password"
/>
<button type="submit" class="text-white bg-indigo-500 border-0 py-2 px-8 focus:outline-none hover:bg-indigo-600 rounded text-lg">
Login
</button>
</form>
</div>
</section>
<form action="With PHP/backend/registerAdmin.php" method="post" class="text-gray-700 body-font" id="login">
<div
class="container px-5 py-24 mx-auto flex flex-wrap items-center"
>
<div class="lg:w-3/5 md:w-1/2 md:pr-16 lg:pr-0 pr-0">
<h1 class="title-font font-medium text-3xl text-gray-900">
<text
style="
font-size: 50px;
font-family: 'Montserrat', sans-serif;
color: #00296b;
"
>Admin Registration</text
>
</h1>
</div>
<div
class="lg:w-2/6 md:w-1/2 bg-gray-200 rounded-lg p-8 flex flex-col md:ml-auto w-full mt-10 md:mt-0"
>
<h2 class="text-gray-900 text-lg font-medium title-font mb-5">Sign Up as Admin</h2>
<input class="bg-white rounded border border-gray-400 focus:outline-none focus:border-indigo-500 text-base px-4 py-2 mb-4" placeholder="First Name" type="text" name="fname" required>
<input class="bg-white rounded border border-gray-400 focus:outline-none focus:border-indigo-500 text-base px-4 py-2 mb-4" placeholder="Last Name" type="text" name="lname" required>
<input type="hidden" value="admin" name="accesslevel">
<input class="bg-white rounded border border-gray-400 focus:outline-none focus:border-indigo-500 text-base px-4 py-2 mb-4" placeholder="DOB" type="text" onfocus="(this.type='date')" onblur="(this.type='text')" name="dob" required>
<input class="bg-white rounded border border-gray-400 focus:outline-none focus:border-indigo-500 text-base px-4 py-2 mb-4" placeholder="Email" type="email" name="email" required>
<input class="bg-white rounded border border-gray-400 focus:outline-none focus:border-indigo-500 text-base px-4 py-2 mb-4" placeholder="Contact Number" type="tel" maxlength="10" minlength="10" name="phoneno" required>
<input class="bg-white rounded border border-gray-400 focus:outline-none focus:border-indigo-500 text-base px-4 py-2 mb-4" placeholder="Password" type="password" name="password" required>
<input class="bg-white rounded border border-gray-400 focus:outline-none focus:border-indigo-500 text-base px-4 py-2 mb-4" placeholder="Salary" type="number" name="salary" required>
<textarea class="bg-white rounded border border-gray-400 focus:outline-none focus:border-indigo-500 text-base px-4 py-2 mb-4" placeholder="Address" type="text" name="address" rows="4" required></textarea>
<button class="text-white bg-indigo-500 border-0 py-2 px-8 focus:outline-none hover:bg-indigo-600 rounded text-lg" type="submit">Sign Up</button>
</div>
</div>
</form>
<script>
function setAdminLogged()
{
if(document.querySelector("#adminEmail").value=="[email protected]"&&document.querySelector("#adminPass").value=="adminOne")
{
localStorage.setItem('loggedAdmin',document.querySelector("#adminEmail").value.split("@")[0]);
location.replace("With%20PHP/adminProductManage.php");
return false;
}
else
{
window.alert("Wrong Credentials");
return false;
}
}
</script>
</body>
</html>