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"> <input type="hidden" name="action" id="action">
</form> </form>
</div> </div>
<form method="post" id="bulkForm">
<input type="hidden" name="action" id="bulkAction">
<table> <table>
<tr> <tr>
<th>No</th> <th>No</th>
<th><input type="checkbox" onclick="toggleAll(this)">ID</th> <th>ID</th>
<th>Service Name</th> <th>Service Name</th>
<th>Input</th> <th>Input</th>
<th>Output</th> <th>Output</th>
@ -522,12 +520,7 @@ if ($_SERVER["REQUEST_METHOD"] === "POST") {
<?php foreach ($data as $row): ?> <?php foreach ($data as $row): ?>
<tr> <tr>
<td><?= $i++ ?></td> <td><?= $i++ ?></td>
<td> <td><?= $row['id'] ?></td>
<input type="checkbox"
class="rowCheckbox"
name="ids[]"
value="<?= $row['id'] ?>"><?= $row['id'] ?>
</td>
<td><?= $row["service_name"] ?></td> <td><?= $row["service_name"] ?></td>
<td><?= $row["input_udp"] ?></td> <td><?= $row["input_udp"] ?></td>
<td><?= $row["output_udp"] ?></td> <td><?= $row["output_udp"] ?></td>
@ -547,7 +540,6 @@ if ($_SERVER["REQUEST_METHOD"] === "POST") {
</tr> </tr>
<?php endforeach; ?> <?php endforeach; ?>
</table> </table>
</form>
<!-- POPUP --> <!-- POPUP -->
<div id="overlay"></div> <div id="overlay"></div>
<div id="popup"> <div id="popup">
@ -608,27 +600,6 @@ if ($_SERVER["REQUEST_METHOD"] === "POST") {
</div> </div>
<script> <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() { function openAddPopup() {
document.getElementById("popup_title").innerText = "Add Service"; document.getElementById("popup_title").innerText = "Add Service";
document.getElementById("saveBtn").setAttribute("onclick", "saveService()"); document.getElementById("saveBtn").setAttribute("onclick", "saveService()");