-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
117 lines (115 loc) · 3.16 KB
/
index.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
<?php
include_once 'header.php';
include_once 'includes/nilai.inc.php';
$pro3 = new Nilai($db);
$stmt3 = $pro3->readAll();
include_once 'includes/alternatif.inc.php';
$pro1 = new Alternatif($db);
$stmt1 = $pro1->readAll();
$stmt4 = $pro1->readAll();
include_once 'includes/kriteria.inc.php';
$pro2 = new Kriteria($db);
$stmt2 = $pro2->readAll();
?>
<div class="row">
<div class="col-xs-12 col-sm-12 col-md-4">
<div class="page-header">
<h5>Nilai Preferensi</h5>
</div>
<div class="panel panel-default">
<div class="panel-body">
<ol>
<?php
while ($row3 = $stmt3->fetch(PDO::FETCH_ASSOC)){
?>
<li><?php echo $row3['ket_nilai'] ?> (<?php echo $row3['jum_nilai'] ?>)</li>
<?php
}
?>
</ol>
</div>
</div>
</div>
<div class="col-xs-12 col-sm-12 col-md-4">
<div class="page-header">
<h5>Kriteria-Kriteria</h5>
</div>
<div class="panel panel-default">
<div class="panel-body">
<ol class="list-unstyled">
<?php
while ($row2 = $stmt2->fetch(PDO::FETCH_ASSOC)){
?>
<li>(<?php echo $row2['id_kriteria'] ?>) <?php echo $row2['nama_kriteria'] ?></li>
<?php
}
?>
</ol>
</div>
</div>
</div>
<div class="col-xs-12 col-sm-12 col-md-4">
<div class="page-header">
<h5>Alternatif Produk</h5>
</div>
<div class="panel panel-default">
<div class="panel-body">
<ol class="list-unstyled">
<?php
while ($row1 = $stmt1->fetch(PDO::FETCH_ASSOC)){
?>
<li>(<?php echo $row1['id_alternatif'] ?>) <?php echo $row1['nama_alternatif'] ?></li>
<?php
}
?>
</ol>
</div>
</div>
</div>
</div>
<div id="container2" style="min-width: 310px; height: 400px; margin: 0 auto"></div>
<footer class="text-center">© 2015</footer>
</div>
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="js/jquery-1.11.3.min.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="js/bootstrap.min.js"></script>
<script src="js/highcharts.js"></script>
<script src="js/exporting.js"></script>
<script>
var chart1; // globally available
$(document).ready(function() {
chart1 = new Highcharts.Chart({
chart: {
renderTo: 'container2',
type: 'column'
},
title: {
text: 'Grafik Perangkingan '
},
xAxis: {
categories: ['Alternatif']
},
yAxis: {
title: {
text: 'Jumlah Nilai'
}
},
series:
[
<?php
while ($row4 = $stmt4->fetch(PDO::FETCH_ASSOC)){
?>
//data yang diambil dari database dimasukan ke variable nama dan data
//
{
name: '<?php echo $row4['nama_alternatif'] ?>',
data: [<?php echo $row4['hasil_alternatif'] ?>]
},
<?php } ?>
]
});
});
</script>
</body>
</html>