} }); # ------------------------------------------------------------------ # Productos: # ------------------------------------------------------------------ $app->post('/productos-list', function (Request $req, Response $res, $args = []) { $request = $req->getParsedBody(); $rs_data = getProductos($request, $res); }); $app->post('/productos-save', function (Request $req, Response $res, $args = []) { $request = $req->getParsedBody(); $rs_data = addProducto($request, $res); }); $app->post('/productos-upd', function (Request $req, Response $res, $args = []) { $request = $req->getParsedBody(); $rs_data = updProducto($request, $res); }); $app->run(); # ------------------------------------------------------------------ # Proveedores: # ------------------------------------------------------------------ function getProveedores($req, $res) { $db = getCnxn(); // REQUERIDO PARA VALIDA CREDENCIALES $user_id = null; $user = $req['user']; $pwd = $req['pwd']; // <--------------------------------- $id = $req['id']; $empresa = $req['empresa'];
<?php include '../funciones/DB.php'; if ($_POST['acc'] == 'mod') { modProducto($_POST['id'], $_POST['sub']); } else { updProducto($_POST, $_FILES); }