-
Notifications
You must be signed in to change notification settings - Fork 0
/
add_users.php
138 lines (123 loc) · 5.1 KB
/
add_users.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
<?php $title = 'Add user'; ?>
<?php
include_once 'includes/includes.php';
$session = new Session();
$functions = new Functions();
if($session->isUserLoggedIn() == false){
$functions->redirect('index.php');
}
$functions->edit_add_permission_access('create');
?>
<style>
.card{
width:100% !important;
}
</style>
</head>
<body>
<?php include 'includes/layout/topBar.php' ?>
<div class="row" style="margin-top:30px">
<div class="col-md-12 col-lg-2">
<?php include 'includes/layout/sidebar.php' ?>
</div>
<div class="col-md-10 main-content">
<div class="ui breadcrumb">
<a class="section">Home</a>
<div class="divider"> / </div>
<a class="section">Profile</a>
<div class="divider"> / </div>
<div class="active section">Settings</div>
</div>
<?php
if(isset($_SESSION['success']) && !empty($_SESSION['success'])){
echo $functions->message($_SESSION['success'],'green');
unset($_SESSION['success']);
}
if(isset($_SESSION['error']) && !empty($_SESSION['error'])){
echo $functions->message($_SESSION['error'],'red');
unset($_SESSION['error']);
}
$functions->add_user();
?>
<div class="html ui top attached segment">
<div class="ui top attached label">Profile Details</div>
<div class="content">
<form action="?" method="post">
<div class="form-group">
<label>First Name</label>
<div class="ui input">
<input type="text" name="first_name" placeholder="First Name" required>
</div>
</div>
<div class="form-group">
<label>Last Name</label>
<div class="ui input">
<input type="text" name="last_name" placeholder="Last Name" required>
</div>
</div>
<div class="ui yellow message">
User name can't be changed once added
</div>
<div class="form-group">
<label>User Name</label>
<div class="ui input">
<input type="text" name="user_name" placeholder="User Name" required>
</div>
</div>
<div class="form-group">
<label>Gender</label>
<div>
<select class="ui dropdown" name="gender" style="width:100%" required >
<option value="">--Select---</option>
<option value="Male" >Male</option>
<option value="Female" >Female</option>
</select>
</div>
</div>
<div class="form-group">
<label>Group</label>
<div class="ui input">
<select class="js-example-basic-single" name="user_type" style="width:100%" onchange="get_value(event)">
<?php
$sql = "select * from groups";
$results = $functions->fetch_rows($functions->query($sql));
foreach ($results as $result) {
$selected = '';
if($result['group_name'] == $data['group_name']){
$selected = 'selected';
}else{
$selected = '';
}
echo '<option value="'.$result['group_name'].'">'.$result['group_name'].'</option>';
}
?>
</select>
</div>
</div>
<div class="form-group">
<label>Phone</label>
<div class="ui input">
<input type="text" name="phone" placeholder="Phone" required>
</div>
</div>
<div class="form-group">
<label>Password</label>
<div class="ui input">
<input type="text" name="password" placeholder="Password" required>
</div>
</div>
<div class="form-group">
<label>Confirm Password</label>
<div class="ui input">
<input type="text" name="cpassword" placeholder="Confirm Password" required>
</div>
</div>
<button name="submit" type="submit" class="ui small primary labeled icon button">
<i class="save icon"></i> Add User
</button>
</form>
</div>
</div>
</div>
</div>
<?php include_once 'includes/layout/footer.php'?>