<?php defined('ABSPATH') || die('Cheatin\' uh?'); ?>

<link href='https://unpkg.com/boxicons@2.1.4/css/boxicons.min.css' rel='stylesheet'> 


<!--Edit author info-->
<div style="width:100%;margin-top:0px; background-color:#EBEBEC;">

    <?php if (!class_exists('SQ_Classes_ObjController') ) {
        echo '<div class="install-sq" style="margin-left:13%;padding-bottom:2vw;display:flex;flex-direction:column;width:70vw;margin-top:3vw;background-color:black;background-image:radial-gradient(at 59% 100%, hsla(180, 100%, 10%, 1) 0px, transparent 50%), radial-gradient(at 0% 42%, hsla(180, 100%, 11%, 1) 0px, transparent 50%), radial-gradient(at 100% 4%, hsla(180, 100%, 17%, 1) 0px, transparent 50%);top:5vw;box-shadow: 0 4px 30px rgba(0,0,0, 0.3);border-radius:16px;backdrop-filter: blur(12px);padding-left:2vw;padding-top:1vw;">
                <div style="display:flex;">
                    <img class="squirrel" style="height:5vw;width:5vw;margin-top:1vw;" src="'.plugins_url(). "/nextlevel/view/assets/img/squirrel.png".'" />
                    
                    <div style="display:flex;flex-direction:column;width:34vw;margin-left:2vw;">
                        <div style="font-weight:600;font-size:1.5vw;color:white;">Install and activate Squirrly Seo</div>
                        <div style="font-size:1vw;font-weight:500;margin-top:-2px;line-height:1.2vw;color:#53DFFF">Optimize your content for search engines and your audience with personalized optimization suggestions from Squirrly, including keyword usage, meta tags, and content length.</div>
                    </div>
                </div>
            
                <div class="" style="display:flex;">
                    <div class="makeNewPost install-btn" style="margin-top:1vw;width:10vw;height:3vw;background-color:#50E0FE;color:black;border-radius:5vw;font-weight:600;font-size:1.2vw;display:flex;align-items:center;justify-content:center;cursor:pointer;">Install now</div>
                    <div class="checkmark-install" style="color:green;font-weight:600;font-size:24px;margin-left:25px;margin-top:1px;display:none;">&#9989;</div>
                </div>
            </div>';
    }?>

    <div id="display-all-themes all-themes-styles"  style="background-image:radial-gradient(at 59% 100%, hsla(180, 100%, 10%, 1) 0px, transparent 50%), radial-gradient(at 0% 42%, hsla(180, 100%, 11%, 1) 0px, transparent 50%), radial-gradient(at 100% 4%, hsla(180, 100%, 17%, 1) 0px, transparent 50%);margin-top:5vh;margin-left:13%;min-height:50px;width:70vw;background-color:#010101;box-shadow: 0 4px 30px rgba(0,0,0, 0.4);border-radius:16px;backdrop-filter: blur(12px);padding-left:2vw;padding-top:1vw;padding-bottom:2vw;">
        
        <a href="<?php echo esc_url(NXTLVL_Classes_Helpers_Tools::getAdminUrl("next_lvl","PostGroup"));?>" style="none;">
            <div class="manage-post-nav" style="">
                Scheduled posts
            </div>
        </a>

        <div>
            <?php //**Get api content 
                NXTLVL_Controllers_Settings::get_and_save_content_into_posts();
              
                $postslist = NXTLVL_Controllers_Settings::get_posts();
              
                if ($postslist->have_posts()){
                    foreach($postslist->posts as $post){       
                        if($post->post_status=="publish")
                            $color="#4AC34A";
                        else $color="yellow";

                        echo'<div class="all-posts'.$post->ID.'" style="width:68vw;">
                                <div  style="display:flex;width:66vw;margin-top:1vw;border-radius:3vw;padding:0.5vw;background-color:rgb(80, 224, 254,0.15);" class="post-opt">
                                    <div style="width:40vw;padding-top:5px;">
                                        <div style="height:100%;font-weight:600;margin-left:20px;padding-top:2px;">
                                            <div style="color:#C9C9C9;line-height:1.3vw;font-size:1.1vw;" class="perma-title'.$post->ID.'">'.$post->post_title.'</div>
                                            <div style="font-size:1vw;font-weight:500;margin-top:4px;line-height:1.2vw;margin-bottom:5px;color:#1085E1;"><a style="color:#50E0FE;" href='.get_permalink($post->ID).'>'.get_permalink($post->ID).'</a></div>
                                        </div>
                                    </div>

                                    <div style="position:relative;;width:6vw;padding-left:4vw;display:flex;align-items:center;">
                                        <div class="" style="background-color:'.$color.';width:1.5vw;height:1.5vw;border-radius:50%;"></div>
                                    </div>

                                    <div style="width:5vw;margin-left:11vw;display:flex;align-items:center;cursor:pointer;">
                                        <div class="toggler-knob'.$post->ID.' meta-checkbox"  style="width:3vw;height:3vw;display:flex;align-items:center;flex-direction:column;gap:5px;justify-content:center;">
                                            <div style="background-color:#50E0FE;width:5px;height:5px;border-radius:50%;"></div>
                                            <div style="background-color:#50E0FE;width:5px;height:5px;border-radius:50%;"></div>
                                            <div style="background-color:#50E0FE;width:5px;height:5px;border-radius:50%;"></div>
                                        </div>
                                        <input class="post_id" type="hidden" value='.$post->ID.' />
                                    </div>

                                    <div style="padding-left:20px;width:20vw;display:flex;align-items:center;position:relative;display:none;">
                                        <div class="dropdown-displays" style="width:220px;height:40px;margin-top:5px;border-radius:20px;z-index:2;display:flex;background-color:rgb(78,224,255,0.9)">
                                            <div class="dropdown-btn-text" style="width:140px;margin-top:5px;padding-left:15px;font-weight:600;">'.get_post_meta( $post->ID,'postType',true).'</div>
                                            <i class="bx bx-chevron-up dropdown-arrow" style="color:black;font-size:1.6vw;font-weight:500;margin-left:15px;margin-top:6px;"></i>
                                        </div>

                                        <div class="pannel-displays closed" style="min-height:50px;width:195px;position:absolute;border-radius:10px;top:65px;color:white;background-color:rgb(41,68,111,0.9);margin-bottom:5px;padding-bottom:5px;z-index:200;">';
                                            $types = get_post_types();  
                                            foreach ($types as $type) {
                                                echo '<div  class="publish-option" style="display:flex;">
                                                        <div class="" style="margin-left:10px;font-weight:600;">'.$type.'</div>
                                                    </div>';}             
                                            echo '<input class="post-id" type="hidden" value="'.$post->ID.'" />
                                        </div>
                                        <div class="publish" style="margin-left:20px;margin-top:5px;font-weight:600;border-radius:5px;border:1px solid black;width:110px;height:40px;display:flex;justify-content:center;padding-top:5px;background-color:#033;color:white;display:none;">Publish</div>
                                        <div class="checkmark" style="color:green;font-weight:600;font-size:24px;margin-left:25px;margin-top:10px;display:none;">&#9989;</div>
                                        <div class="nxt-bin" id="'.$post->ID.'" style="color:red;font-size:18px;margin-top:10px;margin-left:40px;width:60px;height:30px;">Bin</div>
                                    </div>
                                
                                </div>
                                <div style="position:relative;z-index:200;width:66vw;" class="editMetaTags"></div>
                            </div>';
                           
           
                    }
                   // echo NXTLVL_Classes_ObjController::getClass('NXTLVL_Classes_DisplayController')->get_meta_data(3447);

                if (isset($_GET['paged']))
                    $paged = $_GET['paged'];
                else $paged=1;

                if ( $postslist->max_num_pages > 1) {
                    echo   "<div style='padding-left:20px;font-weight:600;font-size:20px;height:60px;padding-top:15px;margin-top:1.5vw;'>" 
                                .paginate_links(array(
                                    'total' => $postslist->max_num_pages,
                                    'format' => '?paged=%#%',
                                    'current' => max( 1, $paged ),
                                    'prev_next' => true,
                                    'prev_text' => __( '&laquo; Previous' ),
                                    'next_text' => 'Next' 
                                        )).
                            "</div>";
                }
            };?>
            
        </div>
    
</div>
<div style="height:3vw;"></div>


<style>
    html{
        min-height:800px;
        background-color:#EBEBEC;
    }
    body{
        min-height:800px;
    }
    .page-numbers{
        border:none;
        padding:15px;
        text-decoration:none;
        color:white;
        background-color:#3c434a;
        border-radius:20px;
        font-weight:500;
    }
    .page-numbers:hover{
        color:aqua;
        opacity:90%;
    }
    .page-numbers.current{
        color:aqua;
    }
    .install-btn:hover{
        opacity:80%;
    }

    .post-opt{
        background-color:rgba(0,0,0, 0.8);   
    }

    .post-opt:hover{
       opacity:0.8;
    } 

    .meta-checkbox:hover{
        border-radius:50%;
        background-color:#010101;
        opacity:0.8;
    }
    .squirrel:hover{
        scale:1.1;
    }
    .manage-post-nav{
        width:10vw;
        height:3vw;
        background-color:rgba(80, 224, 254,0.3);
        color:white;
        font-weight:600;
        font-size:1vw;
        border-radius:3vw;
        padding:0.8vw;
        position:relative;
        margin-top:1vw;
        text-decoration:none;
        display:flex;
        align-items:center;
        justify-content:center;
    }
    .manage-post-nav:hover{
        background-color:rgba(80, 224, 254,0.9);
        box-shadow: 0 10px 30px rgba(80, 224, 254, 0.2);
        text-decoration:none;
    }
</style>
