Guest User

Untitled

a guest
Dec 10th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.71 KB | None | 0 0
  1. <%
  2.  
  3. dim i, Q
  4. dim fInicio, fTermino
  5. dim lCentros
  6.  
  7. ' obtener fechas anteriores
  8. fInicio = DateAdd("d", -7, now())
  9. fTermino = DateAdd("d", 6, fInicio)
  10.  
  11.  
  12.  
  13. ' Listar centros notificados
  14. Q = "SELECT werks,"&_
  15. " stort "&_
  16. "FROM dbo.SAP_ControlMineria_Notificacion "&_
  17. "WHERE id_usuario <> 'job' "&_
  18. " AND fNotificacion BETWEEN '"& fInicio &"' AND '"& fTermino &"' "&_
  19. "GROUP BY werks, stort "&_
  20. "ORDER BY werks, stort;"
  21.  
  22.  
  23.  
  24. lCentros = getDBP(Q)
  25.  
  26. %>
  27.  
  28.  
  29. <!-- fila -->
  30. <div class="row-fluid">
  31. ENVIO DE CORREO SEMANAL, REP 3
  32.  
  33.  
  34. </div>
  35. <div class="clearfix"></div>
  36.  
  37. <script>
  38.  
  39. $(document).ready(function() {
  40. // Se enviara correo de notif. a Mantenimiento
  41. var fecini = $("#<%=fInicio%>").val();
  42. var fecfin = $("#<%=fTermino%>").val();
  43. var werks = 'M027';
  44. var stort = 'SALVADORC2';
  45. var func = 'normal';
  46. var fechaNotif = $("#<%=fTermino%>").val();
  47. $.ajax({
  48. async:false,
  49. cache:false,
  50. dataType:"html",
  51. type: 'POST',
  52. url: "rep3_notificacion.asp",
  53. data: {
  54. fecini:fecini
  55. , fecfin:fecfin
  56. , werks:werks
  57. , stort:stort
  58. , func:func
  59. },
  60. success: function(respuesta){
  61. $("#mostrarRep").html(respuesta);
  62.  
  63. // enviar correo reporte mantenmiento
  64. $.post("rep3_notificacion_email.asp", { werks:werks , stort:stort , tablas:respuesta, fechaNotif:fechaNotif }, function(data) {
  65. }).done(function() {
  66. // enviar mensaje de ejecucion correcta
  67. window.location.href = "rep7_detalle.asp";
  68. }).fail(function() {
  69. window.location.href = "rep8_detalle.asp";
  70. });
  71.  
  72. },
  73. beforeSend:function(){},
  74. error:function(objXMLHttpRequest){}
  75. });
Add Comment
Please, Sign In to add comment