HTML/js/ai-admin.js
// check if member already has a card
check if member already has a card
check if member already has a card
function checkCard()
{
    let options = {};
    let member_list;
    options.registry = $('#registryName3').find(':selected').text();
    $('#admin-forms').empty();
    $('#messages').empty();
    $('#messages').append(formatMessage('Getting Member List for '+options.registry+'.'));
    $.when($.post('/composer/admin/getMembers', options),$.get('removeMember.html')).done(function (_results, _page)
    {
        $('#admin-forms').append(_page[0]);
        $('#member_type').append(options.registry);
        member_list = _results[0].members;
        for (let each in _results[0].members)
        {(function(_idx, _arr){
            $('#member_list').append('<option value="'+_arr[_idx].id+'">' +_arr[_idx].id+'</option>');
        })(each, _results[0].members);
        }
        let first = $('#member_list').find(':first').text();
        displayMember(first, member_list);
        let _cancel = $('#cancel');
        let _submit = $('#submit');
        _cancel.on('click', function (){$('#admin-forms').empty();});
        _submit.on('click', function(){
            options.id = $('#member_list').find(':selected').text();
            $('#messages').append(formatMessage('starting check member id request.'));
            $.when($.post('/composer/admin/checkCard', options)).done(function (_results)
                { let _msg = ((_results.result === 'success') ? _results.card : _results.message);
                $('#messages').append(formatMessage(_msg));});
        });
        $('#member_list').on('change',function()
            { let id = $('#member_list').find(':selected').text();
            displayMember(id, member_list);
        });
    });
}
function checkCard ( ) { let options = { } ; let member_list ; options . registry = $ ( '#registryName3' ) . find ( ':selected' ) . text ( ) ; $ ( '#admin-forms' ) . empty ( ) ; $ ( '#messages' ) . empty ( ) ; $ ( '#messages' ) . append ( formatMessage ( 'Getting Member List for ' + options . registry + '.' ) ) ; $ . when ( $ . post ( '/composer/admin/getMembers' , options ) , $ . get ( 'removeMember.html' ) ) . done ( function ( _results , _page ) { $ ( '#admin-forms' ) . append ( _page [ 0 ] ) ; $ ( '#member_type' ) . append ( options . registry ) ; member_list = _results [ 0 ] . members ; for ( let each in _results [ 0 ] . members ) { ( function ( _idx , _arr ) { $ ( '#member_list' ) . append ( '<option value="' + _arr [ _idx ] . id + '">' + _arr [ _idx ] . id + '</option>' ) ; } ) ( each , _results [ 0 ] . members ) ; } let first = $ ( '#member_list' ) . find ( ':first' ) . text ( ) ; displayMember ( first , member_list ) ; let _cancel = $ ( '#cancel' ) ; let _submit = $ ( '#submit' ) ; _cancel . on ( 'click' , function ( ) { $ ( '#admin-forms' ) . empty ( ) ; } ) ; _submit . on ( 'click' , function ( ) { options . id = $ ( '#member_list' ) . find ( ':selected' ) . text ( ) ; $ ( '#messages' ) . append ( formatMessage ( 'starting check member id request.' ) ) ; $ . when ( $ . post ( '/composer/admin/checkCard' , options ) ) . done ( function ( _results ) { let _msg = ( ( _results . result === 'success' ) ? _results . card : _results . message ) ; $ ( '#messages' ) . append ( formatMessage ( _msg ) ) ; } ) ; } ) ; $ ( '#member_list' ) . on ( 'change' , function ( ) { let id = $ ( '#member_list' ) . find ( ':selected' ) . text ( ) ; displayMember ( id , member_list ) ; } ) ; } ) ; }
check if member already has a card
check if member already has a card
//updatePage('removeMember');