-
Notifications
You must be signed in to change notification settings - Fork 0
/
edit_employee.php
233 lines (212 loc) · 11.1 KB
/
edit_employee.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
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
<html>
<head>
<meta charset="UTF-8">
<meta content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0' name='viewport' />
<meta name="viewport" content="width=device-width" />
<title>Perfect Match</title>
<link rel="icon" href="img/browser-icon.png">
<!--- Fonts--->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"/>
<link href="http://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet"/>
<link href='http://fonts.googleapis.com/css?family=Roboto:400,700,300' rel='stylesheet' type='text/css'/>
<link href="css/pe-icon-7-stroke.css" rel="stylesheet" />
<!--- Stylesheets--->
<link rel = "stylesheet" href = "css/main.page.style.css"/>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.2/css/bootstrap.min.css" integrity="sha384-y3tfxAZXuh4HwSYylfB+J125MxIs6mR5FOHamPBG064zB+AFeWH94NdvaCBm8qnd" crossorigin="anonymous">
<link rel="stylesheet" href="bootstrap-3.3.6-dist/css/bootstrap.min.css"/>
</head>
<style>
.form-control::-moz-placeholder {
color: #DDDDDD;
opacity: 1;
filter: alpha(opacity=100);
}
.form-control:-moz-placeholder {
color: #DDDDDD;
opacity: 1;
filter: alpha(opacity=100);
}
.form-control::-webkit-input-placeholder {
color: #DDDDDD;
opacity: 1;
filter: alpha(opacity=100);
}
.form-control:-ms-input-placeholder {
color: #DDDDDD;
opacity: 1;
filter: alpha(opacity=100);
}
.form-control {
background-color: #FFFFFF;
border: 1px solid #E3E3E3;
border-radius: 4px;
color: #565656;
padding: 8px 12px;
height: 40px;
-webkit-box-shadow: none;
box-shadow: none;
}
.form-control:focus {
background-color: #FFFFFF;
border: 1px solid #AAAAAA;
-webkit-box-shadow: none;
box-shadow: none;
outline: 0 !important;
color: #333333;
}
.has-success .form-control, .has-error .form-control, .has-success .form-control:focus, .has-error .form-control:focus {
border-color: #E3E3E3;
-webkit-box-shadow: none;
box-shadow: none;
}
.has-success .form-control {
color: #87CB16;
}
.has-success .form-control:focus {
border-color: #87CB16;
}
.has-error .form-control {
color: #FF4A55;
}
.has-error .form-control:focus {
border-color: #FF4A55;
}
.form-control + .form-control-feedback {
border-radius: 6px;
font-size: 14px;
margin-top: -7px;
position: absolute;
right: 10px;
top: 50%;
vertical-align: middle;
}
.open .form-control {
border-radius: 4px 4px 0 0;
border-bottom-color: transparent;
}
.form-control[disabled], .form-control[readonly], fieldset[disabled] .form-control {
background-color: #F5F5F5;
color: #888888;
cursor: not-allowed;
}
.table > thead > tr > th {
border-bottom-width: 1px;
font-size: 12px;
text-transform: uppercase;
color: #9A9A9A;
font-weight: 400;
padding-bottom: 5px;
}
@media (max-width: 991px) {
.table-responsive {
width: 100%;
margin-bottom: 15px;
overflow-x: scroll;
overflow-y: hidden;
-ms-overflow-style: -ms-autohiding-scrollbar;
-webkit-overflow-scrolling: touch;
}
}
</style>
<body>
<?php
require_once ('MysqliDb.php');
$db = new MysqliDb('localhost', 'root', '', 'perfectmatch');
$id_empregado = $_POST["id"];
$db -> where ('id_empregado', $id_empregado);
$empregado = $db->get('empregados');
$db -> where ('id_login', $empregado[0]["id_login"]);
$login = $db -> get('login');
?>
<div class = "card">
<div class="header">
<p><button type="button" class="btn btn-lg back-man-employee" class="fa fa-undo" aria-hidden="true"><i class="fa fa-undo" aria-hidden="true"></i> Voltar</button>
</p>
<h4 class="title" style = "color: #DC006C;"><b style="font-size: 90%;">Empregado</b></h4>
<br>
</div>
<form method = "POST" action = "processforms/edit_employee_form.php">
<input type = "number" name = "id_empregado" value = "<?php echo $id_empregado;?>" style = "display: none;">
<div class = "row">
<div class = "col-md-12">
<div class = "form-group">
<label>Username</label>
<input name ="username" type="text" class="form-control" value="<?php echo $login[0]['username']; ?>">
</div>
</div>
</div>
<div class = "row">
<div class = "col-md-12">
<div class = "form-group">
<label>Password</label>
<input name ="password" type="password" class="form-control" value="<?php echo $login[0]['password']; ?>">
</div>
</div>
</div>
<div class = "row">
<div class = "col-md-8">
<div class = "form-group">
<label>Tipo de login</label>
<select name ="tipo_login" class="form-control">
<?php
if(strcasecmp($login[0]["tipo_login"], "admin") === 0){
echo '<option selected="selected">Admin</option>';
echo '<option >Empregado</option>';
} else {
echo '<option>Admin</option>';
echo '<option selected="selected">Empregado</option>';
}
?>
</select>
</div>
</div>
</div>
<div class = "row">
<div class = "col-md-12">
<div class = "form-group">
<label>Primeiro nome</label>
<input name ="primeiro_nome" type="text" class="form-control" value="<?php echo $empregado[0]['primeiro_nome']; ?>">
</div>
</div>
</div>
<div class = "row">
<div class = "col-md-12">
<div class = "form-group">
<label>Último nome</label>
<input name ="ultimo_nome" type="text" class="form-control" value="<?php echo $empregado[0]['ultimo_nome']; ?>">
</div>
</div>
</div>
<div class = "row">
<div class = "col-md-12">
<div class = "form-group">
<label>Email</label>
<input name ="email" type="email" class="form-control" value="<?php echo $empregado[0]['email']; ?>">
</div>
</div>
</div>
<div class = "row">
<div class = "col-md-12">
<div class = "form-group">
<label>Morada</label>
<input name = "morada" type="text" class="form-control" value="<?php echo $empregado[0]['morada']; ?>">
</div>
</div>
</div>
<div class = "row">
<div class = "col-md-12">
<div class = "form-group">
<label>Data de nascimento</label>
<input name ="data_nascimento" type="date" class="form-control" value="<?php echo $empregado[0]['data_nascimento']; ?>">
</div>
</div>
</div>
<br><br>
<button type="submit" class="btn btn-lg btn-fill pull-right" style = "background-color: #DC006C; color:#FFF">Editar empregado</button>
<div class="clearfix"></div>
</form>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>
<script src="bootstrap-3.3.6-dist/js/bootstrap.min.js"></script>
</body>
</html>