forked from michsko544/RecruitmentSystem
-
Notifications
You must be signed in to change notification settings - Fork 0
/
admin_create_user.php
109 lines (105 loc) · 3.74 KB
/
admin_create_user.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
<?php
session_start();
if ($_SESSION['id_role'] != 1) {
header("Location: /index.php");
exit();
}
require_once "php/connect.php";
require_once "php/getRole.php";
getRole($host, $db_user, $db_pass, $db_name);
require_once "php/FormsValidation.php";
$inst = new FormsValidation(true);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Recruitment System - Admin panel</title>
<link rel="stylesheet" href="/css/style.css" type="text/css">
<link rel="stylesheet" href="/font/stylesheet.css" type="text/css" charset="utf-8" />
<link href="css/jquery-ui.css" rel="stylesheet" />
<script src="script/jquery-1.11.1.js"></script>
<script src="script/jquery-ui.js"></script>
</head>
<body>
<nav>
<div class="nav-bar">
<div class="logo-nav">myCompany</div>
<ul class="nav-links">
<li id="menu">Menu</li>
</ul>
<div id="btn-burger" class="btn-nav">
<div class="line1"></div>
<div class="line2"></div>
<div class="line3"></div>
</div>
</div>
<div id="nav-help"></div>
</nav>
<div id="container">
<div id="sign-up-1" class="sign-up-wrapper">
<div class="page-title cyan-color">Add user</div>
<form id="sform" action="php/admin/create_user.php" method="post">
<div class="form-row">
<label for="login">Login</label>
<input type="text" name="login" value="<?php $inst->rememberValue('rem_username'); ?>" placeholder="Username" required>
<div class="underline"></div>
<?php
$inst->setError('err_username');
?>
</div>
<div class="form-row">
<label for="first-name">First name</label>
<input type="text" name="first-name" value="<?php $inst->rememberValue('rem_first_name'); ?>" placeholder="John" required>
<div class="underline"></div>
<?php
$inst->setError('err_first_name');
?>
</div>
<div class="form-row">
<label for="last-name">Last name</label>
<input type="text" name="last-name" value="<?php $inst->rememberValue('rem_last_name'); ?>" placeholder="Smith" required>
<div class="underline"></div>
<?php
$inst->setError('err_last_name');
?>
</div>
<div class="form-row">
<label for="password-one">Password</label>
<input type="password" name="password-one" value="<?php $inst->rememberValue('rem_password_one'); ?>" placeholder="●●●●●●●●●●" required>
<div class="underline"></div>
</div>
<div class="form-row">
<label for="password-two">Password</label>
<input type="password" name="password-two" value="<?php $inst->rememberValue('rem_password_two'); ?>" placeholder="●●●●●●●●●●" required>
<div class="underline"></div>
<?php
$inst->setError('err_password');
?>
</div>
<div class="form-row">
<label for="role">Role</label>
<select name="role">
<?php
// Pick data from DB
$query = "SELECT name_role FROM roles";
$inst->pickDataFromDB($query, $host, $db_user, $db_pass, $db_name);
?>
</select>
</div>
<div class="form-btn-wrapper">
<input type="submit" value="Create" class="btn btn-cyan" id="btn-sign-up-1">
</div>
</form>
</div>
</div>
</body>
<script src="script/burger.js"></script>
<script src="script/main.js"></script>
<script src="script/user-data-handler.js"></script>
<script src="script/input-file.js"></script>
<script src="script/sign-up.js"></script>
<script src="script/userRecognizer.js"></script>
</html>