<?

$idkar = $_GET['idkar'];
include"../plg/kon.php";
$sql = "select * from kpikar where idkar='$idkar'";
$res = $conn->query($sql);
while($a = $res->fetch_assoc()){
  $namax = $a['nama'];
  $nip = $a['nip'];
  $jab = $a['jab'];
  $cab = $a['lok'];
  $smt = $a['smt'];
  $unit = $a['unit'];
  $hasilkua = $a['hasilkua'];
  $hasilkuan = $a['hasilkuan'];
}

$sqlk = "select * from karyawan where nip='$nip'";
$resk = $conn->query($sqlk);
while($k = $resk->fetch_assoc()){
  $atasan = $k['bos'];
}
$sqlk2 = "select * from karyawan where jab like'%$atasan%'";
$resk2 = $conn->query($sqlk2);
while($k2 = $resk2->fetch_assoc()){
  $natasan = $k2['nama'];
}
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" href="../plg/w3.css">
<link rel="icon" href="../plg/logoadp.png">
<title></title>
</head>
<style type="text/css">
    .grs{
      border-right:0.5px solid gray;font-size:9px;padding:1px;border-bottom:0.5px solid gray;text-align:center;
    }
    .grs0{
      border-right:0.5px solid gray;font-size:9px;padding-left:5px;border-bottom:0.5px solid gray;text-align:left;
    }
    .grs1{
      border-right:0.5px solid black;font-size:9px;padding:1px;border-bottom:0.5px solid black;
    }
    .page{
      padding-left:10px;padding-right:10px;font-size:10px;padding-top:10px;
    }
    .fok{
      background-color:#D5D9DC;font-weight:bold;font-size:10px;padding-left:10px;text-align:center;
    }
</style>

