-
Notifications
You must be signed in to change notification settings - Fork 0
/
tabel-alternatif.php
77 lines (72 loc) · 2.08 KB
/
tabel-alternatif.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
<?php
include_once 'header.php';
include_once 'includes/alternatif.inc.php';
$pro1 = new Alternatif($db);
$stmt1 = $pro1->readAll();
include_once 'includes/kriteria.inc.php';
$pro2 = new Kriteria($db);
$stmt2 = $pro2->readAll();
include_once 'includes/rangking.inc.php';
$pro = new Rangking($db);
$stmt = $pro->readKhusus();
?>
<br/>
</div>
<div class="container-fluid">
<br/>
<h4>Normalisasi </h4>
<table width="100%" class="table table-striped table-bordered" id="tabeldata" style="font-size: 9px;">
<thead>
<tr>
<th rowspan="2" style="vertical-align: middle" class="text-center">Nama</th>
<th colspan="<?php echo $stmt2->rowCount(); ?>" class="text-center">Kriteria</th>
</tr>
<tr>
<?php
while ($row2 = $stmt2->fetch(PDO::FETCH_ASSOC)){
?>
<th><?php echo $row2['nama_kriteria'] ?></th>
<?php
}
?>
</tr>
</thead>
<tbody>
<?php
while ($row1 = $stmt1->fetch(PDO::FETCH_ASSOC)){
?>
<tr>
<th><?php echo $row1['nama'] ?></th>
<?php
$a= $row1['id_alternatif'];
$stmtr = $pro->readR($a);
while ($rowr = $stmtr->fetch(PDO::FETCH_ASSOC)){
$b = $rowr['id_kriteria'];
$tipe = $rowr['tipe_kriteria'];
$bobot = $rowr['bobot_kriteria'];
?>
<td>
<?php
if($tipe=='benefit'){
$stmtmax = $pro->readMax($b);
$maxnr = $stmtmax->fetch(PDO::FETCH_ASSOC);
echo $rowr['nilai_rangking'];
} else{
$stmtmin = $pro->readMin($b);
$minnr = $stmtmin->fetch(PDO::FETCH_ASSOC);
echo $rowr['nilai_rangking'];
}
?>
</td>
<?php
}
?>
</tr>
<?php
}
?>
</tbody>
</table>
<?php
include_once 'footer.php';
?>