<?php defined('ABSPATH') || die('Cheatin\' uh?');?>
<link rel="stylesheet" href="<?php echo _STRB_THEME_DIR_.'css/myStyle.css'?>" >


<div style="width:100%;min-height:1310px;position:absolute;background-color:#F4F4F4;top:0px;padding-top:4vw;display:flex;justify-content:center;padding-bottom:4vw;">
    <div style="position:relative;display:flex;flex-direction:column;width:55vw;background-color:white;box-shadow: 0 4px 30px rgba(0,0,0,0.1);padding:1vw;border-radius:3vw;align-items:center;">
        <div style="display:flex;width:35vw;margin-top:1vw;">
            <?php  echo '<img  style="width:4vw;height:4vw;" src='.plugins_url(). "/starboxnew/view/assets/img/logo.png".' alt="">';?>
            <div style="margin-left:0.5vw;margin-top:0.5vw;">
                <div style="font-size:1.2vw;font-weight:700;">Starbox</div>
                <div style="font-size:0.8vw;font-weight:700;color:#fbcc34;margin-top:-.3vw;">Dare to stand out.</div>
            </div>
        </div>
        <div style="background-color:white;margin-left:1vw;width:36vw;margin-top:2vw;">
            <form method="POST" class="display-options-form-f-t-s" enctype="multipart/form-data">
    
            <div style="">
                <p style="font-size:1.2vw;font-weight:500;">Load Starbox In:</p>
                <div  style="display:flex;">
                <label class="toggler-wrapper style-1">   
                <input type="checkbox" <?php echo STRB_Classes_Helpers_Tools::getOption('allPost')=='true' ? 'checked' : ''; ?> name="extra_field_check" class="strb-switch all-post-types"  />
                <div class="toggler-slider" style="width:4vw;height:1.6vw;">
                    <div class="toggler-knob" style="height:1.2vw;width:1.2vw;top:0.3vw;margin-left:0.4vw;"></div>
                </div>
                </label>
                <label style="font-size:1vw;margin-left:1vw;font-weight:500;">All post types</label>
            </div>
     
            <div  style="display:flex;margin-top:1vw;">
                <label class="toggler-wrapper style-1">
                <input type="hidden" name="strb_option" value="0"/>
                <input type="checkbox" <?php echo STRB_Classes_Helpers_Tools::getOption('specificPost')=='true' ? 'checked' : ''; ?>  name="extra_field_check" class="strb-switch add-specific-post-types" />
                <div class="toggler-slider" style="width:4vw;height:1.6vw;">
                    <div class="toggler-knob" style="height:1.2vw;width:1.2vw;top:0.3vw;margin-left:0.4vw;"></div>
                </div>
                </label>
                <label style="font-size:1vw;margin-left:1vw;font-weight:500;">Specific Wordpress post types</label>
            </div>

            <div class="specific-pos specific-posts<?php  echo STRB_Classes_Helpers_Tools::getOption('specificPost')?>" style="width:24vw;gap:1vw;min-height:100px;flex-wrap:wrap;background-color:rgba(0,0,0,0.2);padding:1.5vw;border-radius:2vw;margin-top:1vw;">
                <?php   $types = get_post_types();
                    foreach ($types as $type) {
                        $type_data = get_post_type_object($type);
                        if (!isset($type_data->show_ui) || $type_data->show_ui != 1) {
                            unset($types[$type]);
                        } else {?>
                        <div  style="isplay:flex;gap:0.4vw;min-width:7vw;flex-direction:column;width:10vw;">
                            <label style="font-weight:500;font-size:0.9vw;"><?php echo $type_data->labels->name; ?></label>
                            <label class="toggler-wrapper style-1 ">
                                <input type="hidden" name="strb_option" value="0"/>
                                <input type="checkbox" value="<?php echo $type ?>" <?php if(STRB_Classes_Helpers_Tools::getOption('field-check')!=null) echo  in_array($type,STRB_Classes_Helpers_Tools::getOption('field-check')) ? 'checked' : ''; ?>  name="<?php echo $type_data->labels->name; ?>" class="abh_post_types strb-switch add-specific-pages" />
                                <div class="toggler-slider" style="width:4vw;height:1.6vw;">
                                    <div class="toggler-knob" style="height:1.2vw;width:1.2vw;top:0.3vw;margin-left:0.4vw;"></div>
                                </div>
                            </label>
                        </div> 
                        <?php
                        }
                }?>
            </div>

            <h3 style="font-size:1.2vw;font-weight:500;margin-top:2vw;">Default Author Box:</h3>
                <div class="preview-img" style="">
                    <?php 
                        $STB_user_data = new STRB_Models_ThemeUserData();
                        $id=STRB_Classes_Helpers_Tools::getOption('strb_user_id');
                        $STB_user_data->loadThemeDataByID($id);
                        $theme= $STB_user_data->getData('user_theme');
                        $img = $STB_user_data->getData('background_img');
                        echo STRB_Classes_ObjController::getClass('STRB_Classes_FrontController')->getThemeViewImg($id,$theme,$img,TRUE);
                    ?>
                </div>
           
                <div style="width:80%;display:flex;justify-content:flex-end;height:4vw;margin-top:1vw;">
                    <input type="hidden" name="finish" value="finish"/> 
                    <button type="submit" class="finish-f-t-s" style="cursor:pointer;height:2vw;width:10vw;border-radius:2vw;border:none;font-weight:500;background-color:#fbcc34;font-size:1vw;margin-top:1vw;" ><?php echo esc_html__("Save and finish", 'squirrly-seo'); ?></button>
                </div>
        </div>
        </form>
            
        <div>
            <form method="POST" enctype="multipart/form-data">
                <?php STRB_Classes_Helpers_Tools::setNonce('strb_settings_prev_to_themes', 'strb_nonce'); ?>
                <input type="hidden" name="action" value="strb_settings_prev_to_themes"/>     
                <link href='https://unpkg.com/boxicons@2.1.4/css/boxicons.min.css' rel='stylesheet'>

                <div style="position:relative;top:-3.4vw;width:4vw;">
                    <button type="submit" style="cursor:pointer;height:2vw;width:10vw;border-radius:2vw;border:none;font-weight:500;background-color:#F3F6F8;font-size:1vw;color:black;" class=""><?php echo esc_html__("Back", 'squirrly-seo'); ?></button>
                </div>
            </form>    
        </div>    
    </div>
</div>

<style>
    .toggler-wrapper{
        width:3.5vw;
        height:1.5vw;
   }
   .toggler-wrapper.style-1 .toggler-knob{
        width:1vw;
        height:1vw;
        top:0.19vw;
   }
   .toggler-wrapper.style-1 input[type="checkbox"]:checked+.toggler-slider .toggler-knob {
        left: calc(100% - 1.8vw );
    }
</style>