Created
September 27, 2017 14:21
-
-
Save rodrigobravo/70c3abf16a09f461a5ab9be20dab1115 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $(document).ready(function(){ | |
| var $div_novospedidos = $('#div_novospedidos'); | |
| $div_novospedidos.empty(); //Limpando a tabela | |
| // setTimeout(function(){ location.reload(); }, 5000); | |
| $.get("database3.php", function(data, status){ | |
| //if (data == null) {console.log("sem pedidos hoje")} else {console.log("teste")}; | |
| var dados_pedido = data; | |
| console.log(dados_pedido); | |
| const obj = dados_pedido; | |
| } | |
| var dados = $.parseJSON(data); | |
| console.log(dados); | |
| $.each(dados, function(i, item) { | |
| numeroPedido = item.doc_number; | |
| nomeCliente = item.client_name; | |
| horarioPedido = item.clock; | |
| var newReq = $('<div class="panel panel-default col-6 col-lg-4 ">'); | |
| var cols = ""; | |
| cols += '<p>HORARIO: '+horarioPedido+'</p></div>'; | |
| cols += '<p>PEDIDO: '+numeroPedido+'</p></div>'; | |
| cols += '<p>Cliente: '+nomeCliente+'</p></div>'; | |
| newReq.append(cols); | |
| $("#div_novospedidos").append(newReq); | |
| }); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment