| <?php require_once('Connections/db28ilir.php'); ?> <?php if (!function_exists("GetSQLValueString")) { function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") { if (PHP_VERSION < 6) { $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue; }
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) { case "text": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "long": case "int": $theValue = ($theValue != "") ? intval($theValue) : "NULL"; break; case "double": $theValue = ($theValue != "") ? doubleval($theValue) : "NULL"; break; case "date": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "defined": $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue; break; } return $theValue; } }
$colname_t_pndk = "-1"; if (isset($_GET['cari'])) { $colname_t_pndk = $_GET['cari']; } mysql_select_db($database_db28ilir, $db28ilir); $query_t_pndk = sprintf("SELECT * FROM penduduk WHERE NIK LIKE %s ORDER BY NIK ASC", GetSQLValueString("%" . $colname_t_pndk . "%", "text")); $t_pndk = mysql_query($query_t_pndk, $db28ilir) or die(mysql_error()); $row_t_pndk = mysql_fetch_assoc($t_pndk); $totalRows_t_pndk = mysql_num_rows($t_pndk);
mysql_free_result($t_pndk); ?> <style type="text/css"> input#caridata { border: 2px solid #9CC; border-radius: 7px; -moz-border-radius: 7px; -webkit-border-radius: 7px; color: #00F; background: #09F; opacity: .8; } </style>
<table width="177" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td><div align="center"><font size="1" face="Arial Black" color="#006699"><b><u>CARI DATA PENDUDUK</u></b></font></div></td> </tr> <tr> <td width="117" align="center" valign="middle"><form action="caridatapenduduk.php" method="get" name="form1" id="form1"> <label for="cari"></label> <input name="cari" type="text" id="cari" size="17" /> <input type="submit" name="caridata" id="caridata" value="Cari" /> </form></td> </tr> </table> <p> </p> <table border="1"> <tr> <td>NIK</td> <td>No_KK</td> <td>Nama_Lengkap</td> <td>Tempat_Lahir</td> <td>Tanggal_Lahir</td> <td>Jenis_Kelamin</td> <td>Agama</td> <td>Pendidikan_Terakhir</td> <td>Pekerjaan</td> <td>Status_Pernikahan</td> <td>Alamat</td> <td>Kelurahan</td> <td>Kecamatan</td> <td>Kode_Pos</td> <td>Kota</td> <td>Provinsi</td> <td>Kewarganegaraan</td> </tr> <?php do { ?> <tr> <td><?php echo $row_t_pndk['NIK']; ?></td> <td><?php echo $row_t_pndk['No_KK']; ?></td> <td><?php echo $row_t_pndk['Nama_Lengkap']; ?></td> <td><?php echo $row_t_pndk['Tempat_Lahir']; ?></td> <td><?php echo $row_t_pndk['Tanggal_Lahir']; ?></td> <td><?php echo $row_t_pndk['Jenis_Kelamin']; ?></td> <td><?php echo $row_t_pndk['Agama']; ?></td> <td><?php echo $row_t_pndk['Pendidikan_Terakhir']; ?></td> <td><?php echo $row_t_pndk['Pekerjaan']; ?></td> <td><?php echo $row_t_pndk['Status_Pernikahan']; ?></td> <td><?php echo $row_t_pndk['Alamat']; ?></td> <td><?php echo $row_t_pndk['Kelurahan']; ?></td> <td><?php echo $row_t_pndk['Kecamatan']; ?></td> <td><?php echo $row_t_pndk['Kode_Pos']; ?></td> <td><?php echo $row_t_pndk['Kota']; ?></td> <td><?php echo $row_t_pndk['Provinsi']; ?></td> <td><?php echo $row_t_pndk['Kewarganegaraan']; ?></td> </tr> <?php } while ($row_t_pndk = mysql_fetch_assoc($t_pndk)); ?> </table> |
Tidak ada komentar:
Posting Komentar