<?php

require_once "config.php";

header('Content-Type: application/json');

$method = $_SERVER['REQUEST_METHOD'];

switch ($method) {
    case 'GET':
        $cemail = $_GET["cemail"];
        $stmt = $conn->prepare("select * FROM tbutppoint where cusername = ?");
        $stmt->bind_param("s", $cemail);
        $stmt->execute();
        $result = $stmt->get_result()->fetch_assoc();
        $stmt->close();
        
        echo json_encode($result);
        break;
}

// Menutup koneksi database
$conn->close();

?>
