<?php
$json = file_get_contents('php://input');   
$obj = json_decode($json);
$id = $obj->flag;
// Returns a Json
header('Content-Type: application/json');
switch($id){
    
    case '0': //get paquete clase visita
        $array;
        $conn = new mysqli("directoriofitness.com.mx", "direct18", "L4LL4v3M@3str@","$obj->bd");
        $conn -> set_charset("utf8");
        $query = "SELECT idServicio,NombreServicio,Tipo,PVisita,Sucursal FROM servicios WHERE idServicio = '$obj->idServicio'";
        
        $resultado = $conn->query($query);
            
        while($row = $resultado->fetch_assoc()){
            $array[] = $row;
        }
        
        $conn->close();
        echo json_encode($array);
    break;
}

?>