forked from Ethredah/PHP-Blog-Admin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
blog.php
135 lines (113 loc) · 4.25 KB
/
blog.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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
<!--
author: Ethredah
author URL: http://ethredah.github.io
-->
<?php
require_once "Company_admin/functions/db.php";
$sql = 'SELECT * FROM posts';
$query = mysqli_query($connection, $sql);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="icon" href="images/icon.png">
<title>Company</title>
<!-- custom-theme -->
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="Coalition Responsive web template, Bootstrap Web Templates, Flat Web Templates, Android Compatible web template,
Smartphone Compatible web template, free webdesigns for Nokia, Samsung, LG, SonyEricsson, Motorola web design" />
<script type="application/x-javascript"> addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false);
function hideURLbar(){ window.scrollTo(0,1); } </script>
<!-- //custom-theme -->
<link href="css/bootstrap.css" rel="stylesheet" type="text/css" media="all" />
<link href="css/style.css" rel="stylesheet" type="text/css" media="all" />
<!-- js -->
<script type="text/javascript" src="js/jquery-2.1.4.min.js"></script>
<!-- //js -->
<!-- font-awesome-icons -->
<link href="css/font-awesome.css" rel="stylesheet">
<!-- //font-awesome-icons -->
<link href="//fonts.googleapis.com/css?family=Montserrat" rel="stylesheet">
<link href='//fonts.googleapis.com/css?family=Open+Sans:400,300,300italic,400italic,600,600italic,700,700italic,800,800italic' rel='stylesheet' type='text/css'>
</head>
<body>
<!-- banner -->
<div class="banner1">
<div class="container">
<div class="w3_agile_banner_top">
<div class="agile_phone_mail">
<ul>
<li><i class="fa fa-phone" aria-hidden="true"></i>+(254) 002 100 500</li>
<li><i class="fa fa-envelope" aria-hidden="true"></i><a href="mailto:[email protected]">[email protected]</a></li>
</ul>
</div>
</div>
<div class="agileits_w3layouts_banner_nav">
<nav class="navbar navbar-default">
<div class="navbar-header navbar-left">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<h1><a class="navbar-brand" href="index.php"><img src="images/logo.png" class="img-responsive"></a></h1>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse navbar-right" id="bs-example-navbar-collapse-1">
<nav class="cl-effect-13" id="cl-effect-13">
<ul class="nav navbar-nav">
<li><a href="index.php">Home</a></li>
<li><a href="about.php">About</a></li>
<li><a href="portfolio.php">Products</a></li>
<li class="active"><a href="blog.php">Blog</a></li>
<li><a href="contact.php">Contact</a></li>
</ul>
</nav>
</div>
</nav>
</div>
</div>
</div>
<!-- //banner -->
<!-- gallery -->
<div class="gallery">
<div class="container">
<h2 class="w3l_head w3l_head1">Blog</h2>
<div class="wthree_gallery_grids">
<div class="row">
<?php
if (mysqli_num_rows($query)==0) {
echo "<b style='color:brown;'>Sorry there are no posts Yet :( We will be uploading new content soon! </b> ";
}
else
{
while ($row=mysqli_fetch_array($query)) {
echo
'<div class="col-md-4">
<a href="single.php?id='.$row["id"].'"><h4>'.$row["title"].'</h4></a>
<br>
<p>
'.substr($row["content"], 0, 200).'...
</p>
<br>
<h6 style="color: orange;">'.$row["author"].' <b style="color: #000;">|</b> '.$row["date"].'</h6>
<hr>
</div>';
}
}
?>
</div>
<div class="row">
<!-- <h5>Comments</h5> -->
</div>
</div>
<script src="js/jzBox.js"></script>
</div>
</div>
<!-- //gallery -->
<!-- footer -->
<?php
include("footer.php");
?>