This commit is contained in:
devdatt 2026-01-08 07:06:34 +05:30
parent 589d7a400a
commit a61e452acd
2 changed files with 96 additions and 50 deletions

View File

@ -271,7 +271,7 @@
<span class="pill"><a style="color: #ffffff;" href="certification.html">Certificate</a></span>
</div>
<div class="pill-row">
<span class="pill"><a style="color: #ffffff;" href="login.html">Login</a></span>
<span class="pill"><a style="color: #ffffff;" href="login.php">Login</a></span>
</div>
<div class="footer">

View File

@ -1,19 +1,62 @@
<?php include 'header.php'; ?>
<style>
body { font-family: Arial, sans-serif; padding: 20px; }
button { padding: 8px 14px; cursor: pointer; }
#popup {
display:none; position: fixed; top: 50%; left: 50%;
transform: translate(-50%, -50%); background: #fff;
padding: 20px; border:1px solid #333; width: 350px;
}
#popup input, #popup select { width: 100%; margin-bottom: 10px; padding: 6px; }
#overlay { display:none; position:fixed; top:0; left:0; right:0; bottom:0; background:rgba(0,0,0,0.6); }
.table { width: 100%; border-collapse: collapse; margin-top: 20px; }
.table th, .table td { padding: 10px; border: 1px solid #ccc; text-align: left; }
body {
font-family: Arial, sans-serif;
padding: 20px;
}
button {
padding: 8px 14px;
cursor: pointer;
}
#popup {
display: none;
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
background: #fff;
padding: 20px;
border: 1px solid #333;
width: 350px;
}
#popup input,
#popup select {
width: 100%;
margin-bottom: 10px;
padding: 6px;
}
#overlay {
display: none;
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.6);
}
.table {
width: 100%;
border-collapse: collapse;
margin-top: 20px;
}
.table th,
.table td {
padding: 10px;
border: 1px solid #ccc;
text-align: left;
}
</style>
</head>
<br>
<br>
<br>
<br>
<h2>Service List</h2>
<button onclick="openPopup()">Add Service</button>
@ -32,17 +75,17 @@ button { padding: 8px 14px; cursor: pointer; }
</tr>
<?php foreach ($data as $row): ?>
<tr>
<td><?= htmlspecialchars($row["id"]) ?></td>
<td><?= htmlspecialchars($row["input_udp"]) ?></td>
<td><?= htmlspecialchars($row["output_udp"]) ?></td>
<td><?= htmlspecialchars($row["video_format"]) ?></td>
<td><?= htmlspecialchars($row["audio_format"]) ?></td>
<td><?= htmlspecialchars($row["resolution"]) ?></td>
<td><?= htmlspecialchars($row["video_bitrate"]) ?></td>
<td><?= htmlspecialchars($row["audio_bitrate"]) ?></td>
<td><?= htmlspecialchars($row["status"]) ?></td>
</tr>
<tr>
<td><?= htmlspecialchars($row["id"]) ?></td>
<td><?= htmlspecialchars($row["input_udp"]) ?></td>
<td><?= htmlspecialchars($row["output_udp"]) ?></td>
<td><?= htmlspecialchars($row["video_format"]) ?></td>
<td><?= htmlspecialchars($row["audio_format"]) ?></td>
<td><?= htmlspecialchars($row["resolution"]) ?></td>
<td><?= htmlspecialchars($row["video_bitrate"]) ?></td>
<td><?= htmlspecialchars($row["audio_bitrate"]) ?></td>
<td><?= htmlspecialchars($row["status"]) ?></td>
</tr>
<?php endforeach; ?>
</table>
@ -84,33 +127,36 @@ button { padding: 8px 14px; cursor: pointer; }
</div>
<script>
function openPopup() {
document.getElementById("popup").style.display = "block";
document.getElementById("overlay").style.display = "block";
}
function openPopup() {
document.getElementById("popup").style.display = "block";
document.getElementById("overlay").style.display = "block";
}
function closePopup() {
document.getElementById("popup").style.display = "none";
document.getElementById("overlay").style.display = "none";
}
function closePopup() {
document.getElementById("popup").style.display = "none";
document.getElementById("overlay").style.display = "none";
}
function saveService() {
let form = new FormData();
form.append("action", "add");
form.append("input_udp", document.getElementById("in_udp").value);
form.append("output_udp", document.getElementById("out_udp").value);
form.append("video_format", document.getElementById("video_format").value);
form.append("audio_format", document.getElementById("audio_format").value);
form.append("resolution", document.getElementById("resolution").value);
form.append("video_bitrate", document.getElementById("video_bitrate").value);
form.append("audio_bitrate", document.getElementById("audio_bitrate").value);
form.append("status", document.getElementById("status").value);
function saveService() {
let form = new FormData();
form.append("action", "add");
form.append("input_udp", document.getElementById("in_udp").value);
form.append("output_udp", document.getElementById("out_udp").value);
form.append("video_format", document.getElementById("video_format").value);
form.append("audio_format", document.getElementById("audio_format").value);
form.append("resolution", document.getElementById("resolution").value);
form.append("video_bitrate", document.getElementById("video_bitrate").value);
form.append("audio_bitrate", document.getElementById("audio_bitrate").value);
form.append("status", document.getElementById("status").value);
fetch("input.php", { method: "POST", body: form })
.then(r => r.text())
.then(res => {
if (res === "OK") location.reload();
});
}
fetch("input.php", {
method: "POST",
body: form
})
.then(r => r.text())
.then(res => {
if (res === "OK") location.reload();
});
}
</script>
<?php include 'footer.php'; ?>