Sunteți pe pagina 1din 4

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71

<?php require_once('Connections/koneksidb.php'); if(!isset($_SESSION['login'])) { header("location:login.php");}?> <?php $currentPage = $_SERVER["PHP_SELF" ]; mysql_select_db ($database_koneksidb , $koneksidb ); $query_rs_index = "SELECT * FROM tampil_index" ; $rs_index = mysql_query ($query_rs_index , $koneksidb ) or die (mysql_error ()); $row_rs_index = mysql_fetch_assoc ($rs_index ); $totalRows_rs_index = mysql_num_rows ($rs_index ); 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 break ; case "long" : case "int" : $theValue = ($theValue break ; case "double" : $theValue = ($theValue break ; case "date" : $theValue = ($theValue break ; case "defined" : $theValue = ($theValue break ; } return $theValue ;

!= "" ) ? "'" . $theValue . "'" : "NULL" ;

!= "" ) ? intval ($theValue ) : "NULL" ; != "" ) ? doubleval ($theValue ) : "NULL" ; != "" ) ? "'" . $theValue . "'" : "NULL" ; != "" ) ? $theDefinedValue : $theNotDefinedValue ;

} }

$maxRows_rs_index = 20; $pageNum_rs_index = 0; if (isset ($_GET['pageNum_rs_index' ])) { $pageNum_rs_index = $_GET['pageNum_rs_index' ]; } $startRow_rs_index = $pageNum_rs_index * $maxRows_rs_index ; $colname_rs_index = "-1" ; //Cari Data mysql_select_db ($database_koneksidb , $koneksidb ); if (isset ($_POST['txt_cari' ])) { $cari_data = $_POST['txt_cari' ]; $query_rs_index = "SELECT * from tampil_index WHERE NIK LIKE '%" ata."%'" ; } else { $query_rs_index = "SELECT * from tampil_index ORDER BY NAMA_LGKP " ;

.$cari_data ."%' OR NAMA_LGKP LIKE '%" .$cari_d

} $query_limit_rs_index = sprintf ("%s LIMIT %d, %d" , $query_rs_index , $startRow_rs_index , $maxRows_rs_index ); $rs_index = mysql_query ($query_limit_rs_index , $koneksidb ) or die (mysql_error ()); $row_rs_index = mysql_fetch_assoc ($rs_index );

C:\xampp\htdocs\sisfoduk\index.php: 1/4

72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102

//==================== if (isset ($_GET['totalRows_rs_index' ])) { $totalRows_rs_index = $_GET['totalRows_rs_index' ]; } else { $all_rs_index = mysql_query ($query_rs_index ); $totalRows_rs_index = mysql_num_rows ($all_rs_index ); } $totalPages_rs_index = ceil ($totalRows_rs_index /$maxRows_rs_index )-1; $queryString_rs_index = "" ; if (!empty ($_SERVER['QUERY_STRING' ])) { $params = explode ("&" , $_SERVER['QUERY_STRING' ]); $newParams = array (); foreach ($params as $param ) { if (stristr ($param , "pageNum_rs_index" ) == false && stristr ($param , "totalRows_rs_index" ) == false ) { array_push ($newParams , $param ); } } if (count ($newParams ) != 0) { $queryString_rs_index = "&" . htmlentities (implode ("&" , $newParams )); } } $queryString_rs_index = sprintf ("&totalRows_rs_index=%d%s" , $totalRows_rs_index , $queryString_rs_index );

?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitio nal.dtd" > 103 <html xmlns= "http://www.w3.org/1999/xhtml" > 104 105 <head> 106 107 <meta http-equiv= "Content-Type" content= "text/html; charset=utf-8" /> 108 <title> Sistem Informasi Penduduk </title> 109 <link rel= "shortcut icon" href= "img/favicon.ico" > 110 <link href= "design/design_entry_data.css" rel= "stylesheet" type= "text/css" /> 111 <style type= "text/css" > 112 .page-header h1 { 113 text-align : center ; 114 font-family : "Arial Black" , Gadget, sans-serif ; 115 color : #FF0; 116 font-size : 36px ; 117 } 118 .page-header p { 119 color : #FF6; 120 text-align : center ; 121 } 122 #form1 p { 123 font-family : Verdana, Geneva, sans-serif ; 124 color : #FFF; 125 } 126 #form2 { 127 font-family : "Trebuchet MS" , Arial, Helvetica, sans-serif ; 128 text-align : center ; 129 } 130 #form2 #form2 { 131 color : #000136; 132 } 133 #form1 p { 134 text-align : center ; 135 font-size : 24px ; 136 } 137 #logout #logout { 138 font-family : Tahoma, Geneva, sans-serif ; 139 font-size : 18px ; 140 color : #F00; 141 text-align : center ; 142 }
C:\xampp\htdocs\sisfoduk\index.php: 2/4

143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211

#bawah #logout #logout a { text-align : right ; } test { text-align : center ; } </style> <body> <div id= "atas" ></div> <div id= "tengah" ></div> <div class= "page-header" > <h1> &gt;&gt;&gt; |SELAMAT DATANG |&lt;&lt;&lt; </h1> </form> <form id="form1" name="form1" method="post" action=""> <p>PENCARIAN DATA PENDUDUK </p> <form id="logout" name="logout" method="post" action=""> <span text-align:"right" id="logout"><a href="login.php">Logout</a></span> </form> </div>

