-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathheader.php
85 lines (66 loc) · 2.14 KB
/
header.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<title>News Site</title>
<!-- Bootstrap -->
<link rel="stylesheet" href="css/bootstrap.min.css" />
<!-- Font Awesome Icon -->
<link rel="stylesheet" href="css/font-awesome.css">
<!-- Custom stlylesheet -->
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<!-- HEADER -->
<div id="header">
<!-- container -->
<div class="container">
<!-- row -->
<div class="row">
<!-- LOGO -->
<div class=" col-md-offset-4 col-md-4">
<a href="index.php" id="logo"><img src="images/news.jpg"></a>
</div>
<!-- /LOGO -->
</div>
</div>
</div>
<!-- /HEADER -->
<!-- Menu Bar -->
<div id="menu-bar">
<div class="container">
<div class="row">
<div class="col-md-12">
<?php
include "admin/config.php";
if(isset($_GET['cid'])){
$cat_id = $_GET['cid'];
}
$query = "SELECT * FROM category WHERE post > 0";
$result = mysqli_query($connection, $query) or die("Catergories query failed.");
if(mysqli_num_rows($result)){
$active = "";
?>
<ul class='menu'>
<?php
while($row = mysqli_fetch_assoc($result)){
if(isset($_GET['cid'])){
if($row['category_id'] == $cat_id){
$active = 'active';
}else{
$active = '';
}
}
echo "<li><a class='$active' href='category.php?cid={$row['category_id']}'>{$row['category_name']}</a></li>";
}
?>
</ul>
<?php } ?>
</div>
</div>
</div>
</div>
<!-- /Menu Bar -->