-
Notifications
You must be signed in to change notification settings - Fork 2
/
view.php
60 lines (52 loc) · 2.47 KB
/
view.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
<?php
$title = 'View Record';
require_once 'includes/header.php';
require_once './includes/auth_check.php';
require_once './db/conn.php';
require './includes/sanitise.php';
// Get Blog by id
if(!isset($_GET['id'])){
include './includes/errormessage.php';
} else{
$id = test_input($_GET['id']);
$result = $crud->getBlogDetails($id);
?>
<ul class="nav nav-tabs" id="myTab" role="tablist">
<li class="nav-item" role="presentation">
<button class="nav-link active" id="home-tab" data-bs-toggle="tab" data-bs-target="#home" type="button" role="tab" aria-controls="home" aria-selected="true">Blog Preview</button>
</li>
<li class="nav-item" role="presentation">
<button class="nav-link" id="profile-tab" data-bs-toggle="tab" data-bs-target="#profile" type="button" role="tab" aria-controls="profile" aria-selected="false">Comments</button>
</li>
</ul>
<div class="tab-content" id="myTabContent">
<div class="tab-pane fade show active" id="home" role="tabpanel" aria-labelledby="home-tab">
<div class="text-center container">
<div class="row row-cols-1 row-cols-md-3 g-4">
<div class="col py-2">
<div class="card h-100 shadow-lg p-3 mb-5 bg-white rounded">
<img src="<?php echo $result['imagepath'] ; ?>" class="card-img-top" alt="<?php echo $result['blogtitle']; ?>">
<div class="card-body">
<h5 class="card-title"><?php echo $result['blogtitle']; ?></h5>
<p class="card-text"><?php echo $result['name']; ?></p>
<p class="card-text"><?php echo $result['blogpreview']; ?></p>
<a href="blogpage.php?id=<?php echo $result['blog_id'] ?>" class="btn btn-primary">Continue reading</a>
</div>
</div>
</div>
</div>
<br/>
<a href="viewrecords.php" class="btn btn-info">Back to List</a>
<a href="edit.php?id=<?php echo $result['blog_id'] ?>" class="btn btn-warning">Edit</a>
<a onclick="return confirm('Are you sure you want to delete this record?')" href="delete.php?id=<?php echo $result['blog_id'] ?>" class="btn btn-danger">Delete</a>
</div></div>
<div class="tab-pane fade" id="profile" role="tabpanel" aria-labelledby="profile-tab"><div id="iframeHolder"></div>
<?php if(!isset($_GET['id'])){
include './includes/errormessage.php';
} else{
$id = test_input($_GET['id']);
$crud->modComments($id);
?>
</div>
<?php } }?>
<?php require_once 'includes/footer.php'; ?>