Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function Load() {
- var cpf;
- cpf = sessionStorage.getItem('cpf');
- jQuery.support.cors = true;
- // Default options are marked with *
- fetch('http://API_AQUI', {
- method: 'POST',
- headers: {'Content-Type':'application/x-www-form-urlencoded'},
- body: `cpf=${cpf}`
- }).then(response => response.json().then(data => ({
- data: data,
- status: response.status
- })
- ).then(res => {
- res.data.map(element => {
- var text = element;
- var pegaId = element.ID;
- localStorage.setItem('pegaId', pegaId);
- $('.produto-1').append(`<div class="col-xs-6 col-sm-4 col-lg-12">
- <div class="thumbnail">
- <div class="caption">
- <h3>${element.PRODUTO}</h3> <img class="fon" src="img/icon/guido.ico"/>
- <p class="flex-text text-muted">${element.STATUS}</p>
- <br>
- <p><a class="btn btn-primary" type="button" id="${element.ID}" href="progress.php" >Acompanhar Pedido</a></p>
- </div>
- </div>
- </div>`);
- })
- })
- )
- }
- // Default options are marked with *
- fetch('http://api_aqui', {
- method: 'POST',
- headers: {'Content-Type':'application/x-www-form-urlencoded'},
- body: `ID=${ID}`
- }).then(response => response.json().then(data => ({
- data: data,
- status: response.status
- })
- ).then(res => {
- res.data.map(element => {
- var text = element;
- console.log(text);
- $('.progresso-1').append(`${element.NOME}`);
- $('.progresso-2').append(`${element.PRODUTO}`);
- $('.progresso-3').append(`${element.CPF}`);
- $('.progresso-4').append(`${element.CIDADE}`);
- $('.progresso-5').append(`${element.ENTREGAPREVISTA}`);
- $('.progresso-6').append(`${element.CODPRODUTO}`);
- $('.progresso-7').append(`${element.CODCLIENTE}`);
- $('.progresso-8').append(`${element.ENTREGAPROGRAMADA}`);
- $('.progresso-9').append(`${element.NOTAFICAL}`);
- $('.progresso-10').append(`${element.QTDPEDIDO}`);
- $('.progresso-11').append(`${element.ENTREGACONFIRMADA}`);
- $('.progresso-12').append(`${element.MONTAGEMPREVISTA}`);
- $('.progresso-13').append(`${element.MONTCONFIRMADA}`);
- })
- })
- )
- }
Add Comment
Please, Sign In to add comment