<?
session_start();
include"../plg/ses.php";
$idkar = $_POST['idkar'];

function simpan($a,$b){
  include"../plg/kon.php";
  $sql1 = "update kpiuser set vol='$a' where id='$b'";
  $res1 = $conn->query($sql1);
}

for ($a = 1; $a < 30; $a++) {
  $volx = "vol".$a;
  $idx = "id".$a;
  $voly = $_POST[$volx];
  $idy = $_POST[$idx];
  simpan($voly,$idy);
}
echo "<script>location.href='formuserkpiver2.php?idkar=$idkar';</script>";
?>
