-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvijesti.php
88 lines (64 loc) · 2.32 KB
/
vijesti.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
<?php
require 'database.php';
$pdo = Database::connect();
$pdo->query("SET NAMES 'utf8'")
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="">
<meta name="author" content="">
<link rel="icon" href="../../favicon.ico">
<title>Narrow Jumbotron Template for Bootstrap</title>
<!-- Bootstrap core CSS -->
<link href="./bootstrap.min.css" rel="stylesheet">
<!-- Custom styles for this template -->
<link href="./narrow-jumbotron.css" rel="stylesheet">
</head>
<body>
<div class="container">
<div class="header clearfix">
<nav>
<ul class="nav nav-pills float-right">
<li class="nav-item">
<a class="nav-link active" href="#">Home <span class="sr-only">(current)</span></a>
</li>
<li class="nav-item">
<a class="nav-link" href="sign_in.php">Sign in</a>
</li>
<li class="nav-item">
<a class="nav-link" href="registration.php">Registration</a>
</li>
</ul>
</nav>
<h3 class="text-muted">XNEWS</h3>
</div>
<div class="jumbotron">
<h1 class="display-3">Jumbotron heading</h1>
<p class="lead">Cras justo odio, dapibus ac facilisis in, egestas eget quam. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus.</p>
<p><a class="btn btn-lg btn-success" href="#" role="button">Sign up today</a></p>
</div>
<div class="row marketing">
<?php
$sql = 'SELECT * FROM news ORDER BY id DESC LIMIT 6';
$rowCntr = 0;
echo '<div class="col-lg-6">';
foreach ($pdo->query($sql) as $row) {
echo '<h4>'. $row['title'].'</h4>';
echo '<p>'. $row['content'].'</p>';
if($rowCntr==2){
echo '</div><div class="col-lg-6">';
}
$rowCntr++;
}
echo '</div>';
?>
</div>
<footer class="footer">
<p>© Company 2017</p>
</footer>
</div> s/ie10-viewport-bug-workaround.js"></script>
</body>
</html>