//ログインフォーム表示
function CustmerReg(){
$(".member").show();
}
//フォーム切り替え
$(function() {
$('input[type=radio]').change(function() {
$('section.mem').hide();
$('section.signup').hide();
if ($("input:radio[name='custmer']:checked").val() == "1") {
$('section.mem').show();
} else if($("input:radio[name='custmer']:checked").val() == "2") {
$('section.signup').show();
}
}).trigger('change'); //←(1)
});
jQuery(document).ready(function(){
jQuery("#loginForm").validationEngine( 'attach', {
ajaxFormValidation: true,
onBeforeAjaxFormValidation: beforeCall,
promptPosition: "bottomLeft",
focusFirstField: false,
scroll: false,
});
function beforeCall(){
seq = $('#loginForm').find('#seq').val();
pass = $('#loginForm').find('#pass').val();
date = $('#loginForm').find('#date').val();
proid = $('#loginForm').find('#proid').val();
stucd = $('#loginForm').find('#stucd').val();
trid = $('#loginForm').find('#trid').val();
time = $('#loginForm').find('#time').val();
STIME = $('#loginForm').find('#STIME').val();
if((seq != null)||(pass != null)){
$('.mem p.coution').html('

');
$('div.radio-group').hide();
$('form#loginForm').hide();
$.ajax({
url: "/wp/wp-content/themes/new_aun/lib/js/login.php",
type: "POST",
data: {seq:seq,pass:pass,date:date,proid:proid,stucd:stucd,trid:trid,time:time,STIME:STIME},
dataType: "html",
success: function(data) {
if(data == 'error'){
$('div.radio-group').show();
$('.mem p.coution').html('会員番号かパスワードをご確認の上、
もう一度ご入力ください。');
$('form#loginForm').show();
}else{
$('.mem p.coution').hide;
$('.member').html(jQuery.parseHTML(data));
}
},
error: function(MLHttpRequest, textStatus, errorThrown) {
$('div.radio-group').show();
$('.mem p.coution').html(errorThrown);
$('form#loginForm').show();
}
});
}
}
});
jQuery(document).ready(function(){
jQuery("#signupForm").validationEngine( 'attach', {
ajaxFormValidation: true,
onBeforeAjaxFormValidation: beforeCall,
promptPosition: "bottomLeft",
focusFirstField: false,
scroll: false,
});
function beforeCall(){
$(".chkName").text($('#Namae').val());
$(".chkAdd").text($('#MailAd').val());
$(".chkPhone").text($('#phone').val());
$(".chkForm").show();
$(".regForm").hide();
$(".chkLi").addClass("active");
}
$(document).on('click','#back',function(){
$(".chkForm").hide();
$(".regForm").show();
$(".chkLi").removeClass("active");
});
$(document).on('click','#signup',function(){
Namae = $('#signupForm').find('#Namae').val();
MailAd = $('#signupForm').find('#MailAd').val();
phone = $('#signupForm').find('#phone').val();
date = $('#signupForm').find('#date').val();
proid = $('#signupForm').find('#proid').val();
stucd = $('#signupForm').find('#stucd').val();
trid = $('#signupForm').find('#trid').val();
time = $('#signupForm').find('#time').val();
STIME = $('#signupForm').find('#STIME').val();
if((Namae != null)||(phone != null)){
$('.signup p.coution').html('
');
$('div.radio-group').hide();
$('.box_step02').hide();
$('form#signupForm').hide();
$.ajax({
url: "/wp/wp-content/themes/new_aun/lib/js/signup.php",
type: "POST",
data: {Namae:Namae,MailAd:MailAd,phone:phone,date:date,proid:proid,stucd:stucd,trid:trid,time:time,STIME:STIME},
dataType: "html",
success: function(data) {
if(data == 'error'){
$('div.radio-group').show();
$('.signup p.coution').html('登録に失敗しました。
お手数ですが、もう一度入力してください。');
$('form#signupForm').show();
$('.box_step02').show();
$(".chkForm").hide();
$(".regForm").show();
$(".chkLi").removeClass("active");
}else if(data == 'NG'){
$('div.radio-group').show();
$('.signup p.coution').html('恐れ入りますがお客様のオンラインでのご予約はできません。
お電話にてご予約ください。');
$('form#signupForm').show();
$('.box_step02').show();
$(".chkForm").hide();
$(".regForm").show();
$(".chkLi").removeClass("active");
}else{
$('.member').html(jQuery.parseHTML(data));
}
},
error: function(MLHttpRequest, textStatus, errorThrown) {
$('div.radio-group').show();
$('.signup p').html(errorThrown);
$('form#signupForm').show();
}
});
}
});
});