<div class="container-fluid">
    <div class="block-header">
        <h2>Tools > Auto Friend </h2>
    </div>
    <div class="row">
        <div class="col-lg-6 col-md-6">
            <div class="card">
                <div class="header">
                    <h2>Auto Friend</h2>
                    <br>
                    <small>When a user creates a new account, choose which users you would like to get auto friended / followed.</small>
                </div>
                <div class="body">
                    <div class="form-group form-float">
                        <div class="form-line">
                            <input type="text" id="users" name="users" class="form-control" value="<?php echo $music->config->auto_friend_users; ?>">
                            <label class="form-label">Username(s), sperated by a comma (,)</label>
                        </div>
                    </div>
                    <div class="clearfix"></div><br>
                    <small>This process might take some time, you can check for your site changes after few minutes.</small><br>
                    <input type="hidden" name="hash_id" value="<?php echo createMainSession();?>">
                    <button type="submit" class="btn btn-danger waves-effect waves-light m-t-20" id="users-btn">Save</button>
                </div>
            </div>
        </div>
        <div class="clearfix"></div>
    </div>
</div>
<script>
    $(document).on('click', '#users-btn', function(event) {
        event.preventDefault();
        $(this).text('Please wait..');
        $.get('{{CONFIG ajax_url}}/ap/auto_friend', { users: $('#users').val()}, function(data, textStatus, xhr) {
            $('#users-btn').text('Saved!');
            setTimeout(function () {
                $('#users-btn').text('Save');
            }, 4000);
        });
    });
</script>