<?
session_start();
include"../plg/ses.php";
?>
<!DOCTYPE html>
<?
$idkar = $_GET['idkar'];
$smt = substr($idkar,0,8);
?>
<html>
<title></title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="../plg/w3.css">
<body>
<?include"../menu.php";?>
<hr/>
<div class="w3-container">
  <h4>SEMESTER <?=$smt?></h4>
  <table class="w3-table" id="myTable" style="">
    <tr>
      <th style="width:300px" class="w3-small w3-border w3-blue-gray w3-center">NAMA</th>
      <th style="width:150px" class="w3-small w3-border w3-blue-gray w3-center">NIP</th>
      <th style="width:200px" class="w3-small w3-border w3-blue-gray w3-center">UNIT</th>
      <th style="width:400px" class="w3-small w3-border w3-blue-gray w3-center">JABATAN</th>
      <th style="width:200px" class="w3-small w3-border w3-blue-gray w3-center">LOKASI</th>
    </tr>
    <?
    include"../plg/kon.php";
    $sql = "select * from kpikar where idkar='$idkar'";
    $res = $conn->query($sql);
    while($b = $res->fetch_assoc()){
      $lokk = $b['lok'];
    ?>
    <tr>
      <td class="w3-large w3-border"><?=$b['nama']?></td>
      <td class="w3-large w3-border"><?=$b['nip']?></td>
      <td class="w3-large w3-border"><?=$b['unit']?></td>
      <td class="w3-large w3-border"><?=$b['jab']?></td>
      <td class="w3-large w3-border"><?=$lokk?></td>
    </tr>
    <?}?>
  </table>
<hr/>
  <table class="w3-table-all w3-hoverable">
    <thead>
      <tr class="w3-light-grey">
        <th class="w3-small w3-center w3-border" rowspan="2">NO</th>
        <th class="w3-small w3-center w3-border" rowspan="2">KODE</th>
        <th class="w3-small w3-center w3-border" rowspan="2">KPI</th>
        <th class="w3-small w3-center w3-border" rowspan="2">POLA<br/>RISASI</th>
        <th class="w3-small w3-center w3-border" rowspan="2">KEY PERFORMANCE INDICATOR<br/>(SASARAN KINERJA)</th>
        <th class="w3-small w3-center w3-border" rowspan="2">SATUAN</th>
        <th class="w3-small w3-center w3-border" rowspan="2">VOLUME</th>
        <th class="w3-small w3-center w3-border" rowspan="2">KUALITAS</th>
        <th class="w3-small w3-center w3-border w3-pale-yellow" colspan="3">PENCAPAIAN KINERJA</th>
        <th class="w3-small w3-center w3-border w3-pale-blue" colspan="2">HASIL PENILAIAN</th>
      </tr>
      <tr>
        <th class="w3-small w3-center w3-border w3-pale-yellow" colspan="">VOLUME</th>
        <th class="w3-small w3-center w3-border w3-pale-yellow" colspan="">KUALITAS</th>
        <th class="w3-small w3-center w3-border w3-pale-yellow" colspan="">CATATAN</th>
        <th class="w3-small w3-center w3-border w3-pale-blue" colspan="">KUANTITAS</th>
        <th class="w3-small w3-center w3-border w3-pale-blue" colspan="">KUALITAS</th>
      </tr>
    </thead>
    <?
    include"../plg/kon.php";
    $i= 1;
    $sql = "select * from kpiuser where idkar='$idkar'";
    $res = $conn->query($sql);
    while($a = $res->fetch_assoc()){
      $idx = $a['id'];
      ?>
      <tr onclick="editkan('<?=$idx?>')">
        <td class="w3-small w3-center w3-border"><?=$i++?></td>
        <td class="w3-small w3-border"><?=$a['kode']?></td>
        <td class="w3-small w3-border"><?=$a['kpi']?></td>
        <td class="w3-small w3-center w3-border"><?=$a['pola']?></td>
        <td class="w3-small w3-border"><?=$a['des']?></td>
        <td class="w3-small w3-center w3-border"><?=$a['sat']?></td>
        <td class="w3-small w3-center w3-border"><?=number_format($a['vol'])?></td>
        <td class="w3-small w3-center w3-border"><?=number_format($a['kua'])?> %</td>
        <td class="w3-small w3-center w3-border w3-pale-yellow"><?=number_format($a['pkvol'])?></td>
        <td class="w3-small w3-center w3-border w3-pale-yellow"><?=number_format($a['pkkua'])?></td>
        <td class="w3-small w3-center w3-border w3-pale-yellow"><?=$a['pkcat']?></td>
        <td class="w3-small w3-center w3-border w3-pale-blue"><?=number_format($a['hpkuan'])?> %</td>
        <td class="w3-small w3-center w3-border w3-pale-blue"><?=number_format($a['hpkua'])?> %</td>
      </tr>
      <?
    }
    include"rumus.php";
    ?>

    <tr>
      <td class="w3-small w3-center w3-border" colspan="10"></td>

      <td class="w3-small w3-center w3-border" colspan="1"><b>TOTAL</b></td>
      <td class="w3-small w3-center w3-border" colspan="1"><b><?=$hasilkuantab?> %</b></td>
      <td class="w3-small w3-center w3-border" colspan="1"><b><?=$hasilkuatab?> %</b></td>
    </tr>
    <tr>
      <td class="w3-small w3-center w3-border" colspan="10"></td>
tab
      <td class="w3-small w3-center w3-border" colspan="1"><b>KATEGORI</b></td>
      <td class="w3-small w3-center w3-border" colspan="1"><b><?=$kategori?></b></td>
      <td class="w3-small w3-center w3-border" colspan="1"><b><?=$hasilnya?></b></td>
    </tr>
  </table>

  <br/><br/><hr/>
</div>
<div id="id01" class="w3-modal">
  <div class="w3-modal-content" style="width:95%;">
    <div class="w3-container" style="">
        <span onclick="batal()"
        class="w3-button w3-display-topright w3-red">&times;</b></span>
        <br/><hr/>
        <iframe style="border:1px solid white;width:100%;height:400px;" id="rangka">

        </iframe>
    </div>
  </div>
</body>
<script>
function editkan(a){
  document.getElementById('id01').style.display='block';
  document.getElementById('rangka').src="perkpi.php?kode="+a;
}
function batal(){
  document.getElementById('id01').style.display='none';
}
function isiulang(){
  location.reload();
}
</script>
</html>
