Files
2024-10-14 00:08:40 +02:00

43 lines
1.1 KiB
PHP

<html>
<head>
</head>
<body>
<?php
if( $_POST["save"] == "save" ) {
// $_POST['status] == "an" "aus"
// $_POST['port_id] == id
echo " port_id: $_POST[port_id] Status: $_POST[status]\n";
}
?>
<table>
<tr>
<td>Port</td>
<td>Beschreibung</td>
<td>Status</td>
<td></td>
<td></td>
</tr>
<?php
$pdo = new PDO('mysql:host=panel.agserver.de;dbname=1_power', '1_power', 'K01v1kk0!');
$sql = "SELECT id,nr,descr,status FROM ports";
foreach ($pdo->query($sql) as $row) {
echo " <tr>\n";
echo " <form method=post action=index.php>\n";
echo " <td>$row[nr]</td>\n";
echo " <td>$row[descr]</td>\n";
echo " <td>$row[status]</td>\n";
echo " <td><input type=submit name=status value=an></td>\n";
echo " <td><input type=submit name=status value=aus></td>\n";
echo " <input type=hidden name=save value=save>\n";
echo " <input type=hidden name=port_id value=$row[id]>\n";
echo " </form>\n";
echo " </tr>\n";
}
?>
</table>
</body>
</html>