sync
This commit is contained in:
+4
-1
@@ -35,13 +35,16 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($_SERVER['SCRIPT_NAME'] == '/admin.php') {
|
if ($_SERVER['SCRIPT_NAME'] == '/admin.php') {
|
||||||
|
echo '
|
||||||
|
<script src="js/clickable_rows.js"></script>
|
||||||
|
';
|
||||||
$args = get_args_from_url();
|
$args = get_args_from_url();
|
||||||
|
|
||||||
if (isset($args['view'])) {
|
if (isset($args['view'])) {
|
||||||
if ($args['view'] == 'users') {
|
if ($args['view'] == 'users') {
|
||||||
echo '
|
echo '
|
||||||
<script src="js/upload.js"></script>
|
<script src="js/upload.js"></script>
|
||||||
';
|
';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ function admin_article_view()
|
|||||||
<table>
|
<table>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Select</th>
|
<th class="">Select</th>
|
||||||
<th>Article ID</th>
|
<th>Article ID</th>
|
||||||
<th>Author</th>
|
<th>Author</th>
|
||||||
<th>Title</th>
|
<th>Title</th>
|
||||||
@@ -67,8 +67,8 @@ function admin_article_view()
|
|||||||
|
|
||||||
foreach ($results as $key => $result) {
|
foreach ($results as $key => $result) {
|
||||||
$display .= '
|
$display .= '
|
||||||
<tr>
|
<tr data-href="articles.php?action=view&article_id=' . $result['article_id'] . '">
|
||||||
<td>
|
<td class="excluded_cell">
|
||||||
<label class="form_checkbox_container">
|
<label class="form_checkbox_container">
|
||||||
<input name="selected_articles[]" value="' . $result['article_id'] . '" type="checkbox">
|
<input name="selected_articles[]" value="' . $result['article_id'] . '" type="checkbox">
|
||||||
<span class="checkmark"></span>
|
<span class="checkmark"></span>
|
||||||
@@ -139,8 +139,8 @@ function admin_user_view()
|
|||||||
|
|
||||||
foreach ($results as $key => $result) {
|
foreach ($results as $key => $result) {
|
||||||
$display .= '
|
$display .= '
|
||||||
<tr>
|
<tr data-href="user.php?action=view&user_id=' . $result['user_id'] . '">
|
||||||
<td>
|
<td class="excluded_cell">
|
||||||
<label class="form_checkbox_container">
|
<label class="form_checkbox_container">
|
||||||
<input name="selected_users[]" value="' . $result['user_id'] . '" type="checkbox">
|
<input name="selected_users[]" value="' . $result['user_id'] . '" type="checkbox">
|
||||||
<span class="checkmark"></span>
|
<span class="checkmark"></span>
|
||||||
|
|||||||
@@ -0,0 +1,15 @@
|
|||||||
|
document.addEventListener('DOMContentLoaded', function() {
|
||||||
|
const rows = document.querySelectorAll('tbody tr');
|
||||||
|
|
||||||
|
rows.forEach(row => {
|
||||||
|
row.addEventListener('click', function(event) {
|
||||||
|
// Check if the clicked element is within the non-clickable cell
|
||||||
|
if (event.target.closest('.excluded_cell')) {
|
||||||
|
return; // Do nothing if clicked inside the non-clickable cell
|
||||||
|
}
|
||||||
|
|
||||||
|
// Perform the desired action (e.g., redirect)
|
||||||
|
window.location.href = this.dataset.href; // Example redirect
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
Reference in New Issue
Block a user