YGYangGaming

skStep27Pilihanphp

Feb 23rd, 2023
11
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.24 KB | None | 0 0
  1. <?php include 'header.php'; ?>
  2. <html>
  3. <!-- PANGGIL MENU -->
  4. <div id="menu">
  5. <?php include 'menu2.php'; ?>
  6. </div>
  7. <!-- PANGGIL isi -->
  8. <div id="isi">
  9. <body>
  10. <center>
  11. <h2><U>STATISTIK PILIHAN PENGGUNA</U></h2>
  12. </center>
  13. <table width="90%" border=1 align="left">
  14. <!-- PAPAR MAKLUMAT PRODUK -->
  15. <tr>
  16. <td>BIL</td>
  17. <td>NAMA PRODUK</b></td>
  18. <td>HARGA</td>
  19. <td>GAMBAR</td>
  20. <td>BILANGAN</td>
  21. </td>
  22. <?php
  23. $no=1;
  24. $data1=mysqli_query($con,"
  25. SELECT t2.namaProduk,
  26. COUNT(t1.idPengguna) AS kira,
  27. t2.harga,
  28. t2.gambar
  29. FROM pilih as t1
  30. INNER JOIN produk AS t2
  31. ON t1.idProduk=t2.idProduk
  32. GROUP BY t1.idProduk
  33. ORDER BY COUNT(t1.idPengguna) DESC");
  34. while ($info1=mysqli_fetch_array($data1))
  35. {
  36. ?>
  37. <tr>
  38. <td><?php echo $no; ?></td>
  39. <td></php echo $info1['namaProduk']; ?></td>
  40. <td>RM<?php echo $info1['harga']; ?></td>
  41. <td width="200px">
  42. <img src="gambar/<?php echo $info1['gambar']; ?>"
  43. width="auto" height="120px"></td>
  44. <td><?php echo $info1['kira']; ?></td>
  45. </tr>
  46. <?php $no++; } ?>
  47. <tr>
  48. <td colspan="5" align="center">
  49. <font style='font-size:10px'>* Senarai Tamat *<br />
  50. Jumlah Pilihan:
  51. <?php echo $no-1; ?>
  52. </font>
  53. <p><button onclick="javascript:window.print()">
  54. Cetak</button></p>
  55. </td>
  56. </tr>
  57. </table>
  58. </body>
  59. </div>
  60. </html>
Add Comment
Please, Sign In to add comment