<?php
$selected_cacheSystem_yes       = ($wo['config']['cacheSystem'] != 0) ? ' checked' : '';
$selected_cacheSystem_no        = ($wo['config']['cacheSystem'] == 0) ? ' checked' : '';
$active_cacheSystem_yes         = ($wo['config']['cacheSystem'] != 0) ? ' active' : '';
$active_cacheSystem_no          = ($wo['config']['cacheSystem'] == 0) ? ' active' : '';
$selected_chatSystem_yes        = ($wo['config']['chatSystem'] != 0) ? ' checked' : '';
$selected_chatSystem_no         = ($wo['config']['chatSystem'] == 0) ? ' checked' : '';
$active_chatSystem_yes          = ($wo['config']['chatSystem'] != 0) ? ' active' : '';
$active_chatSystem_no           = ($wo['config']['chatSystem'] == 0) ? ' active' : '';
$selected_emailValidation_yes   = ($wo['config']['emailValidation'] != 0) ? ' checked' : '';
$selected_emailValidation_no    = ($wo['config']['emailValidation'] == 0) ? ' checked' : '';
$active_emailValidation_yes     = ($wo['config']['emailValidation'] != 0) ? ' active' : '';
$active_emailValidation_no      = ($wo['config']['emailValidation'] == 0) ? ' active' : '';
$selected_emailNotification_yes = ($wo['config']['emailNotification'] != 0) ? ' checked' : '';
$selected_emailNotification_no  = ($wo['config']['emailNotification'] == 0) ? ' checked' : '';
$active_emailNotification_yes   = ($wo['config']['emailNotification'] != 0) ? ' active' : '';
$active_emailNotification_no    = ($wo['config']['emailNotification'] == 0) ? ' active' : '';
$selected_seoLink_yes           = ($wo['config']['seoLink'] != 0) ? ' checked' : '';
$selected_seoLink_no            = ($wo['config']['seoLink'] == 0) ? ' checked' : '';
$active_seoLink_yes             = ($wo['config']['seoLink'] != 0) ? ' active' : '';
$active_seoLink_no              = ($wo['config']['seoLink'] == 0) ? ' active' : '';
$selected_fileSharing_yes       = ($wo['config']['fileSharing'] != 0) ? ' checked' : '';
$selected_fileSharing_no        = ($wo['config']['fileSharing'] == 0) ? ' checked' : '';
$active_fileSharing_yes         = ($wo['config']['fileSharing'] != 0) ? ' active' : '';
$active_fileSharing_no          = ($wo['config']['fileSharing'] == 0) ? ' active' : '';
$selected_useSeoFrindly_yes     = ($wo['config']['useSeoFrindly'] != 0) ? ' checked' : '';
$selected_useSeoFrindly_no      = ($wo['config']['useSeoFrindly'] == 0) ? ' checked' : '';
$active_useSeoFrindly_yes       = ($wo['config']['useSeoFrindly'] != 0) ? ' active' : '';
$active_useSeoFrindly_no        = ($wo['config']['useSeoFrindly'] == 0) ? ' active' : '';
?>
<div class="tab-container">
   <div class="row">
      <form action="#" method="post" class="setting-onOff-container">
         <div class="col-lg-2">
            <h4>
               <span class="save-progress-icon">
               <i class="fa fa-cogs progress-icon" data-icon="cogs"></i>
               </span>
               <?php echo $wo['lang']['setting']; ?>
            </h4>
            <hr>
            <h5 class="tooltip-wide"><?php echo $wo['lang']['cache_system']; ?> <i class="fa fa-question-circle pointer gray" data-toggle="tooltip" data-placement="<?php echo Wo_RightToLeft('right');?>" title="<?php echo $wo['lang']['cache_setting_info']; ?>"></i></h5>
            <div class="form-group inner-addon  <?php echo Wo_RightToLeft('left-addon');?> ">
               <div class="btn-group" data-toggle="buttons">
                  <label class="btn btn-default btn-onoff <?php echo  $active_cacheSystem_yes;?>">
                  <input type="radio" name="cacheSystem" value="1" <?php echo $selected_cacheSystem_yes;?> />
                  <i class=" fa fa-power-off on"></i> <?php echo $wo['lang']['on']; ?>
                  </label> 
                  <label class="btn btn-default btn-onoff <?php echo  $active_cacheSystem_no;?>">
                  <input type="radio" name="cacheSystem" value="0" <?php echo $selected_cacheSystem_no;?> />
                  <i class=" fa fa-power-off off"></i> <?php echo $wo['lang']['off']; ?>
                  </label> 
               </div>
            </div>
            <h5 class="tooltip-wide"><?php echo $wo['lang']['chat_system']; ?> <i class="fa fa-question-circle pointer gray" data-toggle="tooltip" data-placement="<?php echo Wo_RightToLeft('right');?>" title="<?php echo $wo['lang']['chat_setting_info']; ?>"></i></h5>
            <div class="form-group inner-addon  <?php echo Wo_RightToLeft('left-addon');?> ">
               <div class="btn-group" data-toggle="buttons">
                  <label class="btn btn-default btn-onoff <?php echo  $active_chatSystem_yes;?>">
                  <input type="radio" name="chatSystem" value="1" <?php echo $selected_chatSystem_yes;?> />
                  <i class=" fa fa-power-off on"></i> <?php echo $wo['lang']['on']; ?>
                  </label> 
                  <label class="btn btn-default btn-onoff <?php echo  $active_chatSystem_no;?>">
                  <input type="radio" name="chatSystem" value="0" <?php echo $selected_chatSystem_no;?> />
                  <i class=" fa fa-power-off off"></i> <?php echo $wo['lang']['off']; ?>
                  </label> 
               </div>
            </div>
            <h5 class="tooltip-wide"><?php echo $wo['lang']['email_validation']; ?> <i class="fa fa-question-circle pointer gray" data-toggle="tooltip" data-placement="<?php echo Wo_RightToLeft('right');?>" title="<?php echo $wo['lang']['email_validation_info']; ?>"></i></h5>
            <div class="form-group inner-addon  <?php echo Wo_RightToLeft('left-addon');?> ">
               <div class="btn-group" data-toggle="buttons">
                  <label class="btn btn-default btn-onoff <?php echo  $active_emailValidation_yes;?>">
                  <input type="radio" name="emailValidation" value="1" <?php echo $selected_emailValidation_yes;?> />
                  <i class=" fa fa-power-off on"></i> <?php echo $wo['lang']['on']; ?>
                  </label> 
                  <label class="btn btn-default btn-onoff <?php echo  $active_emailValidation_no;?>">
                  <input type="radio" name="emailValidation" value="0" <?php echo $selected_emailValidation_no;?> />
                  <i class=" fa fa-power-off off"></i> <?php echo $wo['lang']['off']; ?>
                  </label> 
               </div>
            </div>
            <h5 class="tooltip-wide"><?php echo $wo['lang']['email_notification']; ?> <i class="fa fa-question-circle pointer gray" data-toggle="tooltip" data-placement="<?php echo Wo_RightToLeft('right');?>" title="<?php echo $wo['lang']['email_notification_info']; ?>"></i></h5>
            <div class="form-group inner-addon  <?php echo Wo_RightToLeft('left-addon');?> ">
               <div class="btn-group" data-toggle="buttons">
                  <label class="btn btn-default btn-onoff <?php echo  $active_emailNotification_yes;?>">
                  <input type="radio" name="emailNotification" value="1" <?php echo $selected_emailNotification_yes;?> />
                  <i class=" fa fa-power-off on"></i> <?php echo $wo['lang']['on']; ?>
                  </label> 
                  <label class="btn btn-default btn-onoff <?php echo  $active_emailNotification_no;?>">
                  <input type="radio" name="emailNotification" value="0" <?php echo $selected_emailNotification_no;?> />
                  <i class=" fa fa-power-off off"></i> <?php echo $wo['lang']['off']; ?>
                  </label> 
               </div>
            </div>
            <h5 class="tooltip-wide"><?php echo $wo['lang']['smooth_links']; ?> <i class="fa fa-question-circle pointer gray" data-toggle="tooltip" data-placement="<?php echo Wo_RightToLeft('right');?>" title="<?php echo $wo['lang']['smooth_links_info']; ?>"></i></h5>
            <div class="form-group inner-addon  <?php echo Wo_RightToLeft('left-addon');?> ">
               <div class="btn-group" data-toggle="buttons">
                  <label class="btn btn-default btn-onoff <?php echo  $active_seoLink_yes;?>">
                  <input type="radio" name="seoLink" value="1" <?php echo $selected_seoLink_yes;?> />
                  <i class=" fa fa-power-off on"></i> <?php echo $wo['lang']['on']; ?>
                  </label> 
                  <label class="btn btn-default btn-onoff <?php echo  $active_seoLink_no;?>">
                  <input type="radio" name="seoLink" value="0" <?php echo $selected_seoLink_no;?> />
                  <i class=" fa fa-power-off off"></i> <?php echo $wo['lang']['off']; ?>
                  </label> 
               </div>
            </div>
            <h5 class="tooltip-wide"><?php echo $wo['lang']['seo_friendly_url']; ?> <i class="fa fa-question-circle pointer gray" data-toggle="tooltip" data-placement="<?php echo Wo_RightToLeft('right');?>" title="<?php echo $wo['lang']['seo_frindly_info']; ?>"></i></h5>
            <div class="form-group inner-addon  <?php echo Wo_RightToLeft('left-addon');?> ">
               <div class="btn-group" data-toggle="buttons">
                  <label class="btn btn-default btn-onoff <?php echo  $active_useSeoFrindly_yes;?>">
                  <input type="radio" name="useSeoFrindly" value="1" <?php echo $selected_useSeoFrindly_yes;?> />
                  <i class=" fa fa-power-off on"></i> <?php echo $wo['lang']['on']; ?>
                  </label> 
                  <label class="btn btn-default btn-onoff <?php echo  $active_useSeoFrindly_no;?>">
                  <input type="radio" name="useSeoFrindly" value="0" <?php echo $selected_useSeoFrindly_no;?> />
                  <i class=" fa fa-power-off off"></i> <?php echo $wo['lang']['off']; ?>
                  </label> 
               </div>
            </div>
            <h5 class="tooltip-wide"><?php echo $wo['lang']['file_sharing']; ?> <i class="fa fa-question-circle pointer gray" data-toggle="tooltip" data-placement="<?php echo Wo_RightToLeft('right');?>" title="<?php echo $wo['lang']['file_sharing_info']; ?>"></i></h5>
            <div class="form-group inner-addon  <?php echo Wo_RightToLeft('left-addon');?> ">
               <div class="btn-group" data-toggle="buttons">
                  <label class="btn btn-default btn-onoff <?php echo  $active_fileSharing_yes;?>">
                  <input type="radio" name="fileSharing" value="1" <?php echo $selected_fileSharing_yes;?> />
                  <i class=" fa fa-power-off on"></i> <?php echo $wo['lang']['on']; ?>
                  </label> 
                  <label class="btn btn-default btn-onoff <?php echo  $active_fileSharing_no;?>">
                  <input type="radio" name="fileSharing" value="0" <?php echo $selected_fileSharing_no;?> />
                  <i class=" fa fa-power-off off"></i> <?php echo $wo['lang']['off']; ?>
                  </label> 
               </div>
            </div>
         </div>
      </form>
      <div class="col-lg-10">
         <ul class="nav nav-tabs">
            <li class="active">
               <a href="#general-setting-a" data-toggle="tab">
               <i class="fa fa-cog"></i>
               <span class="setting-tab-text"><?php echo $wo['lang']['site_setting']; ?></span>
               </a>
            </li>
            <li>
               <a href="#themes-setting-c" data-toggle="tab">
               <i class="fa fa-paint-brush"></i> 
               <span class="setting-tab-text"><?php echo $wo['lang']['themes']; ?></span>
               </a>
            </li>
            <li>
               <a href="#user-setting-b" data-toggle="tab">
               <i class="fa fa-cog"></i> 
               <span class="setting-tab-text"><?php echo $wo['lang']['user_setting']; ?></span>
               </a>
            </li>
            <li class="<?php echo ($wo['config']['reCaptcha'] == 1 && empty($wo['config']['reCaptchaKey'])) ? 'danger-tab' : '';?>"> 
               <a href="#reCaptcha-setting-b" data-toggle="tab">
               <i class="fa fa-key"></i> 
               <span class="setting-tab-text">reCaptcha</span>
               </a>
            </li>
            <li>
               <a href="#googleAnalytics-setting-b" data-toggle="tab">
               <i class="fa fa-bar-chart"></i> 
               <span class="setting-tab-text">Google Analytics</span>
               </a>
            </li>
            <li class="<?php echo (Wo_FolderSize('cache') > 5000000) ? 'danger-tab' : '';?>">
               <a href="#cache-setting-b" data-toggle="tab">
               <i class="fa fa-files-o"></i> 
               <span class="setting-tab-text"><?php echo $wo['lang']['cache']; ?></span>
               </a>
            </li>
         </ul>
         <div class="tab-content" id="tabs2">
            <div class="tab-pane active" id="general-setting-a">
               <?php echo Wo_LoadPage('admin/general/site_info/content');?>
            </div>
            <div class="tab-pane" id="themes-setting-c">
               <?php echo Wo_LoadPage('admin/general/theme/content');?>
            </div>
            <div class="tab-pane" id="user-setting-b">
               <?php echo Wo_LoadPage('admin/general/user_setting/content');?>
            </div>
            <div class="tab-pane" id="reCaptcha-setting-b">
               <?php echo Wo_LoadPage('admin/general/reCaptcha/content');?>
            </div>
            <div class="tab-pane" id="googleAnalytics-setting-b">
               <?php echo Wo_LoadPage('admin/general/google_analytics/content');?>
            </div>
            <div class="tab-pane" id="cache-setting-b">
               <?php echo Wo_LoadPage('admin/general/cache/content');?>
            </div>
         </div>
      </div>
   </div>
</div>
<script type="text/javascript">
$(function() {
    $('form.setting-onOff-container input:radio').change(function() {
      $('form.setting-onOff-container').submit();
    });
    $('form.setting-onOff-container').ajaxForm({
      url: Wo_Ajax_Requests_File() + '?f=admin_setting&s=update_on_off_setting',
      beforeSend: function() {
        Wo_progressIconLoader($('form.setting-onOff-container').find('span.save-progress-icon'));
      },
      success: function(data) {
        if (data.status == 200) {
          Wo_progressIconLoader($('form.setting-onOff-container').find('span.save-progress-icon'));
        } 
      }
    });
});
</script>