HTML/js/ai-admin.js
// add a member to a registry
add a member to a registry
add a member to a registry
function addMember()
{
    $.when($.get('createMember.html')).done(function (_page)
    {
        $('#admin-forms').empty();
        $('#admin-forms').append(_page);
        let _cancel = $('#cancel');
        let _submit = $('#submit');
        $('#messages').empty();
        $('#messages').append('<br/>Please fill in add member form.');
        _cancel.on('click', function (){$('#admin-forms').empty();});
        _submit.on('click', function(){
            $('#messages').append('<br/>starting add member request.');
            let options = {};
            options.companyName = $('#companyName').val();
            options.id = $('#participant_id').val();
            options.type = $('#member_type').find(':selected').text();
            $.when($.post('/composer/admin/addMember', options)).done(function(_res)
            { $('#messages').append(formatMessage(_res)); });
        });
    });
}
function addMember ( ) { $ . when ( $ . get ( 'createMember.html' ) ) . done ( function ( _page ) { $ ( '#admin-forms' ) . empty ( ) ; $ ( '#admin-forms' ) . append ( _page ) ; let _cancel = $ ( '#cancel' ) ; let _submit = $ ( '#submit' ) ; $ ( '#messages' ) . empty ( ) ; $ ( '#messages' ) . append ( '<br/>Please fill in add member form.' ) ; _cancel . on ( 'click' , function ( ) { $ ( '#admin-forms' ) . empty ( ) ; } ) ; _submit . on ( 'click' , function ( ) { $ ( '#messages' ) . append ( '<br/>starting add member request.' ) ; let options = { } ; options . companyName = $ ( '#companyName' ) . val ( ) ; options . id = $ ( '#participant_id' ) . val ( ) ; options . type = $ ( '#member_type' ) . find ( ':selected' ) . text ( ) ; $ . when ( $ . post ( '/composer/admin/addMember' , options ) ) . done ( function ( _res ) { $ ( '#messages' ) . append ( formatMessage ( _res ) ) ; } ) ; } ) ; } ) ; }
add a member to a registry
add a member to a registry
//updatePage('createMember');