<?php 
include 'header.php';
    $id = $_GET['id'];
    $kdc=$_SESSION['kdc'];
    $kel=$_SESSION['kelurahan'];
    $nama_singkat   = $_SESSION['n_singkat'];
    $gambar         = $_SESSION['logo_kop'];
    echo $gambar;
?>

<div class="container">

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

  <section class="content">
    <div class="row justify-content-center">
      <section class="col-lg-7">       
        <div class="card card-info">
          <div class="card-header justify-content-between d-flex">
            <span class="card-title fw-semibold">Ganti Foto Kop Laporan Masjid <?php echo $nama_singkat ?></span>
            <a href="javascript:history.go(-1)" class="btn btn-primary btn-sm pull-right"><i class="bi bi-reply"></i> &nbsp; Kembali</a> 
          </div>
          <div class="card-body">
<div style="background-color: <?php echo$_SESSION['warna_bag']; ?>; padding: 15px; border-radius: 15px; box-shadow: 0 0 15px <?php echo$_SESSION['warna_bag']; ?>;">              
            <form action="00_foto_kop_act.php" method="post" enctype="multipart/form-data">
              <?php 
              $id = $_GET['id'];              
              $data = mysqli_query($koneksi, "select * from kdkanca where kd='$kdc'");
              while($d = mysqli_fetch_array($data)){
                  
                ?>
              <div class="form-group mb-2">
                <div class="form-group mb-2">
                  <input type="hidden" class="form-control" name="id" value="<?php echo $d['id'] ?>" readonly="readonly">
                </div>
                <div class="form-group mb-2">
                    
                    <center>
                    <?php if($d['gambar'] == ""){ ?>
                      <img src="../gambar/user.png" style="width: 50px;height: auto">
                      <font color='#ff0000'  style="text-align:left; font-size: 8pt; font-weight:normal;"><i>Belum ada foto....</i></font><br>
                    <?php }else{ ?>
                      <img src="../gambar/<?php echo $d['gambar'] ?>" style="width: 650px;height: auto">
                    <?php } ?>
                    </center>
                    <input type="hidden" class="form-control" name="foto_gambar_lama" value="<?php echo $d['gambar'] ?>" readonly required="required">
                    <input type="hidden" class="form-control" name="tkdc" value="<?php echo $kdc ?>" readonly required="required">
                </div>
                <div class="form-group mb-2">
                  <label class="form-label">Foto</label>
                  <input type="file" name="foto" class="form-control">
                  <p>Kosong Jika tidak ingin di ganti</p>
                </div>
              
                <div class="form-group mb-2">
                  <input type="submit" class="btn btn-primary" value="Simpan">
                  <font color='#ff0000'  style="text-align:left; font-size: 10pt; font-weight:normal;"><i>Jika ukuran foto terlalu besar, bisa jadi TIDAK BISA disimpan....</i></font><br>
                  <font color='#f000ff'  style="text-align:left; font-size: 12pt; font-weight:normal;"><i>Disarankan gambar jenis PNG, ukuran 25-Kb dimensi 425 X 75 ....</i></font><br>
                </div>
                <?php
              }

              ?>
              
            </form>
          </div>
                <a href="lap_akunt_all_print.php" target="blank" class="btn btn-warning btn-sm pull-right"><i class="bi bi-printer"></i> &nbsp; Lihat Contoh Tampilan Foto Kopsurat dalam Laporan</a> 
        </div>
      </section>
    </div>
  </section>

</div>
<?php include 'footer.php'; ?>