<?php

/*error_reporting(E_ALL^(E_NOTICE|E_WARNING));
ini_set('display_errors',1);
error_reporting(0);*/
?>

<!-- Content Header (Page header) -->
<div class="content-header">
  <div class="container-fluid">
    <div class="row mb-1">
      <div class="col-sm-12">
        <!-- <h1 class="m-0 text-dark">Laporan Neraca []</h1> -->
      </div><!-- /.col -->
    </div><!-- /.row -->
  </div><!-- /.container-fluid -->
</div>
<!-- /.content-header -->

<!-- Main content -->
    <section class="content">
      <div class="container-fluid">
        <div class="row">
          <div class="col-12">
            <!-- Default box -->
            <div class="card">
              <div class="card-header bg-info">
                <h3 class="card-title ">Profile Nasabah</h3>
                <div class="card-tools">
                  <button type="button" class="btn btn-tool" data-card-widget="collapse" title="Collapse">
                    <i class="fas fa-minus"></i>
                  </button>
                  <button type="button" class="btn btn-tool" data-card-widget="remove" title="Remove">
                    <i class="fas fa-times"></i>
                  </button>
                </div>
              </div>

              <!-- /.card-header -->
        <div class="card-body">
          <?php
          
          
          $username=$_SESSION['username'];
          if(isset($_POST['c_register'])){
            $id = $_POST['c_register'];


            if($_POST['c_register']=='Pilih')
              $where="where a.id = '".$id."' OR a.nama = '".$id."' ";
            else
              $where="where a.id = '".$id."' OR a.nama = '".$id."'  ";

          }else{
            
            $id="";

            $where="where a.id='$id'  ";
           
          }
          ?>
          <form role="form" id="quickForm" action="home.php?home=<?php echo md5("cariprofile");?>" method="post">
            <div class="form-group row">
              <label for="nama" class="col-2 m-3">Cari Nasabah</label>
              <input type="text" name="c_register" id="c_register"  class="form-control col-sm-5" placeholder="ketik Nama/Alamat/No Register/Ayah">
              <div class="form-group row">
                <button type="submit" class="  btn btn-info"  ><i class="fas fa-search"></i></button>
               </div>
              
                     
          </form>                   
          <hr>

          <!-- <table id="example3" class="table table-bordered table-hover" width="148%"> -->
          
              <?php
              include 'koneksi.php';
              $queryb = "SELECT a.id as id,a.ibu as ibu,a.wali as pekerjaan,a.tgl as tgl, a.nik as nik,a.nama as nama,a.alamat as alamat,a.rtrw as rtrw, b.kec as kec,b.kab as kab,a.nohp as nohp from registrasi a left join alamat b ON a.desa=b.k_desa and a.kec=b.k_kec and a.kab=b.k_kab $where  ";
                $querya       =mysqli_query($koneksi,$queryb);
                if(mysqli_num_rows($querya)){
                $no=0;
                while ($data = mysqli_fetch_assoc($querya)) {
                  extract($data);
                
                  /*https://www.niagahoster.co.id/blog/undefined-index-php/
                  cara mengatasi Undefined variable  php terbaru*/
                  ?>

          <table border="0"  width="148%">
          <tr>
          <td  ><img src="./menu/uploads/<?php echo $id;?>.png" style="width:80px;height:80px"align="center" /></td>
          </tr>
          </table>
          </br> 
          <p><b>PROFILE NASABAH PT MENARA SEMBILAN</p></b>
            <table class="" width="148%">
              <!-- <table class="table table-bordered table-hover" width="148%"> -->
            <thead>
             
              <tr>
                <td width="15%" >Tanggal</th>
                  <td width="1%">:</td>
                <td><?php echo date('d-m-Y',strtotime($tgl)); ?></td>
                </tr>
                <tr>
                <td width="15%" >Register</th>
                  <td width="1%">:</td>
                  <td><?php echo $id; ?></td>
                </tr>
                <tr>
                <td width="15%">NIK</th>
                  <td width="1%">:</td>
                  <td><?php echo $nik; ?></td>
                </tr>
                <tr>
                <td width="15%">Nama</th>
                  <td width="1%">:</td>
                  <td><?php echo $nama; ?></td>
                </tr>
                <tr>
                  <td width="15%">Pekerjaan</th>
                  <td width="1%">:</td>
                  <td><?php echo $pekerjaan; ?></td>
              </tr>
                <td width="15%">Ibu</th>
                  <td width="1%">:</td>
                  <td><?php echo $ibu; ?></td>
              </tr>
                <tr>
                <td width="15%">Alamat</th>
                  <td width="1%">:</td>
                  <td><?php echo $alamat ?></td>
                </tr>
                <tr>
                <td width="5%">R/RW</th>
                  <td width="1%">:</td>
                  <td><?php echo $rtrw; ?></td>
                </tr>
                <tr>
                <td width="15%">Kec</th>
                  <td width="1%">:</td>
                  <td><?php echo $kec; ?></td>
                </tr>
                <tr>
                <td width="15%">Kab</th>
                  <td width="1%">:</td>
                  <td><?php echo $kab; ?></td>
                </tr>
                <tr>
                <td width="15%">No Hp</th>
                  <td width="1%">:</td>
                  <td><?php echo $nohp; ?></td>
              </tr>
              
            </thead>
            <tbody>
                  <tr>
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                  </tr>
                <?php }}?>
              </tbody>
              </table>

              <?php if(isset($_POST['par1'])){
               /* $_SESSION['laporan']['judul']="Laporan Buku Besar";
                $_SESSION['laporan']['unit']="BMT UGT";*/
                ?>
                <a href="laporan/lap_buku_besar_pdf.php" target="_blank" style="float: right;margin-top: 10px;" class="btn btn-success"><i class="fa fa-print"></i> Cetak PDF</a>

              <?php } ?>
            </div>
            <!-- /.card-body -->
          </div>
          <!-- /.card -->
        </div>
        <!-- /.col -->
      </div>

      <!-- /.row -->
    </section>
    <!-- /.content -->


