<?php
include 'conexion.php';

$nombre = $_GET['nombre'];
$sql = "SELECT id, CONCAT(nombres, ' ', apellido_paterno) AS nombre 
        FROM usuarios 
        WHERE nombres LIKE ? OR apellido_paterno LIKE ?";
$stmt = $conexion->prepare($sql);
$param = "%$nombre%";
$stmt->bind_param("ss", $param, $param);
$stmt->execute();
$result = $stmt->get_result();

$tecnicos = [];
while ($row = $result->fetch_assoc()) {
    $tecnicos[] = $row;
}
echo json_encode($tecnicos);
?>
