-
Notifications
You must be signed in to change notification settings - Fork 0
/
add_admin.php
129 lines (117 loc) · 5 KB
/
add_admin.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
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<?php
include 'headerfiles.html';
?>
</head>
<body>
<?php
include_once 'adminheader.php';
?>
<div class="container">
<form action="insertadmin.php" method="post" id="form1" enctype="multipart/form-data">
<div class="row ml-3 justify-content-center">
<div class="input-containder">
<h1 class="text-danger input-field">Add Admin</h1>
</div>
</div>
<div class="row mt-3">
<div class="col-sm-5 offset-1 mr-3">
<div class="row">
<div class="input-container">
<i class="icon fa fa-envelope-square"></i>
<input type="email" name="email" id="email" placeholder="enter your email address"
data-rule-required="true" data-msg-required="Please enter a valid email address"
class="input-field">
</div>
</div>
<div class="row">
<div class="input-container">
<i class="icon fa fa-user"></i>
<input type="text" name="username" id="username"
placeholder="enter username"
data-rule-required="true" data-msg-required="Please enter an unique username"
class="input-field">
</div>
</div>
<div class="row">
<div class="input-container">
<i class="icon fa fa-phone-alt"></i>
<input type="number" name="mobile" id="mobile"
placeholder="enter a valid mobile number"
data-rule-required="true" data-msg-required="Please enter a valid mobile number"
class="input-field" minlength="10" maxlength="12">
</div>
</div>
</div>
<div class="col-sm-5 ml-3">
<div class="row">
<div class="input-container">
<i class="icon fa fa-user-circle"></i>
<input type="text" name="fullname" id="fullname"
placeholder="enter your name"
data-rule-required="true" data-msg-required="Please enter name"
class="input-field">
</div>
</div>
<div class="row">
<div class="input-container">
<i class="icon fa fa-user-lock"></i>
<input type="password" name="password" id="password"
placeholder="enter secure password"
data-rule-required="true" data-msg-required="Please enter password"
class="input-field"><span><i
class="fa fa-eye-slash" id="eyeslash" onclick="showpassword()"></i></span>
</div>
</div>
<div class="row">
<div class="input-container">
<i class="icon fa fa-user-lock"></i>
<input type="password" name="conpassword" id="conpassword"
placeholder="enter confirm password"
data-rule-required="true" data-msg-required="Please enter confirm password"
data-rule-equalto="#password"
data-msg-equalto="Password and confirm password must be same"
class="input-field">
</div>
</div>
</div>
</div>
<div class="row">
<div class="input-container justify-content-center">
<input type="submit" value="submit" class="btn btn-success w-25">
</div>
</div>
</form>
<?php
if (isset($_REQUEST['er'])) {
$val = $_REQUEST['er'];
if ($val == 1) {
echo '<div class="alert alert-success">
Admin added Successfully
<span class="close" data-dismiss="alert">×</span>
</div>';
} elseif ($val == 2) {
echo '<div class="alert alert-danger">
Admin insert failed
<span class="close" data-dismiss="alert">×</span>
</div>';
}
elseif ($val == 0) {
echo '<div class="alert alert-info">
Admin Already exist
<span class="close" data-dismiss="alert">×</span>
</div>';
}
}
include_once 'footer.php';
?>
</div>
</body>
</html>