<?php
require '../config.php';

if (isset($_POST['metode_id'])) {
    
    $metode_id = $_POST['metode_id'];
    
    if (!empty($metode_id)) {
        $query_metode = mysqli_query($db, "SELECT * FROM metode_guest WHERE id = '$metode_id'");
            
        if (mysqli_num_rows($query_metode) !== 0) {
            $harga = [];
            while($fetch_metode = mysqli_fetch_assoc($query_metode)) {
                $harga[] = [
                    'id' => $fetch_metode['id'],
                    'metode' => $fetch_metode['metode']
                ];
            }
            echo json_encode($harga);
        }
    }
}