<?php
 if ( ! defined( 'ABSPATH' ) ) exit;
require_once( 'legalPages.php' );
global $wpdb;
$lpObj = new legalPages();
$lpObj->lp_enqueue_editor();

$post_id = $object->ID;

if(!empty($_POST) && isset($_POST['lp-submit'])){



	if(isset($_POST['lp_eu_status'])){
	 update_option('lp_eu_cookie_enable',sanitize_text_field($_POST['lp_eu_status']));	
	} else {
	 update_option('lp_eu_cookie_enable','off');	
	}
	

	if(isset($_POST['lp_eu_theme_css'])) {
		update_option('lp_eu_theme_css', sanitize_text_field($_POST['lp_eu_theme_css']));
	} else {
		update_option('lp_eu_theme_css','0');
	}

	update_option('lp_eu_cookie_title',addslashes(sanitize_text_field($_POST['lp_eu_title'])));
	update_option('lp_eu_cookie_message',htmlentities(sanitize_text_field($_POST['lp_eu_message'])));
	update_option('lp_eu_box_color',sanitize_text_field($_POST['lp_eu_box_color']));
	update_option('lp_eu_button_color',sanitize_text_field($_POST['lp_eu_button_color']));
	update_option('lp_eu_button_text_color',sanitize_text_field($_POST['lp_eu_button_text_color']));
	update_option('lp_eu_text_color',sanitize_text_field($_POST['lp_eu_text_color']));

	update_option('lp_eu_button_text',sanitize_text_field($_POST['lp_eu_button_text']));
	update_option('lp_eu_link_text',sanitize_text_field($_POST['lp_eu_link_text']));
	update_option('lp_eu_link_url',sanitize_text_field($_POST['lp_eu_link_url']));
	update_option('lp_eu_text_size',sanitize_text_field($_POST['lp_eu_text_size']));
	update_option('lp_eu_link_color',sanitize_text_field($_POST['lp_eu_link_color']));
}


$lp_eu_get_visibility_post_id   = get_option('lp_eu_cookie_enable_' . $post_id);


$field_value = "";
if (trim($lp_eu_get_visibility_post_id) != "OFF") {
	 $field_value = " checked ";
}

wp_enqueue_script( 'jquery-minicolor',  plugin_dir_url( __FILE__ ) . 'js/jquery.miniColors.min.js', array('jquery') );
wp_enqueue_style('jquery-miniColor', plugin_dir_url( __FILE__ ) . 'css/minicolor/jquery.miniColors.css');

//Form validation library file
wp_enqueue_script('jquery-validation-plugin', plugin_dir_url( __FILE__ ) .'js/jquery.validate.min.js', array('jquery'));

?>

<div class="wrap">
        <div class="postbox all_pad">
            <form id="lp_eu_cookies_form" enctype="multipart/form-data" method="post" action="" name="terms">
                <div class="row">
                    <div class="col-md-9">
                        <label class="field_title"> 
                        
                             <?php _e('Adult Content Site','wplegalpages');?> : </label>
                        <label class="switch">

                            <input type="checkbox" <?php echo $field_value; ?> name="lp-is_adult" value="ON" >
                            <div class="slider round"></div>
                        </label>
                       <input id="post_aid" type="hidden" value="<?php echo $post_id; ?>" name="post_aid" />
                      
                    </div>
                  
                </div>
            </form>
        </div>
    </div>
 
