-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpostlist.php
More file actions
62 lines (56 loc) · 2.1 KB
/
Copy pathpostlist.php
File metadata and controls
62 lines (56 loc) · 2.1 KB
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
<?php include "inc/header.php";?>
<?php include "inc/sidebar.php";?>
<div class="grid_10">
<div class="box round first grid">
<h2>Post List</h2>
<div class="block">
<table class="data display datatable" id="example">
<thead>
<tr>
<th width="5%">Serial No</th>
<th width="15%">Post Title</th>
<th width="20%">Body</th>
<th width="10%">Category</th>
<th width="10%">Image</th>
<th width="10%">Author</th>
<th width="10%">Tags</th>
<th width="10%">Dates</th>
<th width="10%">Action</th>
</tr>
</thead>
<tbody>
<?php
$query = "SELECT tbl_post.*, tbl_category.name FROM tbl_post INNER JOIN tbl_category
ON tbl_post.cat = tbl_category.id order by tbl_post.title desc";
$post=$db->select($query);
if ($post) {
$i=0;
while ($result = $post->fetch_assoc()) {
$i++;
?>
<tr class="odd gradeX">
<td><?php echo $i;?></td>
<td><?php echo $result['title'];?></td>
<td><?php echo $fm->readmore($result['body'],100);?></td>
<td><?php echo $result['name'];?></td>
<td><img src="upload/<?php echo $result['image'];?>" width=40px heiht=40px alt="post image" /></td>
<td><?php echo $result['author'];?></td>
<td><?php echo $result['tag'];?></td>
<td><?php echo $fm->formateDate($result['date']);?></td>
<td><a href="editpost.php?editid=<?php echo $result['id'];?>">Edit</a>
|| <a href="delpost.php?delpost=<?php echo $result['id'];?>">Delete</a></td>
</tr>
<?php } }?>
</tbody>
</table>
</div>
</div>
</div>
<script type="text/javascript">
$(document).ready(function () {
setupLeftMenu();
$('.datatable').dataTable();
setSidebarHeight();
});
</script>
<?php include "inc/footer.php";?>