Mayoor School Of Music

Loading.. function snackBar() { // Get the snackbar DIV var x = document.getElementById("snackbar"); // Add the "show" class to DIV x.className = "show"; // After 3 seconds, remove the show class from DIV setTimeout(function(){ x.className = x.className.replace("show", ""); }, 5000); } function ajaxService(obj,callback) { $.ajax({ url: obj.url, type: obj.type, data: obj.data, contentType: (obj.contentType)?obj.contentType:"application/x-www-form-urlencoded", cache: obj.cache, processData: obj.processData, beforeSend: function () { $('#snackbar').empty().append(` Loading...`); $('#snackbar').addClass('show'); }, success: function (res) { if(res){ $('#snackbar').removeClass('show'); callback(null,res); } }, }); } $(document).ajaxComplete(function(event,xhr,options){ if(xhr.status===403){ $('#snackbar').empty().append('Your session expired! '+xhr.responseJSON.message); snackBar(); return false; }if(xhr.status===409){ $('#snackbar').empty().append(xhr.responseJSON.message); snackBar(); return false; } }); function deleteUser(id,input) { console.log("id",id); let confrm = confirm("Are you sure you want to delete this?"); if(confrm){ let obj={ url: 'https://lms.mayoorschoolofmusic.com/deleteUser', type : 'POST', data:{ "id" : id}, cache: false, processData: true, }; ajaxService(obj,function (err,res) { if(err){ $('#snackbar').empty().append(err); snackBar(); }else{ $('#snackbar').empty().append(res.message); snackBar(); $(input).parents('tr').remove(); } }); } } function deleteCourse(id,input) { let confrm = confirm("Are you sure you want to delete this? \nAll associated classes and scheduled class will be deleted"); if(confrm){ let obj={ url: 'https://lms.mayoorschoolofmusic.com/deleteCourse', type : 'POST', data:{ "id" : id}, cache: false, processData: true, }; ajaxService(obj,function (err,res) { if(err){ $('#snackbar').empty().append(err); snackBar(); }else{ $('#snackbar').empty().append(res.message); snackBar(); $(input).parents('.col-md-3').remove(); } }); } } function assignUserListModel(id,input) { let obj={ url: 'https://lms.mayoorschoolofmusic.com/assignUserListModel', type : 'GET', data:{ "id" : id}, cache: false, processData: true, }; ajaxService(obj,function (err,res) { if(err){ $('#snackbar').empty().append(err); snackBar(); }else{ $('.modelAppend').html(res); $('#primaryModal').modal('show'); $('#snackbar').removeClass('show'); } }); } $(document).on('click','.editScheduledCls',function (e) { let classData = $(this).data('fields'); if(classData){ $.ajax({ url: '/editScheduledModal', type: "GET", data: classData, contentType: false, cache: false, // processData: false, beforeSend: function () { $('#snackbar').addClass('show'); }, success: function (res) { $('.modelAppend').html(res); $('#primaryModal').modal('show'); $('#snackbar').removeClass('show'); } }); } }); function deleteScheduledCls(input,id) { console.log("id",id); let confrm = confirm("Are you sure you want to delete this?"); if(confrm){ let obj={ url: 'https://lms.mayoorschoolofmusic.com/deleteScheduledCls', type : 'POST', data:{ "id" : id}, cache: false, processData: true, }; ajaxService(obj,function (err,res) { if(err){ $('#snackbar').empty().append(err); snackBar(); }else{ $('#snackbar').empty().append(res.message); snackBar(); $(input).parents('tr').remove(); } }); } } function deleteSingleRecordingMeeting(meetingId,fileId) { console.log(meetingId,fileId); let confrm = confirm("Are you sure you want to delete this recording?"); if(confrm){ let obj={ url: 'https://lms.mayoorschoolofmusic.com/deleteRecordingMeeting', type : 'GET', data:{ "meetingId" : meetingId,"fileId":fileId}, cache: false, processData: true, }; ajaxService(obj,function (err,res) { if(err){ $('#snackbar').empty().append(err); snackBar(); }else{ $('#snackbar').empty().append(res.message); snackBar(); $(input).parents('tr').remove(); } }); } } s="fa fa-spinner fa-spin" style="font-size:24px">