-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhitung.php
41 lines (41 loc) · 1.46 KB
/
hitung.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
<div class="page-header">
<h1>Hasil Perhitungan</h1>
</div>
<?php
$success = false;
if($_POST){
$next_periode = $_POST['next_periode'];
if($next_periode==''){
print_msg('Isikan periode');
} else {
$success = true;
}
}
?>
<form method="post">
<div class="panel panel-primary">
<div class="panel-heading">
<h3 class="panel-title">Masukkan data periode</h3>
</div>
<div class="panel-body">
<div class="row">
<div class="col-md-4">
<div class="form-group">
<label>Periode <span class="text-danger">*</span></label>
<input class="form-control" type="number" name="next_periode" value="<?=set_value('next_periode', $db->get_var("SELECT MAX(nama_periode) + 1 FROM tb_periode"))?>" />
</div>
<button class="btn btn-primary"><span class="glyphicon glyphicon-signal"></span> Hitung</button>
</div>
</div>
</div>
</div>
</form>
<?php
$c = $db->get_results("SELECT * FROM tb_relasi WHERE nilai < 0");
if (!$PERIODE || !$JENIS):
echo "Tampaknya anda belum mengatur periode dan jenis. Silahkan tambahkan minimal 3 periode dan 3 jenis.";
elseif ($c):
echo "Tampaknya anda belum mengatur nilai periode. Silahkan atur pada menu <strong>Nilai Periode</strong>.";
elseif ($success):
include 'hasil.php';
endif?>