1
I have an ajax that runs through post, some information in PHP to another page. I saved this information in session.
I would like to update the div where I have a modal. In this case, this modal would have to update without refreshing the whole page, only in it to get the value of $_SESSION['IMPR_PEDIDO']['pedido'] current. Someone knows how to do?
<div class="modal fade" id="altera_cliente" tabindex="-1" role="dialog" aria-labelledby="modalLabel">
   <div class="modal-dialog" role="document">
      <div class="modal-content">
         <div class="modal-header modal_pedido">
            <button type="button" class="close" data-dismiss="modal" aria-label="Fechar"><span aria-hidden="true">×</span></button>
            <h4 class="modal-title" id="modalLabel">PedidoOnline gerado com sucesso!</h4>
         </div>
         <div class="modal-body">
            <div class="row">
               <div class="form-group">
                  <a class='btn-info btn-mini' href='pedidos_pdf/pedido_/<?php echo $_SESSION['IMPR_PEDIDO']['pedido']; ?>.pdf' target='_blank' download='Pedido_<?php echo $_SESSION['IMPR_PEDIDO']['pedido']; ?>'><img border='0' src='./images/download9.png' alt='W3Schools'></a>
               </div>
               <p />
            </div>
         </div>
         <div class="modal-footer">
            <button type="button" class="btn btn-default" data-dismiss="modal">Sair</button>
         </div>
      </div>
   </div>
</div>
Javascript code:
$(document).ready(function () {
   $('.informacoes').click(function () {
      var dados = $(this).val();
      $.ajax({
         type: 'GET',
         url: './ajax/pdf_pedido_faturado.php',
         data: 'pedido=' + dados,
         beforeSend: function () {
            $('<div class="ajaxModal"><div class="ajaxModal-preload"><p>Salvando PDF aguarde!</p></div></div>').insertAfter('body');
            $('.ajaxModal').fadeIn('fast');
         },
         success: function () {
            ajaxModal_Close();
            $('#altera_cliente').modal('show');
         }
      });
      return false;
   });
});
What pdf_pedido_invoiced.php returns (HTML, Json, string)?
– Marco Antonio Quintal
In this file I select and save a PDF file in a folder of my site, then record a $SESSION['numero'] , i’m not returning anything just this Septssion.
– Maicon Fernando Stefene da Sil
Want to update the div with what content?
– Jhonatan Pereira
I want to update the div with the value that is in $_SESSION
– Maicon Fernando Stefene da Sil
<a class='btn-info btn-mini' href='pedidos_pdf/pedido_/<? php echo $_SESSION['IMPR_PEDIDO']['request']; ? >. pdf' target='Blank' download='Request<?php echo $_SESSION['IMPR_PEDIDO']['request']; ? >'><img border='0' src='. /images/download9.png' alt='W3schools'></a>
– Maicon Fernando Stefene da Sil