<div class="container-fluid">
    <div>
        <h3>Push Notifications Settings</h3>
        <nav aria-label="breadcrumb">
            <ol class="breadcrumb">
                <li class="breadcrumb-item">
                    <a href="#">Home</a>
                </li>
                <li class="breadcrumb-item">
                    <a href="#">Settings</a>
                </li>
                <li class="breadcrumb-item active" aria-current="page">Push Notifications Settings</li>
            </ol>
        </nav>
    </div>
    <!-- Vertical Layout -->
    <div class="row">
        <div class="col-lg-6 col-md-6">
            <div class="card">
                <div class="card-body">
                    <h6 class="card-title">Push Notifications Settings</h6>
                    <div class="alert alert-warning">This system allows your script to send push notifications to any application who uses our API.<br> To get started, <a href="https://onesignal.com/" target="_blank">Register Here</a>.</div>
                    <div class="email-settings-alert"></div>
                    <form class="email-settings" method="POST">
                        <label for="push">Push Notifications System</label>
                        <div class="form-group">
                            <div class="form-check form-check-inline">
                                <input class="form-check-input" type="radio" name="push" id="push-enabled" value="1" <?php echo ($music->config->push == 1) ? 'checked': '';?>>
                                <label class="form-check-label" for="push-enabled">Enabled</label>
                            </div>
                            <div class="form-check form-check-inline">
                                <input class="form-check-input" type="radio" name="push" id="push-disabled" value="0" <?php echo ($music->config->push == 0) ? 'checked': '';?>>
                                <label class="form-check-label" for="push-disabled" class="m-l-20">Disabled</label>
                            </div>
                        </div>
                        <br>
                        <!--<label class="form-check-label" for="android_push_messages">Android Push Messages (Push User Messages)</label>-->
                        <!--<div class="form-group">-->
                            <!--<div class="form-check form-check-inline">
                                <input class="form-check-input" type="radio" name="android_push_messages" id="android_push_messages-enabled" value="1" <?php echo ($music->config->android_push_messages == 1) ? 'checked': '';?>>-->
                            <!--<label class="form-check-label" for="android_push_messages-enabled">Enabled</label>-->
                            <!--<div class="form-check form-check-inline">
                                <input class="form-check-input" type="radio" name="android_push_messages" id="android_push_messages-disabled" value="0" <?php echo ($music->config->android_push_messages == 0) ? 'checked': '';?>>-->
                            <!--<label class="form-check-label" for="android_push_messages-disabled" class="m-l-20">Disabled</label>-->
                        <!--</div>-->
                        <!--<br>-->
                        <!--<label class="form-check-label" for="ios_push_messages">IOS Push Messages (Push User Messages)</label>-->
                        <!--<div class="form-group">-->
                            <!--<div class="form-check form-check-inline">
                                <input class="form-check-input" type="radio" name="ios_push_messages" id="ios_push_messages-enabled" value="1" <?php echo ($music->config->ios_push_messages == 1) ? 'checked': '';?>>-->
                            <!--<label class="form-check-label" for="ios_push_messages-enabled">Enabled</label>-->
                            <!--<div class="form-check form-check-inline">
                                <input class="form-check-input" type="radio" name="ios_push_messages" id="ios_push_messages-disabled" value="0" <?php echo ($music->config->ios_push_messages == 0) ? 'checked': '';?>>-->
                            <!--<label class="form-check-label" for="ios_push_messages-disabled" class="m-l-20">Disabled</label>-->
                        <!--</div>-->
                        <!--<br>-->
                        <label for="android_push_native">Android Push Native Site Notifications (Likes, Followed, Comment etc)</label>
                        <div class="form-group">
                            <div class="form-check form-check-inline">
                                <input class="form-check-input" type="radio" name="android_push_native" id="android_push_native-enabled" value="1" <?php echo ($music->config->android_push_native == 1) ? 'checked': '';?>>
                                <label class="form-check-label" for="android_push_native-enabled">Enabled</label>
                            </div>
                            <div class="form-check form-check-inline">
                                <input class="form-check-input" type="radio" name="android_push_native" id="android_push_native-disabled" value="0" <?php echo ($music->config->android_push_native == 0) ? 'checked': '';?>>
                                <label class="form-check-label" for="android_push_native-disabled" class="m-l-20">Disabled</label>
                            </div>
                        </div>
                        <br>
                        <label for="ios_push_native">IOS Push Native Site Notifications (Likes, Followed, Comment etc)</label>
                        <div class="form-group">
                            <div class="form-check form-check-inline">
                                <input class="form-check-input" type="radio" name="ios_push_native" id="ios_push_native-enabled" value="1" <?php echo ($music->config->ios_push_native == 1) ? 'checked': '';?>>
                                <label class="form-check-label" for="ios_push_native-enabled">Enabled</label>
                            </div>
                            <div class="form-check form-check-inline">
                                <input class="form-check-input" type="radio" name="ios_push_native" id="ios_push_native-disabled" value="0" <?php echo ($music->config->ios_push_native == 0) ? 'checked': '';?>>
                                <label class="form-check-label" for="ios_push_native-disabled" class="m-l-20">Disabled</label>
                            </div>
                        </div>
                        <br>

                        <!--<label class="form-check-label" for="web_push">Web Push Notifications (Chrome, Firefox etc..) SSL required</label>-->
                        <!--<div class="form-group">-->
                            <!--<div class="form-check form-check-inline">
                                <input class="form-check-input" type="radio" name="web_push" id="web_push-enabled" value="1" <?php echo ($music->config->web_push == 1) ? 'checked': '';?>>-->
                            <!--<label class="form-check-label" for="web_push-enabled">Enabled</label>-->
                            <!--<div class="form-check form-check-inline">
                                <input class="form-check-input" type="radio" name="web_push" id="web_push-disabled" value="0" <?php echo ($music->config->web_push == 0) ? 'checked': '';?>>-->
                            <!--<label class="form-check-label" for="web_push-disabled" class="m-l-20">Disabled</label>-->
                        <!--</div>-->
                        <!--<br>-->
                        <p class="help-block">Need Help? <a href="https://documentation.onesignal.com/v3.0/docs/setup" target="_blank">Read The Documentation</a></p>
                        <input type="hidden" name="hash_id" value="<?php echo createMainSession();?>">
                        <button type="submit" class="btn btn-primary m-t-15 waves-effect">Save</button>
                    </form>
                </div>
            </div>
        </div>

        <div class="col-lg-6 col-md-6">
            <div class="card">
                <div class="card-body">
                    <h6 class="card-title">Android Push Notifications Settings</h6>
                    <div class="email3-settings-alert"></div>
                    <form class="email3-settings" method="POST">
                        <div class="form-group form-float">
                            <div class="form-line">
                                <label class="form-label">OneSignal APP ID</label>
                                <input type="text" id="android_m_push_id" name="android_m_push_id" class="form-control" value="<?php echo $music->config->android_m_push_id;?>">
                                
                            </div>
                        </div>
                        <div class="form-group form-float">
                            <div class="form-line">
                                <label class="form-label">REST API Key</label>
                                <input type="text" id="android_m_push_key" name="android_m_push_key" class="form-control" value="<?php echo $music->config->android_m_push_key;?>">
                                
                            </div>
                        </div>
                        <input type="hidden" name="hash_id" value="<?php echo createMainSession();?>">
                        <button type="submit" class="btn btn-primary m-t-15 waves-effect">Save</button>
                    </form>
                </div>
            </div>
            <div class="card">
                <div class="card-body">
                    <h6 class="card-title">IOS Global Notifications Settings (Likes, Dislikes, Comments, Follow etc.)</h6>
                    <div class="email5-settings-alert"></div>
                    <form class="email5-settings" method="POST">
                        <div class="form-group form-float">
                            <div class="form-line">
                                <label class="form-label">OneSignal APP ID</label>
                                <input type="text" id="ios_n_push_id" name="ios_n_push_id" class="form-control" value="<?php echo $music->config->ios_n_push_id;?>">
                                
                            </div>
                        </div>
                        <div class="form-group form-float">
                            <div class="form-line">
                                <label class="form-label">REST API Key</label>
                                <input type="text" id="ios_n_push_key" name="ios_n_push_key" class="form-control" value="<?php echo $music->config->ios_n_push_key;?>">
                                
                            </div>
                        </div>
                        <input type="hidden" name="hash_id" value="<?php echo createMainSession();?>">
                        <button type="submit" class="btn btn-primary m-t-15 waves-effect">Save</button>
                    </form>
                </div>
            </div>
        </div>

        <!--<div class="col-lg-6 col-md-6">-->
            <!--<div class="card">-->
                <!--<div class="header">-->
                    <!--<h2>IOS Messenger & Chat Push Notifications Settings</h2><br>-->
                <!--</div>-->
                <!--<div class="card-body">
                <h6 class="card-title">Configure Amazon S3</h6>-->
                    <!--<div class="alert alert-success ios-m-settings-alert"></div>-->
                    <!--<form class="ios-m-settings" method="POST">-->
                        <!--<div class="form-group form-float">-->
                            <!--<div class="form-line">-->
                                <!--<input type="text" id="ios_m_push_id" name="ios_m_push_id" class="form-control" value="<?php echo $music->config->ios_m_push_id;?>">-->
                                <!--<label class="form-label">OneSignal APP ID</label>-->
                            <!--</div>-->
                        <!--</div>-->
                        <!--<div class="form-group form-float">-->
                            <!--<div class="form-line">-->
                                <!--<input type="text" id="ios_m_push_key" name="ios_m_push_key" class="form-control" value="<?php echo $music->config->ios_m_push_key;?>">-->
                                <!--<label class="form-label">REST API Key</label>-->
                            <!--</div>-->
                        <!--</div>-->
                        <!--<input type="hidden" name="hash_id" value="<?php echo createMainSession();?>">-->
                        <!--<button type="submit" class="btn btn-primary m-t-15 waves-effect">Save</button>-->
                    <!--</form>-->
                <!--</div>-->
            <!--</div>-->
        <!--</div>-->

        <!--<div class="col-lg-6 col-md-6">-->
            <!--<div class="card">-->
                <!--<div class="header">-->
                    <!--<h2>Android Global Notifications Settings (Likes, Dislikes, Comments, Follow etc.)</h2><br>-->
                <!--</div>-->
                <!--<div class="card-body">
                <h6 class="card-title">Configure Amazon S3</h6>-->
                    <!--<div class="alert alert-success email2-settings-alert"></div>-->
                    <!--<form class="email2-settings" method="POST">-->
                        <!--<div class="form-group form-float">-->
                            <!--<div class="form-line">-->
                                <!--<input type="text" id="android_n_push_id" name="android_n_push_id" class="form-control" value="<?php echo $music->config->android_n_push_id;?>">-->
                                <!--<label class="form-label">OneSignal APP ID</label>-->
                            <!--</div>-->
                        <!--</div>-->
                        <!--<div class="form-group form-float">-->
                            <!--<div class="form-line">-->
                                <!--<input type="text" id="android_n_push_key" name="android_n_push_key" class="form-control" value="<?php echo $music->config->android_n_push_key;?>">-->
                                <!--<label class="form-label">REST API Key</label>-->
                            <!--</div>-->
                        <!--</div>-->
                        <!--<input type="hidden" name="hash_id" value="<?php echo createMainSession();?>">-->
                        <!--<button type="submit" class="btn btn-primary m-t-15 waves-effect">Save</button>-->
                    <!--</form>-->
                <!--</div>-->
            <!--</div>-->
        <!--</div>-->

        <!--<div class="col-lg-6 col-md-6 pull-left">-->
            <!--<div class="card">-->
                <!--<div class="header">-->
                    <!--<h2>Web Global Notifications Settings (Likes, Dislikes, Comments, Follow etc.)</h2><br>-->
                <!--</div>-->
                <!--<div class="card-body">
                <h6 class="card-title">Configure Amazon S3</h6>-->
                    <!--<div class="alert alert-success email4-settings-alert"></div>-->
                    <!--<form class="email4-settings" method="POST">-->
                        <!--<div class="form-group form-float">-->
                            <!--<div class="form-line">-->
                                <!--<input type="text" id="web_push_id" name="web_push_id" class="form-control" value="<?php echo $music->config->web_push_id;?>">-->
                                <!--<label class="form-label">OneSignal APP ID</label>-->
                            <!--</div>-->
                        <!--</div>-->
                        <!--<div class="form-group form-float">-->
                            <!--<div class="form-line">-->
                                <!--<input type="text" id="web_push_key" name="web_push_key" class="form-control" value="<?php echo $music->config->web_push_key;?>">-->
                                <!--<label class="form-label">REST API Key</label>-->
                            <!--</div>-->
                        <!--</div>-->
                        <!--<input type="hidden" name="hash_id" value="<?php echo createMainSession();?>">-->
                        <!--<button type="submit" class="btn btn-primary m-t-15 waves-effect">Save</button>-->
                    <!--</form>-->
                <!--</div>-->
            <!--</div>-->
        <!--</div>-->


        <div class="clearfix"></div>
    </div>
