-
Notifications
You must be signed in to change notification settings - Fork 16
/
addUser.php
88 lines (65 loc) · 2.29 KB
/
addUser.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
<?php
include 'inc/header.php';
Session::CheckSession();
$sId = Session::get('roleid');
if ($sId === '1') { ?>
<?php
if ($_SERVER['REQUEST_METHOD'] == 'POST' && isset($_POST['addUser'])) {
$userAdd = $users->addNewUserByAdmin($_POST);
}
if (isset($userAdd)) {
echo $userAdd;
}
?>
<div class="card ">
<div class="card-header">
<h3 class='text-center'>Add New User</h3>
</div>
<div class="cad-body">
<div style="width:600px; margin:0px auto">
<form class="" action="" method="post">
<div class="form-group pt-3">
<label for="name">Your name</label>
<input type="text" name="name" class="form-control">
</div>
<div class="form-group">
<label for="username">Your username</label>
<input type="text" name="username" class="form-control">
</div>
<div class="form-group">
<label for="email">Email address</label>
<input type="email" name="email" class="form-control">
</div>
<div class="form-group">
<label for="mobile">Mobile Number</label>
<input type="text" name="mobile" class="form-control">
</div>
<div class="form-group">
<label for="password">Password</label>
<input type="password" name="password" class="form-control">
</div>
<div class="form-group">
<div class="form-group">
<label for="sel1">Select user Role</label>
<select class="form-control" name="roleid" id="roleid">
<option value="1">Admin</option>
<option value="2">Editor</option>
<option value="3">User only</option>
</select>
</div>
</div>
<div class="form-group">
<button type="submit" name="addUser" class="btn btn-success">Register</button>
</div>
</form>
</div>
</div>
</div>
<?php
}else{
header('Location:index.php');
}
?>
<?php
include 'inc/footer.php';
?>