<div class="container-fluid">
    <div class="block-header">
        <h2>Settings > Live Settings</h2>
    </div>
    <!-- Vertical Layout -->
    <div class="row">
        <div class="col-lg-6 col-md-6">
            <div class="card">
                <div class="header">
                    <h2>Live Settings</h2>
                </div>
                <div class="body">
                    <div class="alert alert-success email-settings-alert"></div>
                    <form class="email-settings" method="POST">
                        <label for="live_video">Live Video</label>
                        <div class="form-group">
                            <input type="radio" name="live_video" id="live_video-enabled" value="1" <?php echo ($wo['config']['live_video'] == 1) ? 'checked': '';?>>
                            <label for="live_video-enabled">Enabled</label>
                            <input type="radio" name="live_video" id="live_video-disabled" value="0" <?php echo ($wo['config']['live_video'] == 0) ? 'checked': '';?>>
                            <label for="live_video-disabled" class="m-l-20">Disabled</label>
                        </div>
                        <label for="live_video_save">Save user live streams?</label>
                        <div class="form-group">
                            <input type="radio" name="live_video_save" id="live_video_save-enabled" value="1" <?php echo ($wo['config']['live_video_save'] == 1) ? 'checked': '';?>>
                            <label for="live_video_save-enabled">Enabled</label>
                            <input type="radio" name="live_video_save" id="live_video_save-disabled" value="0" <?php echo ($wo['config']['live_video_save'] == 0) ? 'checked': '';?>>
                            <label for="live_video_save-disabled" class="m-l-20">Disabled</label>
                        </div>
                        <div>
                        	To start using this feature, you'll need to create an account in <a href="https://www.millicast.com/">MilliCast</a>.
                        </div>
                        <br><br>
                        <div class="form-group form-float">
                            <div class="form-line">
                                <input type="text" id="live_token" name="live_token" class="form-control" value="<?php echo $wo['config']['live_token'];?>">
                                <label class="form-label">PUBLISHING TOKEN</label>
                            </div>
                        </div>
                        <div class="form-group form-float">
                            <div class="form-line">
                                <input type="text" id="live_account_id" name="live_account_id" class="form-control" value="<?php echo $wo['config']['live_account_id'];?>">
                                <label class="form-label">ACCOUNT ID</label>
                            </div>
                        </div>
                        <input type="hidden" name="hash_id" value="<?php echo Wo_CreateSession();?>">
                        <button type="submit" class="btn btn-primary m-t-15 waves-effect">Save</button>
                    </form>
                </div>
            </div>
        </div>
        <div class="clearfix"></div>
    </div>
    <!-- #END# Vertical Layout -->
<script>

$(function() {
    var form_email_settings = $('form.email-settings');
    form_email_settings.ajaxForm({
        url: Wo_Ajax_Requests_File() + '?f=admin_setting&s=update_general_setting',
        beforeSend: function() {
            form_email_settings.find('button').text('Please wait..');
        },
        success: function(data) {
            if (data.status == 200) {
                form_email_settings.find('button').text('Save');
                $("html, body").animate({ scrollTop: 0 }, "slow");
                $('.email-settings-alert').html('<i class="fa fa-check"></i> Settings updated successfully');
                setTimeout(function () {
                    $('.email-settings-alert').empty();
                }, 2000);
            }
        }
    });
});
</script>