<?php
session_start();
if (empty($_SESSION['namauser']) AND empty($_SESSION['passuser'])){
  echo "<link href='css/style.css' rel='stylesheet' type='text/css'>
 <center>Untuk mengakses modul, Anda harus login <br>";
  echo "<a href=index.php><b>LOGIN</b></a></center>";
}
else{
?>

<!DOCTYPE html>
<html>
    <head>
     
        <link rel="stylesheet" href="css2/style.css" type="text/css" />
        <style type="text/css">
            @import "media/css/demo_table_jui.css";
            @import "media/themes/sunny/jquery-ui.css";
        </style>      

        <script src="media/js/jquery.js"></script>
        <script src="media/js/jquery.dataTables.js"></script>
        <script type="text/javascript" charset="utf-8">
          $(document).ready(function(){
            $('#datatables').dataTable({
					     "oLanguage": {
						      "sLengthMenu": "Tampilkan _MENU_ data per halaman",
						      "sSearch": "Pencarian : ", 
						      "sZeroRecords": "Maaf, tidak ada data yang ditemukan",
						      "sInfo": "Menampilkan _START_ s/d _END_ dari _TOTAL_ data",
						      "sInfoEmpty": "Menampilkan 0 s/d 0 dari 0 data",
						      "sInfoFiltered": "(di filter dari _MAX_ total data)",
						      "oPaginate": {
						          "sFirst": "<<",
						          "sLast": ">>", 
						          "sPrevious": "<", 
						          "sNext": ">"
					       }
				      },
              "sPaginationType":"full_numbers",
              "bJQueryUI":true
            });
          })    
        </script>
    </head>
    <body>

			
		
			<table id="datatables" class="display">
                <thead>
                    <tr>
                        
                        <th>NRG</th>
                        <th>Nama PTK</th>
						<th>NUPTK</th>
						<th>Kelamin</th>
						<th>Bidang Studi</th>
						<th>Tahun</th>
						
						
						<th>aksi</th>
						
                    </tr>
                </thead>

                <tbody>
                    <?php
                    mysql_connect("localhost","root","ayosekolah");
                    mysql_select_db("nrg");
					          $sql = mysql_query("SELECT * FROM pelanggan ORDER BY nm_pelanggan");
					          $no = 1;
                    while ($r = mysql_fetch_array($sql)) {
                      echo "<tr>
                            
                            <td>$r[no_polisi]</td>
                            <td>$r[nm_pelanggan]</td>
							<td>$r[alamat]</td>
							<td>$r[kota]</td>
							<td>$r[telp]</td>
							<td>$r[tipe_kendaraan]</td>
							

								<td class='center'><a href='?module=pelanggan&act=editpelanggan&id=$r[no_polisi]'><img src='images/btn_edit.png' width='20' height='20' /></a></td>


					

                            </tr>";
                      $no++;
                    }                    
                    ?>
                </tbody>

            </table>
						
    </body>
</html>

<?php
}
?>
