-
Notifications
You must be signed in to change notification settings - Fork 0
/
notices.php
158 lines (132 loc) · 5.18 KB
/
notices.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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
<?php
session_start();
require_once('includes/dbh.inc.php');
$query ="Select * from notices where notices_status=1";
$result =@mysqli_query($conn,$query);
$query ="Select notices_date from notices where notices_status=1";
$result1 =@mysqli_query($conn,$query);
?>
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Notices | IAS</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="css/header.css">
<link rel="stylesheet" type="text/css" href="css/footer.css">
<link rel="stylesheet" type="text/css" href="css/notices.css">
<link rel="stylesheet" type="text/css" href="vendor/css/monthly.css">
<link href="https://fonts.googleapis.com/css?family=Roboto:300,300i,400,400i,500,500i,700,700i" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="icon" type="image/jpg" href="images/logo.jpg" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
</head>
<body>
<?php
include('header.php');
?>
<div class="container-fluid notices-banner">
<h2>NOTICES</h2>
<p>"Education for a better future"</p>
</div>
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="index.html">Home</a></li>
<li class="breadcrumb-item active">Notices</li>
</ol>
<div class="container">
<div class="row" style="margin-bottom: 30px;">
<div class="col-md-9 content">
<div class="col-md-12">
<h3 class="heading">Notice Board</h3>
<?php
// connect to database
require_once('includes/dbh.inc.php');
// define how many results you want per page
$results_per_page = 10;
// find out the number of results stored in database
$sql='SELECT * FROM notices where notices_status=1';
$result = mysqli_query($conn, $sql);
$number_of_results = mysqli_num_rows($result);
// determine number of total pages available
$number_of_pages = ceil($number_of_results/$results_per_page);
// determine which page number visitor is currently on
if (!isset($_GET['page'])) {
$page = 1;
} else {
$page = $_GET['page'];
}
// determine the sql LIMIT starting number for the results on the displaying page
$this_page_first_result = ($page-1)*$results_per_page;
// retrieve selected results from database and display them on page
$sql='SELECT * FROM notices where notices_status=1 order by notices_date desc LIMIT ' . $this_page_first_result . ',' . $results_per_page;
$result = mysqli_query($conn, $sql);
while($row = mysqli_fetch_array($result)) {
$phpdate = strtotime($row['notices_date']);
$date = date( 'd M, Y', $phpdate );
echo'
<div class=notice_data>
<a href="'.$row['notices_location'].'" target="_blank"><span>'.$date.'</span> | ' . $row['notices_content']. '</a>
</div> <br>
';
}
// display the links to the pages
$prev=$page-1;
$next=$page+1;
echo '<ul class="pagination">';
if($prev >=1){
echo '
<li><a href="notices.php?page=' . $prev . '">«</a><li>
';
}
for ($p=1;$p<=$number_of_pages;$p++) {
$selected = $p == $page ? 'class="selected"' : '';
echo '
<li><a '.$selected.' href="notices.php?page=' . $p . '">' . $p . '</a><li>
';
}
if($next <= $number_of_pages && $number_of_pages >= 2){
echo '
<li><a href="notices.php?page=' . $next . '">»</a><li>
';
}
echo '</ul>';
?>
</div>
</div>
<div class="col-md-3 ">
<div class="col-md-12">
<div class="sidebar">
<h4>Robotics with Arduino and PID Control Technology</h4>
<img src="images/poster_ar.jpg" height="110" width="195" style="margin:20px 0px; display:block;"></img>
<p>This course contains:<p>
<ul>
<li>Introduction to ARDUINO</li>
<li>Interfacing of ARDUINO</li>
<li>Project work with ARDUINO</li>
<li>Advanced ARDUINO model with PID controller</li>
</ul>
<p>This is a certified course. Students will get certificate from IAS.
For more details please visit your nearest branch of IAS.</p>
<a href="registration.php" style="color:#000; display:block; text-align:center; font-size:17px;"><b>Enroll Now!</b></a>
</div>
</div>
</div>
</div>
</div>
<?php
include('footer.php');
?>
<script src="js/jquery-3.2.1.min.js"></script>
<script src="js/bootstrap.js"></script>
<script>
$('ul.nav li.dropdown').hover(function() {
$(this).find('.dropdown-menu').stop(true, true).delay(100).fadeIn(500);
$('.bg').removeClass('bg');
$(this).addClass('bg');
}, function() {
$(this).find('.dropdown-menu').stop(true, true).delay(100).fadeOut(100);
$('.bg').removeClass('bg');
});
</script>
</body>
</html>