diff --git a/P3/controller/form_penilaian_skp_controller.php b/P3/controller/form_penilaian_skp_controller.php index ee2fee9d11b511c2edceb90e0affa6582fe966ba..c2f285f24fd6a1ce1c1969c6438aadefa54cca50 100644 --- a/P3/controller/form_penilaian_skp_controller.php +++ b/P3/controller/form_penilaian_skp_controller.php @@ -39,7 +39,7 @@ echo "update done "; - header( 'Location: ../form_penilaian_skp.php?nip='.$nip ) ; + header( 'Location: ../list_penilaian_skp.php' ) ; exit(); } diff --git a/P3/form_penilaian_skp.php b/P3/form_penilaian_skp.php index 00ddb536a83045cc8632eaeb99a403b845b832fc..409efeff617235e50f5321084b59eaa791f5bc70 100644 --- a/P3/form_penilaian_skp.php +++ b/P3/form_penilaian_skp.php @@ -23,6 +23,7 @@ <?php require_once 'header.php' ?> <?php require_once 'aside.php' ?> + <?php require_once 'controller/connectdb.php' ?> <!-- content --> <div id="content" class="app-content" role="main"> @@ -67,7 +68,7 @@ <td><b>Realisasi Kuantitas</b></td> <td><b>Realisasi Waktu</b></td> <td><b>Realisasi Biaya</b></td> - <td><b>Status</b></td> + <td><b>Nilai</b></td> </tr> </thead> <tbody> @@ -98,6 +99,32 @@ <td><?php if(is_null($k["real_biaya"])) echo "-" ; else echo $k["real_biaya"]; ?> </td> + <td><?php if(is_null($k["real_ak"]) && is_null($k["real_biaya"]) && is_null($k["real_kualitas"]) && is_null($k["real_waktu"]) && is_null($k["real_kuantitas"]) ) echo "Belum dinilai" ; + else { + $KL = ($k["real_kualitas"] / $k["target_kualitas"]) *100; + $KT = ($k["real_kuantitas"] / $k["target_kuantitas"]) *100; + $W = 100 - ($k["real_waktu"] / $k["target_waktu"] *100 ); + if($W<=24) $W = (1.76 * $k["target_waktu"] - $k["real_waktu"] )/ $k["target_waktu"] * 100; + + $B = 100 - ($k["real_biaya"] / $k["target_biaya"] *100 ); + if($B<=24) $B = (1.76 * $k["target_biaya"] - $k["real_biaya"]) / $k["target_biaya"] * 100; + + $hasil = ($KL + $KT +$W + $B)/4; + //echo "(",$KL, "+", $KT ,"+",$W ,"+", $B,") /",4; + echo $hasil; + + $conn = connect_database(); + $skp = $k["id_skp"]; + $keg = $k["id_kegiatan"]; + + $sql = "UPDATE kegiatan + SET nilai_kegiatan=$hasil + WHERE id_skp = $skp AND id_kegiatan = $keg "; + $result = $conn->query($sql); + + + }?> + </td> <td> <div class=""> @@ -125,31 +152,31 @@ <div class="form-group"> <label class="col-lg-3 control-label">Realisasi Angka Kredit</label> <div class="col-lg-9"> - <input type="number" name="r_kredit" class="form-control"> + <input type="number" name="r_kredit" class="form-control" value="<?php if(!is_null($k["real_ak"])) echo $k["real_ak"]?>"> </div> </div> <div class="form-group"> <label class="col-lg-3 control-label">Realisasi Output / Kuantitas</label> <div class="col-lg-9"> - <input type="text" name="r_kuantitas" class="form-control"> + <input type="text" name="r_kuantitas" class="form-control" value="<?php if(!is_null($k["real_kuantitas"])) echo $k["real_kuantitas"]?>"> </div> </div> <div class="form-group"> <label class="col-lg-3 control-label">Realisasi Mutu / Kualitas</label> <div class="col-lg-9"> - <input type="number" name="r_kualitas" class="form-control"> + <input type="number" name="r_kualitas" class="form-control" value="<?php if(!is_null($k["real_kualitas"])) echo $k["real_kualitas"]?>"> </div> </div> <div class="form-group"> <label class="col-lg-3 control-label">Realisasi Waktu</label> <div class="col-lg-9"> - <input type="text" name="r_waktu" class="form-control"> + <input type="text" name="r_waktu" class="form-control"value="<?php if(!is_null($k["real_waktu"])) echo $k["real_waktu"] ?>" > </div> </div> <div class="form-group"> <label class="col-lg-3 control-label">Realisasi Biaya</label> <div class="col-lg-9"> - <input type="number" name="r_biaya" class="form-control"> + <input type="number" name="r_biaya" class="form-control" value="<?php if(!is_null($k["real_biaya"])) echo $k["real_biaya"]?>" > </div> </div> diff --git a/P3/js/penilaian.js b/P3/js/penilaian.js new file mode 100644 index 0000000000000000000000000000000000000000..80e546c8455b73c708357449b178e0928eff54e3 --- /dev/null +++ b/P3/js/penilaian.js @@ -0,0 +1,11 @@ +function hitung (int t_kl, int t_kt, int t_w, int t_b, int r_kl, int r_kt, int r_w, int r_b){ + + float KL = (r_kl*1.0)/t_kl * 1000; + float KT = (r_kt*1.0)/t_kt * 1000; + float W = 100 - ((r_w*1.0)/t_w * 1000); + float B = 100 - ((r_b*1.0)/t_b * 1000); + + float hasil = (KT + KL + W + B)/4; + document.write(hasil); + +} \ No newline at end of file diff --git a/a.out b/a.out new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391