<?php
/*
  Plugin Name: Bullet List
  Plugin URI: https://www.oxilab.org/
  Description: Bullet List is the most easiest builder Plugin. Create multiple design with this.
  Author: Jay Ghosh
  Author URI: http://www.oxilab.org/
  Version: 1.0
 */
if (!defined('ABSPATH'))
    exit;
$team_bullet_list_ultimate_version = '1.0';
define('Team_Plugins_bullet_list', plugin_dir_path(__FILE__));


include Team_Plugins_bullet_list . 'admin/public-data.php';
add_shortcode('blu_ultimate_ayan', 'blu_ultimate_ayan_shortcode');

function blu_ultimate_ayan_shortcode($atts) {
    extract(shortcode_atts(array('id' => ' ',), $atts));
    $styleid = $atts['id'];
    blu_ultimate_ayan_shortcode_function($styleid);
}

function blu_list_font_familly_charecter($data) {
    $data = str_replace('+', ' ', $data);
    $data = explode(':', $data);
    return $data[0];
}

if (is_admin()) {
    add_action('admin_menu', 'team_bullet_list_menu');

    function team_bullet_list_menu() {
        add_menu_page('bullet list', 'bullet list', 'manage_options', 'team-bullet-list-ultimate', 'team_bullet_list_home');
        add_submenu_page('team-bullet-list-ultimate', 'team-bullet-list-ultimate', 'bullet lists', 'manage_options', 'team-bullet-list-ultimate', 'team_bullet_list_home');
        add_submenu_page('team-bullet-list-ultimate', 'team bullet list new', 'create new', 'manage_options', 'team-bullet-list-ultimate-new', 'team_bullet_list_new');
    }

    function team_bullet_list_home() {
        if (!current_user_can('manage_options')) {
            wp_die(__('You do not have sufficient permissions to access this page.'));
        }
        include(Team_Plugins_bullet_list . 'home.php');
    }

    function team_bullet_list_new() {
          if (!current_user_can('manage_options')) {
            wp_die(__('You do not have sufficient permissions to access this page.'));
        }
        include(Team_Plugins_bullet_list . 'admin.php');
    }

    register_activation_hook(__FILE__, 'team_bullet_list_install');

    function team_bullet_list_install() {
        global $wpdb;
        global $team_bullet_list_ultimate_version;

        $bullet_name = $wpdb->prefix . 'team_bullet_list_ultimate_style';
        $bullet_list = $wpdb->prefix . 'team_bullet_list_ultimate_list';

        $charset_collate = $wpdb->get_charset_collate();

        $sql1 = "CREATE TABLE $bullet_name (
		id mediumint(5) NOT NULL AUTO_INCREMENT,
                                name varchar(50) NOT NULL,
		style_name varchar(10) NOT NULL,
                 
                                css varchar(1000) NOT NULL,
		PRIMARY KEY  (id)
	) $charset_collate;";
        $sql2 = "CREATE TABLE $bullet_list (
		id mediumint(5) NOT NULL AUTO_INCREMENT,
                                styleid mediumint(6) NOT NULL,
                                title varchar(100),
                                files text,
                                css varchar(100),
                                icon varchar(100),
		PRIMARY KEY  (id)
	) $charset_collate;";

        require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
        dbDelta($sql1);
        dbDelta($sql2);

        add_option('team_bullet_list_ultimate_version', $team_bullet_list_ultimate_version);
    }
    function blu_promote_free() {
    ?>

    <div class="blu-admin-wrapper-promote">
        <div class="col-lg-5 col-md-5 hidden-sm hidden-xs">
            <h1>Bullet List  <span>Ultimate</span></h1>
            <p>If you have any difficulties in using the options, please follow the link to <a href="https://www.oxilab.org/downloads/bullet-list/">Demo</a> </p>
        </div>
        <div class="col-lg-4 col-md-4 col-sm-12 col-xm-12">
            <p><a target="_blank" href="https://www.oxilab.org/downloads/bullet-list/" class="blu-admin-wrapper-promote-botton"><i class="fa fa-cart-plus" aria-hidden="true"></i> Upgrade NOW </a> <br> Just click on "Upgrade NOW" to get Pro Version only $10.99.</p>
        </div>
        <div class="col-lg-3 col-md-3  hidden-sm hidden-xs blu-admin-wrapper-promote-rate">
            <p> <i class="fa fa-heart" aria-hidden="true"></i>  <a target="_blank" href="https://wordpress.org/support/plugin/bullet-list/reviews/">Rate Us</a></p>
            <p> <i class="fa fa-life-ring" aria-hidden="true"></i>  <a target="_blank" href="https://wordpress.org/support/plugin/bullet-list/">Support Ticket</a></p>
            <p> <i class="fa fa-envelope" aria-hidden="true"></i>  <a target="_blank" href="https://www.oxilab.org/contact-us/">Contact Oxilab</a></p>
            <p> <i class="fa fa-youtube" aria-hidden="true"></i> <a target="_blank" href="https://youtu.be/LnBBflKuc3w">Video Tutorials</a></p>
        </div>
    </div>
    <?php
}

}


