SHARE
TWEET

page

a guest May 22nd, 2019 146 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <!DOCTYPE html>
  2.  
  3. <html>
  4. <head>
  5.     <title></title>
  6.     <link rel="stylesheet" type="text/css" href="style.css">
  7.    
  8. </head>
  9. <body>
  10. <center>
  11.  
  12.     <div class="judul">
  13.     <img src ='HDS_logo.png' align='left' width='150' height='150'>
  14.    
  15.         <h1>Hotel Dafam Semarang</h1>
  16.         <h2>Jl. Imam Bonjol No.188 Semarang - Jawa Tengah</h2>
  17.         <h3>Telepon: (024) 3554111</h3>
  18.     </div>
  19.     <br/>
  20.  
  21.     <?php
  22.     if(isset($_GET['pesan'])){
  23.         $pesan = $_GET['pesan'];
  24.         if($pesan == "input"){
  25.             echo "Data berhasil di input.";
  26.         }else if($pesan == "update"){
  27.             echo "Data berhasil di update.";
  28.         }else if($pesan == "hapus"){
  29.             echo "Data berhasil di hapus.";
  30.         }
  31.     }
  32.     ?>
  33.     <br/>
  34.     <a class="tombol" href="input.php">+ Tambah Data Baru</a>
  35.     <a href="logout.php">Home</a>
  36.  
  37.     <h3>Data Penilaian</h3>
  38.    
  39.     <table border="1" class="table">
  40.         <tr>
  41.             <th>No</th>
  42.             <th>Alternatif</th>
  43.             <th>Kriteria</th>
  44.             <th>Nilai</th>
  45.            
  46.             <th>Opsi</th>      
  47.         </tr>
  48.        
  49.  
  50.  
  51.  
  52.         <?php
  53.         include "koneksi.php";
  54.         $no = 1;
  55.         $query = "SELECT * FROM tbl_nilai
  56.                 INNER JOIN tbl_alternatif ON tbl_nilai.id = tbl_alternatif.id
  57.                 INNER JOIN tbl_kriteria ON tbl_nilai.id_kriteria = tbl_kriteria.id_kriteria
  58.                 ";
  59.                
  60.         $sql_rm = mysql_query($query) or die (mysql_error());
  61.         while ($data = mysql_fetch_array($sql_rm)) { ?>
  62.                
  63.         <tr>
  64.             <td><?php echo $no++; ?>.</td>
  65.             <td><?php echo $data['alternatif']; ?></td>
  66.             <td><?php echo $data['kriteria']; ?></td>
  67.             <td><?php echo $data['nilai']; ?></td>
  68.            
  69.            
  70.             <td>
  71.                 <a href="edit.php?id_nilai=<?php echo $data['id_nilai']; ?>">Edit</a>
  72.                 <a href="hapus.php?id_nilai=<?php echo $data['id_nilai']; ?>">Hapus</a>                
  73.             </td>
  74.         </tr>
  75.         <?php } ?>
  76.     </table>
  77.  
  78.         </div>
  79.     <?php
  80. $host = 'localhost';
  81. $user = 'root';
  82. $pass = '';
  83. $db = 'db_moora';
  84.  
  85. $link = mysql_connect($host,  $user, $pass, $db) or die(mysql_error($link));
  86.  
  87. $perpage = 5;
  88. $page   = isset($_GET["halaman"]) ? (int)$_GET["halaman"] : 1;
  89. $start = ($page > 1) ? ($page * $perpage) - $perpage : 0;
  90.  
  91. $articles = "SELECT * From `tbl_nilai` LIMIT $start, $perpage";
  92. $result2 = mysql_query($articles, $link);
  93.  
  94. $result = mysql_query("SELECT * FROM `tbl_nilai`", $link);
  95. $num_rows = mysql_num_rows($result);
  96.  
  97. $pages = ceil($num_rows/$perpage);
  98. ?>
  99.  
  100. <div class="">
  101. <?php for($i=1; $i<=$pages; $i++) { ?>
  102. <a href="?halaman=<? echo $i?>"><? echo $i?></a>
  103. <?php } ?>
  104. </div>
  105.    
  106.     <br>
  107.     <a class="tombol" href="proses/index.php">Hitung</a>
  108.  
  109. </center>
  110. </body>
  111. </html>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top