-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreviewarticle.php
More file actions
48 lines (48 loc) · 1.37 KB
/
reviewarticle.php
File metadata and controls
48 lines (48 loc) · 1.37 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
<?php //reviewarticle.php
require_once "conn.php";
require_once "outputfunctions.php";
require_once "header.php";
?>
<form method="post" action="transact-article.php">
<h2>Article Review</h2>
<?php
outputStory($_GET["article"]);
$sql = "SELECT ar. *, usr.name, usr.access_lvl " .
"FROM cms_articles ar INNER JOIN cms_users usr " .
"ON ar.author_id = usr.user_id " .
"WHERE article_id=" . $_GET["article"];
$result = mysql_query($sql, $conn)
or die("Couldn't retrieve article information: " . mysql_error());
$row = mysql_fetch_array($result);
if($row["date_published"] and $row["is_published"])
{
echo "<h4>Published: " .
date("l F j, Y H: i", strtotime($row["date_published"])) .
"</h4>\n";
}
echo "<p><br/>\n";
if ($row["is_published"])
{
$buttonType = "Retract";
}
else
{
$buttonType = "Publish";
}
echo "<input type=\"submit\" class=\"submit\" " .
"name=\"action\" value=\"Edit\" /> ";
if(($row["access_lvl"] > 1) or ($_SESSION["access_lvl"] > 1))
{
echo "<input type=\"submit\" class=\"submit\" " .
"name=\"action\" value=\"$buttonType\" /> ";
}
echo "<input type=\"submit\" class=\"submit\" " .
"name=\"action\" value=\"Delete\" > ";
?>
<input type="hidden" name="article" value="<?php echo $_GET["article"] ?>" />
</p>
</form>
<?php
mysql_close($conn);
require_once "footer.php";
?>