partially implemented todo tracker
This commit is contained in:
@@ -1,16 +1,16 @@
|
||||
<?php
|
||||
function admin_article_view()
|
||||
{
|
||||
$display = '
|
||||
$display = '
|
||||
<div class="view_card">
|
||||
<div class="row">
|
||||
<div class="row_space_between">
|
||||
<h3>Articles</h3>
|
||||
<a href="admin.php?view=users">View Users</a>
|
||||
</div>
|
||||
<div class="line"></div>
|
||||
<form method="post">
|
||||
<input type="hidden" name="form_id" value="articles">
|
||||
<div class="row">
|
||||
<div class="row_space_between">
|
||||
<label for="delete" class="form_checkbox_container">Delete
|
||||
<input type="radio" class="button" name="action" id="delete" value="delete">
|
||||
<span class="checkmark"></span>
|
||||
@@ -33,11 +33,11 @@ function admin_article_view()
|
||||
</thead>
|
||||
<tbody>
|
||||
';
|
||||
$conn = get_connection();
|
||||
$results = $conn->query('SELECT article_id, username, title, read_count, article.created_at, updated_at, published_at, excerpt FROM article INNER JOIN user ON article.author_id = user.user_id;');
|
||||
$conn = get_connection();
|
||||
$results = $conn->query('SELECT article_id, username, title, read_count, article.created_at, updated_at, published_at, excerpt FROM article INNER JOIN user ON article.author_id = user.user_id;');
|
||||
|
||||
foreach ($results as $key => $result) {
|
||||
$display .= '
|
||||
foreach ($results as $key => $result) {
|
||||
$display .= '
|
||||
<tr data-href="articles.php?view=read&article_id=' . $result['article_id'] . '">
|
||||
<td class="excluded_cell">
|
||||
<label class="form_checkbox_container">
|
||||
@@ -54,9 +54,9 @@ function admin_article_view()
|
||||
<td>' . $result['read_count'] . '</td>
|
||||
</tr>
|
||||
';
|
||||
}
|
||||
}
|
||||
|
||||
$display .= '
|
||||
$display .= '
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
@@ -64,5 +64,5 @@ function admin_article_view()
|
||||
</div>
|
||||
';
|
||||
|
||||
return $display;
|
||||
return $display;
|
||||
}
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
<?php
|
||||
function admin_user_view()
|
||||
{
|
||||
$display = '
|
||||
$display = '
|
||||
<div class="view_card">
|
||||
<div class="row">
|
||||
<div class="row_space_between">
|
||||
<h3>Users</h3>
|
||||
<a href="admin.php?view=articles">View Articles</a>
|
||||
</div>
|
||||
<div class="line"></div>
|
||||
<form method="post" enctype="multipart/form-data">
|
||||
<input type="hidden" name="form_id" value="users">
|
||||
<div class="row">
|
||||
<div class="row_space_between">
|
||||
<label for="delete" class="form_checkbox_container">Delete
|
||||
<input type="radio" class="button" name="action" id="delete" value="delete">
|
||||
<span class="checkmark"></span>
|
||||
@@ -36,11 +36,11 @@ function admin_user_view()
|
||||
<th>Profile Picture</th>
|
||||
</tr>
|
||||
';
|
||||
$conn = get_connection();
|
||||
$results = $conn->query('SELECT user_id, username, email, last_active, role, created_at, is_active, profile_picture FROM user INNER JOIN roles ON user.role_id = roles.role_id;');
|
||||
$conn = get_connection();
|
||||
$results = $conn->query('SELECT user_id, username, email, last_active, role, created_at, is_active, profile_picture FROM user INNER JOIN roles ON user.role_id = roles.role_id;');
|
||||
|
||||
foreach ($results as $key => $result) {
|
||||
$display .= '
|
||||
foreach ($results as $key => $result) {
|
||||
$display .= '
|
||||
<tr data-href="user.php?action=view&user_id=' . $result['user_id'] . '">
|
||||
<td class="excluded_cell">
|
||||
<label class="form_checkbox_container">
|
||||
@@ -58,14 +58,14 @@ function admin_user_view()
|
||||
<td><img src="' . $_ENV['PROFILE_IMAGES_PQ_PATH'] . $result['profile_picture'] . '" class="card_profile_picture"></td>
|
||||
</tr>
|
||||
';
|
||||
}
|
||||
}
|
||||
|
||||
$display .= '
|
||||
$display .= '
|
||||
</table>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
';
|
||||
|
||||
return $display;
|
||||
return $display;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user