<body onload="print()">

	<div class="page">
    <table cellpadding="0" cellspacing="0" width="100%">
      <tr>
          <td style="width:25%;">
            <b>PT ADHI GUNA PUTERA</b><br/>
            <b><?=$unit?></b><br/>
            <table cellpadding="0" cellspacing="0">
              <tr>
                <td>NAMA PEGAWAI</td>
                <td> : </td>
                <td>&nbsp;<?=strtoupper($namax)?></td>
              </tr>
              <tr>
                <td>NIP</td>
                <td> : </td>
                <td>&nbsp;<?=strtoupper($nip)?></td>
              </tr>
              <tr>
                <td>JABATAN</td>
                <td> : </td>
                <td>&nbsp;<?=strtoupper($jab)?></td>
              </tr>
            </table>
          </td>
          <td style="width:50%;">
            <center>
              <div style="font-weight:bold;font-size:11px;">
              SISTIM MANAJEMEN KINERJA PEGAWAI<br/>
              PERIODE SEMESTER <?=$smt?> ( 01 JANUARI S/D 30 JUNI )
            </div>
            </center>
          </td>
          <td style="width:25%" cellpadding="0" cellspacing="0">
            <table>
              <tr>
                <td>CABANG</td>
                <td> : </td>
                <td><?=strtoupper($cab)?></td>
              </tr>
              <tr>
                <td>PENILAI</td>
                <td> : </td>
                <td>XXX</td>
              </tr>
            </table>
          </td>
      <tr>
    </table>

     <br/>

     <table style="width:100%;" cellpadding="0" cellspacing="0">
       <thead>
         <tr style="background-color:#4CA4EA" class="">
           <th class="grs1" rowspan="2">KODE KPI</th>
           <th class="grs1" rowspan="2" style="">KEY</th>
           <th class="grs1" rowspan="2" style="">NO</th>
           <th class="grs1" rowspan="2" style="">POLARISASI</th>
           <th class="grs1" rowspan="2">KEY PERFORMANCE INDICATOR<br/>(SASARAN KINERJA)</th>
           <th class="grs1" rowspan="2">SATUAN</th>
           <th class="grs1" rowspan="2">VOLUME</th>
           <th class="grs1" rowspan="2">KUALITAS</th>
           <th class="grs1" colspan="3">PENCAPAIAN KINERJA</th>
           <th class="grs1" colspan="2">HASIL PENILAIAN</th>
         </tr>
         <tr style="background-color:#4CA4EA">
           <th class="grs1" colspan="">VOLUME</th>
           <th class="grs1" colspan="">KUALITAS</th>
           <th class="grs1" colspan="">CATATAN</th>
           <th class="grs1" colspan="">KUANTITAS</th>
           <th class="grs1" colspan="">KUALITAS</th>
         </tr>
       </thead>

       <tr>
         <td colspan="13" class="grs fok" style=""> I Fokus Keuangan</td>
       </tr>
       <?
       $i = 1;
       $sql1 = "select * from kpiuser where idkar='$idkar' and del='0' and fok like'%keuangan%'";
       $res1 = $conn->query($sql1);
       while($b = $res1->fetch_assoc()){
       ?>

       <tr>
         <td class="grs"><?=$b['kpi']?></td>
         <td class="grs"><?=$b['kode']?></td>
         <td class="grs"><?=$i++?></td>
         <td class="grs"><?=$b['pola']?></td>
         <td class="grs0"><?=$b['des']?></td>
         <td class="grs"><?=$b['sat']?></td>
         <td class="grs"><?=$b['vol']?></td>
         <td class="grs"><?=$b['kua']?></td>
         <td class="grs"><?=$b['pkvol']?></td>
         <td class="grs"><?=$b['pkkua']?></td>
         <td class="grs"><?=$b['pkcat']?></td>
         <td class="grs"><?=$b['hpkuan']?></td>
         <td class="grs"><?=$b['hpkua']?></td>
       </tr>
       <?}?>

       <tr>
         <td colspan="13" class="grs fok" style=""> II Fokus Pelayanan</td>
       </tr>
       <?
       $sql1 = "select * from kpiuser where idkar='$idkar' and del='0' and fok like'%pelayanan%'";
       $res1 = $conn->query($sql1);
       while($b = $res1->fetch_assoc()){
       ?>
       <tr>
         <td class="grs"><?=$b['kpi']?></td>
         <td class="grs"><?=$b['kode']?></td>
         <td class="grs"><?=$i++?></td>
         <td class="grs"><?=$b['pola']?></td>
         <td class="grs0"><?=$b['des']?></td>
         <td class="grs"><?=$b['sat']?></td>
         <td class="grs"><?=$b['vol']?></td>
         <td class="grs"><?=$b['kua']?></td>
         <td class="grs"><?=$b['pkvol']?></td>
         <td class="grs"><?=$b['pkkua']?></td>
         <td class="grs"><?=$b['pkcat']?></td>
         <td class="grs"><?=$b['hpkuan']?></td>
         <td class="grs"><?=$b['hpkua']?></td>
       </tr>
       <?}?>

       <tr>
         <td colspan="13" class="grs fok" style=""> III Efektivitas Produk dan Proses</td>
       </tr>
       <?
       $sql1 = "select * from kpiuser where idkar='$idkar' and del='0' and fok like'%efektivitas produk%'";
       $res1 = $conn->query($sql1);
       while($b = $res1->fetch_assoc()){
       ?>
       <tr>
         <td class="grs"><?=$b['kpi']?></td>
         <td class="grs"><?=$b['kode']?></td>
         <td class="grs"><?=$i++?></td>
         <td class="grs"><?=$b['pola']?></td>
         <td class="grs0"><?=$b['des']?></td>
         <td class="grs"><?=$b['sat']?></td>
         <td class="grs"><?=$b['vol']?></td>
         <td class="grs"><?=$b['kua']?></td>
         <td class="grs"><?=$b['pkvol']?></td>
         <td class="grs"><?=$b['pkkua']?></td>
         <td class="grs"><?=$b['pkcat']?></td>
         <td class="grs"><?=$b['hpkuan']?></td>
         <td class="grs"><?=$b['hpkua']?></td>
       </tr>
       <?}?>

       <tr>
         <td colspan="13" class="grs fok" style=""> IV Fokus Kepemimpinan</td>
       </tr>
       <?
       $sql1 = "select * from kpiuser where idkar='$idkar' and del='0' and fok like'%kepemimpinan%'";
       $res1 = $conn->query($sql1);
       while($b = $res1->fetch_assoc()){
       ?>
       <tr>
         <td class="grs"><?=$b['kpi']?></td>
         <td class="grs"><?=$b['kode']?></td>
         <td class="grs"><?=$i++?></td>
         <td class="grs"><?=$b['pola']?></td>
         <td class="grs0"><?=$b['des']?></td>
         <td class="grs"><?=$b['sat']?></td>
         <td class="grs"><?=$b['vol']?></td>
         <td class="grs"><?=$b['kua']?></td>
         <td class="grs"><?=$b['pkvol']?></td>
         <td class="grs"><?=$b['pkkua']?></td>
         <td class="grs"><?=$b['pkcat']?></td>
         <td class="grs"><?=$b['hpkuan']?></td>
         <td class="grs"><?=$b['hpkua']?></td>
       </tr>
       <?}?>

       <tr>
         <td colspan="13" class="grs fok" style=""> V Fokus Efesiensi</td>
       </tr>
       <?
       $sql1 = "select * from kpiuser where idkar='$idkar' and del='0' and fok like'%efisiensi%'";
       $res1 = $conn->query($sql1);
       while($b = $res1->fetch_assoc()){
       ?>
       <tr>
         <td class="grs"><?=$b['kpi']?></td>
         <td class="grs"><?=$b['kode']?></td>
         <td class="grs"><?=$i++?></td>
         <td class="grs"><?=$b['pola']?></td>
         <td class="grs0"><?=$b['des']?></td>
         <td class="grs"><?=$b['sat']?></td>
         <td class="grs"><?=$b['vol']?></td>
         <td class="grs"><?=$b['kua']?></td>
         <td class="grs"><?=$b['pkvol']?></td>
         <td class="grs"><?=$b['pkkua']?></td>
         <td class="grs"><?=$b['pkcat']?></td>
         <td class="grs"><?=$b['hpkuan']?></td>
         <td class="grs"><?=$b['hpkua']?></td>
       </tr>
       <?}?>

       <tr>
         <td class="grs" colspan="10"></td>

         <td class="grs" colspan="1"><b>TOTAL</b></td>
         <td class="grs" colspan="1"><b><?=$hasilkuan?> %</b></td>
         <td class="grs" colspan="1"><b><?=$hasilkua?> %</b></td>
       </tr>
       <tr>
         <td class="grs" colspan="10"></td>
         <td class="grs" colspan="1"><b>KATEGORI</b></td>
         <td class="grs" colspan="1"><b><?=$kategori?></b></td>
         <td class="grs" colspan="1"><b><?=$hasilnya?></b></td>
       </tr>
     </table>
     <br/>
     <table cellpadding="0" cellspacing="0" style="width:100%">
       <tr>
         <td style="width:25%">
           <table cellpadding="0" cellspacing="0">
             <tr>
               <td><b>KESIMPULAN PENILAIAN</b></td>
             </tr>
             <tr>
               <td>Diatas 120%</td>
               <td>  = </td>
               <td>&nbsp;Luar Biasa</td>
             </tr>
             <tr>
               <td>101% - 120% </td>
               <td>  = </td>
               <td>&nbsp;Baik</td>
             </tr>
             <tr>
               <td>91% - 100%</td>
               <td>  = </td>
               <td>&nbsp;Cukup</td>
             </tr>
             <tr>
               <td>Dibawah 90%</td>
               <td>  = </td>
               <td>&nbsp;Kurang</td>
             </tr>
           </table>
          </td>
          <td style="width:25%;text-align:center;">
            <?=strtoupper($atasan)?><br/><br/><br/><br/><br/><?=strtoupper($natasan)?>
          </td>
          <td style="width:25%;text-align:center;">
            <?=strtoupper($jab)?><br/><br/><br/><br/><br/><?=strtoupper($namax)?>
          </td>
        </tr>
   </table>
	</div>

</body>
</html>
