-
Notifications
You must be signed in to change notification settings - Fork 0
/
guru_pilih_soalan.php
43 lines (42 loc) · 1.79 KB
/
guru_pilih_soalan.php
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
<?php
include('sambungan.php');
$jenispilihan = $_GET['pilihan'];
?>
<html>
<link rel="stylesheet" href="senarai.css">
<link rel="stylesheet" href="button.css">
<body>
<form action="jawab_semak.php" method="post">
<table>
<caption>SOALAN KUIZ YANG DICIPTA</caption>
<tr>
<th>Bil</th>
<th>Soalan</th>
</tr>
<?php
$sql = "select * from soalan order by idsoalan ASC";
$data = mysqli_query($sambungan, $sql);
$bil = 1;
while ($soalan = mysqli_fetch_array($data)) {
?>
<tr>
<td class="bil"><?php echo $bil; ?></td>
<td class="soalan">
<?php echo $soalan['namasoalan']; ?><br>
<label><?php echo "A. ".$soalan['pilihana']; ?></label><br>
<label><?php echo "B. ".$soalan['pilihanb']; ?></label><br>
<label><?php echo "C. ".$soalan['pilihanc']; ?></label><br>
<?php
if($jenispilihan == 'update'){
?>
<a href="soalan_update2.php?idsoalan=<?php echo $soalan['idsoalan'] ?>&soalan=<?php echo str_replace("+","%2b",$soalan['namasoalan']); ?>&pilihana=<?php echo $soalan['pilihana'] ?>&pilihanb=<?php echo $soalan['pilihanb'] ?>&pilihanc=<?php echo $soalan['pilihanc'] ?>&jawapan=<?php echo $soalan['jawapan'] ?>&idguru=<?php echo $soalan['idguru'] ?>" target="kandungan">Pilih Soalan</a>
<?php }elseif($jenispilihan == 'delete'){ ?>
<a href="soalan_delete.php?idsoalan=<?php echo $soalan['idsoalan'] ?>" onclick="return confirm('Adakah anda pasti ingin memadam soalan ini?')">Padam</a>
<?php } ?>
</td>
</tr>
<?php $bil = $bil + 1; } ?>
</table>
<button class="semak" type="submit">Semak</button>
</form>
</body>