-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpenilaian-data-page.php
147 lines (141 loc) · 7 KB
/
penilaian-data-page.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
<?php
include('./process/koneksi.php');
include('./componen/header.php')
?>
<!DOCTYPE html>
<html lang="en">
<body class="fixed-nav sticky-footer bg-dark" id="page-top">
<!-- Navigation-->
<?php include('./componen/navbar.php') ?>
<div class="content-wrapper">
<div class="container-fluid">
<!-- Breadcrumbs-->
<ol class="breadcrumb">
<h1><i class="fa fa-folder" aria-hidden="true"> </i></h1>
<li class="breadcrumb-item">
<h1>Data Penilaian Absen Karyawan</h1>
</li>
</ol>
<!-- Example DataTables Card-->
<div class="card mb-3">
<!-- <div class="card-header">
<a class="btn btn-success text-white" role="button" aria-disabled="true" data-toggle="modal" data-target="#modal-add-karyawan">Tambah Data</a>
</div> -->
<div class="card-body">
<div class="table-responsive">
<table class="table table-bordered text-center b" id="dataTable" width="100%" cellspacing="0">
<thead>
<tr>
<th>No</th>
<th>Nama Karyawan</th>
<th>Kejujuran</th>
<th>Kualitas</th>
<th>Kuantitas</th>
<th>Inisiatif</th>
<th>Loyalitas</th>
<th>Kerja Sama</th>
<th>Ketelitian</th>
<th style="width: 3%">Merasa Memiliki</th>
<th style="width: 3%">Tanggung Jawab</th>
<th>Kerajinan</th>
<th style="width: 10%">Aksi</th>
</tr>
</thead>
<tbody>
<?php
$no = 1;
$sql = mysqli_query($connect, "SELECT * FROM perhitungan_absen");
if (!$sql) {
die('Query Error: ' . mysqli_error($connect));
}
while ($data_absen = mysqli_fetch_array($sql)) {
$select = mysqli_query($connect, "SELECT * FROM absensi");
if (!$select) {
die('Query Error: ' . mysqli_error($connect));
}
while ($data_bobot = mysqli_fetch_array($select)) {
// Menghitung nilai berdasarkan persentase
$sd_value = ($data_absen['sd'] / 100) * $data_bobot['sd'];
$pc_value = ($data_absen['pc'] / 100) * $data_bobot['pc'];
$dt_value = ($data_absen['dt'] / 100) * $data_bobot['dt'];
$i_value = ($data_absen['i'] / 100) * $data_bobot['i'];
$s_value = ($data_absen['s'] / 100) * $data_bobot['s'];
$a_value = ($data_absen['a'] / 100) * $data_bobot['a'];
$total_perhitungan = ($sd_value + $pc_value + $dt_value + $i_value + $s_value + $a_value) * 100;
$pengurangan = 100 - $total_perhitungan;
if ($pengurangan == 100) {
$point_absen = 100;
} elseif ($pengurangan >= 99 && $pengurangan < 100) {
$point_absen = 90;
} elseif ($pengurangan >= 95 && $pengurangan < 99) {
$point_absen = 80;
} elseif ($pengurangan >= 91 && $pengurangan < 95) {
$point_absen = 70;
} elseif ($pengurangan >= 87 && $pengurangan < 91) {
$point_absen = 60;
} elseif ($pengurangan >= 83 && $pengurangan < 87) {
$point_absen = 50;
} elseif ($pengurangan >= 79 && $pengurangan < 83) { // Updated range
$point_absen = 40;
} elseif ($pengurangan >= 75 && $pengurangan < 79) {
$point_absen = 30;
} elseif ($pengurangan >= 71 && $pengurangan < 75) {
$point_absen = 20;
} elseif ($pengurangan >= 67 && $pengurangan < 71) {
$point_absen = 10;
} elseif ($pengurangan >= 63 && $pengurangan < 67) {
$point_absen = 0;
} elseif ($pengurangan >= 59 && $pengurangan < 63) {
$point_absen = -10;
} else {
$point_absen = -20;
}
}
?>
<tr>
<td><?php echo $no; ?></td>
<td><?php echo $data_absen['nama_pera']; ?></td>
<td><?php echo $data_absen['kj']; ?></td>
<td><?php echo $data_absen['kl']; ?></td>
<td><?php echo $data_absen['kt']; ?></td>
<td><?php echo $data_absen['in']; ?></td>
<td><?php echo $data_absen['ly']; ?></td>
<td><?php echo $data_absen['ks']; ?></td>
<td><?php echo $data_absen['kte']; ?></td>
<td><?php echo $data_absen['mm']; ?></td>
<td><?php echo $data_absen['tj']; ?></td>
<td><?php echo $data_absen['kjin']; ?></td>
<td>
<a class="btn btn-success text-white mr-1" role="button" aria-disabled="true" data-toggle="modal" data-target="#modal-edit-karyawan-absen<?php echo $data_absen['pera_id']; ?>">
<i class="fa fa-plus"></i>
</a>
<?php include('./componen/modal-penilaian-nilai-edit.php'); ?>
</td>
</tr>
<?php $no++;
} ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
<!-- /.container-fluid-->
<!-- /.content-wrapper-->
<?php
include('./componen/footer.php');
?>
<!-- Scroll to Top Button-->
<a class="scroll-to-top rounded" href="#page-top">
<i class="fa fa-angle-up"></i>
</a>
<!-- Logout Modal-->
<?php
include('./componen/modal.php');
?>
</div>
<?php
include('./componen/script.php');
?>
</body>
</html>