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,54 +500,46 @@ 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"> <table>
<input type="hidden" name="action" id="bulkAction"> <tr>
<table> <th>No</th>
<th>ID</th>
<th>Service Name</th>
<th>Input</th>
<th>Output</th>
<th>Video</th>
<th>Audio</th>
<th>Resolution</th>
<th>V-Bitrate</th>
<th>A-Bitrate</th>
<th>Volume (dB)</th>
<th>Status</th>
<th>Actions</th>
</tr>
<?php $i = 1; ?>
<?php foreach ($data as $row): ?>
<tr> <tr>
<th>No</th> <td><?= $i++ ?></td>
<th><input type="checkbox" onclick="toggleAll(this)">ID</th> <td><?= $row['id'] ?></td>
<th>Service Name</th> <td><?= $row["service_name"] ?></td>
<th>Input</th> <td><?= $row["input_udp"] ?></td>
<th>Output</th> <td><?= $row["output_udp"] ?></td>
<th>Video</th> <td><?= $row["video_format"] ?></td>
<th>Audio</th> <td><?= $row["audio_format"] ?></td>
<th>Resolution</th> <td><?= $row["resolution"] ?></td>
<th>V-Bitrate</th> <td><?= $row["video_bitrate"] ?></td>
<th>A-Bitrate</th> <td><?= $row["audio_bitrate"] ?></td>
<th>Volume (dB)</th> <td><?= $row["volume"] ?> dB</td>
<th>Status</th> <td><?= $row["service"] ?></td>
<th>Actions</th>
</tr>
<?php $i = 1; ?>
<?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["service_name"] ?></td>
<td><?= $row["input_udp"] ?></td>
<td><?= $row["output_udp"] ?></td>
<td><?= $row["video_format"] ?></td>
<td><?= $row["audio_format"] ?></td>
<td><?= $row["resolution"] ?></td>
<td><?= $row["video_bitrate"] ?></td>
<td><?= $row["audio_bitrate"] ?></td>
<td><?= $row["volume"] ?> dB</td>
<td><?= $row["service"] ?></td>
<td style="margin-top:3px;"> <td style="margin-top:3px;">
<button class="edit-btn" onclick='openEditPopup(<?= json_encode($row) ?>)'>Edit</button> <button class="edit-btn" onclick='openEditPopup(<?= json_encode($row) ?>)'>Edit</button>
<button class="restart-btn" onclick="restartService(<?= $row['id'] ?>)">Restart</button> <button class="restart-btn" onclick="restartService(<?= $row['id'] ?>)">Restart</button>
<button class="delete-btn" onclick="deleteService(<?= $row['id'] ?>)">Delete</button> <button class="delete-btn" onclick="deleteService(<?= $row['id'] ?>)">Delete</button>
</td> </td>
</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()");