<?php 
    include 'header.php'; 
    $kdc=$_SESSION['kdc'];
    $kel=$_SESSION['kelurahan'];
    
    $kdkanca = mysqli_query($koneksi,"select * from kdkanca where kd='$kdc'");
    $k = mysqli_fetch_assoc($kdkanca);
?>

<div class="container">

 <div class="my-4 border-bottom">
   <h2 class="fw-semibold fs-3"></h2>
 </div>

  <div class="row justify-content-center">
    <div class="col-lg-12">
       <?php 
        if(isset($_GET['alert'])){
          if($_GET['alert'] == "berhasil"){
            ?>
            <div class="alert alert-success">
              Baground, telah diupdate!
            </div>
            <?php
          }
        }
        ?>
       <div class="card">
    <div class="card-header d-flex justify-content-between">
      <span class="card-title fw-semibold align-self-start mb">Baground Aplikasi & Kop Laporan (<font color='#ff0000'>untuk mengganti silahkan klik pada gambar yg tertera)</font></span>
    </div>
    <div class="card-body">
      <div class="table-responsive">
        <table class="table table-bordered table-striped" id="table-datatable">
          <thead>
            <tr>
              <th width="1%" class="text-center">Kd</th>    
              <th width="20%" class="text-center">Koperasi</th>
              <th width="30%" class="text-center" style="text-align:left; font-size: 12pt; font-weight:normal;">KOPSURAT</th>
              <th width="30%" class="text-center" style="text-align:left; font-size: 12pt; font-weight:normal;">Baground</th>
            </tr>
          </thead>
          <tbody>
            <?php 
            $no=1;
            $data = mysqli_query($koneksi,"SELECT * FROM kdkanca where kd='$kdc' ORDER BY id ASC");
            while($d = mysqli_fetch_array($data)){
                         
              ?>
              <tr>
                <td><?php echo $d['kd']; ?></td>
                <td><?php echo $d['kanca']; ?></td>
                    <td>
                      <center>
                        <?php if($d['gambar'] == ""){ ?>
                          <img src="../gambar/user.png" style="width: 40px;height: auto">  
                        <?php }else{ ?>
                            <a href="00_foto_kop.php?id=<?php echo $d['gambar'] ?>&kd=<?php echo $d['kd'] ?>" data-placement='top' title='Ganti Gambar KOP SURAT <?php echo $d['kd'] ?>' >								    
                               <img width="80" height="80" 
                            src="../gambar/<?php echo $d['gambar'] ?>" style="width: 300px;height: auto">
                            </a>             
                        <?php } ?>
                      </center>
                    </td>              
                    <td>
                      <center>
                        <?php if($d['foto_bag'] == ""){ ?>
                          <img src="../gambar/user.png" style="width: 40px;height: auto">  
                        <?php }else{ ?>
                            <a href="00_foto_baground.php?id=<?php echo $d['foto_bag'] ?>&kd=<?php echo $d['kd'] ?>" data-placement='top' title='Ganti Gambar BAGROUND <?php echo $d['kd'] ?>' >								    
                               <img width="80" height="80" 
                            src="../gambar/<?php echo $d['foto_bag'] ?>" style="width: 300px;height: auto">
                            </a>             
                        <?php } ?>
                      </center>
                    </td>                    
              </tr>
              <?php 
            }
            ?>
          </tbody>
        </table>
      </div>
    </div>
    
  </div>
    </div>
  </div>
</div>
<?php include 'footer.php'; ?>