/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
// delete moot court functionlity
jQuery('.delete_mootcourtId').on('click', function () {
var memberMootCourtDeleteID = jQuery(this).data('delmootcourtid');
jQuery('#combinemootcourt').data("yesdelmootcourt", memberMootCourtDeleteID);
});
jQuery(document).on('click', 'button.delete-my-moot-court-info', function () {
var mootcourtID = jQuery(this).data('yesdelmootcourt');
$.ajax({
url: baseurl + "moot-court/deleteProfileMootCourt",
type: 'post',
data: {mootcourtID: mootcourtID},
dataType: 'json',
beforeSend: function () {
jQuery('button.delete-moot-court-info').button('loading');
},
complete: function () {
jQuery('button.delete-my-moot-court-info').button('reset');
jQuery('#delete-moot-court-info').modal('hide');
},
success: function (json) {
jQuery('#mootcourtid' + mootcourtID).html('' + json + '');
setTimeout(function () {
jQuery('#mootcourtid' + mootcourtID).remove()
}, 5000);
}
});
});
// delete moot court functionlity
jQuery('.btn-moot-status').on('click', function () {
var memberMootCourtID = jQuery(this).data('id');
var memberMootCourtStatus = jQuery(this).data('st');
if(memberMootCourtStatus === 1)
{
jQuery('#moot-court-msg').html("Are you sure you want to publish?");
}else if(memberMootCourtStatus === 0){
jQuery('#moot-court-msg').html("Are you sure you want to unpublish?");
}
jQuery('#combinemootcourtsatus').data("yesstatusmootcourt", memberMootCourtID);
jQuery('#combinemootcourtsatus').data("status", memberMootCourtStatus);
});
// published or draft
jQuery(document).on('click','button.update-status-moot-court-info',function(){
var status = jQuery(this).data('status');
var mootcourtID = jQuery(this).data('yesstatusmootcourt');
$.ajax({
url: baseurl+"moot-court/mootCourtStatus",
type: 'post',
data: {mootcourtID:mootcourtID,status:status},
dataType: 'json',
beforeSend: function () {
jQuery('button#combinemootcourtsatus').button('loading');
},
complete: function () {
jQuery('button#combinemootcourtsatus').button('reset');
jQuery('#update-moot-court-info').modal('hide');
},
success: function (json) {
jQuery('#mootcourtid' + mootcourtID).html('' + json + '');
setTimeout(function () {
jQuery('#mootcourtid' + mootcourtID).remove()
}, 5000);
}
});
});