<?php include 'conexion.php'; ?>
<!DOCTYPE html>
<html lang="es">
<head>
  <meta charset="UTF-8">
  <title>Editar Facturas por Cliente</title>
  <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
</head>
<body class="bg-light">

<div class="container mt-4">
  <h4>Editar Facturas de Cliente</h4>
  <form id="formBuscar" class="row g-3">
    <div class="col-md-4">
      <input type="number" class="form-control" name="customer_id" id="customer_id" placeholder="ID del Cliente" required>
    </div>
    <div class="col-md-2">
      <button class="btn btn-primary">Buscar</button>
    </div>
  </form>

  <div id="resultados" class="mt-4"></div>
</div>

<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script>
$('#formBuscar').on('submit', function(e){
  e.preventDefault();
  let id = $('#customer_id').val();
  $.post('buscar_facturas.php', {customer_id: id}, function(data){
    $('#resultados').html(data);
  });
});
</script>

</body>
</html>
