forked from andyblarblar/assignment6cis435
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathview_article.php
More file actions
43 lines (34 loc) · 874 Bytes
/
view_article.php
File metadata and controls
43 lines (34 loc) · 874 Bytes
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
<?php //TODO make this a smarty template
include('db.php');
include('function.php');
// Require id in query params
$id = $_GET["id"];
$statement = $connection->prepare(
"SELECT * FROM articles WHERE id=:id"
);
$statement->execute(array(
":id" => $id
));
// Grab article info
$article = $statement->fetchObject("ArticleDTO");
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">
<title>Article</title>
</head>
<body>
<a id="add_button" data-toggle="modal" data-target="#userModal"
class="btn btn-info btn-lg" href="edit_article.php?id=<?= $article->id ?>">
Edit This Article
</a>
<p>
<b>Author name:</b> <?= $article->author_name ?>
</p>
<div class="container">
<?= $article->article_text ?>
</div>
</body>
</html>