<?
$idk = $_GET['id'];
?>
<link rel="stylesheet" href="../plg/w3.css">
<div style="overflow-x:scroll">
<table class="w3-table gr w3-animate-zoom w3-card-4 w3-white" style="width:">
  <tr>
    <th colspan="8" class="w3-border w3-small w3-center w3-light-gray">LIST UPLOAD DOCUMENT</th>
  </tr>
  <tr class="">
    <th class="w3-border w3-small w3-center w3-light-gray" style="width:50px">NO</th>
    <th class="w3-border w3-small w3-center w3-light-gray" style="width:800px">KETERANGAN DOCUMENT</th>
    <th class="w3-border w3-small w3-center w3-light-gray" style="width:300px">ACTION</th>
  </tr>
<?
$i = 1;
include"../plg/kon.php";
$sqle = "select * from doc where del=0 and idkpi='$idk'";
$rese = $conn->query($sqle);
while($a = $rese->fetch_assoc()){
?>
  <tr>
    <td class="w3-border w3-small  w3-center">
      <?=$i++?>
    </td>
    <td class="w3-border w3-small" style="text-align:left;padding-left:10px;">
      <b><?=$a['ketdoc']?>
    </td>
    <td class="w3-border w3-center">
      <div class="w3-btn w3-blue-gray w3-small w3-card-2 w3-round-large" onclick="bukadoc('<?=$a['docfile']?>')">OPEN</div>
      &nbsp;
      <div class="w3-btn w3-red w3-small w3-card-2 w3-round-large" onclick="deldoc('<?=$a['id']?>','<?=$a['idkpi']?>')">DELETED</div>
    </td>
  </tr>
<?
}
?>
</table>
</div>

<script>
function bukadoc(x){
  window.open(x,"_blank");
}
function deldoc(x,k){
  var r = confirm("APAKAH DOCUMENT AKAN DI HAPUS ?...");
  if(r == true){
    location.href="deldoc.php?id="+x+"&idk="+k;
  }
}
</script>
