<?php
$selected_age_yes          = ($wo['config']['age'] != 0) ? ' checked' : '';
$selected_age_no           = ($wo['config']['age'] == 0) ? ' checked' : '';
$active_age_yes            = ($wo['config']['age'] != 0) ? ' active' : '';
$active_age_no             = ($wo['config']['age'] == 0) ? ' active' : '';
$selected_friendSystem_yes = ($wo['config']['connectivitySystem'] != 0) ? ' checked' : '';
$selected_friendSystem_no  = ($wo['config']['connectivitySystem'] == 0) ? ' checked' : '';
$active_friendSystem_yes   = ($wo['config']['connectivitySystem'] != 0) ? ' active' : '';
$active_friendSystem_no    = ($wo['config']['connectivitySystem'] == 0) ? ' active' : '';
$selected_profileVisit_yes = ($wo['config']['profileVisit'] != 0) ? ' checked' : '';
$selected_profileVisit_no  = ($wo['config']['profileVisit'] == 0) ? ' checked' : '';
$active_profileVisit_yes   = ($wo['config']['profileVisit'] != 0) ? ' active' : '';
$active_profileVisit_no    = ($wo['config']['profileVisit'] == 0) ? ' active' : '';
$selected_message_seen_yes = ($wo['config']['message_seen'] != 0) ? ' checked' : '';
$selected_message_seen_no  = ($wo['config']['message_seen'] == 0) ? ' checked' : '';
$active_message_seen_yes   = ($wo['config']['message_seen'] != 0) ? ' active' : '';
$active_message_seen_no    = ($wo['config']['message_seen'] == 0) ? ' active' : '';
$selected_message_typing_yes = ($wo['config']['message_typing'] != 0) ? ' checked' : '';
$selected_message_typing_no  = ($wo['config']['message_typing'] == 0) ? ' checked' : '';
$active_message_typing_yes   = ($wo['config']['message_typing'] != 0) ? ' active' : '';
$active_message_typing_no    = ($wo['config']['message_typing'] == 0) ? ' active' : '';
?>
<form action="#" method="post" class="setting-userSetting-container tab-container">
   <div class="row">
      <div class="col-lg-6">
         <h5><?php echo $wo['lang']['user_status'];?> <small><?php echo $wo['lang']['online_lastseen']; ?></small></h5>
          <!-- Multiple Radios (inline) -->
         <div class="form-group">
            <?php 
            $selected_user_lastseen_yes   = ($wo['config']['user_lastseen'] != 0)   ? ' checked' : '';
            $selected_user_lastseen_no    = ($wo['config']['user_lastseen'] == 0)   ? ' checked' : '';
            ?>
            <label class="radio-inline" for="user_lastseen-0">
            <input type="radio" name="user_lastseen" id="user_lastseen-0" value="1" <?php echo $selected_user_lastseen_yes; ?>>
               <?php echo $wo['lang']['enable']; ?>
            </label> 
            <label class="radio-inline" for="user_lastseen-1">
            <input type="radio" name="user_lastseen" id="user_lastseen-1" value="0" <?php echo $selected_user_lastseen_no; ?>>
               <?php echo $wo['lang']['disable']; ?>
            </label>
         </div>
         <!-- Multiple Radios (inline) -->
         <h5><?php echo $wo['lang']['allow_users_to_delete']; ?></h5>
         <div class="form-group">
            <?php 
            $selected_delete_yes   = ($wo['config']['deleteAccount'] != 0)   ? ' checked' : '';
            $selected_delete_no    = ($wo['config']['deleteAccount'] == 0)   ? ' checked' : '';
            ?>
            <label class="radio-inline" for="deleteAccount-0">
            <input type="radio" name="deleteAccount" id="deleteAccount-0" value="1" <?php echo $selected_delete_yes; ?>>
               <?php echo $wo['lang']['enable']; ?>
            </label> 
            <label class="radio-inline" for="deleteAccount-1">
            <input type="radio" name="deleteAccount" id="deleteAccount-1" value="0" <?php echo $selected_delete_no; ?>>
               <?php echo $wo['lang']['disable']; ?>
            </label>
         </div>
         <h5><?php echo $wo['lang']['profile_visit_notification']; ?></h5>
         <div class="form-group">
            <?php 
            $selected_profileVisit_yes   = ($wo['config']['profileVisit'] != 0)   ? ' checked' : '';
            $selected_profileVisit_no    = ($wo['config']['profileVisit'] == 0)   ? ' checked' : '';
            ?>
            <label class="radio-inline" for="profileVisit-0">
            <input type="radio" name="profileVisit" id="profileVisit-0" value="1" <?php echo $selected_profileVisit_yes; ?>>
               <?php echo $wo['lang']['enable']; ?>
            </label> 
            <label class="radio-inline" for="profileVisit-1">
            <input type="radio" name="profileVisit" id="profileVisit-1" value="0" <?php echo $selected_profileVisit_no; ?>>
               <?php echo $wo['lang']['disable']; ?>
            </label>
         </div>
         <h5><?php echo $wo['lang']['display_user_age_as']; ?></h5>
         <div class="form-group">
            <?php 
            $active_age_yes   = ($wo['config']['age'] != 0)   ? ' checked' : '';
            $selected_age_no    = ($wo['config']['age'] == 0)   ? ' checked' : '';
            ?>
            <label class="radio-inline" for="age-0">
            <input type="radio" name="age" id="age-0" value="1" <?php echo $active_age_yes; ?>>
               <?php echo $wo['lang']['date']; ?>
            </label> 
            <label class="radio-inline" for="age-1">
            <input type="radio" name="age" id="age-1" value="0" <?php echo $selected_age_no; ?>>
               <?php echo $wo['lang']['age']; ?>
            </label>
         </div>
         
         <h5>Message Seen <small>(Recommended for powerful servers)</small></h5>
         <div class="form-group">
            <?php 
            $selected_message_seen_yes   = ($wo['config']['message_seen'] != 0)   ? ' checked' : '';
            $selected_message_seen_no    = ($wo['config']['message_seen'] == 0)   ? ' checked' : '';
            ?>
            <label class="radio-inline" for="message_seen-0">
            <input type="radio" name="message_seen" id="message_seen-0" value="1" <?php echo $selected_message_seen_yes; ?>>
               <?php echo $wo['lang']['enable']; ?>
            </label> 
            <label class="radio-inline" for="message_seen-1">
            <input type="radio" name="message_seen" id="message_seen-1" value="0" <?php echo $selected_message_seen_no; ?>>
               <?php echo $wo['lang']['disable']; ?>
            </label>
         </div>

         <h5>Chat typing system <small>(Recommended for powerful servers)</small></h5>
         <div class="form-group">
            <?php 
            $selected_message_typing_yes   = ($wo['config']['message_typing'] != 0)   ? ' checked' : '';
            $selected_message_typing_no    = ($wo['config']['message_typing'] == 0)   ? ' checked' : '';
            ?>
            <label class="radio-inline" for="message_typing-0">
            <input type="radio" name="message_typing" id="message_typing-0" value="1" <?php echo $selected_message_typing_yes; ?>>
               <?php echo $wo['lang']['enable']; ?>
            </label> 
            <label class="radio-inline" for="message_typing-1">
            <input type="radio" name="message_typing" id="message_typing-1" value="0" <?php echo $selected_message_typing_no; ?>>
               <?php echo $wo['lang']['disable']; ?>
            </label>
         </div>
      </div>
      <div class="col-lg-6">
         <h5><?php echo $wo['lang']['connectivity_system']; ?>
            <small><?php echo $wo['lang']['connectivity_system_note'];?></small>
         </h5>
         <div class="form-group">
            <select name="connectivitySystem" class="form-control" id="">
               <option value="1"  <?php echo ($wo['config']['connectivitySystem'] == 1) ? ' selected': '';?>><?php echo $wo['lang']['friends_system']; ?></option>
               <option value="0" <?php echo ($wo['config']['connectivitySystem'] == 0) ? ' selected': '';?>><?php echo $wo['lang']['follow_system']; ?></option>
            </select>
         </div>
         <h5><?php echo $wo['lang']['max_upload_size']; ?> <small>Server max uplaod size = <?php echo Wo_SizeFormat(Wo_MaxFileUpload()); ?></small></h5>
         <div class="form-group">
            <select name="maxUpload" class="form-control" id="">
               <option value="2000000"    <?php echo ($wo['config']['maxUpload'] == 2000000)   ? ' selected': '';?>>2 MB</option>
               <option value="6000000"    <?php echo ($wo['config']['maxUpload'] == 6000000)   ? ' selected': '';?>>6 MB</option>
               <option value="12000000"   <?php echo ($wo['config']['maxUpload'] == 12000000)  ? ' selected': '';?>>12 MB</option>
               <option value="24000000"   <?php echo ($wo['config']['maxUpload'] == 24000000)  ? ' selected': '';?>>24 MB</option>
               <option value="48000000"   <?php echo ($wo['config']['maxUpload'] == 48000000)  ? ' selected': '';?>>48 MB</option>
               <option value="96000000"   <?php echo ($wo['config']['maxUpload'] == 96000000)  ? ' selected': '';?>>96 MB</option>
               <option value="256000000"  <?php echo ($wo['config']['maxUpload'] == 256000000) ? ' selected': '';?>>256 MB</option>
               <option value="512000000"  <?php echo ($wo['config']['maxUpload'] == 512000000) ? ' selected': '';?>>512 MB</option>
               <option value="1000000000" <?php echo ($wo['config']['maxUpload'] == 1000000000) ? ' selected': '';?>>1 GB</option>
            </select>
         </div>
         <h5><?php echo $wo['lang']['max_characters_length']; ?> <small>posts/messages</small></h5>
         <div class="form-group">
            <select name="maxCharacters" class="form-control" id="">
               <option value="80"   <?php echo ($wo['config']['maxCharacters'] == 80) ? ' selected': '';?>>80 Characters</option>
               <option value="160"  <?php echo ($wo['config']['maxCharacters'] == 160) ? ' selected': '';?>>160 Characters</option>
               <option value="320"  <?php echo ($wo['config']['maxCharacters'] == 320) ? ' selected': '';?>>320 Characters</option>
               <option value="640"  <?php echo ($wo['config']['maxCharacters'] == 640) ? ' selected': '';?>>640 Characters</option>
               <option value="1280" <?php echo ($wo['config']['maxCharacters'] == 1280) ? ' selected': '';?>>1280 Characters</option>
            </select>
         </div>
         <h5><?php echo $wo['lang']['allowed_extenstions']; ?> <small>File sharing (separated with comma,)</small></h5>
         <div class="form-group">
            <input type="text"  name="allowedExtenstion" class="form-control" value="<?php echo $wo['config']['allowedExtenstion'];?>">
         </div>
         <h5>Google Map API</h5>
         <div class="form-group">
            <input type="text"  name="google_map_api" class="form-control" value="<?php echo $wo['config']['google_map_api'];?>">
         </div>
         <h5>Censored Words<small> Words to be censored, separated by a comma (,)</small></h5>
         <div class="form-group">
            <input type="text"  name="censored_words" class="form-control" value="<?php echo $wo['config']['censored_words'];?>">
         </div>
      </div>
   </div>
   <hr>
   <div class="form-group">
      <div class="row">
         <div class="col-sm-3 pull-left">
            <button type="submit" name="save_setting" class="form-control btn-main-color btn-main">
            <i class="fa fa-floppy-o progress-icon" data-icon="floppy-o"></i> <?php echo $wo['lang']['save']; ?>
            </button>
         </div>
         <div class="setting-saved-update-alert"></div>
      </div>
   </div>
</form>

<script type="text/javascript">
$(function() {
    $('form.setting-userSetting-container').ajaxForm({
      url: Wo_Ajax_Requests_File() + '?f=admin_setting&s=update_users_setting',
      beforeSend: function() {
        Wo_progressIconLoader($('form.setting-userSetting-container').find('button'));
      },
      success: function(data) {
        if (data.status == 200) {
          $('.setting-saved-update-alert').hide().fadeIn(200).html("<i class='fa fa-check'></i> <?php echo $wo['lang']['saved'];?>").delay(2000).fadeOut(200);
        } 
        Wo_progressIconLoader($('form.setting-userSetting-container').find('button'));
      }
    });
});
</script>