<?
session_start();
include"../plg/ses.php";
include"../plg/kon.php";
$id = $_GET['id'];
$idkar = $_GET['idkar'];
$smt = $_GET['smt'];
$sqle = "select * from masterkpi where id='$id'";
$rese = $conn->query($sqle);
while($k = $rese->fetch_assoc()){
  $kpi = $k['kpi'];
  $kode = $k['kode'];
  $pola = $k['pola'];
  $des = $k['des'];
  $sat = $k['sat'];
  $fok = $k['fok'];
  $area = $k['area'];
  $kodejab = $k['kodejab'];
  $foktan = $k['foktan'];
  //$saverec = $k['saverec'];
}

?>
<link rel="stylesheet" href="../plg/w3.css">
<form action="savedatakpi.php" method="post" id="formdatakpi">
  <input type="hidden"name="id" value="<?=$id?>">
<table class="w3-table" id="" style="">
  <tr>
    <th style="width:150px" class="w3-small w3-border w3-blue-gray w3-center">KPI</th>
    <th style="width:150px" class="w3-small w3-border w3-blue-gray w3-center">KODE</th>
    <th style="width:150px" class="w3-small w3-border w3-blue-gray w3-center">POLARISASI</th>
    <th style="width:100px" class="w3-small w3-border w3-blue-gray w3-center">SATUAN</th>
    <th style="width:300px" class="w3-small w3-border w3-blue-gray w3-center">FOKUS</th>
    <th style="width:150px" class="w3-small w3-border w3-blue-gray w3-center">AREA</th>
  </tr>
  <tr>
    <td class="w3-small w3-border">
      <input type="hidden" name="idkar" value="<?=$idkar?>"/>
      <input type="hidden" name="smt" value="<?=$smt?>"/>
      <input type="hidden" name="foktan" value="<?=$foktan?>"/>
      <input type="text" name="kpi" id="" class="w3-border w3-input" value="<?=$kpi?>" <?=$nipdis?> readonly/>
    </td>
    <td class="w3-small w3-border">
      <input type="text" name="kode" class="w3-border w3-input" value="<?=$kode?>" onclick="<?=$fung?>" readonly/>
    </td>
    <td class="w3-small w3-border">
      <input type="text" name="pola" class="w3-border w3-input" value="<?=$pola?>" onclick="<?=$fung?>" readonly/>
    </td>
    <td class="w3-small w3-border">
      <input type="text" name="sat" class="w3-border w3-input" value="<?=$sat?>" onclick="<?=$fung?>" readonly/>
    </td>
    <td class="w3-small w3-border">
      <input type="text" name="fok" id="" class="w3-border w3-input" value="<?=$fok?>" <?=$nipdis?> readonly/>
    </td>
    <td class="w3-small w3-border">
      <input type="text" name="area" id="" class="w3-border w3-input" value="<?=$area?>" <?=$nipdis?> readonly/>
    </td>
  </tr>
</table>
<br/>
<table class="w3-table" id="" style="">
  <tr>
    <th style="width:150px" class="w3-small w3-border w3-blue-gray w3-center">DESCRIPTION KPI</th>
  </tr>
  <tr>
    <td class="w3-small w3-border">
      <input type="text" name="des" id="nip" class="w3-border w3-input" value="<?=$des?>" <?=$nipdis?> readonly/>
    </td>
  </tr>
</table>
</form>
<hr/>
<center>
<div class="w3-btn w3-blue w3-small w3-round-large" onclick="masukanke()" id="btnsave" style="display:<?=$btndis?>">MASUKAN</div>
&nbsp;
<div class="w3-btn w3-red w3-small w3-round-large" onclick="batalkpi()">CANCEL</div>
</center>
<iframe style="display:none" id="rangka2"></iframe>
<script>
function loncatisi(a,y,d){
  document.getElementById(y).value=a;
  dropFunction(d);
}
function masukanke(){
  var r = confirm('MASUKAN DATA KPI ?...');
  if(r == true){
    document.getElementById('formdatakpi').submit();
  }
}
function batalkpi(){
  parent.keluar();
  parent.kembalikan();
}
function ceknip(){
  nip = document.getElementById('nip').value;
  document.getElementById('rangka2').src="ceknip.php?nip="+nip;
}
function ulang(){
  document.getElementById('nip').focus();
  document.getElementById('btnsave').style="display:none";
}
// Dropdown
function dropFunction(x) {
  var x = document.getElementById(x);
  if (x.className.indexOf("w3-show") == -1) {
    x.className += " w3-show";
  } else {
    x.className = x.className.replace(" w3-show", "");
  }
}

// Filter
function filterFunction(x,y) {
  var input, filter, ul, li, a, i;
  input = document.getElementById(y);
  filter = input.value.toUpperCase();
  div = document.getElementById(x);
  a = div.getElementsByTagName("a");
  for (i = 0; i < a.length; i++) {
    txtValue = a[i].textContent || a[i].innerText;
    if (txtValue.toUpperCase().indexOf(filter) > -1) {
      a[i].style.display = "";
    } else {
      a[i].style.display = "none";
    }
  }
}
</script>
