-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
116 lines (110 loc) · 4.85 KB
/
Copy pathindex.php
File metadata and controls
116 lines (110 loc) · 4.85 KB
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
<!DOCTYPE html>
<html>
<head>
<title>Tugas Besar</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
<link rel="stylesheet" type="text/css" href="style.css">
<?php
include_once ("connect.php");
$game = mysqli_query($mysqli, "SELECT * FROM games");
?>
</head>
<body>
<div class="p-5 bg-primary text-white text-center">
<h1>Play Your Games</h1>
<p>Play Has No Limits!</p>
</div>
<nav class="navbar navbar-expand-sm bg-dark navbar-dark">
<div class="container-fluid">
<ul class="navbar-nav">
<li class="nav-item">
<a class="btn btn-dark" href="add.php">Add Games</a>
</li>
</div>
</nav>
<div class="container bg-light rounded">
<div class="row">
<?php
while ($games = mysqli_fetch_array($game)){
$date = date_create($games['Release_Date']);
echo "<div class='col-sm-12 mt-5 rounded'>";
echo "<h2 class='align'>".$games['Title']."</h2>";
echo "<h5>Release Date, ";
echo date_format($date,'F d, Y');
echo "</h5>";
echo "<img src=".$games['img']." class='rounded mx-auto d-block image' width='1000px'>";
echo "<table class='table mt-3'>
<tr>
<td>
Genre
</td>
<td>
: ".$games['Genre']."
</td>
</tr>
<tr>
<td>
Developer
</td>
<td>
: ".$games['Developer']."
</td>
</tr>
<tr>
<td>
Publisher
</td>
<td>
: ".$games['Publisher']."
</td>
</tr>
<tr>
<td>
File Size
</td>
<td>
: ".$games['File_Size']." GB
</td>
</tr>
<tr>
<td>
Price
</td>
<td>
: Rp ".$games['Price']."
</td>
</tr>
<tr>
<td><a href='edit.php?id_games=".$games['id_games']."' class='btn btn-warning col-sm-3'>Edit</a></td>
</tr>
<tr>
<td><a href='#' class='btn btn-danger col-sm-3'
onclick='confirmation(`".$games['id_games']."`)'>Delete</a></td>
</tr>
</table>";
echo "<h6>About This Game</h6><div style='text-align: justify;'>".str_replace("\n", "",$games['Details'])."</div>";
echo "</div>";
echo "<table class='table'>
<tr>
<td><a href=".$games['Link']." class='btn btn-primary col-sm-1'>Buy</a></td>
</tr>
</table>";
}
?>
</div>
</div>
<div class="p-3 bg-dark text-white text-center">
<p class="align_text">Always Be Fun!</p>
</div>
</body>
</html>
<script type="text/javascript">
function confirmation (id_games) {
if (confirm('Apakah anda yakin akan menghapus data game ini?')){
window.location.href = 'delete.php?id_games='+id_games;
}
}
</script>