<?php
    $current_user = wp_get_current_user();
?>
<div class="starterpack-body-wrapper">
    
	<div class="starterpack-body-header">
		<h2><?php _e('Admin Controls', 'starterpack') ?></h2>
	</div>
	
	<p class="pt-24 mt-0 mb-15"><?php echo sprintf('<strong>%s: %s</strong>', __('You', 'starterpack'), antispambot(esc_attr($current_user->user_email))); ?></p>
	<input name="starterpack_admin[]" value="<?php echo  $current_user->ID ?>" type="hidden"/>
	<?php
		$admin_args = array(
		    'role' => 'administrator',
		    'exclude' => $current_user->ID,
		);
		$adminusers = get_users( $admin_args );
		$starterpack_admin_setting = AdminStarterPack\starterpack_field_setting('starterpack_admin');
		
		if( count( $adminusers ) ):
		echo sprintf('<label class="mb-3 normal">%s</label>', __('Select other SuperAdmins:', 'starterpack'));
		echo '<div class="starterpack-other-admins mt-10">';
		foreach ( $adminusers as $user ) { ?>
	<div class="starterpack-input pb-0" style="display:flex;align-items:center;">
		<input class="starterpack-toggle starterpack-toggle-light starterpack_admin_users" id="starterpack_admin_<?php echo  $user->ID?>" name="starterpack_admin[]" value="<?php echo  $user->ID ?>" type="checkbox" <?php
			if( $starterpack_admin_setting && in_array( $user->ID, $starterpack_admin_setting ) ):
			    ?>checked="checked"<?php
			endif;?>/>
		<label class="starterpack-toggle-btn " for="starterpack_admin_<?php echo  $user->ID?>"></label>&nbsp;&nbsp;<label class="toggle-label pt-4 pb-4 normal" for="starterpack_admin_<?php echo esc_attr($user->ID) ?>"><?php echo antispambot(esc_attr($user->user_email)) ?></label> 
	</div>
	<?php
		}
		echo '</div>';
		endif;
		?>
		
	<?php AdminStarterPack\starterpack_instance()->admin_view('parts/partials/admin-controls/menus'); ?>
	<div class="starterpack-spacer starterpack-spacer-medium"></div>
	
	
</div>

<div class="starterpack-spacer starterpack-spacer-medium"></div>
<div class="starterpack-spacer starterpack-spacer-medium"></div>