

<!DOCTYPE html>
<html lang="id">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Sitemap - 4Kerja</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            line-height: 1.6;
            padding: 20px;
        }
        h1 {
            color: #333;
        }
        ul {
            list-style-type: none;
        }
        li {
            margin: 5px 0;
        }
        a {
            color: #007bff;
            text-decoration: none;
        }
        a:hover {
            text-decoration: underline;
        }
    </style>
</head>
<body>

    <h1>Sitemap 4Kerja</h1>
    <p>Berikut adalah daftar URL halaman di situs web kami:</p>

    <ul>
    <?php
    // 3. Periksa apakah ada hasil dari query
    if ($result->num_rows > 0) {
        // Outputkan URL untuk setiap postingan
        while($row = $result->fetch_assoc()) {
            // Buat URL dengan ID postingan
            $url = "https://www.4kerja.com/job/{$row['id']}"; // Ubah sesuai format URL Anda
            echo '<li><a href="' . $url . '" target="_blank">' . htmlspecialchars($row['title']) . '</a></li>';
        }
    } else {
        echo "<li>Tidak ada postingan ditemukan.</li>";
    }

    // 4. Tutup koneksi database
    $conn->close();
    ?>
    </ul>

</body>
</html>
