forked from pcsaini/hotel_management_system
-
Notifications
You must be signed in to change notification settings - Fork 0
/
add_emp.php
131 lines (113 loc) · 6.6 KB
/
add_emp.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
<div class="col-sm-9 col-sm-offset-3 col-lg-10 col-lg-offset-2 main">
<div class="row">
<ol class="breadcrumb">
<li><a href="#">
<em class="fa fa-home"></em>
</a></li>
<li class="active">Add Employee</li>
</ol>
</div><!--/.row-->
<div class="row">
<div class="col-lg-12">
<h1 class="page-header">Add Employee</h1>
</div>
</div><!--/.row-->
<div class="row">
<div class="col-lg-12">
<div class="panel panel-default">
<div class="panel-heading">Employee Detail:</div>
<div class="panel-body">
<div class="emp-response"></div>
<form role="form" id="addEmployee" data-toggle="validator">
<div class="row">
<div class="form-group col-lg-6">
<label>Staff</label>
<select class="form-control" id="staff_type" required data-error="Select Staff Type">
<option selected disabled>Select Staff Type</option>
<?php
$query = "SELECT * FROM staff_type";
$result = mysqli_query($connection, $query);
if (mysqli_num_rows($result) > 0) {
while ($staff = mysqli_fetch_assoc($result)) {
echo '<option value="' . $staff['staff_type_id'] . '">' . $staff['staff_type'] . '</option>';
}
}
?>
</select>
<div class="help-block with-errors"></div>
</div>
<div class="form-group col-lg-6">
<label>Shift</label>
<select class="form-control" id="shift" required data-error="Select Shift Type">
<option selected disabled>Select Staff Type</option>
<?php
$query = "SELECT * FROM shift";
$result = mysqli_query($connection, $query);
if (mysqli_num_rows($result) > 0) {
while ($shift = mysqli_fetch_assoc($result)) {
echo '<option value="' . $shift['shift_id'] . '">' . $shift['shift'] . ' - ' . $shift['shift_timing'] . '</option>';
}
}
?>
</select>
<div class="help-block with-errors"></div>
</div>
<div class="form-group col-lg-6">
<label>First Name</label>
<input type="text" class="form-control" placeholder="First Name" id="first_name" required data-error="Enter First Name">
<div class="help-block with-errors"></div>
</div>
<div class="form-group col-lg-6">
<label>Last Name</label>
<input type="text" class="form-control" placeholder="Last Name" id="last_name">
</div>
<div class="form-group col-lg-6">
<label>ID Card Type</label>
<select class="form-control" id="id_card_id" required onchange="validId(this.value);">
<option selected disabled>Select ID Card Type</option>
<?php
$query = "SELECT * FROM id_card_type";
$result = mysqli_query($connection, $query);
if (mysqli_num_rows($result) > 0) {
while ($id_card_type = mysqli_fetch_assoc($result)) {
echo '<option value="' . $id_card_type['id_card_type_id'] . '">' . $id_card_type['id_card_type'] . '</option>';
}
}
?>
</select>
<div class="help-block with-errors"></div>
</div>
<div class="form-group col-lg-6">
<label>ID Card No</label>
<input type="text" class="form-control" placeholder="ID Card No" id="id_card_no" required>
<div class="help-block with-errors"></div>
</div>
<div class="form-group col-lg-6">
<label>Contact Number</label>
<input type="number" class="form-control" placeholder="Contact Number" id="contact_no" required>
<div class="help-block with-errors"></div>
</div>
<div class="form-group col-lg-6">
<label>Address</label>
<input type="text" class="form-control" placeholder="address" id="address" required>
<div class="help-block with-errors"></div>
</div>
<div class="form-group col-lg-6">
<label>Salary</label>
<input type="number" class="form-control" placeholder="Salary" id="salary" data-error="Enter Salary" required>
<div class="help-block with-errors"></div>
</div>
</div>
<button type="submit" class="btn btn-lg btn-primary">Submit</button>
<button type="reset" class="btn btn-lg btn-danger">Reset</button>
</form>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-12">
<p class="back-link">MIS Developed by <a href="https://www.pcsaini.in">pcsaini</a></p>
</div>
</div>
</div> <!--/.main-->