Skip to content

Instantly share code, notes, and snippets.

@EliuTimana
Created August 20, 2017 00:02
Show Gist options
  • Save EliuTimana/11481e3c87d82957877a88cce4a60a39 to your computer and use it in GitHub Desktop.
Save EliuTimana/11481e3c87d82957877a88cce4a60a39 to your computer and use it in GitHub Desktop.
cambios jhudo
// carrito.html
$(document).on('click', '#btnConfirmar', function () {
if (localStorage.id_usuario) {
$.post('../sys/ws/pedido.php', {
op:'confirma_cart',
id_pedido: localStorage.id_pedido
}, function (response) {
localStorage.removeItem("id_pedido");
InstantClick.go('index.html');
});
} else {
InstantClick.go('login.html');
}
});
// sys/ws/pedido.php
case 'confirma_cart':
$objpedido = new pedido();
$objpedido->setVar('id', $_POST['id_pedido']);
$objpedido->setVar('estado_pedido', '1');
echo json_encode($objpedido->updateDB());
break;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment