Show/hide journal
This commit is contained in:
13
action.php
13
action.php
@@ -79,16 +79,12 @@
|
||||
.editable:hover {
|
||||
background:rgb(226, 43, 43);
|
||||
}
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
document.addEventListener("DOMContentLoaded", function () {
|
||||
let id = "<?php echo $_GET['id'];?>";
|
||||
|
||||
@@ -238,7 +234,8 @@ function opDetail() {
|
||||
$journalCount = $journalResult->num_rows;
|
||||
|
||||
// Add button to toggle journal entries
|
||||
echo '<button onclick="toggleJournal()">Show Journal Entries (' . $journalCount . ')</button>';
|
||||
echo '<br><button onclick="window.close()">Close Window</button>';
|
||||
echo ' <button onclick="toggleJournal()">Show Journal Entries (' . $journalCount . ')</button>';
|
||||
echo '<div id="journal-entries" style="display:none;">';
|
||||
echo '<h3>Journal Entries</h3>';
|
||||
echo '<table class="journal-table">';
|
||||
@@ -286,15 +283,17 @@ switch($_GET['op']) {
|
||||
|
||||
}
|
||||
?>
|
||||
<p><center><button onclick="window.close()">Close Window</button></center>
|
||||
|
||||
<script>
|
||||
function toggleJournal() {
|
||||
var journalEntries = document.getElementById("journal-entries");
|
||||
var toggleButton = document.querySelector("button[onclick='toggleJournal()']");
|
||||
if (journalEntries.style.display === "none") {
|
||||
journalEntries.style.display = "block";
|
||||
toggleButton.textContent = "Hide Journal Entries";
|
||||
} else {
|
||||
journalEntries.style.display = "none";
|
||||
toggleButton.textContent = "Show Journal Entries";
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user