<?php
/*
 * Developed By Devozon
 *
 * Check Out at https://devozon.com/
 * Email: support@devozon.com
 * Message: https://www.facebook.com/devozon
 *
 * Please feel free to contact me at any time if you need a custom script or any development work.
 *
 * Devozon Team:
 * Coded by Sanad Nabil
 * Theme by Ahmed Reda
 * Tested By Smith Carter
 *
 * Devozon All rights reserved
 * Copyright (c) 2023-2024.
 * Last Update 15 \ 9 \ 2024
 */

/**
 * Provide a admin area view for the plugin
 *
 * This file is used to markup the admin-facing aspects of the plugin.
 *
 * @link       https://devozon.com
 * @since      1.0.0
 *
 * @package    FENSE_BPVT
 * @subpackage FENSE_BPVT/admin/partials
 */

if ( !defined( 'ABSPATH' ) ) exit; // Exit if accessed directly

$Fense_FUN = ( new FENSE_BPVT_FUN );

echo $Fense_FUN->loadLang();
?>

<script !src="">var settings = true;</script>

<div class="container">
    <div class="row">
        
        <div class="col-12">
            <div class="card">
            <div class="card-body">
                <div class="row">
					<?php if ( $Fense_FUN->IsDailyLimitReached() ): ?>
                        <div class="alert alert-danger alert-dismissible alert-additional fade show mb-3 "
                             role="alert">
                            <div class="alert-body">
                                <button type="button" class="btn-close" data-bs-dismiss="alert"
                                        aria-label="Close"></button>
                                <div class="d-flex">
                                    <div class="flex-shrink-0 me-3">
                                        <i class="ri-alert-line fs-16 align-middle"></i>
                                    </div>
                                    <div class="flex-grow-1">
                                        <h5 class="alert-heading"><?php echo esc_html__( 'Looks Like your current plan has reached its daily request limit !', 'fense-block-vpn-proxy' ) ?></h5>
                                        <p class="mb-0"><?php echo esc_html__( 'You can always upgrade your plan from ', 'fense-block-vpn-proxy' )
												. '<a target="_blank" class="text-danger" href="' . esc_url( FENSE_BPVT_MAIN_LINK ) . 'register">' . esc_html__( 'Fense', 'fense-block-vpn-proxy' ) . '</a>' ?></p>
                                    </div>
                                </div>
                            </div>
                        </div>
					<?php endif; ?>

                    <div class="col-lg-2">
                        <div class="nav nav-pills flex-column nav-pills-tab custom-verti-nav-pills text-center"
                             role="tablist" aria-orientation="vertical">
                            
                            <a class="nav-link active show" data-bs-toggle="pill" href="#general">
                                <i class=" ri-home-3-fill d-block fs-20 mb-1"></i> <?php echo esc_html__( 'General', 'fense-block-vpn-proxy' ) ?>
                            </a>
                            
                            <a class="nav-link" data-bs-toggle="pill" href="#protection">
                                <i class="ri-shield-fill d-block fs-20 mb-1"></i> <?php echo esc_html__( 'Protection', 'fense-block-vpn-proxy' ) ?>
                            </a>
                            
                            <a class="nav-link " data-bs-toggle="pill" href="#style" >
                                <i class="ri-brush-fill d-block fs-20 mb-1"></i> <?php echo esc_html__( 'Style', 'fense-block-vpn-proxy' ) ?>
                            </a>
                            
                            <a class="nav-link" data-bs-toggle="pill" href="#ips">
                                <i class="ri-space-ship-fill d-block fs-20 mb-1"></i> <?php echo esc_html__( 'ip', 'fense-block-vpn-proxy' ) ?>
                            </a>
                            
                            <a class="nav-link" data-bs-toggle="pill" href="#restrict-country">
                                <i class=" ri-lock-2-fill d-block fs-20 mb-1"></i> <?php echo esc_html__( 'Restrict Country', 'fense-block-vpn-proxy' ) ?>
                            </a>
                            
                            <a class="nav-link" data-bs-toggle="pill" href="#about">
                                <i class=" ri-information-fill d-block fs-20 mb-1"></i> <?php echo esc_html__( 'About', 'fense-block-vpn-proxy' ) ?>
                            </a>

                            <a class="nav-link"
                               href="<?php echo esc_url( FENSE_BPVT_MAIN_LINK ) ?>contact-us"
                               target="_blank"
                            >
                                <i class=" ri-external-link-fill d-block fs-20 mb-1"></i> <?php echo esc_html__( 'Support', 'fense-block-vpn-proxy' ) ?>
                            </a>
                        </div>
                    </div> <!-- end col-->

                    <div class="col-lg-10">
						
						<?php if ( !$Fense_FUN->IsKeyValid() ): ?>
                            <div class="alert alert-danger alert-dismissible alert-label-icon label-arrow fade show mb-xl-0"
                                 role="alert">
                                <i class="ri-error-warning-line label-icon"></i>
                                <p>
									<?php echo esc_html__( 'Important : plugin is not activated because You are using a wrong Access Token. If you don\'t have an account feel free to register an account for free from ', 'fense-block-vpn-proxy' )
										. '<a target="_blank" class="text-primary" href="' . esc_url( FENSE_BPVT_MAIN_LINK ) . 'register">' . esc_html__( 'Fense', 'fense-block-vpn-proxy' ) . '</a>' ?>
                                </p>
                                <p>
									<?php echo esc_html__( 'After creating an account login and copy your Access Token from your account dashboard and put it here in Api Key below. see our ', 'fense-block-vpn-proxy' )
										. '<a target="_blank"  class="text-primary" href="' . esc_url( FENSE_BPVT_MAIN_LINK ) . 'wordpress">' . esc_html__( 'docs', 'fense-block-vpn-proxy' ) . '</a>' ?>
                                </p>
                            </div>
						<?php endif; ?>

                        <div class="tab-content text-muted mt-3 mt-lg-0">
                            <div class="tab-pane fade active show" id="general" role="tabpanel">
                                <div class="d-flex mb-4">
                                    <form id="form1" method="POST" action="options.php">
										<?php
										settings_fields( 'FENSE_BPVT_tab_1' );
										do_settings_sections( 'FENSE_BPVT_tab_1' );
										?>
                                    </form>
                                </div>
                            </div>
                            
                            <!--end tab-pane-->
                            <div class="tab-pane fade" id="protection" role="tabpanel">
                                <div class="d-flex mb-4">
                                    <form id="form2" method="POST" action="options.php">
										<?php
										settings_fields( 'FENSE_BPVT_tab_2' );
										do_settings_sections( 'FENSE_BPVT_tab_2' );
										?>
                                    </form>
                                </div>
                            </div>
                            <!--end tab-pane-->

                            <div class="tab-pane fade " id="style" role="tabpanel">
                                <div class="d-flex mb-4">
                                    <form id="form3" method="POST" action="options.php">
										<?php
										settings_fields( 'FENSE_BPVT_tab_3' );
										do_settings_sections( 'FENSE_BPVT_tab_3' );
										?>
                                    </form>
                                </div>
                            </div>
                            <!--end tab-pane-->

                            <!--end tab-pane-->
                            <div class="tab-pane fade" id="restrict-country" role="tabpanel">
                                <div class="d-inline-block mb-4">

                                    <div class="alert alert-secondary alert-dismissible alert-label-icon label-arrow fade show"
                                         role="alert">
                                        <i class="ri-check-double-line label-icon"></i>
										<?php echo esc_html__( 'Restrict Country Options works if you liked to block some countries or enable your site on specific countries Only', 'fense-block-vpn-proxy' ); ?>
                                        <button type="button" class="btn-close" data-bs-dismiss="alert"
                                                aria-label="Close"></button>
                                    </div>

                                    <div class="alert alert-danger alert-dismissible alert-label-icon label-arrow fade show mb-xl-0"
                                         role="alert">
                                        <i class="ri-error-warning-line label-icon"></i>
                                        <p><?php echo esc_html__( 'Block specific countries means that all traffic from the countries you specify will be blocked regardless of whether they are detected as a PROXY/VPN.', 'fense-block-vpn-proxy' ); ?></p>
                                        <p><?php echo esc_html__( 'Enable specific Countries Means that all Traffic comes from countries you selected will be allowed through and countries you did not select Will always get blocked even if they are not detected as a PROXY/VPN', 'fense-block-vpn-proxy' ); ?></p>
                                        <p><?php echo esc_html__( 'We recommend to leave it empty to get all Traffic', 'fense-block-vpn-proxy' ); ?></p>
                                        <button type="button" class="btn-close" data-bs-dismiss="alert"
                                                aria-label="Close"></button>
                                    </div>

                                    <form id="form4" method="POST" action="options.php">
										<?php
										settings_fields( 'FENSE_BPVT_tab_4' );
										do_settings_sections( 'FENSE_BPVT_tab_4' );
										?>
                                    </form>
                                </div>
                            </div>
                            <!--end tab-pane-->
                            
                            <!--end tab-pane-->
                            <div class="tab-pane fade" id="ips" role="tabpanel">

                                <div class="alert alert-info alert-dismissible alert-label-icon label-arrow fade show mb-xl-0"
                                     role="alert">
                                    <i class="ri-error-warning-line label-icon"></i>
                                    <p><strong><?php echo esc_html__( 'IP Whitelisting', 'fense-block-vpn-proxy' ); ?></strong> <?php echo esc_html__( 'lets you exempt specific IP addresses or ranges from your site’s proxy/VPN blocking. Even if our plugin flags a request as proxy or VPN traffic, any IP on the whitelist will still be allowed to pass through.', 'fense-block-vpn-proxy' ); ?></p>

                                    <p><strong><?php echo esc_html__( 'IP Blacklisting', 'fense-block-vpn-proxy' ); ?></strong> <?php echo esc_html__( 'lets you explicitly block specific IPs or ranges, even if they’re not detected as proxy/VPN. Any request from a blacklisted IP is gonna be Blocked!.', 'fense-block-vpn-proxy' ); ?></p>
                                    <button type="button" class="btn-close" data-bs-dismiss="alert"
                                            aria-label="Close"></button>
                                </div>
                                
                                <div class="d-flex mb-4">
                                    
                                    <form class=" needs-validation was-validated" id="form5" method="POST" action="options.php">
                                        <?php
										settings_fields( 'FENSE_BPVT_tab_6' );
										do_settings_sections( 'FENSE_BPVT_tab_6' );
										?>
                                    </form>
                                </div>
                            </div>
                            <!--end tab-pane-->

                            <!--end tab-pane-->
                            <div class="tab-pane fade" id="about" role="tabpanel">
                                <div class="d-inline-block mb-4" style="width: 100%">
                                    <!-- Accordions Bordered -->
                                    <div class="accordion custom-accordionwithicon custom-accordion-border accordion-border-box accordion-secondary"
                                         id="accordionBordered">
                                        <div class="accordion-item">
                                            <h2 class="accordion-header" id="accordionborderedExample1">
                                                <button class="accordion-button" type="button" data-bs-toggle="collapse"
                                                        data-bs-target="#accor_borderedExamplecollapse1"
                                                        aria-expanded="true"
                                                        aria-controls="accor_borderedExamplecollapse1">
													<?php echo esc_html__( 'What is Fense?', 'fense-block-vpn-proxy' ); ?>
                                                </button>
                                            </h2>
                                            <div id="accor_borderedExamplecollapse1"
                                                 class="accordion-collapse collapse show"
                                                 aria-labelledby="accordionborderedExample1"
                                                 data-bs-parent="#accordionBordered">
                                                <div class="accordion-body">
													<?php echo esc_html__( 'it is a Great service that offers a great way to prevent proxies/vpn/tor and all other bad traffic from accessing your website', 'fense-block-vpn-proxy' ); ?>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="accordion-item mt-2">
                                            <h2 class="accordion-header" id="accordionborderedExample2">
                                                <button class="accordion-button collapsed" type="button"
                                                        data-bs-toggle="collapse"
                                                        data-bs-target="#accor_borderedExamplecollapse2"
                                                        aria-expanded="false"
                                                        aria-controls="accor_borderedExamplecollapse2">
													<?php echo esc_html__( 'Why u always should use Fense?', 'fense-block-vpn-proxy' ); ?>
                                                </button>
                                            </h2>
                                            <div id="accor_borderedExamplecollapse2" class="accordion-collapse collapse"
                                                 aria-labelledby="accordionborderedExample2"
                                                 data-bs-parent="#accordionBordered">
                                                <div class="accordion-body">
													<?php echo esc_html__( 'Fense protects your site from harmful and useless visits, protects your ads and increases revenue', 'fense-block-vpn-proxy' ); ?>
                                                </div>
                                            </div>
                                        </div>

                                        <div class="accordion-item mt-2">
                                            <h2 class="accordion-header" id="accordionborderedExample3">
                                                <button class="accordion-button collapsed" type="button"
                                                        data-bs-toggle="collapse"
                                                        data-bs-target="#accor_borderedExamplecollapse3"
                                                        aria-expanded="false"
                                                        aria-controls="accor_borderedExamplecollapse3">
													<?php echo esc_html__( 'Can Fense protect my ads?', 'fense-block-vpn-proxy' ); ?>
                                                </button>
                                            </h2>
                                            <div id="accor_borderedExamplecollapse3" class="accordion-collapse collapse"
                                                 aria-labelledby="accordionborderedExample3"
                                                 data-bs-parent="#accordionBordered">
                                                <div class="accordion-body">
													<?php echo esc_html__( "Let me explain to you what causes advertising companies to close your account as a publisher All advertising companies can see all the visits that come to their ad units, including your ad units. And let me tell you a secret. They rank the site's quality and relevance by the quality of its visits and what makes your visits quality low is the high precentage of proxy/vpn/tor in your total monthly visits", 'fense-block-vpn-proxy' ); ?>
                                                </div>
                                            </div>
                                        </div>

                                        <div class="accordion-item mt-2">
                                            <h2 class="accordion-header" id="accordionborderedExample3">
                                                <button class="accordion-button collapsed" type="button"
                                                        data-bs-toggle="collapse" data-bs-target="#tab4ggm"
                                                        aria-expanded="false" aria-controls="tab4ggm">
													<?php echo esc_html__( 'What makes advertising companies classify your site visit as good or not?', 'fense-block-vpn-proxy' ); ?>
                                                </button>
                                            </h2>
                                            <div id="tab4ggm" class="accordion-collapse collapse"
                                                 aria-labelledby="accordionborderedExample3"
                                                 data-bs-parent="#accordionBordered">
                                                <div class="accordion-body">
													<?php echo esc_html__( 'Good visit: Means that user ip is good he is not changing anything or using any program or app to do it , Bad visit: User uses an app or program to hide his original ip But with Fense plugin you can now rest and let plugin do the hard work for you and watch your site grow fast without a single proxy visit.', 'fense-block-vpn-proxy' ); ?>
                                                </div>
                                            </div>
                                        </div>
                                    </div>

                                    <hr>
                                    
                                    <a class="btn btn-soft-primary"
                                       href="<?php echo esc_url( FENSE_BPVT_MAIN_LINK ) ?>wordpress"
                                       target="_blank"
                                    >
                                        <i class=" ri-external-link-fill d-block fs-20 mb-1"></i> <?php echo esc_html__( 'docs', 'fense-block-vpn-proxy' ) ?>
                                    </a>

                                </div>
                            </div>
                            <!--end tab-pane-->
                        </div>
                    </div> <!-- end col-->

                    <div class="col-lg-12">

                        <div id="alert"></div>
                        
                        <div class="btn btn-primary mt-4" id="submit">
                            <i class="fas fa-floppy-disk"></i>
							<?php echo esc_html__( 'Save Changes' ) ?>
                        </div>
                        
						<?php settings_errors(); ?>
                    </div>
                </div> <!-- end row-->
            </div><!-- end card-body -->
        </div>
        </div>

        <div class="col-12">
            <div class="alert alert-secondary alert-dismissible alert-additional fade show" style="margin-bottom: 0 !important;" role="alert">
                <div class="alert-body">
                    <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
                    <div class="d-flex">
                        <div class="flex-shrink-0 me-3">
                            <i class="ri-notification-line fs-16 align-middle"></i>
                        </div>
                        <div class="flex-grow-1">
                            <h5 class="alert-heading"><?php echo esc_html__( 'Hello Friend !', 'fense-block-vpn-proxy' ); ?></h5>
                            <p class="mb-0"><?php echo esc_html__( 'You can always get a free key from ', 'fense-block-vpn-proxy' )
									. '<a target="_blank" class="text-danger" href="' . esc_url( FENSE_BPVT_MAIN_LINK ) . 'register">' . esc_html__( 'Fense', 'fense-block-vpn-proxy' ) . '</a>' ?></p>

                            <p class="mb-0"><?php echo esc_html__( 'How to use Fense Wordpress plugin see our ', 'fense-block-vpn-proxy' )
									. '<a target="_blank" class="text-danger" href="' . esc_url( FENSE_BPVT_MAIN_LINK ) . 'wordpress">' . esc_html__( 'docs', 'fense-block-vpn-proxy' ) . '</a>' ?></p>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
