-
Notifications
You must be signed in to change notification settings - Fork 9
/
mila-user-auth.php
121 lines (121 loc) · 4.06 KB
/
mila-user-auth.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
<?php
if(isset($_POST['nim']))
{
include "db.php"; $nim = mysql_escape_string($_POST['nim']);
$cek = mysqli_query($con,"select *, count(*) as ROW from view_mahasiswa where NIM = '$nim'");
$mhs = mysqli_fetch_object($cek);
if($mhs->ROW <= 0):
echo 0;
else:
$s = mysqli_query($con,"select DATA from mila_rekomendasi where NIM = $nim;");
$r = mysqli_fetch_object($s); $data = json_decode($r->DATA);
?>
<div class="row navi">
<div class="col-md-2 col-md-offset-10">
<div class="input-group">
<span class="input-group-addon"><span class="glyphicon glyphicon-arrow-left"></span></span>
<a href="./" class="btn btn-sm btn-primary btn-block btn-back" role="button">Kembali</a>
</div>
</div>
</div>
<div class="row navi">
<div class="col-sm-4 col-md-4">
<div class="panel panel-primary">
<div class="panel-heading">DATA MAHASISWA</div>
<div class="panel-body">
<table class="table">
<tr><th>NIM</th><td>:</td><td><?php echo $mhs->NIM;?></td></tr>
<tr><th>Nama</th><td>:</td><th><?php echo $mhs->NAMA;?></th></tr>
<?php $dt=0; foreach($data as $a => $b): $dt++; if($dt>8) break;
switch($mhs->$a){
default: $nilai = $mhs->$a; break;
case "L": $nilai = "LAKI-LAKI"; break;
case "P": $nilai = "PEREMPUAN"; break;
case "Y": $nilai = "YA"; break;
case "T": $nilai = "TIDAK"; break;
}
switch($a){
default: $item=ucwords(strtolower($a)); break;
case "JENKEL": $item="Jenis Kelamin"; break;
case "IPK": $item="Indeks Prestasi"; break;
case "GAJI": $item="Gaji Orang Tua"; $nilai = "Rp. ".number_format($nilai, 0, ',', '.'); break;
case "REKLISTRIK": $item="Rek. Listrik"; $nilai = "Rp. ".number_format($nilai, 0, ',', '.'); break;
case "JMLPIAGAM": $item="Jml. Piagam"; break;
case "PROPOSALPKM": $item="Prop. PKM"; break;
}
?>
<tr><th><?php echo $item;?></th><td>:</td><td><?php echo $nilai;?></td></tr>
<?php endforeach; ?>
</table>
</div>
<div class="panel-foot">
<div style="padding: 15px;">
<strong>Rekomendasi Beasiswa:</strong>
<h3 style="text-align:center;margin:0;padding:5px 0px;background:#dedede;">
<?php echo $data->REKOMENDASI;?>
</h3>
</div>
</div>
</div>
</div>
<div class="col-sm-8 col-md-8">
<div class="panel panel-primary">
<div class="panel-heading">DETAIL REKOMENDASI</div>
<div class="panel-body">
<table class="table">
<thead>
<tr class="filters">
<th>ITEM</th>
<?php foreach(reset($data) as $a => $b): ?>
<th><?php echo $a;?></th>
<?php endforeach; ?>
</tr>
</thead>
</tr>
<tbody>
<?php $dt=0; foreach($data as $a => $b): $dt++; if($dt>8) break;
switch($a){
default: $item=$a; break;
case "JENKEL": $item="JENIS KELAMIN"; break;
case "IPK": $item="INDEKS PRESTASI"; break;
case "GAJI": $item="GAJI ORANG TUA"; break;
case "REKLISTRIK": $item="REK. LISTRIK"; break;
case "JMLPIAGAM": $item="JML. PIAGAM"; break;
case "PROPOSALPKM": $item="PROPOSAL PKM"; break;
}
?>
<tr>
<td><?php echo $item;?></td>
<?php foreach($data->$a as $c => $d): ?>
<td><?php echo number_format($d->NILAI,6,',','.');?></td>
<?php endforeach; ?>
</tr>
<?php endforeach; ?>
</tbody>
<tfoot>
<tr>
<th align=center>LIKELIHOOD</th>
<?php foreach($data->LIKELIHOOD as $c => $d): ?>
<td><?php echo number_format($d,6,',','.');?></td>
<?php endforeach; ?>
</tr>
<tr>
<th align=center>LIKELIHOOD TOTAL</th>
<?php foreach($data->PROBABILITY as $c => $d): ?>
<td><?php echo number_format($d->TOTAL,6,',','.');?></td>
<?php endforeach; ?>
</tr>
<tr>
<th align=center>PROBABILITY VALUE</th>
<?php foreach($data->PROBABILITY as $c => $d): ?>
<td><?php echo number_format($d->NILAI,6,',','.');?></td>
<?php endforeach; ?>
</tr>
</tfoot>
</table>
</div>
</div>
</div>
</div>
<?php endif;
}