-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathadministracija.php
101 lines (95 loc) · 3.55 KB
/
administracija.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
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
<?php
include 'connect.php';
define('UPLPATH', 'slike-clanci/');
if(!isset($_SESSION["login"])){
header("Location: prijava.php");
die();
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<link rel=icon href=img/favicon.png sizes="64x64" type="image/png">
<meta http-equiv="Cache-control" content="no-cache">
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300&display=swap" rel="stylesheet">
<link href="animate.css" type="text/css" rel="stylesheet" />
<link href="administracija.css" type="text/css" rel="stylesheet" />
<title>Le Monde | Administracija</title>
</head>
<?php
include_once("header.php");
?>
<div class="header-razmak">
</div>
<article>
<div class="wrapper">
<div class="sekcije animated fadeIn">
<div class="sekcije-razmak">
<hr class="sekcije-hr">
</div>
<div class="sekcija-kategorija">
<a href="dodaj-clanak.php"><button class="animated fadeInUp gumb">Dodaj novi članak</button></a>
<br><br><br><br><br>
<div class="sekcija-kategorija-poredak animated fadeIn">
<table style="width:100%;">
<tr>
<th>Naslov</th>
<th>Sadržaj</th>
<th>Slika</th>
<th>Arhiva</th>
<th>Akcija</th>
</tr>
<?php
$query = "SELECT * FROM novosti ORDER BY id DESC";
$result = mysqli_query($dbc, $query);
while($row = mysqli_fetch_array($result)){
echo '<tr class="centar">';
echo '<td>';
echo '<b>';
echo substr($row['naslov'], 0, 60) . '...';
echo '</b>';
echo '</td>';
echo '<td>';
echo substr($row['sazetak'], 0, 60) . '...';
echo '</td>';
echo '<td>';
echo '<img src="'.UPLPATH.$row['slika'].'" width="55%" height="30%" alt="Slika ne postoji" />';
echo '</td>';
echo '<td>';
if($row['arhiva'] == 0)
{
echo '<p style="color: green">';
echo 'NE';
echo '</p>';
}
else
{
echo '<p style="color: red">';
echo 'DA';
echo '</p>';
}
echo '</td>';
echo '<center>';
echo '<td><a href="citaj-clanak.php?id='.$row['id'].'"<button class="gumb">Pregledaj</button></a> <a href="izmijeni-clanak.php?id='.$row['id'].'"<button class="gumb">Izmijeni</button></a> <a href="izbrisi-clanak.php?id='.$row['id'].'"<button class="gumb">Izbriši</button></a> </td>';
echo '</center>';
echo '</tr>';
}
?>
</table>
</div>
</div>
<div class="sekcije-razmak">
<hr class="sekcije-hr">
</div>
</div>
</div>
<footer>
<center>
<h4>Izrada:</h4>
<h4>Luka Rukavina </h4>
<p>lrukavina@tvz.hr</p>
</center>
</footer>
</body>
</html>