</div>
    <!-- #END# Vertical Layout -->

<script>

    $(function() {
        var form_email_settings = $('form.email-settings');
        form_email_settings.ajaxForm({
            url: '{{CONFIG ajax_url}}/ap/save-settings',
            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('<div class="alert alert-success"><i class="fa fa-check"></i> Connection successfully established!</div>');
                    setTimeout(function () {
                        $('.email-settings-alert').empty();
                    }, 2000);
                }
            }
        });

        var form_email2_settings = $('form.email2-settings');
        form_email2_settings.ajaxForm({
            url: '{{CONFIG ajax_url}}/ap/save-settings',
            beforeSend: function() {
                form_email2_settings.find('button').text('Please wait..');
            },
            success: function(data) {
                if (data.status == 200) {
                    form_email2_settings.find('button').text('Save');
                    $("html, body").animate({ scrollTop: 0 }, "slow");
                    $('.email2-settings-alert').html('<div class="alert alert-success"><i class="fa fa-check"></i> Connection successfully established!</div>');
                    setTimeout(function () {
                        $('.email2-settings-alert').empty();
                    }, 2000);
                }
            }
        });

        var form_email3_settings = $('form.email3-settings');
        form_email3_settings.ajaxForm({
            url: '{{CONFIG ajax_url}}/ap/save-settings',
            beforeSend: function() {
                form_email3_settings.find('button').text('Please wait..');
            },
            success: function(data) {
                if (data.status == 200) {
                    form_email3_settings.find('button').text('Save');
                    $("html, body").animate({ scrollTop: 0 }, "slow");
                    $('.email3-settings-alert').html('<div class="alert alert-success"><i class="fa fa-check"></i> Connection successfully established!</div>');
                    setTimeout(function () {
                        $('.email3-settings-alert').empty();
                    }, 2000);
                }
            }
        });

        var form_email4_settings = $('form.email4-settings');
        form_email4_settings.ajaxForm({
            url: '{{CONFIG ajax_url}}/ap/save-settings',
            beforeSend: function() {
                form_email4_settings.find('button').text('Please wait..');
            },
            success: function(data) {
                if (data.status == 200) {
                    form_email4_settings.find('button').text('Save');
                    $("html, body").animate({ scrollTop: 0 }, "slow");
                    $('.email4-settings-alert').html('<div class="alert alert-success"><i class="fa fa-check"></i> Connection successfully established!</div>');
                    setTimeout(function () {
                        $('.email4-settings-alert').empty();
                    }, 2000);
                }
            }
        });

        var form_email5_settings = $('form.email5-settings');
        form_email5_settings.ajaxForm({
            url: '{{CONFIG ajax_url}}/ap/save-settings',
            beforeSend: function() {
                form_email5_settings.find('button').text('Please wait..');
            },
            success: function(data) {
                if (data.status == 200) {
                    form_email5_settings.find('button').text('Save');
                    $("html, body").animate({ scrollTop: 0 }, "slow");
                    $('.email5-settings-alert').html('<div class="alert alert-success"><i class="fa fa-check"></i> Connection successfully established!</div>');
                    setTimeout(function () {
                        $('.email5-settings-alert').empty();
                    }, 2000);
                }
            }
        });

        var form_ios_m_settings = $('form.ios-m-settings');
        form_ios_m_settings.ajaxForm({
            url: '{{CONFIG ajax_url}}/ap/save-settings',
            beforeSend: function() {
                form_ios_m_settings.find('button').text('Please wait..');
            },
            success: function(data) {
                if (data.status == 200) {
                    form_ios_m_settings.find('button').text('Save');
                    $("html, body").animate({ scrollTop: 0 }, "slow");
                    $('.ios-m-settings-alert').html('<div class="alert alert-success"><i class="fa fa-check"></i> Connection successfully established!</div>');
                    setTimeout(function () {
                        $('.ios-m-settings-alert').empty();
                    }, 2000);
                }
            }
        });
    });
</script>
