Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ----------------------------------------index.html----------------------------------------------------------------------------------
- <!DOCTYPE html>
- <html lang="pt-br">
- <head>
- <title>Pedidos Pizzaria X</title>
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <link rel="stylesheet" type="text/css" href="style/bootstrap.css">
- <link rel="stylesheet" type="text/css" href="style/estilo.css">
- <script src="//code.jquery.com/jquery-1.12.0.min.js"></script>
- <script src="//code.jquery.com/jquery-migrate-1.2.1.min.js"></script>
- <script>
- $(document).ready(function(){
- $.ajax({
- type:'post',
- url: 'lista_pedidos.php',
- dataType:'html',
- success: function(dados){
- $(".container").html(dados);
- }
- });
- $('body').on('click',"button", function(){
- alert($(this).attr('rel'));
- var id = $('table').find('td.id').text();
- alert("meu id = " + id);
- $.ajax({
- type: 'POST',
- url: 'apagar_pedido.php',
- data: '&id='+ id,
- datatype: 'html',
- success: function(msg){
- alert(msg);
- document.location.href="index.html";
- }
- });
- });
- });</script>
- </head>
- <body>
- <header>
- <div class="row">
- <h2>Pizzaria Sabor e Paladar</h2>
- </div>
- </header>
- <div class="jumbotron"><h1>Recebimento de Pedidos</h1></div>
- <div class="container">
- <button rel="id" > excluir </button>
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement