<div class="container-fluid">
    <div class="block-header">
        <h2>Settings > Site Settings</h2>
    </div>
    <!-- Vertical Layout -->
    <div class="row">
        <div class="col-lg-6 col-md-6">
            <div class="card">
                <div class="header">
                    <h2>Website Settings</h2>
                </div>
                <div class="body">
                    <div class="alert alert-success site-settings-alert"></div>
                    <form class="site-settings" method="POST">
                        <div class="form-group form-float">
                            <div class="form-line">
                                <input type="text" id="title" name="title" class="form-control" value="{{CONFIG title}}">
                                <label class="form-label">Site Title</label>
                            </div>
                        </div>
                        <div class="form-group form-float">
                            <div class="form-line">
                                <input type="text" id="name" name="name" class="form-control" value="{{CONFIG name}}">
                                <label class="form-label">Site Name</label>
                            </div>
                        </div>
                        <div class="form-group form-float">
                            <div class="form-line">
                                <input type="text" id="email" name="email" class="form-control" value="{{CONFIG email}}">
                                <label class="form-label">Site E-mail</label>
                            </div>
                        </div>
                        <div class="form-group form-float">
                            <div class="form-line">
                                <input type="text" id="keyword" name="keyword" class="form-control" value="{{CONFIG keyword}}">
                                <label class="form-label">Site Keywords</label>
                            </div>
                        </div>
                        <div class="form-group form-float">
                            <div class="form-line">
                                <textarea name="description" id="description" class="form-control" cols="30" rows="5">{{CONFIG description}}</textarea>
                                <label class="form-label">Site Description</label>
                            </div>
                        </div>
                        <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>Other Settings</h2>
                </div>
                <div class="body">
                    <div class="alert alert-success other-settings-alert"></div>
                    <form class="other-settings" method="POST">

                        <div class="form-group form-float">
                            <label for="upload">Max Upload Size</label>
                            <select class="form-control show-tick" id="upload" name="max_upload" tabindex="-98">
                                <option value="2000000" <?php if($pt->config->max_upload == '2000000'){ echo "selected";} ?>>2MB</option>
                                <option value="6000000" <?php if($pt->config->max_upload == '6000000'){ echo "selected";} ?>>6MB</option>
                                <option value="12000000" <?php if($pt->config->max_upload == '12000000'){ echo "selected";} ?>>12MB</option>
                                <option value="24000000" <?php if($pt->config->max_upload == '24000000'){ echo "selected";} ?>>24MB</option>
                                <option value="48000000" <?php if($pt->config->max_upload == '48000000'){ echo "selected";} ?>>48MB</option>
                                <option value="96000000" <?php if($pt->config->max_upload == '96000000'){ echo "selected";} ?>>96MB</option>
                                <option value="256000000" <?php if($pt->config->max_upload == '256000000'){ echo "selected";} ?>>256MB</option>
                                <option value="512000000" <?php if($pt->config->max_upload == '512000000'){ echo "selected";} ?>>512MB</option>
                                <option value="1000000000" <?php if($pt->config->max_upload == '1000000000'){ echo "selected";} ?>>1GB</option>
                                <option value="10000000000" <?php if($pt->config->max_upload == '10000000000'){ echo "selected";} ?>>10GB</option>
                            </select>
                        </div>
                        <div class="form-group form-float">
                            <div class="form-line">
                                <input type="text" id="censored_words" name="censored_words" class="form-control" value="{{CONFIG censored_words}}">
                                <label class="form-label">Censored Words</label>
                            </div>
                        </div><br>
                        <label for="language">Default Language</label>
                        <select class="form-control show-tick" id="language" name="language">
                        	<option value="">-- Please select --</option>
                            <?php 
                            $langs__footer = $pt->langs;
						    $langs_html    = '';
						    foreach ($langs__footer as $key => $language) {
						        $lang_explode = explode('.', $language);
						        $language     = $lang_explode[0];
						        $language_    = ucfirst($language);
						        $selected = ($pt->config->language == $language) ? 'selected': '';
						        $langs_html .= '<option value="' . $language . '" ' . $selected . '>' . $language_ . '</option>';
						    }
						    echo $langs_html;
                            ?>
                        </select>
                        <div class="clearfix"></div>
                        <br><br>
                        <label for="seo_link">SEO Links</label> <small  class="text-muted">E.g: site.com/this-is-a-video-_ID.html</small >
                        <div class="form-group">
                            <input type="radio" name="seo_link" id="seo_link-enabled" value="on" <?php echo ($pt->config->seo_link == 'on') ? 'checked': '';?>>
                            <label for="seo_link-enabled">Enabled</label>
                            <input type="radio" name="seo_link" id="seo_link-disabled" value="off" <?php echo ($pt->config->seo_link == 'off') ? 'checked': '';?>>
                            <label for="seo_link-disabled" class="m-l-20">Disabled</label>
                        </div><br>
                        <label for="recaptcha">Recaptcha</label>
                        <div class="form-group">
                            <input type="radio" name="recaptcha" id="recaptcha-enabled" value="on" <?php echo ($pt->config->recaptcha == 'on') ? 'checked': '';?>>
                            <label for="recaptcha-enabled">Enabled</label>
                            <input type="radio" name="recaptcha" id="recaptcha-disabled" value="off" <?php echo ($pt->config->recaptcha == 'off') ? 'checked': '';?>>
                            <label for="recaptcha-disabled" class="m-l-20">Disabled</label>
                        </div>
                        <div class="form-group form-float">
                            <div class="form-line">
                                <input type="text" id="recaptcha_key" name="recaptcha_key" class="form-control" value="{{CONFIG recaptcha_key}}">
                                <label class="form-label">Recaptcha Key</label>
                            </div>
                        </div>
                        <div class="form-group form-float">
                            <div class="form-line">
                                <input type="text" id="google" name="google" class="form-control" value="{{CONFIG google}}">
                                <label class="form-label">Google Analytics ID</label>
                            </div>
                        </div>
                        <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_site_settings = $('form.site-settings');
    var form_other_settings = $('form.other-settings');

    form_site_settings.ajaxForm({
        url: '{{LINK aj/ap/save-settings}}',
        beforeSend: function() {
            form_site_settings.find('button').text('{{LANG please_wait}}');
        },
        success: function(data) {
            if (data.status == 200) {
            	form_site_settings.find('button').text('Save');
            	$('.site-settings-alert').html('<i class="fa fa-check"></i> Settings updated successfully');
            	setTimeout(function () {
            		$('.site-settings-alert').empty();
            	}, 2000);
            }
        }
    });

    form_other_settings.ajaxForm({
        url: '{{LINK aj/ap/save-settings}}',
        beforeSend: function() {
            form_other_settings.find('.waves-effect').text('{{LANG please_wait}}');
        },
        success: function(data) {
            if (data.status == 200) {
                form_other_settings.find('.waves-effect').text('Save');
                $('.other-settings-alert').html('<i class="fa fa-check"></i> Settings updated successfully');
                setTimeout(function () {
                    $('.other-settings-alert').empty();
                }, 2000);
            }
        }
    });
});
</script>