This repository has been archived by the owner on Oct 30, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
media.php
74 lines (64 loc) · 1.82 KB
/
media.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
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
<?php
/**
* Created by PhpStorm.
* User: rdanko
* Date: 26.5.2017
* Time: 10:39
*/
include_once 'session.php';
if ($_SESSION['lang'] == 'en') {
header('location: index.php');
}
?>
<head>
<?php
include_once 'includes.php';
?>
<link href="assets/css/gallery.css" rel="stylesheet">
<script src="assets/js/media.js"></script>
</head>
<body>
<?php
include_once 'menu.php';
include_once 'DB_config.php';
?>
<div class="row row-no-margin">
<div class="container-fluid col-lg-6 col-lg-offset-3">
<table class="table table-hover col-lg-12">
<thead>
<th>
<?php echo $lang['media.media_list']; ?>
</th>
</thead>
<tbody>
<?php
$conn = new mysqli($servername, $username, $password, $db_name);
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$conn->set_charset('utf8');
$stmt = $conn->stmt_init();
if ($stmt = $conn->prepare("SELECT id,title,media,date,filename,url FROM MEDIA")){
$stmt->execute();
/* bind result variables */
$stmt->bind_result($id, $title, $media, $date, $filename, $url);
while ($stmt->fetch()) {
echo "<tr filename='" . $filename . "' url='" . $url . "'>";
echo "<td>" . $title . "</td>";
echo "<td>" . $media . "</td>";
echo "<td>" . $date . "</td>";
echo "</tr>";
}
$stmt->close();
}
else{
echo "false";
}
$conn->close();
?>
</tbody>
</table>
</div>
</div>
<?php include_once('footer.php');?>
</body>