MINI
C:
/
xampp
/
htdocs
/
polling_rt - Copy
/
Upload File:
files >> C:/xampp/htdocs/polling_rt - Copy/index.php
<?php require 'inc/db.php'; require 'inc/functions.php'; $candidates = []; $res = $mysqli->query("SELECT id,name,photo,vision FROM candidates ORDER BY id"); while($row = $res->fetch_assoc()) $candidates[] = $row; ?> <!doctype html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Polling Ketua RT 28</title> <link rel="stylesheet" href="assets/style.css"> </head> <body> <div class="container"> <h1>Polling Ketua RT 28</h1> <div class="grid"> <?php foreach($candidates as $c): ?> <div class="card"> <img src="<?= esc($c['photo']); ?>" alt="<?= esc($c['name']); ?>"> <h3><?= esc($c['name']); ?></h3> <p><?= nl2br(esc($c['vision'])); ?></p> <form method="post" action="vote.php"> <input type="hidden" name="candidate_id" value="<?= (int)$c['id']; ?>"> <button type="submit">PILIH</button> </form> </div> <?php endforeach; ?> </div> <p><a href="results.php">Lihat Hasil</a></p> </div> </body> </html>
Copyright ©2021 || Defacer Indonesia