include_once '../controller/cProductos.php'; $cFallidos = new cFallidos(); $cProductos = new cProductos(); $datos = $cProductos->getProducto($_POST['id_producto']); while ($row = $datos->fetch_array(MYSQLI_ASSOC)) { $producto = $row['clave'] . "/" . $row['descripcion']; } $descripcion = "<h4>EL REGISTRO DE LA VENTA NO SE REALIZO CON EXITO.</h4>EL PRODUCTO A REGISTRAR ES: <b>" . strtoupper($producto . "/" . $_POST['num_serie']) . "</b> CON UNA COMISIÓN TOTAL DE: <b>" . $_POST['comision_total'] . "</b>"; $cFallidos->setFallido($_POST['id_usuario'], $_POST['id_sucursal'], $descripcion, 1); $respuesta = array('error' => $e->getMessage()); echo json_encode($respuesta); } break; case 'getDatosVenta': try { $datos = $cVentas->getDatosVenta($_POST['id_venta']); while ($row = $datos->fetch_array()) { $respuesta = array('estatus' => $row['estatus'], 'imagen' => $row['imagen'], 'observacion' => $row['observacion']); } echo json_encode($respuesta); } catch (Exception $e) { $respuesta = array('error' => $e->getMessage()); echo json_encode($respuesta); } break; case 'updateEstatusVenta': try { $cVentas->updateEstatusVenta($_POST['estatus'], $_POST['id_venta'], $_POST['observacion'], ""); $respuesta = array('resultado' => 1); echo json_encode($respuesta); } catch (Exception $e) {