//ログインフォーム表示
function CustmerReg(){
$(".member").show();
}
//フォーム切り替え
$(function() {
$('input[type=radio]').change(function() {
$('section.mem').hide();
$('section.new').hide();
if ($("input:radio[name='custmer']:checked").val() == "1") {
$('section.mem').show();
} else if($("input:radio[name='custmer']:checked").val() == "2") {
$('section.new').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();
Namae = $('#loginForm').find('#Namae').val();
birth = $('#loginForm').find('#birth').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 != ""){
$('.mem p').html('

');
$('div.radio-group').hide();
$('form#loginForm').hide();
$.ajax({
url: "/wp/wp-content/themes/new_aun/lib/js/adminlogin.php",
type: "POST",
data: {Namae:Namae,seq:seq,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{
$('.member').html(jQuery.parseHTML(data));
}
},
error: function(MLHttpRequest, textStatus, errorThrown) {
$('div.radio-group').show();
$('.mem p').html(errorThrown);
$('form#loginForm').show();
}
});
}else{
$.ajax({
url: "/wp/wp-content/themes/new_aun/lib/js/adminserchlogin.php",
type: "POST",
data: {Namae:Namae,birth:birth,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 if(data == 'NG'){
$('div.radio-group').show();
$('.new p').html('無断キャンセル者です。通常ログインでログインしてください。');
$('form#registForm').show();
}else{
$('.member').html(jQuery.parseHTML(data));
}
},
error: function(MLHttpRequest, textStatus, errorThrown) {
$('div.radio-group').show();
$('.mem p').html(errorThrown);
$('form#loginForm').show();
}
});
}
}
});
jQuery(document).ready(function(){
jQuery("#registForm").validationEngine( 'attach', {
ajaxFormValidation: true,
onBeforeAjaxFormValidation: beforeCall,
promptPosition: "bottomLeft",
focusFirstField: false,
scroll: false,
});
function beforeCall(){
Namae = $('#registForm').find('#Namae').val();
phone = $('#registForm').find('#phone').val();
date = $('#registForm').find('#date').val();
proid = $('#registForm').find('#proid').val();
stucd = $('#registForm').find('#stucd').val();
trid = $('#registForm').find('#trid').val();
time = $('#registForm').find('#time').val();
STIME = $('#registForm').find('#STIME').val();
if((Namae != null)||(phone != null)){
$('.new p').html('
');
$('div.radio-group').hide();
$('form#registForm').hide();
$.ajax({
url: "/wp/wp-content/themes/new_aun/lib/js/regist.php",
type: "POST",
data: {Namae:Namae,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();
$('.new p').html('登録に失敗しました。お手数ですが、もう一度入力してください。');
$('form#registForm').show();
}else{
$('.member').html(jQuery.parseHTML(data));
}
},
error: function(MLHttpRequest, textStatus, errorThrown) {
$('div.radio-group').show();
$('.new p').html(errorThrown);
$('form#registForm').show();
}
});
}
}
});