-
Notifications
You must be signed in to change notification settings - Fork 0
/
Admin-editStaff.php
194 lines (146 loc) · 6.15 KB
/
Admin-editStaff.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
<?php require 'core/init.php' ?>
<body>
<div id="wrapper">
<?php
if ($privilege== "normal"){
include 'widget/header-normal.php';
}else if ($privilege=="supervisor"){
include 'widget/header-supervisor.php';
}else if ($privilege=="admin"){
include 'widget/header-admin.php';
}
?>
<div id="page-wrapper">
<div class="row">
<div class="col-xs-4">
<?php
if(isset($_GET['id'])== true){
if ($_GET['id']== "success"){
echo '<div class="alert alert-success"><p>successfully edit</p></div>';
}else{
echo '<div class="alert alert-danger"><p>fail to edit information</p></div>';
}
}
?>
<form role="form" method ="post" action="Admin-confirmedit.php" enctype="multipart/form-data">
<h1> Employee Personal Information </h1>
<div> <?php
$userid= $_POST['userid'];
$file = "picture/".$userid.".jpg";
if (file_exists($file)==true){
$pict = $userid;
}else{
$pict = "no-pict";
}
?>
<img src="picture/<?php
echo $pict;
?>.jpg" width="150" height="150" class="img-thumbnail">
<input type="file" name="picts">
</div>
<label for="Username">Username:</label>
<input type ="Text" height="20px" width="135px"
enabled="True" id="Ausername" required class="form-control" name="Ausername" value="<?php
$ID =Agetuserlogin($userid,'UserName');
echo $ID;
?>">
<label for="Password">Password:</label>
<input type ="Password" height="20px" width="135px"
enabled="True" id="Ausername" required class="form-control" name="Auserpass" value="<?php
$ID =Agetuserlogin($userid,'Password');
echo $ID;
?>">
<label for="Employees ID">Employees ID:</label>
<input type ="Text" height="20px" width="135px"
enabled="True" id="EmplyID" readonly class="form-control" name="empid" value="<?php
$ID =getuserdetails($userid,'Employees_ID');
echo $ID;
?>">
<label for="Name">Name :</label>
<input type="Text" Height="20px" Width="135px"
Enabled="True" required id="Name" class="form-control" name="Fullname" value="<?php
$name =getuserdetails ($userid, 'FullName');
echo $name;
?>">
<label for="Identication Number">Identication No :</label>
<input type="Text" height="20px" required width="135px" enabled="True" id="Name" class="form-control" name="ID" value="<?php
$IC =getuserdetails($userid,'Identification_Card');
echo $IC;
?>">
<label for="Address">Address :</label>
<textarea class="form-control" style="resize:none" name="add" id="Address" Enabled="True" rows="3" required><?php $address =getuserdetails ($userid, "Address");
echo $address;
?></textarea>
<label for="Contact">Contact No:</label>
<input type="Text" Height="20px" required Width="135px"
Enabled="True" id="Contact" class="form-control" name="conta" value="<?php $contact =getuserdetails ($userid, "Contact_No");
echo $contact;?>
">
<label for="Email">Email :</label>
<input type="email" required Height="20px" Width="135px"
Enabled="True" id="Email" class="form-control" name="email" value="<?php
$email =getuserdetails($userid,'Email');
echo $email;
?>">
Salary :<div class="input-group">
<span class="input-group-addon">RM</span><input type="number" required Height="20px" class ="form-control" Width="30px"
Enabled="True" name="sal_ad" min="0" value="<?php
$salary =getuserdetails($userid,'Salary');
echo $salary;
?>"></div>
Experience :<div class="input-group">
<input type="number" min="0" Height="20px" class ="form-control" Width="135px"
Enabled="True" name="exp_ad" required value="<?php
$exp=getuserdetails($userid,'Experience');
echo $exp;?>">
<span class="input-group-addon">Years</span>
</div>
Recruitment Date :<input type="Date" required Height="20px" Width="135px"
Enabled="True" name="recrdate_ad" class ="form-control" value="<?php
$recrdate=getuserdetails($userid,'Recruitment_Date');
echo $recrdate;
?>">
<label for = "Genderlist">Gender :</label>
<select class="form-control" id = "Genderlist" name="gender" >
<?php $gender=getuserdetails($userid,'Gender');
echo $gender;
?>
<option value = "Male" <?php if($gender== "Male"){ echo 'selected'; }?> >Male</option>
<option value = "Female" <?php if($gender== "Female"){ echo 'selected'; }?> >Female</option>
</select>
<label for="Departmentlist">Department :</label>
<select class="form-control" id = "Departmentlist" name="department" >
<?php
$depart=getdepartmentID($userid);
echo $depart;
$query = mysql_query("SELECT * FROM department ");
while ($result = mysql_fetch_assoc ($query)){
echo "<option value = '".$result['Department_ID']."'";
if ($depart == $result['Department_ID']){
echo "selected";
}
echo " >".$result['Department_Name']."</option>";
}
?>
</select>
<label for = "Privileges">Privileges :</label>
<select class="form-control" id = "Prilist" name="Priv" Width="135" >
<?php $Privilege=getuserdetails($userid,"Privilege");
echo $Privilege;
?>
<option value = "admin" <?php if($Privilege== "admin"){ echo 'selected'; }?> >admin</option>
<option value = "supervisor" <?php if($Privilege== "supervisor"){ echo 'selected'; }?> >supervisor</option>
<option value = "normal" <?php if($Privilege== "normal"){ echo 'selected'; }?> >normal</option>
</select>
</td>
</tr>
<input type="hidden" name="employee_id" value="<?php echo getuserdetails($userid,'Employees_ID'); ?>" >
<label for ="submit"></label>
<input type="submit" id="submit" Value="Confirm" class="form-control" name="confirm">
</form>
</div>
</div>
</div>
</div>
</body>
</html>