<div id="tengah"> </form> <form id="form2" name="form2" method="post" action=""> <span id="form2">Masukan NIK atau NAMA</span> <label for="txt_cari"></label> <input type="text" name="txt_cari" id="txt_cari"/> <input type="submit" name="btn_cari" id="btn_cari" value="Cari" /> </form> </div> <table id="mytable" cellspacing="0"> <thead> <tr> <th align="center" scope="col" abbr="NIK">CHECK </th> <th align="center" scope="col" abbr="NIK">NIK</th> <th align="center" scope="col" abbr="NO_KK">NOMOR KK</th> <th align="center" scope="col" abbr="NAMA_LGKP">NAMA LENGKAP</th> <th align="center" scope="col" abbr="JENIS_KLMN">JENIS KELAMIN</th> <th align="center" scope="col" abbr="TMPT_LHR">TEMPAT LAHIR</th> <th align="center" scope="col" abbr="TGL_LHR">TANGGAL LAHIR</th> <th align="center" scope="col" abbr="PHOTO">PHOTO</th> <th align="center" scope="col" abbr="EDIT">EDIT</th> <th align="center" scope="col" abbr="EDIT">DETAIL</th> <th align="center" scope="col" abbr="EDIT">CETAK SKCK</th> </tr> </thead> <tbody> <?php do { ?> <tr> <td align= "center" > <input type= "checkbox" name= "item[]" id= "item[]" value= " <?php echo $row_rs_index['NIK']; ?>,<? php echo $row_rs_index['NO_KK2']; ?>" /></td> <td><?php echo $row_rs_index['NIK']; ?></td> <td><a href="lihat_kk.php?no_kk= <?php echo $row_rs_index['NO_KK2']; ?>" target="_blank"><?php echo $row_rs_index['N O_KK2']; ?></a></td> <td><?php echo $row_rs_index['NAMA_LGKP']; ?></td> <td align="center"><?php echo $row_rs_index['JENIS_KLMN']; ?></td> <td><?php echo $row_rs_index['TMPT_LHR']; ?></td> <td align="center"><?php echo $row_rs_index['TGL_LHR']; ?></td> <td><img src="<?php echo $row_rs_index['PHOTO']; ?>" width="50" /></td> <td align="center"><a href="edit_data.php?nik=<?php echo $row_rs_index['NIK'];?>" target="_blank">EDIT</a></td> <td align="center"><a href="detail.php?nik=<?php echo $row_rs_index['NIK'];?>" target="_blank">LIHAT</a></td> <td align="center"><a href="laporan.php?nik=<?php echo $row_rs_index['NIK'];?>" target="_blank"><input type="button" na me="cetak" id="cetak" value="CETAK" /></a></td> </tr>

C:\xampp\htdocs\sisfoduk\index.php: 3/4

212 <?php } while ($row_rs_index = mysql_fetch_assoc($rs_index)); ?> 213 </tbody> 214 215 </table> 216 217 <table border= "0" > 218 <tr> 219 <td> <?php if ($pageNum_rs_index > 0) { // Show if not first page ?> 220 <a href= " <?php printf("%s?pageNum_rs_index=%d%s", $currentPage, 0, $queryString_rs_index); ?>">First</a> 221 <?php } // Show if not first page ?></td> 222 <td><?php if ($pageNum_rs_index > 0) { // Show if not first page ?> 223 <a href= " <?php printf("%s?pageNum_rs_index=%d%s", $currentPage, max(0, $pageNum_rs_index - 1), $queryString_rs_i ndex); ?>">Previous</a> 224 <?php } // Show if not first page ?></td> 225 <td><?php if ($pageNum_rs_index < $totalPages_rs_index) { // Show if not last page ?> 226 <a href= " <?php printf("%s?pageNum_rs_index=%d%s", $currentPage, min($totalPages_rs_index, $pageNum_rs_index + 1 ), $queryString_rs_index); ?>">Next</a> 227 <?php } // Show if not last page ?></td> 228 <td><?php if ($pageNum_rs_index < $totalPages_rs_index) { // Show if not last page ?> 229 <a href= " <?php printf("%s?pageNum_rs_index=%d%s", $currentPage, $totalPages_rs_index, $queryString_rs_index); ?>"> Last</a> 230 <?php } // Show if not last page ?></td> 231 <td>Total Keseluruh Data :<?php echo $totalRows_rs_index ?></td> 232 </tr> 233 </table> 234 <div id="bawah"></div> 235 <div class="page-footer"> 236 <p>Sisfoduk Ver 1.0 Created by <strong><a href="http://www.facebook.com/wa1gokill" target="_blank">Wawan Sarwani</ a></strong></p> 237 </div> 238 </body> 239 </html> 240 <?php 241 mysql_free_result($rs_index); 242 ?> 243

C:\xampp\htdocs\sisfoduk\index.php: 4/4

S-ar putea să vă placă și