-
Notifications
You must be signed in to change notification settings - Fork 3
/
manage_message.php
91 lines (70 loc) · 1.31 KB
/
manage_message.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
<?php
require_once("db.php");
?>
<style>
li
{
list-style: none;
float: left;
margin-right: 16px;
padding:5px;
border:solid 1px #dddddd;
color:#0063DC;
}
li:hover
{
color:#FF0084;
cursor: pointer;
}
</style>
<div class="isi">
<?php
$per_page = 15;
$db = new DB;
//$kat = $_POST['kategori'];
//Calculating no of pages
$sql = $db->display_message_all();
$count = mysqli_num_rows($sql);
$pages = ceil($count/$per_page);
?>
<script type="text/javascript">
$(document).ready(function() {
$("#pagination li:first")
.css({'color' : '#FF0084'}).css({'border' : 'none'});
Display_Load();
$("#content").load("data_message.php?page=1", Hide_Load());
function Display_Load()
{
$("#loading").fadeIn(600,0);
}
function Hide_Load()
{
$("#loading").fadeOut('slow');
};
$("#pagination li").click(function(){
Display_Load();
//CSS Styles
$("#pagination li")
.css({'border' : 'solid #dddddd 1px'})
.css({'color' : '#0063DC'});
$(this)
.css({'color' : '#FF0084'})
.css({'border' : 'none'});
//Loading Data
var pageNum = this.id;
$("#content").load("data_message.php?page=" + pageNum, Hide_Load());
});
});
</script>
<div id="loading"></div>
<div id="content"></div>
<ul id="pagination">
<?php
//Pagination Numbers
for($i=1; $i<=$pages; $i++)
{
echo '<li id="'.$i.'">'.$i.'</li>';
}
?>
</ul>
</div>