// JavaScript Document $("#btnCorregir").hide(); $("#btnPagar").hide(); $("#contenido").hide(); $("#cargando").hide(); $(document).ready(function () { "use strict"; // Continuar a paso 2 // Botón continuar $("#btnContinuar").click(function () { if ($("#form1-1k-fecha").val() === "") { alert("Por favor selecciona la fecha que quieres reservar"); } else { $("#formPago1").on("submit", function (e) { e.preventDefault(); $("#formPago1").hide(); $('html, body').animate({ scrollTop: 0 }, 'slow'); //lleva la pagina al top $("#cargando").show(); $.post("/Plantilla/via30-mostrarDatosPago.php", $("#formPago1").serialize(), function (respuesta) { $("#contenido").show(); $("#cargando").hide(); $("#contenido").html(respuesta); $("#tituloPagina").html("Revisa los datos de tu reserva"); $("#subtituloPagina").html("si los datos son correctos haz clic en el botón confirmar reserva"); $("#pasosCompra").html("Paso 2 de 3"); //document.getElementById("formPago1").reset(); $("#btnCorregir").show(); $("#btnPagar").show(); }); }); } }); // verificar fecha function verificaFecha (){ if ($("#form1-1k-fecha") === '') { alert("El campo esta vacío"); return false; } } // Corregir datos $("#btnCorregir").mouseup(function () { $("#cargando").hide(); $("#contenido").hide(); $("#detallePago").hide(); $("#btnCorregir").hide(); $("#btnPagar").hide(); $("#tituloPagina").html("Modifica tus datos de reserva"); $("#subtituloPagina").html("luego haz clic en continuar"); $("#pasosCompra").html("Paso 1 de 3"); $('html, body').animate({ scrollTop: 0 }, 'slow'); //lleva la pagina al top $("#formPago1").show(); }); // Confirmar pago $("#btnPagar").mouseup(function () { $("#formPago2").submit(); }); // Enviar formulario de pago $("#formPago2").on("submit", function (e) { e.preventDefault(); alert("pausa"); $.post("/Plantilla/via30-confirmarPago.php", $("#formPago2").serialize(), function (mensaje) { $("#contenido").html(mensaje); }); }); // BOOTSTRAP DATEPICKER $("#form1FechaBoton").click(function () { $("#form1-1k-fecha").click(); }); $("#form1-1k-fecha").change(function () { $("#labelMoneda").show(); $("#form1-1k-moneda").show(); var $fecha = $("#form1-1k-fecha").val(); switch ($fecha) { case '2018/05/21': case '2018/05/22': case '2018/05/23': case '2018/05/24': case '2018/05/25': case '2018/05/26': case '2018/05/27': case '2018/05/28': case '2018/05/29': case '2018/05/30': case '2018/05/31': case '2018/06/01': case '2018/06/02': case '2018/06/03': case '2018/06/04': case '2018/06/05': case '2018/06/06': case '2018/06/07': $("#labelMoneda").removeClass(); $("#labelMoneda").addClass("label label-warning mayusculas"); $("#labelMoneda").html("Tarifa Oferta:"); $("#form1-1k-moneda").html(""); $("#tipoTarifa").val("especial"); break; case '2019/03/01': case '2019/03/02': case '2019/03/03': case '2019/03/04': case '2019/03/05': case '2019/03/06': case '2019/03/07': case '2019/03/08': case '2019/03/09': case '2019/03/10': case '2019/03/11': case '2019/03/12': case '2019/03/13': case '2019/03/14': case '2019/03/15': case '2019/03/16': case '2019/03/17': case '2019/03/18': case '2019/03/19': case '2019/03/20': case '2019/03/21': case '2019/03/22': case '2019/03/23': case '2019/03/24': case '2019/03/25': case '2019/03/26': case '2019/03/27': case '2019/03/28': case '2019/03/29': case '2019/03/30': case '2019/03/31': $("#labelMoneda").removeClass(); $("#labelMoneda").addClass("label label-primary"); $("#labelMoneda").html("Tarifa regular:"); $("#form1-1k-moneda").html(""); $("#form1-1k-turno").html(" "); $("#tipoTarifa").val("regular"); break; case '2020/01/01': case '2020/01/02': case '2020/04/09': case '2020/04/10': case '2020/04/11': case '2020/04/12': case '2020/07/27': case '2020/07/28': case '2020/07/29': case '2020/12/31': case '2021/01/01': case '2020/01/02': case '2020/01/03': $("#labelMoneda").removeClass(); $("#labelMoneda").addClass("label label-success"); $("#labelMoneda").html("Temporada alta:"); $("#form1-1k-moneda").html(""); $("#form1-1k-turno").html(" "); $("#tipoTarifa").val("feriado"); break; default: $("#labelMoneda").removeClass(); $("#labelMoneda").addClass("label label-primary"); $("#labelMoneda").html("Tarifa regular:"); $("#form1-1k-moneda").html(""); $("#form1-1k-turno").html(""); $("#tipoTarifa").val("regular"); } }); });