1ra Versión

This commit is contained in:
MarcosFlorSalcedo
2026-07-14 18:24:27 -03:00
commit 8ec55e40fc
86 changed files with 15839 additions and 0 deletions
+26
View File
@@ -0,0 +1,26 @@
<?php
header('Content-Type: application/json');
require_once 'conexion.php';
if ($conexion->connect_error) {
echo json_encode(['success' => false, 'error' => 'Error de conexión']);
exit;
}
$data = json_decode(file_get_contents("php://input"), true);
$nombre = $data['nombre'] ?? '';
$telefono = $data['telefono'] ?? '';
$stmt = $conexion->prepare("INSERT INTO proveedores (Nombre, Telefono) VALUES (?, ?)");
$stmt->bind_param("ss", $nombre, $telefono);
if ($stmt->execute()) {
echo json_encode(['success' => true]);
} else {
echo json_encode(['success' => false, 'error' => $conexion->error]);
}
$stmt->close();
$conexion->close();
?>