<?
session_start();
include"../plg/ses.php";
include"../plg/kon.php";

 $idkar = $_POST['idkarpen'];
 $nko = $_POST['nko'];
 $nilai = $_POST['nilai'];
 /*
 $pkkua = $_POST['pkkua'];
 $pkcat = $_POST['pkcat'];
 $hpkuan = $_POST['hpkuan'];
 $hpkua = $_POST['hpkua'];
 $kua = $_POST['kua'];
 $pola = $_POST['pola'];


/*
if($pola == 'Positif'){
  $hasilkuan = $pkvol/$vol*100;
  if($hasilkuan > 120){
    $hasilkuan = "120";
  }
  $hasilkua = $pkkua/$kua*100;
  if($hasilkua > 120){
   $hasilkua = "120";
 }
}

if($pola == 'Negatif'){
  $hasilkuan = $vol/$pkvol*100;
  if($hasilkuan > 120){
    $hasilkuan = "120";
  }
  $hasilkua = $pkkua/$kua*100;
  if($hasilkua > 120){
   $hasilkua = "120";
 }
}

$hasilkuan = $pkvol/$vol*100;
if($hasilkuan > 120){
  $hasilkuan = "120";
}
$hasilkua = $pkkua/$kua*100;
if($hasilkua > 120){
 $hasilkua = "120";
}
*/
//$kategori = round(($nk+$hasilkua)/2);

if($nilai < 91){
  $hasilnya =  "KURANG";
}
elseif($nilai > 90){
  $hasilnya = "CUKUP";
}
elseif($nilai < 101){
  $hasilnya = "CUKUP";
}
elseif($nilai > 100){
  $hasilnya = "BAIK";
}
elseif($nilai > 120){
  $hasilnya = "LUAR BIASA";
}
//$hasilnya;

$sql = "update kpikar set nko='$nko', nilai='$nilai', krite='$hasilnya' where idkar='$idkar'";
$res = $conn->query($sql);

//header("location:../dashboard/penyelarasan.php");
 echo "<script>location.href='../dashboard/penyelarasan.php';</script>";
//echo "test";
 //pkvol='$pkvol', pkkua='$pkkua', pkcat='$pkcat', hpkuan='$hpkuan', hpkua='$hpkua'
?>
