-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcreate_account.php
216 lines (156 loc) · 7.84 KB
/
create_account.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
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
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
<?php include('inc/form.php'); ?>
<?php include('inc/header.php');
session_start();
?>
<nav id="nav-menu-container">
<ul class="nav-menu">
<?php if ($_SESSION['role']!="local_user"){
echo "<li><a href=\"#create_account\">Create Account</a></li>"; }?>
<li class="menu-has-children"><a href=""><?php echo $_SESSION['uname']; ?></a>
<ul>
<li><a href="#">Change password</a></li>
<li><a href="inc/logout.inc.php?logout='1'">Logout</a></li>
</ul>
</li>
</ul>
</nav><!-- #nav-menu-container -->
</div>
</header><!-- #header -->
<!--==========================
Intro Section
============================-->
<section id="create_account">
<div class="container">
<div class="section-header wow fadeInUp">
<br><br><br><br>
<a href="account.php"><h2>Back to Account</a>
<h3>Create Account</h3>
</div>
<div class="row">
<div class="col-lg-3 col-md-6 wow fadeInUp">
<div class="member">
<div class="member-info">
<div class="member-info-content">
<form method="POST">
<label for="emp_reg_id"><b>Registration ID</b></label><br>
<?php
$db = mysqli_connect('localhost', 'root', '', 'hrm');
$sql=("SELECT emp_reg_id FROM employee_job_details order by emp_reg_id desc limit 1");
$result=mysqli_query($db,$sql);
if (mysqli_num_rows($result)>0){
while ($row3=mysqli_fetch_assoc($result)){
echo "Lastly recorded ID is";
echo "<option value=".$row3['emp_reg_id'].">".$row3['emp_reg_id']."</option>";
}
}?>
<input type="text" placeholder="Registration ID" name="emp_reg_id" required><br>
<label for="job_title"><b>Job Title</b></label><br>
<select name="job_title">
<option value="hr_manager">HR Manager</option>
<option value="accountant">Accountant</option>
<option value="software_engineer">Software Engineer</option>
<option value="qa_engineer">QA Engineer</option>
</select>
<label for="joined_date"><b>Joined Date</b></label><br>
<input type="date" placeholder="joined_date" name="joined_date" required><br>
<label for="reports_to"><b>Reports To</b></label><br>
<select name="reports_to">
<?php
$db = mysqli_connect('localhost', 'root', '', 'hrm');
$sql=("SELECT emp_reg_id FROM employee_job_details");
$result=mysqli_query($db,$sql);
if (mysqli_num_rows($result)>0){
while ($row3=mysqli_fetch_assoc($result)){
echo "<option value=".$row3['emp_reg_id'].">".$row3['emp_reg_id']."</option>";
}
}?>
</select>
<br><br>
<label for="emp_status_id"><b>Employee status ID</b></label><br>
<select name="emp_status_id">
<?php
$db = mysqli_connect('localhost', 'root', '', 'hrm');
$sql=("SELECT emp_status_id,employment_type FROM employment_status");
$result=mysqli_query($db,$sql);
if (mysqli_num_rows($result)>0){
while ($row3=mysqli_fetch_assoc($result)){
echo "<option value=".$row3['emp_status_id'].">".$row3['employment_type']."</option>";
}
}?>
</select><br><br>
<br><br>
</div>
</div>
</div>
</div>
<div class="col-lg-3 col-md-6 wow fadeInUp" data-wow-delay="0.1s">
<div class="member">
<div class="member-info">
<div class="member-info-content">
<label for="department"><b>Department</b></label><br>
<select name="department">
<?php
$db = mysqli_connect('localhost', 'root', '', 'hrm');
$sql=("SELECT dep_id,name FROM department");
$result=mysqli_query($db,$sql);
if (mysqli_num_rows($result)>0){
while ($row3=mysqli_fetch_assoc($result)){
echo "<option value=".$row3['dep_id'].">".$row3['name']."</option>";
}
}?>
</select><br><br>
<label for="branch"><b>Branch</b></label><br>
<select name="branch">
<?php
$db = mysqli_connect('localhost', 'root', '', 'hrm');
$sql=("SELECT branch_id,name FROM branch");
$result=mysqli_query($db,$sql);
if (mysqli_num_rows($result)>0){
while ($row3=mysqli_fetch_assoc($result)){
echo "<option value=".$row3['branch_id'].">".$row3['name']."</option>";
}
}?>
</select><br><br>
<label for="role"><b>Role</b></label><br>
<select name="role">
<?php if ($_SESSION['role']=="admin"){
echo "<option value=\"hrm_user\">hrm_user</option>"; }
elseif ($_SESSION['role']=="hrm_user"){
echo "<option value=\"SecondManager_user\">SecondManager_user</option>";}
elseif ($_SESSION['role']=="SecondManager_user"){
echo " <option value=\"local_user\">local_user</option> ";}?>
</select><br><br>
<div class="clearfix">
<button type="submit" class="btn btn-success" name="create">Create »</button>
</div>
</div>
</div>
</div>
</div>
<div class="col-lg-3 col-md-6 wow fadeInUp" data-wow-delay="0.2s">
<div class="member">
<div class="member-info">
<div class="member-info-content">
</div>
</div>
</div>
</div>
<div class="col-lg-3 col-md-6 wow fadeInUp" data-wow-delay="0.3s">
<div class="member">
<div class="member-info">
<div class="member-info-content">
</div>
</div>
</div>
</div>
</div>
</div>
</section><!-- #team -->
<!--==========================
Contact Section
============================-->
</main>
<!--==========================
Footer
============================-->
<?php include('inc/footer.php'); ?>