<div class="panel panel-custom">
    <div class="modal-body form-horizontal">
        <div class="form-group">
            <div class="col-lg-12">
                
				<?= form_input_group('my_password', lang('password'), '', 'password', true); ?>

            </div>
        </div>
        <div class="modal-footer mt-4">
            <button type="submit" id="check_current_password" class="btn btn-primary btn-md"><?= lang('update') ?></button>
        </div>
    </div>
</div>
<script>
    $(document).ready(function () {

        setTimeout(function () {
            $('#show_password').fadeOut('fast');
        }, 10000);

        $('#check_current_password').on('click', function () {
            var my_password = $('input[name="my_password"]').val();
            var encrypt_password = '<?= $password ?>';
            var ids = '<?= $ids ?>';
            $.ajax({
                url: base_url + "admin/common/check_current_password/",
                type: "POST",
                data: {
                    name: my_password,
                    encrypt_password: encrypt_password,
                },
                dataType: 'json',
                success: function (res) {
                    console.log(res);
                    if (res.error) {
                        if (ids) {
                            handle_error("#hosting_password_" + ids, res.error);
                        } else {
                            handle_error("#hosting_password", res.error);
                        }
//                        disable_button("#" + btn);
                        return;
                    } else {
                        if (ids) {
                            remove_error("#hosting_password_" + ids);
                            handle_error("#show_password" + ids, res.password);
                        } else {
                            remove_error("#hosting_password");
                            handle_error("#show_password", res.password);
                        }
//                        disable_remove("#" + btn);
                        $('#myModal').modal('hide');
                        return;
                    }
                }
            });
        });
    });
</script>
