-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpending.php
More file actions
42 lines (42 loc) · 1.02 KB
/
pending.php
File metadata and controls
42 lines (42 loc) · 1.02 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
<?php //pending.php
require_once "conn.php";
require_once "header.php";
$a_artTypes = array (
"Pending" => "submitted",
"Published" => "published"
);
echo "<h2>Article Availability</h2>\n";
$i = -1;
foreach($a_artTypes as $k => $v)
{
$i++;
echo "<h3>" . $k . " Articles</h3>\n";
echo "<p>\n";
echo "<div class=\"scroller\">\n";
$sql = "SELECT article_id, title, date_" . $v .
" FROM cms_articles " .
"WHERE is_published=" . $i .
" ORDER BY title";
$result = mysql_query($sql,$conn)
or die("Couldn't get list of pending articles: " . mysql_error());
if(mysql_num_rows($result) == 0)
{
echo " <em> No " . $k . " articles available.</em>";
}
else
{
while($row = mysql_fetch_array($result))
{
echo " <a href='reviewarticle.php?article=" .
$row["article_id"] . "'>" .
htmlspecialchars($row["title"]) .
"</a> ($v " . date("F j, Y", strtotime($row["date_".$v])) .
")<br/>\n";
}
}
echo " </div>\n";
echo " </p>\n";
}
mysql_close($conn);
require_once "footer.php";
?>