var form = $('#LessonAddIndividualstudentForm');
$.ajax( {
type: "POST",
url: siteurl+'lessons/check_student_tutor_avalability',
data: form.serialize(),
success: function( response ) {
LessonScheduleRec=document.getElementById('LessonScheduleRec').checked;
LessonScheduleMonthly=document.getElementById('LessonScheduleMonthly').checked;
LessonScheduleYearly=document.getElementById('LessonScheduleYearly').checked;
jQuery('#tutor_email_noti').val('0');
jQuery('#LessonAddIndividualstudentForm').submit();
jQuery( this ).dialog( "close" );
/*
if(response==1){
// if(confirm("availability is matched Do you want to continue?")){
event.preventDefault();
jQuery( "#notification_msg" ).dialog({
resizable: false,
dialogClass: "notification_popup",
height:150,
width:'auto',
title: "SMS Notification",
closeText: "X",
modal: true,
buttons: [
{
text: "Ok",
"class": 'OKButtonClass btn btn-large btn-primary',
click: function() {
jQuery('#message').val('1');
jQuery( this ).dialog( "close" );
/////////===========
LessonScheduleRec=document.getElementById('LessonScheduleRec').checked;
LessonScheduleMonthly=document.getElementById('LessonScheduleMonthly').checked;
LessonScheduleYearly=document.getElementById('LessonScheduleYearly').checked;
if(LessonScheduleRec==true){
jQuery( "#notification_msg_msg" ).dialog({
resizable: false,
dialogClass: "notification_popup",
height:260,
width:'auto',
title: "SMS Notification",
closeText: "X",
modal: true,
buttons: [
{
text: "Ok",
"class": 'OKButtonClass btn btn-large btn-primary',
click: function() {
var ms = jQuery('#noti_msg_schedual').val();
jQuery('#message_text').val(ms);
jQuery( this ).dialog( "close" );
jQuery( "#notification_tutor" ).dialog({
resizable: false,
dialogClass: "notification_popup",
height:260,
width:'auto',
title: "Email Notification",
closeText: "X",
modal: true,
buttons: [
{
text: "Ok",
"class": 'OKButtonClass btn btn-large btn-primary',
click: function() {
jQuery('#tutor_email_noti').val('1');
jQuery('#LessonAddIndividualstudentForm').submit();
jQuery( this ).dialog( "close" );
}
},
{
text: "Cancel",
"class": 'cancelButtonClass btn btn-large btn-danger',
click: function() {
jQuery('#tutor_email_noti').val('0');
jQuery('#LessonAddIndividualstudentForm').submit();
jQuery( this ).dialog( "close" );
}
}
],
Cancel: function() {
jQuery( this ).dialog( "close" );
}
})
}
},
{
text: "Cancel",
"class": 'cancelButtonClass btn btn-large btn-danger',
click: function() {
jQuery('#message').val('0');
jQuery('#message_text').val(' ');
jQuery( this ).dialog( "close" );
jQuery( "#notification_tutor" ).dialog({
resizable: false,
dialogClass: "notification_popup",
height:250,
width:'auto',
title: "Email Notification",
closeText: "X",
modal: true,
buttons: [
{
text: "Ok",
"class": 'OKButtonClass btn btn-large btn-primary',
click: function() {
jQuery('#tutor_email_noti').val('1');
jQuery('#LessonAddIndividualstudentForm').submit();
jQuery( this ).dialog( "close" );
}
},
{
text: "Cancel",
"class": 'cancelButtonClass btn btn-large btn-danger',
click: function() {
jQuery('#tutor_email_noti').val('0');
jQuery('#LessonAddIndividualstudentForm').submit();
jQuery( this ).dialog( "close" );
}
}
],
Cancel: function() {
jQuery('#tutor_email_noti').val('0');
jQuery( this ).dialog( "close" );
}
})
}
}
],
Cancel: function() {
jQuery('#tutor_email_noti').val('0');
jQuery( this ).dialog( "close" );
}
})
}else if(LessonScheduleMonthly==true){
jQuery( "#notification_msg_msg_monthely" ).dialog({
resizable: false,
dialogClass: "notification_popup",
height:260,
width:'auto',
title: "SMS Notification",
closeText: "X",
modal: true,
buttons: [
{
text: "Ok",
"class": 'OKButtonClass btn btn-large btn-primary',
click: function() {
var ms = jQuery('#noti_msg_monthely').val();
jQuery('#message_text').val(ms);
jQuery( this ).dialog( "close" );
jQuery( "#notification_tutor" ).dialog({
resizable: false,
dialogClass: "notification_popup",
height:260,
width:'auto',
title: "Email Notification",
closeText: "X",
modal: true,
buttons: [
{
text: "Ok",
"class": 'OKButtonClass btn btn-large btn-primary',
click: function() {
jQuery('#tutor_email_noti').val('1');
jQuery('#LessonAddIndividualstudentForm').submit();
jQuery( this ).dialog( "close" );
}
},
{
text: "Cancel",
"class": 'cancelButtonClass btn btn-large btn-danger',
click: function() {
jQuery('#tutor_email_noti').val('0');
jQuery('#LessonAddIndividualstudentForm').submit();
jQuery( this ).dialog( "close" );
}
}
],
Cancel: function() {
jQuery( this ).dialog( "close" );
}
})
}
},
{
text: "Cancel",
"class": 'cancelButtonClass btn btn-large btn-danger',
click: function() {
jQuery('#message').val('0');
jQuery('#message_text').val(' ');
jQuery( this ).dialog( "close" );
jQuery( "#notification_tutor" ).dialog({
resizable: false,
dialogClass: "notification_popup",
height:250,
width:'auto',
title: "Email Notification",
closeText: "X",
modal: true,
buttons: [
{
text: "Ok",
"class": 'OKButtonClass btn btn-large btn-primary',
click: function() {
jQuery('#tutor_email_noti').val('1');
jQuery('#LessonAddIndividualstudentForm').submit();
jQuery( this ).dialog( "close" );
}
},
{
text: "Cancel",
"class": 'cancelButtonClass btn btn-large btn-danger',
click: function() {
jQuery('#tutor_email_noti').val('0');
jQuery('#LessonAddIndividualstudentForm').submit();
jQuery( this ).dialog( "close" );
}
}
],
Cancel: function() {
jQuery('#tutor_email_noti').val('0');
jQuery( this ).dialog( "close" );
}
})
}
}
],
Cancel: function() {
jQuery('#tutor_email_noti').val('0');
jQuery( this ).dialog( "close" );
}
})
}else if(LessonScheduleYearly==true){
jQuery( "#notification_msg_msg_yearly" ).dialog({
resizable: false,
dialogClass: "notification_popup",
height:260,
width:'auto',
title: "SMS Notification",
closeText: "X",
modal: true,
buttons: [
{
text: "Ok",
"class": 'OKButtonClass btn btn-large btn-primary',
click: function() {
var ms = jQuery('#noti_msg_yearly').val();
jQuery('#message_text').val(ms);
jQuery( this ).dialog( "close" );
jQuery( "#notification_tutor" ).dialog({
resizable: false,
dialogClass: "notification_popup",
height:260,
width:'auto',
title: "Email Notification",
closeText: "X",
modal: true,
buttons: [
{
text: "Ok",
"class": 'OKButtonClass btn btn-large btn-primary',
click: function() {
jQuery('#tutor_email_noti').val('1');
jQuery('#LessonAddIndividualstudentForm').submit();
jQuery( this ).dialog( "close" );
}
},
{
text: "Cancel",
"class": 'cancelButtonClass btn btn-large btn-danger',
click: function() {
jQuery('#tutor_email_noti').val('0');
jQuery('#LessonAddIndividualstudentForm').submit();
jQuery( this ).dialog( "close" );
}
}
],
Cancel: function() {
jQuery( this ).dialog( "close" );
}
})
}
},
{
text: "Cancel",
"class": 'cancelButtonClass btn btn-large btn-danger',
click: function() {
jQuery('#message').val('0');
jQuery('#message_text').val(' ');
jQuery( this ).dialog( "close" );
jQuery( "#notification_tutor" ).dialog({
resizable: false,
dialogClass: "notification_popup",
height:250,
width:'auto',
title: "Email Notification",
closeText: "X",
modal: true,
buttons: [
{
text: "Ok",
"class": 'OKButtonClass btn btn-large btn-primary',
click: function() {
jQuery('#tutor_email_noti').val('1');
jQuery('#LessonAddIndividualstudentForm').submit();
jQuery( this ).dialog( "close" );
}
},
{
text: "Cancel",
"class": 'cancelButtonClass btn btn-large btn-danger',
click: function() {
jQuery('#tutor_email_noti').val('0');
jQuery('#LessonAddIndividualstudentForm').submit();
jQuery( this ).dialog( "close" );
}
}
],
Cancel: function() {
jQuery('#tutor_email_noti').val('0');
jQuery( this ).dialog( "close" );
}
})
}
}
],
Cancel: function() {
jQuery('#tutor_email_noti').val('0');
jQuery( this ).dialog( "close" );
}
})
}else{
jQuery( "#notification_msg_msg_oneoff" ).dialog({
resizable: false,
dialogClass: "notification_popup",
height:260,
width:'auto',
title: "SMS Notification",
closeText: "X",
modal: true,
buttons: [
{
text: "Ok",
"class": 'OKButtonClass btn btn-large btn-primary',
click: function() {
var ms = jQuery('#noti_msg_oneoff').val();
jQuery('#message_text').val(ms);
jQuery( this ).dialog( "close" );
jQuery( "#notification_tutor" ).dialog({
resizable: false,
dialogClass: "notification_popup",
height:260,
width:'auto',
title: "Email Notification",
closeText: "X",
modal: true,
buttons: [
{
text: "Ok",
"class": 'OKButtonClass btn btn-large btn-primary',
click: function() {
jQuery('#tutor_email_noti').val('1');
jQuery('#LessonAddIndividualstudentForm').submit();
jQuery( this ).dialog( "close" );
}
},
{
text: "Cancel",
"class": 'cancelButtonClass btn btn-large btn-danger',
click: function() {
jQuery('#tutor_email_noti').val('0');
jQuery('#LessonAddIndividualstudentForm').submit();
jQuery( this ).dialog( "close" );
}
}
],
Cancel: function() {
jQuery( this ).dialog( "close" );
}
})
}
},
{
text: "Cancel",
"class": 'cancelButtonClass btn btn-large btn-danger',
click: function() {
jQuery('#message').val('0');
jQuery('#message_text').val(' ');
jQuery( this ).dialog( "close" );
jQuery( "#notification_tutor" ).dialog({
resizable: false,
dialogClass: "notification_popup",
height:250,
width:'auto',
title: "Email Notification",
closeText: "X",
modal: true,
buttons: [
{
text: "Ok",
"class": 'OKButtonClass btn btn-large btn-primary',
click: function() {
jQuery('#tutor_email_noti').val('1');
jQuery('#LessonAddIndividualstudentForm').submit();
jQuery( this ).dialog( "close" );
}
},
{
text: "Cancel",
"class": 'cancelButtonClass btn btn-large btn-danger',
click: function() {
jQuery('#tutor_email_noti').val('0');
jQuery('#LessonAddIndividualstudentForm').submit();
jQuery( this ).dialog( "close" );
}
}
],
Cancel: function() {
jQuery('#tutor_email_noti').val('0');
jQuery( this ).dialog( "close" );
}
})
}
}
],
Cancel: function() {
jQuery('#tutor_email_noti').val('0');
jQuery( this ).dialog( "close" );
}
})
}
//////////////=========
}
},
{
text: "Cancel",
"class": 'cancelButtonClass btn btn-large btn-danger',
click: function() {
jQuery('#tutor_email_noti').val('0');
jQuery('#message').val('0');
jQuery('#message_text').val(' ');
jQuery('#LessonAddIndividualstudentForm').submit();
jQuery( this ).dialog( "close" );
}
}
],
Cancel: function() {
jQuery( this ).dialog( "close" );
}
});
//}else{
// return false;
//}
}else{
if(confirm("Availability Does Not Match Do you want to continue?")){
event.preventDefault();
jQuery( "#notification_msg" ).dialog({
resizable: false,
dialogClass: "notification_popup",
height:150,
width:'auto',
title: "SMS Notification",
closeText: "X",
modal: true,
buttons: [
{
text: "Ok",
"class": 'OKButtonClass btn btn-large btn-primary',
click: function() {
jQuery('#message').val('1');
jQuery( this ).dialog( "close" );
/////////===========
LessonScheduleRec=document.getElementById('LessonScheduleRec').checked;
LessonScheduleMonthly=document.getElementById('LessonScheduleMonthly').checked;
LessonScheduleYearly=document.getElementById('LessonScheduleYearly').checked;
if(LessonScheduleRec==true){
jQuery( "#notification_msg_msg" ).dialog({
resizable: false,
dialogClass: "notification_popup",
height:260,
width:'auto',
title: "SMS Notification",
closeText: "X",
modal: true,
buttons: [
{
text: "Ok",
"class": 'OKButtonClass btn btn-large btn-primary',
click: function() {
var ms = jQuery('#noti_msg_schedual').val();
jQuery('#message_text').val(ms);
jQuery( this ).dialog( "close" );
jQuery( "#notification_tutor" ).dialog({
resizable: false,
dialogClass: "notification_popup",
height:260,
width:'auto',
title: "Email Notification",
closeText: "X",
modal: true,
buttons: [
{
text: "Ok",
"class": 'OKButtonClass btn btn-large btn-primary',
click: function() {
jQuery('#tutor_email_noti').val('1');
jQuery('#LessonAddIndividualstudentForm').submit();
jQuery( this ).dialog( "close" );
}
},
{
text: "Cancel",
"class": 'cancelButtonClass btn btn-large btn-danger',
click: function() {
jQuery('#tutor_email_noti').val('0');
jQuery('#LessonAddIndividualstudentForm').submit();
jQuery( this ).dialog( "close" );
}
}
],
Cancel: function() {
jQuery( this ).dialog( "close" );
}
})
}
},
{
text: "Cancel",
"class": 'cancelButtonClass btn btn-large btn-danger',
click: function() {
jQuery('#message').val('0');
jQuery('#message_text').val(' ');
jQuery( this ).dialog( "close" );
jQuery( "#notification_tutor" ).dialog({
resizable: false,
dialogClass: "notification_popup",
height:250,
width:'auto',
title: "Email Notification",
closeText: "X",
modal: true,
buttons: [
{
text: "Ok",
"class": 'OKButtonClass btn btn-large btn-primary',
click: function() {
jQuery('#tutor_email_noti').val('1');
jQuery('#LessonAddIndividualstudentForm').submit();
jQuery( this ).dialog( "close" );
}
},
{
text: "Cancel",
"class": 'cancelButtonClass btn btn-large btn-danger',
click: function() {
jQuery('#tutor_email_noti').val('0');
jQuery('#LessonAddIndividualstudentForm').submit();
jQuery( this ).dialog( "close" );
}
}
],
Cancel: function() {
jQuery('#tutor_email_noti').val('0');
jQuery( this ).dialog( "close" );
}
})
}
}
],
Cancel: function() {
jQuery('#tutor_email_noti').val('0');
jQuery( this ).dialog( "close" );
}
})
}else if(LessonScheduleMonthly==true){
jQuery( "#notification_msg_msg_monthely" ).dialog({
resizable: false,
dialogClass: "notification_popup",
height:260,
width:'auto',
title: "SMS Notification",
closeText: "X",
modal: true,
buttons: [
{
text: "Ok",
"class": 'OKButtonClass btn btn-large btn-primary',
click: function() {
var ms = jQuery('#noti_msg_monthely').val();
jQuery('#message_text').val(ms);
jQuery( this ).dialog( "close" );
jQuery( "#notification_tutor" ).dialog({
resizable: false,
dialogClass: "notification_popup",
height:260,
width:'auto',
title: "Email Notification",
closeText: "X",
modal: true,
buttons: [
{
text: "Ok",
"class": 'OKButtonClass btn btn-large btn-primary',
click: function() {
jQuery('#tutor_email_noti').val('1');
jQuery('#LessonAddIndividualstudentForm').submit();
jQuery( this ).dialog( "close" );
}
},
{
text: "Cancel",
"class": 'cancelButtonClass btn btn-large btn-danger',
click: function() {
jQuery('#tutor_email_noti').val('0');
jQuery('#LessonAddIndividualstudentForm').submit();
jQuery( this ).dialog( "close" );
}
}
],
Cancel: function() {
jQuery( this ).dialog( "close" );
}
})
}
},
{
text: "Cancel",
"class": 'cancelButtonClass btn btn-large btn-danger',
click: function() {
jQuery('#message').val('0');
jQuery('#message_text').val(' ');
jQuery( this ).dialog( "close" );
jQuery( "#notification_tutor" ).dialog({
resizable: false,
dialogClass: "notification_popup",
height:250,
width:'auto',
title: "Email Notification",
closeText: "X",
modal: true,
buttons: [
{
text: "Ok",
"class": 'OKButtonClass btn btn-large btn-primary',
click: function() {
jQuery('#tutor_email_noti').val('1');
jQuery('#LessonAddIndividualstudentForm').submit();
jQuery( this ).dialog( "close" );
}
},
{
"class": 'cancelButtonClass btn btn-large btn-danger',
click: function() {
jQuery('#tutor_email_noti').val('0');
jQuery('#LessonAddIndividualstudentForm').submit();
jQuery( this ).dialog( "close" );
}
}
],
Cancel: function() {
jQuery('#tutor_email_noti').val('0');
jQuery( this ).dialog( "close" );
}
})
}
}
],
Cancel: function() {
jQuery('#tutor_email_noti').val('0');
jQuery( this ).dialog( "close" );
}
})
}else if(LessonScheduleYearly==true){
jQuery( "#notification_msg_msg_yearly" ).dialog({
resizable: false,
dialogClass: "notification_popup",
height:260,
width:'auto',
title: "SMS Notification",
closeText: "X",
modal: true,
buttons: [
{
text: "Ok",
"class": 'OKButtonClass btn btn-large btn-primary',
click: function() {
var ms = jQuery('#noti_msg_yearly').val();
jQuery('#message_text').val(ms);
jQuery( this ).dialog( "close" );
jQuery( "#notification_tutor" ).dialog({
resizable: false,
dialogClass: "notification_popup",
height:260,
width:'auto',
title: "Email Notification",
closeText: "X",
modal: true,
buttons: [
{
text: "Ok",
"class": 'OKButtonClass btn btn-large btn-primary',
click: function() {
jQuery('#tutor_email_noti').val('1');
jQuery('#LessonAddIndividualstudentForm').submit();
jQuery( this ).dialog( "close" );
}
},
{
text: "Cancel",
"class": 'cancelButtonClass btn btn-large btn-danger',
click: function() {
jQuery('#tutor_email_noti').val('0');
jQuery('#LessonAddIndividualstudentForm').submit();
jQuery( this ).dialog( "close" );
}
}
],
Cancel: function() {
jQuery( this ).dialog( "close" );
}
})
}
},
{
text: "Cancel",
"class": 'cancelButtonClass btn btn-large btn-danger',
click: function() {
jQuery('#message').val('0');
jQuery('#message_text').val(' ');
jQuery( this ).dialog( "close" );
jQuery( "#notification_tutor" ).dialog({
resizable: false,
dialogClass: "notification_popup",
height:250,
width:'auto',
title: "Email Notification",
closeText: "X",
modal: true,
buttons: [
{
text: "Ok",
"class": 'OKButtonClass btn btn-large btn-primary',
click: function() {
jQuery('#tutor_email_noti').val('1');
jQuery('#LessonAddIndividualstudentForm').submit();
jQuery( this ).dialog( "close" );
}
},
{
text: "Cancel",
"class": 'cancelButtonClass btn btn-large btn-danger',
click: function() {
jQuery('#tutor_email_noti').val('0');
jQuery('#LessonAddIndividualstudentForm').submit();
jQuery( this ).dialog( "close" );
}
}
],
Cancel: function() {
jQuery('#tutor_email_noti').val('0');
jQuery( this ).dialog( "close" );
}
})
}
}
],
Cancel: function() {
jQuery('#tutor_email_noti').val('0');
jQuery( this ).dialog( "close" );
}
})
}else{
jQuery( "#notification_msg_msg_oneoff" ).dialog({
resizable: false,
dialogClass: "notification_popup",
height:260,
width:'auto',
title: "SMS Notification",
closeText: "X",
modal: true,
buttons: [
{
text: "Ok",
"class": 'OKButtonClass btn btn-large btn-primary',
click: function() {
var ms = jQuery('#noti_msg_oneoff').val();
jQuery('#message_text').val(ms);
jQuery( this ).dialog( "close" );
jQuery( "#notification_tutor" ).dialog({
resizable: false,
dialogClass: "notification_popup",
height:260,
width:'auto',
title: "Email Notification",
closeText: "X",
modal: true,
buttons: [
{
text: "Ok",
"class": 'OKButtonClass btn btn-large btn-primary',
click: function() {
jQuery('#tutor_email_noti').val('1');
jQuery('#LessonAddIndividualstudentForm').submit();
jQuery( this ).dialog( "close" );
}
},
{
text: "Cancel",
"class": 'cancelButtonClass btn btn-large btn-danger',
click: function() {
jQuery('#tutor_email_noti').val('0');
jQuery('#LessonAddIndividualstudentForm').submit();
jQuery( this ).dialog( "close" );
}
}
],
Cancel: function() {
jQuery( this ).dialog( "close" );
}
})
}
},
{
text: "Cancel",
"class": 'cancelButtonClass btn btn-large btn-danger',
click: function() {
jQuery('#message').val('0');
jQuery('#message_text').val(' ');
jQuery( this ).dialog( "close" );
jQuery( "#notification_tutor" ).dialog({
resizable: false,
dialogClass: "notification_popup",
height:250,
width:'auto',
title: "Email Notification",
closeText: "X",
modal: true,
buttons: [
{
text: "Ok",
"class": 'OKButtonClass btn btn-large btn-primary',
click: function() {
jQuery('#tutor_email_noti').val('1');
jQuery('#LessonAddIndividualstudentForm').submit();
jQuery( this ).dialog( "close" );
}
},
{
text: "Cancel",
"class": 'cancelButtonClass btn btn-large btn-danger',
click: function() {
jQuery('#tutor_email_noti').val('0');
jQuery('#LessonAddIndividualstudentForm').submit();
jQuery( this ).dialog( "close" );
}
}
],
Cancel: function() {
jQuery('#tutor_email_noti').val('0');
jQuery( this ).dialog( "close" );
}
})
}
}
],
Cancel: function() {
jQuery('#tutor_email_noti').val('0');
jQuery( this ).dialog( "close" );
}
})
}
//////////////=========
}
},
{
text: "Cancel",
"class": 'cancelButtonClass btn btn-large btn-danger',
click: function() {
jQuery('#tutor_email_noti').val('0');
jQuery('#message').val('0');
jQuery('#message_text').val(' ');
jQuery('#LessonAddIndividualstudentForm').submit();
jQuery( this ).dialog( "close" );
}
}
],
Cancel: function() {
jQuery( this ).dialog( "close" );
}
});
}else{
//alert("Availability Does Not Match please check availability");
return false;
}
}
/// $('#tutoravaliablityresposnse').html(msg);
}
});