-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaccount-manage.php
More file actions
171 lines (160 loc) · 6.39 KB
/
account-manage.php
File metadata and controls
171 lines (160 loc) · 6.39 KB
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
<?php
/**
* @file event-create.php
* @brief page with event create form
* @author Michal Ľaš (xlasmi00)
* @date 13.10.2023
*/
require_once "common/html-components.php";
session_start();
$db = connect_to_db();
if(!userIsAdmin()) {
redirectForce('index.php');
}
generateSessionToken();
updateSessionReturnPage();
updateSession($_GET, ["search-bar", "account_status", 'account_type']);
makeHead("Eventer | Account Management");
makeHeader();
?>
<main>
<!-- Create profile popup -->
<div class="profile-popup" id="profile-add-popup">
<div class="profile-popup-top-bar">
<h3>Create Profile</h3>
<span class="close-edit-btn" id="close-add-profile-btn"><i class="fa-solid fa-xmark"></i></span>
</div>
<form action="scripts/account-manage/add-account.php" method="post">
<input type="hidden" id="add-acc-token" name="token" value="<?php echoSessionVal('token', '') ?>" >
<div class="label-input">
<p>Nick *</p>
<input required name="nick" type="text" id="add-acc-nick">
</div>
<span>
<div class="label-input">
<p>First name *</p>
<input required name="first_name" type="text" id="add-acc-fname">
</div>
<div class="label-input">
<p>Last name *</p>
<input required name="last_name" type="text" id="add-acc-lname">
</div>
</span>
<div class="label-input">
<p>Email *</p>
<input required name="email" type="text" id="add-acc-email">
</div>
<div class="label-input">
<p>Type</p>
<?php makeRoleSelector('add-acc') ?>
</div>
<span>
<div class="label-input">
<p>Password *</p>
<input required type="password" name="password">
</div>
<div class="label-input">
<p>Repeat password *</p>
<input required type="password" name="password2">
</div>
</span>
<button type="submit" class="button-round-filled-green">Submit</button>
</form>
</div>
<!-- Edit profile popup -->
<div class="profile-popup" id="profile-edit-popup">
<div class="profile-popup-top-bar">
<h3>Edit Profile</h3>
<span class="close-edit-btn" id="close-edit-profile-btn"><i class="fa-solid fa-xmark"></i></span>
</div>
<form action="scripts/account-manage/edit-account.php" method="post">
<input type="hidden" id="token" name="token" value="<?php echoSessionVal('token', '') ?>" >
<input type="hidden" id="edit-acc-id" name="account_id">
<div class="label-input">
<p>Nick *</p>
<input type="text" required name='nick' id="edit-acc-nick">
</div>
<span>
<div class="label-input">
<p>First name *</p>
<input type="text" required name="first_name" id="edit-acc-fname">
</div>
<div class="label-input">
<p>Last name *</p>
<input type="text" required name="last_name" id="edit-acc-lname">
</div>
</span>
<div class="label-input">
<p>Email *</p>
<input type="text" required name="email" id="edit-acc-email">
</div>
<div class="label-input">
<p>Type</p>
<?php makeRoleSelector('edit-acc') ?>
</div>
<span>
<div class="label-input">
<p>New password</p>
<input name="password" type="password">
</div>
<div class="label-input">
<p>Repeat password</p>
<input name="password2" type="password">
</div>
</span>
<button type="submit" class="button-round-filled-green">Submit</button>
</form>
</div>
<!-- MAIN -->
<div class="event-create-main-container manage-container">
<!-- Accounts -->
<div class="part-lable">
<h2>Accounts</h2>
</div>
<div class="row-block">
<div class="manage-filters">
<form method="get" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]); ?>">
<span>
<label for="search-bar">Search Accounts</label>
<input type="text" id="search-bar" value="<?php echoSessionVal("search-bar", ""); ?>" name="search-bar" placeholder="Nick, Name, Email,..">
</span>
<span>
<label for="account_status">Account status</label>
<?php makeAccountStatusSelector() ?>
</span>
<span>
<label for="account_type">Account type</label>
<?php makeRoleSelector('_filter'); ?>
</span>
<button class="button-round-filled-green">Submit filters</button>
</form>
</div>
</div>
<form action="scripts/account-manage/bulk-manage-accounts.php" method="post">
<input type="hidden" id="token" name="token" value="<?php echoSessionVal('token', '') ?>" >
<div class="manage-tool-bar">
<button name="change_status" value="change_status" class="button-round-filled">Change status</button>
<button type="button" class="button-round-filled" onclick="toggleAddProfilePopUp()">Add Account</button>
<button name="delete" value="delete" class="button-round-filled">Delete</button>
</div>
<table>
<tr>
<th>ID</th>
<th>Nick</th>
<th>First name</th>
<th>Last name</th>
<th>Email</th>
<th>Role</th>
<th>Status</th>
<th><i class="fa-solid fa-check"></i></th>
<th>Action</th>
</tr>
<?php generateAccountRows() ?>
</table>
</form>
</div>
</main>
<?php
makeFooter();
?>
</html>