<?php
session_start();
require('routeros_api.class.php');

$id = $_GET['id'] ?? '';
if (!$id) { echo "❌ ID tidak ditemukan."; exit; }

$API = new RouterosAPI();
$API->debug = false;
$ipMikrotik = $_SESSION['ip'];
$username = $_SESSION['user'];
$password = $_SESSION['pass'];

if ($API->connect($ipMikrotik, $username, $password)) {
    $API->comm("/ppp/secret/remove", [".id" => $id]);
    $API->disconnect();
    echo "✅ PPP Secret berhasil dihapus.";
} else {
    echo "❌ Gagal konek ke Mikrotik.";
}
?>
