This commit is contained in:
devdatt 2026-01-29 12:47:18 +05:30
parent 36f7de70a1
commit f5f0ece2e8
1 changed files with 38 additions and 67 deletions

View File

@ -500,12 +500,10 @@ if ($_SERVER["REQUEST_METHOD"] === "POST") {
<input type="hidden" name="action" id="action">
</form>
</div>
<form method="post" id="bulkForm">
<input type="hidden" name="action" id="bulkAction">
<table>
<tr>
<th>No</th>
<th><input type="checkbox" onclick="toggleAll(this)">ID</th>
<th>ID</th>
<th>Service Name</th>
<th>Input</th>
<th>Output</th>
@ -522,12 +520,7 @@ if ($_SERVER["REQUEST_METHOD"] === "POST") {
<?php foreach ($data as $row): ?>
<tr>
<td><?= $i++ ?></td>
<td>
<input type="checkbox"
class="rowCheckbox"
name="ids[]"
value="<?= $row['id'] ?>"><?= $row['id'] ?>
</td>
<td><?= $row['id'] ?></td>
<td><?= $row["service_name"] ?></td>
<td><?= $row["input_udp"] ?></td>
<td><?= $row["output_udp"] ?></td>
@ -547,7 +540,6 @@ if ($_SERVER["REQUEST_METHOD"] === "POST") {
</tr>
<?php endforeach; ?>
</table>
</form>
<!-- POPUP -->
<div id="overlay"></div>
<div id="popup">
@ -608,27 +600,6 @@ if ($_SERVER["REQUEST_METHOD"] === "POST") {
</div>
<script>
function toggleAll(master) {
document.querySelectorAll('.rowCheckbox')
.forEach(cb => cb.checked = master.checked);
}
function submitBulk(action) {
const checked = document.querySelectorAll('.rowCheckbox:checked');
if (checked.length === 0) {
alert('No services selected');
return;
}
if (!confirm('Are you sure?')) {
return;
}
document.getElementById('bulkAction').value = action;
document.getElementById('bulkForm').submit();
}
function openAddPopup() {
document.getElementById("popup_title").innerText = "Add Service";
document.getElementById("saveBtn").setAttribute("onclick", "saveService()");