
<script>
function OpenUpdateUserDetailsButtonHtml(){return HomeMenuButtons('assets/edituser.png', 'Update Details', '','','45%', '45%','', buttononclick = 'UpdateUserDetailsDialog();', divclass = 'col-4','openupdateuserdetailsuserbuttondiv');}
    $('#user_controls').append(OpenUpdateUserDetailsButtonHtml());

    function UpdateUserNow(response) {
const usernumber=getElementvalue('update-m-number');
const usernick = getElementvalue('update-nick');

function TrytoUpdateUserDetails(response){
const modalsuccess = ModalQuickDismiss('Success',modalbody='User Details Updated.',modalid='UpdateUserDetailsSuccess',modaltohide='UpdateUserDetailsDialog',ReloadPage,response);
const modalfailed =  ModalQuickDismiss('Failed',modalbody='Unable to Update User Details.<br><br>'+response,modalid='UpdateUserDetailsFailed',modaltohide='',functiontodo='',response!==true);
}
        

        AjaxDo('?admin/user/details/update', { user_target: currenttarget, user_number: usernumber, user_nick: usernick }, TrytoUpdateUserDetails, null, reqtype = 'POST');
    }


    function UpdateUserDetailsDialog() {
        const  usernumber = getElementhtml('User_phonenumber');
        const usernick = getElementhtml('User_nick');
        let modalbody = dualcolrow('Mobile Number',textformcontrol('update-m-number','','',placeholder='09xxxxxxxxx',usernumber))+'<br>'+
                        dualcolrow('Nickname',textformcontrol('update-nick','','','',usernick));

        let modalfooter = `<button type="button" class="btn btn-warning" data-dismiss="modal">Cancel</button>
                           <button type="button" class="btn btn-danger" onclick="UpdateUserNow()" id="">Continue</button>`;

        ModalContinueCancel("UpdateUserDetailsDialog",'Update User',modalbody,'UpdateUserNow();');

       // CreateAndShowModal(modalid, modaltitle, modalbody, modalfooter, modalfooterclose = false, topclosebutton = true, modalbodyclass = 'modal-body', modalheaderclass = 'modal-header');
    }

    function EnableUser() {

let modalid = "EnableUserConfirmationDialog";
let modaltitle = 'Enable User?';
let modalbody = 'Are you sure you want to Enable user?<br> The user would have access his/her account?';

let modalfooter = `<button type="button" class="btn btn-warning" data-dismiss="modal">Cancel</button>
<button type="button" class="btn btn-danger" onclick="EnableUserNow()" id="">Continue</button>`;

CreateAndShowModal(modalid, modaltitle, modalbody, modalfooter, modalfooterclose = false, topclosebutton = true, modalbodyclass = 'modal-body', modalheaderclass = 'modal-header');
}



    $(document).ready(function () {
  

   



    });



</script>

