
<?php 
    include 'header.php'; 
    include '../fungsi_indotgl.php'; 
    
    $id  = $_GET['id'];
    $kab = $_GET['kab'];
    $kdc = $_SESSION['kdc'];
   
    $tgl_ini=date('d-m-Y') ;
    $tgl_ini2=date('Y-m-d') ;  

              // fungsi untuk membuat kode transaksi
                $sql1 = mysqli_query($koneksi, "SELECT right(angg_no,7) as kode3 FROM anggota ORDER BY angg_no DESC LIMIT 1");
                list($kode3) = mysqli_fetch_array($sql1);
              $count3 = mysqli_num_rows($sql1);

              if ($count3 <> 0) {
                  // mengambil data kode transaksi
                  $data_id3 = mysqli_fetch_assoc($sql1);
                  $kode3    = $kode3+1;
                  $no_angg  = $kode3 ;
              } else {
                  $no_angg = '1000001';
              } 
              
    $oleh=$_SESSION['id_kar'];
    $sql5 = mysqli_query($koneksi, "SELECT nama AS nama_kary FROM karyawan WHERE id='$oleh' ");
           list($nama_kary) = mysqli_fetch_array($sql5);       
?>    

<div class="container">
  <div class="my-4 border-bottom">
    <h3 class="fw-semibold fs-3">Tambah Warga/Jama'ah/Donatur Baru </h3>
  </div>
  <section class="content">
    <div class="row justify-content-center">
      <section class="col-lg-5">       
        <div class="card card-info">
          <div class="card-header d-flex justify-content-between">
            <span class="card-title fw-semibold"><font color='#ff0000'  style="text-align:left; font-size: 11pt; font-weight:normal;"><i>Halo Tn. <?php echo $nama_kary; ?>,  - Lengkapi data ini dan isi saja dengan strip (-) jika data belum diketahui....</i></font><br></span>
            <a href="@_angg_tgl_sd_tgl.php" class="btn btn-primary btn-sm"><i class="bi bi-reply-all"></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="@_angg_tambah_act.php" method="post">
              <div class="form-group mb-2">
                <div class="form-group">
                 <label>Kode Anggota</label>        
                    <input type="hidden" name="tkdc" required="required" class="form-control" value=<?php echo $kdc; ?> readonly required >
                    <input type="hidden" name="tkdk" required="required" class="form-control" value=<?php echo $id; ?> readonly required >
                    <input type="hidden" name="tkab" required="required" class="form-control" value=<?php echo $kab; ?> readonly required >
                    <input type="hidden" name="toleh" required="required" class="form-control" value=<?php echo $oleh; ?> readonly required >
                    <input type="text" name="noang" class="form-control" value=<?php echo $no_angg; ?> readonly required >
                </div>                     
                <div class="form-group">
                  <label> <font color="#000fff">Nama Anggota</font></label>
                  <input type="text" name="nama" required="required" class="form-control" placeholder="Isikan Nama ..">
                </div>
                <div class="form-group">
                  <label><font color="#000fff">Alamat <font color='#ff0000'><i>(Cukup diisi nama Kampung)</i></font color></label>
                  <input type="text" name="alamat" required="required" class="form-control" placeholder="Isikan Alamat ..">
                </div> 
            	<div class="form-group">
                    <label class="form-label">RT <font color='#ff0000'><i>(2 digit pakai NUMERIK misalnya : 01 atau 10)</i></font color></label>
                    <input type="text" minlength="2" maxlength="2" name="rt" required="required" class="form-control" placeholder="Isikan RT ..">
            	</div>                         
            	<div class="form-group">
                    <label class="form-label">RW <font color='#ff0000'><i>(2 digit pakai NUMERIK misalnya : 01 atau 10)</i></font color></label>
                    <input type="text" minlength="2" maxlength="2" name="rw" required="required" class="form-control" placeholder="Isikan RW ..">
            	</div>                                   
            	<div class="form-group">
                    <label class="form-label">Kelurahan <font color='#ff0000'><i>(isi nama Kelurahan)</i></font color></label>
                    <input type="text" name="kel" required="required" class="form-control" placeholder="Isikan Kelurahan ..">
            	</div> 
            	<div class="form-group">
                    <label class="form-label">Kecamatan <font color='#ff0000'><i>(isi nama Kecamatan)</i></font color></label>
                    <input type="text" name="kec" required="required" class="form-control" placeholder="Isikan Kecamatan ..">
            	</div> 
            	<div class="form-group">
                    <label class="form-label">Kab/Kota <font color='#ff0000'><i>(isi nama Kab/Kota)</i></font color></label>
                    <input type="text" name="kab" required="required" class="form-control" placeholder="Isikan Kab/Kota ..">
            	</div>             	
                <div class="form-group">
                  <label><font color="#000fff">Nomor HP</font></label>
                  <input type="text" name="hp" required="required" class="form-control" placeholder="Isikan nomor HP ....">
                </div>
              </div>  
              <div class="form-group mb-2">
                <input type="submit" class="btn btn-primary" value="Simpan">
              </div>
</div>               
            </form>
          </div>
        </div>
      </section>
    </div>
  </section>
</div>


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