<div class="page-margin mt-0">
	<div class="wow_content popular_posts_hdr">
		<h2><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-shield"><path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"></path></svg>&nbsp;<?php echo $wo['lang']['privacy_setting'];?></h2>
	</div>
</div>

<div class="wo_settings_page wow_content">
	<form  method="post" class="form-horizontal setting-information-form">
		<div class="setting-information-alert setting-update-alert"></div>
		
		<div class="form-group">
            <label class="col-md-5" for="privacy"><?php echo $wo['lang']['group_type'];?> </label>
            <div class="col-md-5">
				<div class="wow_form_fields mt-0">
					<select id="privacy" name="privacy" class="form-control">
						<?php 
							$selected_privacy_yes   = ($wo['setting']['privacy'] == 1)   ? ' selected' : '';
							$selected_privacy_no  = ($wo['setting']['privacy'] == 2)   ? ' selected' : '';
						?>
						<option value="1" <?php echo $selected_privacy_yes; ?>><?php echo $wo['lang']['public'];?> </option>
						<option value="2" <?php echo $selected_privacy_no; ?>><?php echo $wo['lang']['private'];?> </option>
					</select>
				</div>
            </div>
		</div>
		<div class="form-group">
            <label class="col-md-5" for="join_privacy"><?php echo $wo['lang']['confirm_request_group_privacy_label'];?></label>
            <div class="col-md-5">
				<div class="wow_form_fields mt-0">
					<select id="join_privacy" name="join_privacy">
						<?php 
							$selected_followp_yes   = ($wo['setting']['join_privacy'] == 1)   ? ' selected' : '';
							$selected_followp_no  = ($wo['setting']['join_privacy'] == 2)   ? ' selected' : '';
						?>
						<option value="1" <?php echo $selected_followp_yes; ?>><?php echo $wo['lang']['no'];?></option>
						<option value="2" <?php echo $selected_followp_no; ?>><?php echo $wo['lang']['yes'];?></option>
					</select>
				</div>
            </div>
		</div>
		<div class="text-center">
            <button class="btn btn-main btn-mat btn-mat-raised add_wow_loader" type="submit"><?php echo $wo['lang']['save']; ?></button>
		</div>
		<input type="hidden" name="group_id" value="<?php echo $wo['setting']['id'];?>">
		<input type="hidden" name="hash_id" value="<?php echo Wo_CreateSession();?>">
	</form>
</div>
<script type="text/javascript">
$(function() {
  $('form.setting-information-form').ajaxForm({
    url: Wo_Ajax_Requests_File() + '?f=groups&s=update_privacy_setting',
    beforeSend: function() {
      $('.setting-information-form').find('.add_wow_loader').addClass('btn-loading');
    },
    success: function(data) {
      if (data.status == 200) {
        scrollToTop();
        $('.setting-information-alert').html('<div class="alert alert-success">' + data.message + '</div>');
        $('.alert-success').fadeIn('fast', function() {
          $(this).delay(2500).slideUp(500, function() {
            $(this).remove();
          });
        });
      }
      $('.setting-information-form').find('.add_wow_loader').removeClass('btn-loading');
    }
  });
});
</script>