/wp-content/plugins/membership/membershipincludes/classes/membershipadmin.php
PHP | 7679 lines | 6042 code | 1458 blank | 179 comment | 829 complexity | abcfed5a5d8add241782e0275b9eaee5 MD5 | raw file
Possible License(s): GPL-2.0, GPL-3.0, AGPL-1.0, LGPL-3.0, LGPL-2.1
Large files files are truncated, but you can click here to view the full file
- <?php
- if(!class_exists('membershipadmin')) {
-
- class membershipadmin {
-
- var $build = 14;
- var $db;
-
- //
- var $showposts = 25;
- var $showpages = 100;
-
- var $tables = array('membership_levels', 'membership_rules', 'subscriptions', 'subscriptions_levels', 'membership_relationships', 'membermeta', 'communications', 'urlgroups', 'ping_history', 'pings', 'coupons');
-
- var $membership_levels;
- var $membership_rules;
- var $membership_relationships;
- var $subscriptions;
- var $subscriptions_levels;
- var $membermeta;
- var $communications;
- var $urlgroups;
- var $ping_history;
- var $pings;
- var $coupons;
-
- // Class variable to hold a link to the tooltips class
- var $_tips;
-
- // The Wizard
- var $potter;
-
- // The tutorial
- var $tutorial;
-
- // Coupons
- var $_coupons;
-
- // For the coupons datepicker
- var $language;
-
-
- function __construct() {
-
- global $wpdb;
-
- $this->db =& $wpdb;
-
- foreach($this->tables as $table) {
- $this->$table = membership_db_prefix($this->db, $table);
- }
-
- // Instantiate the tooltips class and set the icon
- $this->_tips = new WpmuDev_HelpTooltips();
- $this->_tips->set_icon_url(membership_url('membershipincludes/images/information.png'));
-
- // Initiate the wizard class
- $this->potter = new M_Wizard();
-
- // Add administration actions
- add_action('init', array(&$this, 'initialise_plugin'), 1);
-
- // Add in admin area membership levels
- add_action('init', array(&$this, 'initialise_membership_protection'), 999);
-
- if( (function_exists('is_plugin_active_for_network') && is_plugin_active_for_network('membership/membershippremium.php')) && (defined('MEMBERSHIP_GLOBAL_TABLES') && MEMBERSHIP_GLOBAL_TABLES === true)) {
- add_action('network_admin_menu', array(&$this, 'add_admin_menu'));
- } else {
- add_action('admin_menu', array(&$this, 'add_admin_menu'));
- }
-
- add_action( 'plugins_loaded', array(&$this, 'load_textdomain'));
-
- // Header actions
- add_action('load-toplevel_page_membership', array(&$this, 'add_admin_header_membership'));
- add_action('load-membership_page_membershipmembers', array(&$this, 'add_admin_header_members'));
- add_action('load-membership_page_membershiplevels', array(&$this, 'add_admin_header_membershiplevels'));
- add_action('load-membership_page_membershipsubs', array(&$this, 'add_admin_header_membershipsubs'));
- add_action('load-membership_page_membershipcoupons', array(&$this, 'add_admin_header_membershipcoupons'));
- add_action('load-membership_page_membershipgateways', array(&$this, 'add_admin_header_membershipgateways'));
- add_action('load-membership_page_membershipoptions', array(&$this, 'add_admin_header_membershipoptions'));
- add_action('load-membership_page_membershipcommunication', array(&$this, 'add_admin_header_membershipcommunication'));
- add_action('load-membership_page_membershipurlgroups', array(&$this, 'add_admin_header_membershipurlgroups'));
- add_action('load-membership_page_membershippings', array(&$this, 'add_admin_header_membershippings'));
-
- add_action('load-users_page_membershipuser', array(&$this, 'add_admin_header_membershipuser'));
-
- add_filter('membership_level_sections', array(&$this, 'default_membership_sections'));
-
- // Media management additional fields
- add_filter('attachment_fields_to_edit', array(&$this, 'add_media_protection_settings'), 99, 2);
- add_filter('attachment_fields_to_save', array(&$this, 'save_media_protection_settings'), 99, 2);
-
- // rewrites
- add_action('generate_rewrite_rules', array(&$this, 'add_rewrites'));
- add_filter('query_vars', array(&$this, 'add_queryvars') );
-
- // profile field for feeds
- add_action('show_user_profile', array(&$this, 'add_profile_feed_key') );
-
- // Pings
- add_action('membership_subscription_form_after_levels', array(&$this, 'show_subscription_ping_information'));
- add_action('membership_subscription_add', array(&$this, 'update_subscription_ping_information'));
- add_action('membership_subscription_update', array(&$this, 'update_subscription_ping_information'));
-
- add_action('membership_level_form_after_rules', array(&$this, 'show_level_ping_information'));
- add_action('membership_level_add', array(&$this, 'update_level_ping_information'));
- add_action('membership_level_update', array(&$this, 'update_level_ping_information'));
-
- // Ajax calls have to go here because admin-ajax.php is an admin call even though we're calling it from the front end.
- add_action( 'wp_ajax_nopriv_buynow', array(&$this, 'popover_signup_form') );
-
- //login and register are no-priv only because, well they aren't logged in or registered
- add_action( 'wp_ajax_nopriv_register_user', array(&$this, 'popover_register_process') );
- add_action( 'wp_ajax_nopriv_login_user', array(&$this, 'popover_login_process') );
-
- // if logged in:
- add_action( 'wp_ajax_buynow', array(&$this, 'popover_sendpayment_form') );
- add_action( 'wp_ajax_extra_form', array(&$this, 'popover_extraform_process') );
- add_action( 'wp_ajax_register_user', array(&$this, 'popover_register_process') );
- add_action( 'wp_ajax_login_user', array(&$this, 'popover_login_process') );
-
- // Helper actions
- add_action( 'membership_activate_addon', array(&$this, 'activate_addon'), 10, 1 );
- add_action( 'membership_deactivate_addon', array(&$this, 'deactivate_addon'), 10, 1 );
-
- // Level shortcodes filters
- add_filter( 'membership_level_shortcodes', array(&$this, 'build_level_shortcode_list' ) );
-
- add_action( 'plugins_loaded', array(&$this, 'load_tutorial'), 11); //init tutorial after translation loaded
-
- // Add in the coupon class
- $this->_coupons = new M_Coupon();
-
- }
-
- function membershipadmin() {
- $this->__construct();
- }
-
- function load_textdomain() {
-
- $locale = apply_filters( 'membership_locale', get_locale() );
- $mofile = membership_dir( "membershipincludes/languages/membership-$locale.mo" );
-
- if ( file_exists( $mofile ) ) {
- load_textdomain( 'membership', $mofile );
- }
-
- //setup language code for jquery datepicker translation
- $temp_locales = explode('_', get_locale());
- $this->language = ($temp_locales[0]) ? $temp_locales[0] : 'en';
-
- }
-
- function load_tutorial() {
- // Add in pointer tutorial
- $this->tutorial = new M_Tutorial();
- $this->tutorial->serve();
- }
-
- function initialise_plugin() {
-
- global $user, $M_options;
-
- $installed = get_option('M_Installed', false);
-
- if(empty($user) || !method_exists($user, 'has_cap')) {
- $user = wp_get_current_user();
- }
-
- if($installed === false || $installed != $this->build) {
- include_once(membership_dir('membershipincludes/classes/upgrade.php') );
-
- M_Upgrade($installed);
- update_option('M_Installed', $this->build);
-
- // Add in our new capability
- if(!$user->has_cap('membershipadmin') && defined('MEMBERSHIP_SETACTIVATORAS_ADMIN') && MEMBERSHIP_SETACTIVATORAS_ADMIN == 'yes') {
- $user->add_cap('membershipadmin');
- }
-
- $this->create_defaults();
- }
-
- // Add in our new capability
- if($user->user_login == MEMBERSHIP_MASTER_ADMIN && !$user->has_cap('membershipadmin')) {
- $user->add_cap('membershipadmin');
- }
-
-
- if($user->has_cap('membershipadmin')) {
- // profile field for capabilities
- //add_action( 'edit_user_profile', array(&$this, 'add_membershipadmin_capability') );
- //add_action( 'edit_user_profile_update', array(&$this, 'update_membershipadmin_capability'));
-
- // If the user is a membershipadmin user then we can add in notices
- add_action('all_admin_notices', array(&$this, 'show_membership_status_notice'));
-
- }
-
- if(defined('MEMBERSHIP_GLOBAL_TABLES') && MEMBERSHIP_GLOBAL_TABLES === true) {
- if(function_exists('get_blog_option')) {
- $M_options = get_blog_option(MEMBERSHIP_GLOBAL_MAINSITE, 'membership_options', array());
- } else {
- $M_options = get_option('membership_options', array());
- }
- } else {
- $M_options = get_option('membership_options', array());
- }
-
- // Short codes
- if(!empty($M_options['membershipshortcodes'])) {
- foreach($M_options['membershipshortcodes'] as $key => $value) {
- if(!empty($value)) {
- add_shortcode(stripslashes(trim($value)), array(&$this, 'do_fake_shortcode') );
- }
- }
- }
-
- // Admin only Shortcodes setup
- if(!empty($M_options['membershipadminshortcodes'])) {
- foreach($M_options['membershipadminshortcodes'] as $key => $value) {
- if(!empty($value)) {
- add_shortcode(stripslashes(trim($value)), array(&$this, 'do_fake_shortcode') );
- }
- }
- }
-
- do_action('membership_register_shortcodes');
-
- add_action( 'wp_ajax_m_set_coupon', array(&$this, 'set_membership_coupon_cookie'));
- add_action( 'wp_ajax_nopriv_m_set_coupon', array(&$this, 'set_membership_coupon_cookie'));
-
- }
-
- function show_membership_status_notice() {
-
- global $user, $M_options;
-
- // Membership active check
- $membershipactive = M_get_membership_active();
- if($membershipactive == 'no') {
- echo '<div class="error fade"><p>' . sprintf(__("The Membership plugin is not enabled. To ensure your content is protected you should <a href='%s'>enable it</a>", 'membership'), wp_nonce_url("?page=membership&action=activate", 'toggle-plugin')) . '</p></div>';
- }
-
- // Membership admin check
- if(empty($user) || !method_exists($user, 'has_cap')) {
- $user = wp_get_current_user();
- }
-
- if($user->has_cap('membershipadmin')) {
- // Show a notice to say that they are logged in as the membership admin user and protection isn't enabled on the front end
- echo '<div class="update-nag">' . __("You are logged in as a <strong>Membership Admin</strong> user, you will therefore see all protected content on this site.", 'membership') . '</div>';
- }
-
-
- }
-
- function add_admin_menu() {
-
- global $menu, $admin_page_hooks;
-
- if(current_user_can('membershipadmin')) {
- // Add the menu page
- add_menu_page(__('Membership','membership'), __('Membership','membership'), 'membershipadmin', 'membership', array(&$this,'handle_membership_panel'), membership_url('membershipincludes/images/members.png'));
- //echo $hook;
- // Fix WP translation hook issue
- if(isset($admin_page_hooks['membership'])) {
- $admin_page_hooks['membership'] = 'membership';
- }
-
- do_action('membership_add_menu_items_top');
- // Add the sub menu
- add_submenu_page('membership', __('Members','membership'), __('All Members','membership'), 'membershipadmin', "membershipmembers", array(&$this,'handle_members_panel'));
- do_action('membership_add_menu_items_after_members');
- add_submenu_page('membership', __('Membership Levels','membership'), __('Access Levels','membership'), 'membershipadmin', "membershiplevels", array(&$this,'handle_levels_panel'));
- do_action('membership_add_menu_items_after_levels');
- add_submenu_page('membership', __('Membership Subscriptions','membership'), __('Subscription Plans','membership'), 'membershipadmin', "membershipsubs", array(&$this,'handle_subs_panel'));
- do_action('membership_add_menu_items_after_subscriptions');
- add_submenu_page('membership', __('Membership Coupons','membership'), __('Coupons','membership'), 'membershipadmin', "membershipcoupons", array(&$this,'handle_coupons_panel'));
- do_action('membership_add_menu_items_after_coupons');
- //add_submenu_page('membership', __('Membership Purchases','membership'), __('Extra Purchases','membership'), 'membershipadmin', "membershippurchases", array(&$this,'handle_purchases_panel'));
- do_action('membership_add_menu_items_after_purchases');
- add_submenu_page('membership', __('Membership Communication','membership'), __('Communications','membership'), 'membershipadmin', "membershipcommunication", array(&$this,'handle_communication_panel'));
- do_action('membership_add_menu_items_after_communications');
- add_submenu_page('membership', __('Membership URL Groups','membership'), __('URL Groups','membership'), 'membershipadmin', "membershipurlgroups", array(&$this,'handle_urlgroups_panel'));
- do_action('membership_add_menu_items_after_urlgroups');
- add_submenu_page('membership', __('Membership Pings','membership'), __('Remote Pings','membership'), 'membershipadmin', "membershippings", array(&$this,'handle_pings_panel'));
- do_action('membership_add_menu_items_after_pings');
- add_submenu_page('membership', __('Membership Gateways','membership'), __('Payment Gateways','membership'), 'membershipadmin', "membershipgateways", array(&$this,'handle_gateways_panel'));
- do_action('membership_add_menu_items_after_gateways');
- add_submenu_page('membership', __('Membership Options','membership'), __('Options','membership'), 'membershipadmin', "membershipoptions", array(&$this,'handle_options_panel'));
- do_action('membership_add_menu_items_after_options');
- do_action('membership_add_menu_items_bottom');
- }
-
-
- }
-
- // Admin area protection
- function initialise_membership_protection() {
-
- global $user, $member, $M_options, $M_Rules, $wp_query, $wp_rewrite, $M_active;
- // Set up some common defaults
-
- static $initialised = false;
-
- if($initialised) {
- // ensure that this is only called once, so return if we've been here already.
- return;
- }
-
- $M_options = get_option('membership_options', array());
- // Check if the membership plugin is active
- $M_active = get_option('membership_active', 'no');
-
- if(empty($user) || !method_exists($user, 'has_cap')) {
- $user = wp_get_current_user();
- }
-
- if(!method_exists($user, 'has_cap') || $user->has_cap('membershipadmin') || $M_active == 'no') {
- // Admins can see everything
- return;
- }
-
- // Users
- $member = new M_Membership($user->ID);
-
- if($user->ID > 0 && $member->has_levels()) {
- // Load the levels for this member - and associated rules
- $member->load_admin_levels( true );
- } else {
- // need to grab the stranger settings
- if(isset($M_options['strangerlevel']) && $M_options['strangerlevel'] != 0) {
- $member->assign_admin_level($M_options['strangerlevel'], true );
- }
- }
-
- do_action('membership-admin-add-shortcodes');
-
- // Set the initialisation status
- $initialised = true;
-
- }
-
- // Add admin headers
-
- function add_admin_header_core() {
-
- // Add in help pages
- $screen = get_current_screen();
- $help = new M_Help( $screen );
- $help->attach();
-
- // Add in default style sheet with common styling elements
- wp_enqueue_style('defaultcss', membership_url('membershipincludes/css/default.css'), array(), $this->build);
-
- }
-
- function add_admin_header_membership() {
- // The dashboard - top level menu
-
- global $wp_version;
-
- // Load the core first
- $this->add_admin_header_core();
-
- wp_enqueue_script('dashjs', membership_url('membershipincludes/js/dashboard.js'), array( 'jquery' ), $this->build);
-
- if(version_compare( preg_replace('/-.*$/', '', $wp_version), "3.3", '<')) {
- wp_enqueue_style('dashcss', membership_url('membershipincludes/css/dashboard.css'), array('widgets'), $this->build);
- } else {
- wp_enqueue_style('dashcss', membership_url('membershipincludes/css/dashboard.css'), array(), $this->build);
- }
- // Add localisation for the wizard
- wp_localize_script('dashjs', 'membershipwizard', array( 'ajaxurl' => admin_url( 'admin-ajax.php' ),
- 'membershiploading' => __('Loading...', 'membership'),
- 'membershipnextstep' => __('Next Step »','membership'),
- 'membershipgonewrong' => __('Something has gone wrong with the Wizard, please try clicking the button again.', 'membership'),
- 'membershiplevel' => __('Level', 'membership'),
- ));
-
- $this->handle_membership_dashboard_updates();
- }
-
- function add_admin_header_membershiplevels() {
-
- global $wp_version;
-
- $this->add_admin_header_core();
-
- wp_enqueue_script('levelsjs', membership_url('membershipincludes/js/levels.js'), array( 'jquery-ui-sortable', 'jquery-ui-draggable', 'jquery-ui-droppable' ), $this->build);
-
- if(version_compare( preg_replace('/-.*$/', '', $wp_version), "3.3", '<')) {
- wp_enqueue_style('levelscss', membership_url('membershipincludes/css/levels.css'), array('widgets'), $this->build);
- } else {
- wp_enqueue_style('levelscss', membership_url('membershipincludes/css/levels.css'), array(), $this->build);
- }
-
- wp_localize_script( 'levelsjs', 'membership', array( 'deletelevel' => __('Are you sure you want to delete this level?','membership'),
- 'deactivatelevel' => __('Are you sure you want to deactivate this level?','membership'),
- 'movetopositive' => __('Moving to the Positive area will remove any Negative rules you have set - is that ok?','membership'),
- 'movetonegative' => __('Moving to the Negative area will remove any Positive rules you have set - is that ok?','membership')
- ) );
-
- $this->handle_levels_updates();
- }
-
- function add_admin_header_membershipsubs() {
-
- global $wp_version;
- // Run the core header
- $this->add_admin_header_core();
-
- // Queue scripts and localise
- wp_enqueue_script('subsjs', membership_url('membershipincludes/js/subscriptions.js'), array( 'jquery-ui-sortable', 'jquery-ui-draggable', 'jquery-ui-droppable' ), $this->build);
-
- if(version_compare( preg_replace('/-.*$/', '', $wp_version), "3.3", '<')) {
- wp_enqueue_style('subscss', membership_url('membershipincludes/css/subscriptions.css'), array('widgets'), $this->build);
- } else {
- wp_enqueue_style('subscss', membership_url('membershipincludes/css/subscriptions.css'), array(), $this->build);
- }
-
- wp_localize_script( 'subsjs', 'membership', array( 'deletesub' => __('Are you sure you want to delete this subscription?','membership'), 'deactivatesub' => __('Are you sure you want to deactivate this subscription?','membership') ) );
-
- $this->handle_subscriptions_updates();
-
- }
-
- function add_admin_header_membershipcoupons() {
-
- global $wp_version;
- // Run the core header
- $this->add_admin_header_core();
-
- wp_enqueue_script( 'jquery-ui-datepicker' );
- wp_enqueue_script( 'jquery-ui-timepicker', membership_url('membershipincludes/js/datepicker/js/jquery.timepicker.min.js'), array('jquery', 'jquery-ui-core', 'jquery-ui-datepicker') , $this->build );
-
- //only load languages for datepicker if not english (or it will show Chinese!)
- if ($this->language != 'en')
- wp_enqueue_script( 'jquery-datepicker-i18n', membership_url( 'membershipincludes/js/datepicker/js/datepicker-i18n.min.js'), array('jquery', 'jquery-ui-core', 'jquery-ui-datepicker'), $this->build);
-
- wp_enqueue_style( 'jquery-datepicker-css', '//ajax.googleapis.com/ajax/libs/jqueryui/1.8.19/themes/base/jquery-ui.css', false, $this->build);
-
- // Queue scripts and localise
- wp_enqueue_script('couponsjs', membership_url('membershipincludes/js/coupons.js'), array(), $this->build);
- wp_enqueue_style('couponscss', membership_url('membershipincludes/css/coupons.css'), array(), $this->build);
-
- wp_localize_script( 'couponsjs', 'membership', array( 'deletecoupon' => __('Are you sure you want to delete this coupon?','membership'),
- 'setlangugae' => $this->language,
- 'start_of_week' => (get_option('start_of_week')=='0') ? 7 : get_option('start_of_week')
- ) );
-
-
-
- $this->handle_coupons_updates();
-
- }
-
- function add_admin_header_members() {
-
- global $wp_version;
- // Run the core header
- $this->add_admin_header_core();
-
- wp_enqueue_script('membersjs', membership_url('membershipincludes/js/members.js'), array(), $this->build);
-
- if(version_compare( preg_replace('/-.*$/', '', $wp_version), "3.3", '<')) {
- // Using the level css file for now - maybe switch to a members specific one later
- wp_enqueue_style('memberscss', membership_url('membershipincludes/css/levels.css'), array('widgets'), $this->build);
- } else {
- // Using the level css file for now - maybe switch to a members specific one later
- wp_enqueue_style('memberscss', membership_url('membershipincludes/css/levels.css'), array(), $this->build);
- }
-
- wp_localize_script( 'membersjs', 'membership', array( 'deactivatemember' => __('Are you sure you want to deactivate this member?','membership') ) );
-
-
- $this->handle_members_updates();
-
- }
-
- function add_admin_header_membershipgateways() {
- $this->add_admin_header_core();
-
- $this->handle_gateways_panel_updates();
- }
-
- function add_admin_header_membershipoptions() {
- $this->add_admin_header_core();
-
- wp_enqueue_style('optionscss', membership_url('membershipincludes/css/options.css'), array(), $this->build);
-
- $this->handle_options_panel_updates();
- }
-
- function add_admin_header_membershipuser() {
- $this->add_admin_header_core();
-
- wp_enqueue_style('optionscss', membership_url('membershipincludes/css/options.css'), array(), $this->build);
- }
-
- function add_admin_header_membershipcommunication() {
- // Run the core header
- $this->add_admin_header_core();
-
- wp_enqueue_script('commsjs', membership_url('membershipincludes/js/communication.js'), array(), $this->build);
- wp_localize_script( 'commsjs', 'membership', array( 'deletecomm' => __('Are you sure you want to delete this message?','membership'), 'deactivatecomm' => __('Are you sure you want to deactivate this message?','membership') ) );
-
- $this->handle_communication_updates();
- }
-
- function add_admin_header_membershipurlgroups() {
- // Run the core header
- $this->add_admin_header_core();
-
- wp_enqueue_script('groupsjs', membership_url('membershipincludes/js/urlgroup.js'), array(), $this->build);
- wp_localize_script( 'groupsjs', 'membership', array( 'deletegroup' => __('Are you sure you want to delete this url group?','membership') ) );
-
-
- $this->handle_urlgroups_updates();
- }
-
- function add_admin_header_membershippings() {
- // Run the core header
- $this->add_admin_header_core();
-
- wp_enqueue_script('pingsjs', membership_url('membershipincludes/js/ping.js'), array(), $this->build);
- wp_localize_script( 'pingsjs', 'membership', array( 'deleteping' => __('Are you sure you want to delete this ping and the associated history?','membership') ) );
-
- $this->handle_ping_updates();
- }
-
- // Panel handling functions
-
- function build_signup_stats() {
-
- $sql = $this->db->prepare( "SELECT YEAR(startdate) as year, MONTH(startdate)as month, DAY(startdate) as day, count(*) AS signedup FROM {$this->membership_relationships} WHERE startdate > DATE_SUB(CURDATE(), INTERVAL %d DAY) GROUP BY YEAR(startdate), MONTH(startdate), DAY(startdate) ORDER BY startdate DESC", 10 );
-
- $results = $this->db->get_results( $sql );
-
- if(!empty($results)) {
-
- $stats = array();
- $ticks = array();
- $data = array();
- foreach($results as $key => $res) {
-
- $stats[strtotime($res->year . "-" . $res->month . "-" . $res->day)] = (int) $res->signedup;
-
- }
-
- $startat = time();
- for($n = 0; $n < 11; $n++) {
- $switch = 10 - $n;
- $rdate = strtotime('-' . $switch . ' DAYS', $startat);
-
- $ticks[$n] = '"' . date('n', $rdate) . "/" . date('j', $rdate) . '"';
-
- if(isset($stats[strtotime(date("Y", $rdate) . "-" . date("n", $rdate) . "-" . date("j", $rdate))])) {
- $data[$n] = $stats[strtotime(date("Y", $rdate) . "-" . date("n", $rdate) . "-" . date("j", $rdate))];
- } else {
- $data[$n] = 0;
- }
- }
-
- $stats = $data;
-
- return compact('stats', 'ticks');
-
- } else {
- return false;
- }
-
- }
-
- function build_levels_stats() {
-
- $sql = "SELECT l.id, l.level_title, count(m.rel_id) as users FROM {$this->membership_levels} as l, {$this->membership_relationships} as m WHERE l.id = m.level_id GROUP BY l.id, l.level_title ORDER BY users DESC";
-
- $results = $this->db->get_results( $sql );
-
- if(!empty($results)) {
-
- $stats = array();
- $ticks = array();
- foreach($results as $key => $res) {
-
- $stats[] = (int) $res->users;
- $ticks[] = '"' . esc_html($res->level_title) . '"';
- }
-
- return compact('stats', 'ticks');
-
- } else {
- return false;
- }
-
- }
-
- function build_subs_stats() {
-
- $sql = "SELECT s.id, s.sub_name, count(m.rel_id) as users FROM {$this->subscriptions} as s, {$this->membership_relationships} as m WHERE s.id = m.sub_id GROUP BY s.id, s.sub_name ORDER BY users DESC";
-
- $results = $this->db->get_results( $sql );
-
- if(!empty($results)) {
-
- $stats = array();
- $ticks = array();
- foreach($results as $key => $res) {
-
- $stats[] = (int) $res->users;
- $ticks[] = '"' . esc_html($res->sub_name) . '"';
- }
-
- return compact('stats', 'ticks');
-
- } else {
- return false;
- }
-
- }
-
- function get_data($results) {
-
- $data = array();
-
- foreach( (array) $results as $key => $res) {
- $data[] = "[ " . $key . ", " . $res . " ]";
- }
-
- return "[ " . implode(", ", $data) . " ]";
-
- }
-
- function handle_membership_dashboard_updates() {
-
- global $page, $action;
-
- wp_reset_vars( array('action', 'page') );
-
- switch($action) {
-
- case 'activate': check_admin_referer('toggle-plugin');
- update_option('membership_active', 'yes');
- wp_safe_redirect( wp_get_referer() );
- break;
-
- case 'deactivate': check_admin_referer('toggle-plugin');
- update_option('membership_active', 'no');
- wp_safe_redirect( wp_get_referer() );
- break;
-
- default: do_action('membership_dashboard_' . $action);
- break;
-
- }
-
- wp_enqueue_script('flot_js', membership_url('membershipincludes/js/jquery.flot.min.js'), array('jquery'));
- wp_enqueue_script('mdash_js', membership_url('membershipincludes/js/dashboard.js'), array('jquery'));
-
- wp_localize_script( 'mdash_js', 'membership', array( 'signups' => __('Signups','membership'), 'members' => __('Members','membership') ) );
-
-
- add_action ('admin_head', array(&$this, 'dashboard_iehead'));
- add_action ('admin_head', array(&$this, 'dashboard_chartdata'));
-
- }
-
- function dashboard_chartdata() {
- $returned = $this->build_signup_stats();
- $levels = $this->build_levels_stats();
- $subs = $this->build_subs_stats();
-
- echo "\n" . '<script type="text/javascript">';
- echo "\n" . '/* <![CDATA[ */ ' . "\n";
-
- echo "var membershipdata = {\n";
- echo "chartonestats : " . $this->get_data($returned['stats']) . ",\n";
- echo "chartoneticks : " . $this->get_data($returned['ticks']) . ",\n";
-
- echo "charttwostats : " . $this->get_data($levels['stats']) . ",\n";
- echo "charttwoticks : " . $this->get_data($levels['ticks']) . ",\n";
-
- echo "chartthreestats : " . $this->get_data($subs['stats']) . ",\n";
- echo "chartthreeticks : " . $this->get_data($subs['ticks']) . "\n";
- echo "};\n";
-
- echo "\n" . '/* ]]> */ ';
- echo '</script>';
- }
-
- function dashboard_iehead() {
- echo '<!--[if IE]><script language="javascript" type="text/javascript" src="' . membership_url('membershipincludes/js/excanvas.min.js') . '"></script><![endif]-->';
- }
-
- function dashboard_members() {
-
- global $page, $action;
-
- $plugin = get_plugin_data(membership_dir('membershippremium.php'));
-
- $membershipactive = M_get_membership_active();
-
- echo __('Membership protection ','membership');
- echo __(' is ', 'membership');
-
- // Membership active toggle
- if($membershipactive == 'no') {
- echo '<strong>' . __('disabled', 'membership') . '</strong> <a id="enablemembership" href="' . wp_nonce_url("?page=" . $page. "&action=activate", 'toggle-plugin') . '" title="' . __('Click here to enable the plugin','membership') . '">' . __('[Enable it]','membership') . '</a>';
- } else {
- echo '<strong>' . __('enabled', 'membership') . '</strong> <a id="enablemembership" href="' . wp_nonce_url("?page=" . $page. "&action=deactivate", 'toggle-plugin') . '" title="' . __('Click here to enable the plugin','membership') . '">' . __('[Disable it]','membership') . '</a>';
- }
-
- echo '<br/><br/>';
-
- echo "<strong>" . __('Member breakdown', 'membership') . "</strong><br/>";
-
- $detail = $this->get_subscriptions_and_levels(array('sub_status' => 'active'));
- $subs = $this->get_subscriptions(array('sub_status' => 'active'));
-
- $levels = $this->get_membership_levels(array('level_id' => 'active'));
-
- echo "<table style='width: 100%;'>";
- echo "<tbody>";
- echo "<tr>";
- echo "<td style='width: 48%' valign='top'>";
- if($levels) {
- $levelcount = 0;
- echo "<table style='width: 100%;'>";
- echo "<tbody>";
- echo "<tr>";
- echo "<td colspan='2'><strong>" . __('Levels','membership') . "</strong></td>";
- echo "</tr>";
- foreach($levels as $key => $level) {
- echo "<tr>";
- echo "<td><a href='" . admin_url('admin.php?page=membershiplevels&action=edit&level_id=') . $level->id . "'>" . esc_html($level->level_title) . "</a></td>";
- // find out how many people are in this level
- $thiscount = $this->count_on_level( $level->id );
-
- echo "<td style='text-align: right;'>" . (int) $thiscount . "</td>";
- $levelcount += (int) $thiscount;
- echo "</tr>";
- }
- echo "</tbody>";
- echo "</table>";
- }
- echo "</td>";
-
- echo "<td style='width: 48%' valign='top'>";
- if($subs) {
- $subcount = 0;
- echo "<table style='width: 100%;'>";
- echo "<tbody>";
- echo "<tr>";
- echo "<td colspan='2'><strong>" . __('Subscriptions','membership') . "</strong></td>";
- echo "</tr>";
- foreach($subs as $key => $sub) {
- echo "<tr>";
- echo "<td><a href='" . admin_url('admin.php?page=membershipsubs&action=edit&sub_id=') . $sub->id . "'>" . $sub->sub_name . "</a></td>";
- // find out how many people are in this sub
- $thiscount = $this->count_on_sub( $sub->id );
-
- echo "<td style='text-align: right;'>" . (int) $thiscount . "</td>";
- $subcount += (int) $thiscount;
- echo "</tr>";
- }
- echo "</tbody>";
- echo "</table>";
- }
- echo "</td>";
-
- echo "</tr>";
- echo "</tbody>";
- echo "</table>";
-
- echo "<br/><strong>" . __('Member counts', 'membership') . "</strong><br/>";
-
- echo "<table style='width: 100%;'>";
- echo "<tbody>";
- echo "<tr>";
- echo "<td style='width: 48%' valign='top'>";
-
- echo "<table style='width: 100%;'>";
- echo "<tbody>";
-
- $usercount = $this->db->get_var( "SELECT count(*) FROM {$this->db->users} INNER JOIN {$this->db->usermeta} ON {$this->db->users}.ID = {$this->db->usermeta}.user_id WHERE {$this->db->usermeta}.meta_key = '{$this->db->prefix}capabilities'" );
-
- echo "<tr>";
- echo "<td>" . __('Total Members', 'membership') . "</td>";
- echo "<td style='text-align: right;'>" . $usercount . "</td>";
- echo "</tr>";
-
- $deactivecount = $this->db->get_var( $this->db->prepare("SELECT count(*) FROM {$this->db->usermeta} WHERE meta_key = %s AND meta_value = %s", $this->db->prefix . 'membership_active' , 'no') );
-
- echo "<tr>";
- echo "<td>" . __('Deactivated Members', 'membership') . "</td>";
- echo "<td style='text-align: right;'>" . $deactivecount . "</td>";
- echo "</tr>";
-
- echo "</tbody>";
- echo "</table>";
-
- echo "</td>";
-
- echo "<td style='width: 48%' valign='top'></td>";
-
- echo "</tr>";
- echo "</tbody>";
- echo "</table>";
-
- }
-
- function dashboard_statistics() {
-
- echo "<div id='memchartone'></div>";
- echo "<div id='memcharttwo'></div>";
- echo "<div id='memchartthree'></div>";
-
- do_action( 'membership_dashboard_statistics' );
- }
-
- function handle_membership_panel() {
-
- ?>
- <div class='wrap nosubsub'>
- <div class="icon32" id="icon-index"><br></div>
- <h2><?php _e('Membership dashboard','membership'); ?></h2>
-
- <?php
- $this->potter->conditional_show();
- ?>
-
- <div id="dashboard-widgets-wrap">
-
- <div class="metabox-holder" id="dashboard-widgets">
- <div style="width: 49%;" class="postbox-container">
- <div class="meta-box-sortables ui-sortable" id="normal-sortables">
-
- <div class="postbox " id="dashboard_right_now">
- <h3 class="hndle"><span><?php _e('Members','membership'); ?></span></h3>
- <div class="inside">
- <?php $this->dashboard_members(); ?>
- <br class="clear">
- </div>
- </div>
-
- <?php
- do_action( 'membership_dashboard_left' );
- ?>
- </div>
- </div>
-
- <div style="width: 49%;" class="postbox-container">
- <div class="meta-box-sortables ui-sortable" id="side-sortables">
-
- <?php
- do_action( 'membership_dashboard_right_top' );
- ?>
-
- <div class="postbox " id="dashboard_quick_press">
- <h3 class="hndle"><span><?php _e('Statistics','membership'); ?></span></h3>
- <div class="inside">
- <?php $this->dashboard_statistics(); ?>
- <br class="clear">
- </div>
- </div>
-
- <?php
- do_action( 'membership_dashboard_right' );
- ?>
-
- </div>
- </div>
-
- <div style="display: none; width: 49%;" class="postbox-container">
- <div class="meta-box-sortables ui-sortable" id="column3-sortables" style="">
- </div>
- </div>
-
- <div style="display: none; width: 49%;" class="postbox-container">
- <div class="meta-box-sortables ui-sortable" id="column4-sortables" style="">
- </div>
- </div>
- </div>
-
- <div class="clear"></div>
- </div>
-
- </div> <!-- wrap -->
- <?php
-
- }
-
- function handle_members_updates() {
-
- global $action, $page;
-
- wp_reset_vars( array('action', 'page') );
-
- if(isset($_GET['doaction']) || isset($_GET['doaction2'])) {
- if(addslashes($_GET['action']) == 'toggle' || addslashes($_GET['action2']) == 'toggle') {
- $action = 'bulk-toggle';
- }
- }
-
- switch(addslashes($action)) {
-
- case 'removeheader': $this->dismiss_user_help( $page );
- wp_safe_redirect( remove_query_arg( 'action' ) );
- break;
-
- case 'toggle': if(isset($_GET['member_id'])) {
- $user_id = (int) $_GET['member_id'];
-
- check_admin_referer('toggle-member_' . $user_id);
-
- $member = new M_Membership($user_id);
-
- if( $member->toggle_activation() ) {
- wp_safe_redirect( add_query_arg( 'msg', 7, wp_get_referer() ) );
- } else {
- wp_safe_redirect( add_query_arg( 'msg', 8, wp_get_referer() ) );
- }
-
- }
- break;
-
- case 'bulk-toggle':
- check_admin_referer('bulk-members');
- foreach($_GET['users'] AS $value) {
- if(is_numeric($value)) {
- $user_id = (int) $value;
-
- $member = new M_Membership($user_id);
-
- $member->toggle_activation();
- }
- }
-
- wp_safe_redirect( add_query_arg( 'msg', 7, wp_get_referer() ) );
- break;
-
- case 'bulkaddlevel-level-complete':
- case 'addlevel-level-complete':
- check_admin_referer($action);
- $members_id = $_POST['member_id'];
-
- $members = explode(',', $members_id);
- if($members) {
- foreach($members as $member_id) {
- $member = new M_Membership($member_id);
-
- $tolevel_id = (int) $_POST['tolevel_id'];
- if($tolevel_id) {
- $member->add_level($tolevel_id);
- }
- }
- }
-
- $this->update_levelcounts();
-
- wp_safe_redirect( add_query_arg( 'msg', 3, wp_get_original_referer() ) );
- break;
-
- case 'bulkdroplevel-level-complete':
- case 'droplevel-level-complete':
- check_admin_referer($action);
- $members_id = $_POST['member_id'];
-
- $members = explode(',', $members_id);
- if($members) {
- foreach($members as $member_id) {
- $member = new M_Membership($member_id);
-
- $fromlevel_id = (int) $_POST['fromlevel_id'];
- if($fromlevel_id) {
- $member->drop_level($fromlevel_id);
- }
- }
- }
-
- $this->update_levelcounts();
-
- wp_safe_redirect( add_query_arg( 'msg', 3, wp_get_original_referer() ) );
- break;
-
- case 'bulkmovelevel-level-complete':
- case 'movelevel-level-complete':
- check_admin_referer($action);
- $members_id = $_POST['member_id'];
-
- $members = explode(',', $members_id);
- if($members) {
- foreach($members as $member_id) {
- $member = new M_Membership($member_id);
-
- $fromlevel_id = (int) $_POST['fromlevel_id'];
- $tolevel_id = (int) $_POST['tolevel_id'];
- if($fromlevel_id && $tolevel_id) {
- $member->move_level($fromlevel_id, $tolevel_id);
- }
- }
- }
-
- $this->update_levelcounts();
-
- wp_safe_redirect( add_query_arg( 'msg', 3, wp_get_original_referer() ) );
- break;
-
- case 'bulkaddsub-sub-complete':
- case 'addsub-sub-complete':
- check_admin_referer($action);
- $members_id = $_POST['member_id'];
-
- $members = explode(',', $members_id);
- if($members) {
- foreach($members as $member_id) {
- $member = new M_Membership($member_id);
-
- $tosub_id = $_POST['tosub_id'];
- if($tosub_id) {
- $subs = explode('-',$tosub_id);
- if(count($subs) == 3) {
- $member->add_subscription($subs[0], $subs[1], $subs[2]);
- }
- }
- }
- }
-
- $this->update_levelcounts();
- $this->update_subcounts();
-
- wp_safe_redirect( add_query_arg( 'msg', 3, wp_get_original_referer() ) );
- break;
-
- case 'bulkdropsub-sub-complete':
- case 'dropsub-sub-complete':
- check_admin_referer($action);
- $members_id = $_POST['member_id'];
-
- $members = explode(',', $members_id);
- if($members) {
- foreach($members as $member_id) {
- $member = new M_Membership($member_id);
-
- $fromsub_id = (int) $_POST['fromsub_id'];
- if($fromsub_id) {
- $member->drop_subscription($fromsub_id);
- }
- }
- }
-
- $this->update_levelcounts();
- $this->update_subcounts();
-
- wp_safe_redirect( add_query_arg( 'msg', 3, wp_get_original_referer() ) );
- break;
-
- case 'bulkmovesub-sub-complete':
- case 'movesub-sub-complete':
- check_admin_referer($action);
- $members_id = $_POST['member_id'];
-
- $members = explode(',', $members_id);
- if($members) {
- foreach($members as $member_id) {
- $member = new M_Membership($member_id);
-
- $fromsub_id = (int) $_POST['fromsub_id'];
- $tosub_id = $_POST['tosub_id'];
- if($fromsub_id && $tosub_id) {
- $subs = explode('-',$tosub_id);
- if(count($subs) == 3) {
- $member->move_subscription($fromsub_id, $subs[0], $subs[1], $subs[2]);
- }
- }
- }
- }
-
- $this->update_levelcounts();
- $this->update_subcounts();
-
- wp_safe_redirect( add_query_arg( 'msg', 3, wp_get_original_referer() ) );
- break;
-
- case 'bulkmovegateway-gateway-complete':
- case 'movegateway-gateway-complete':
-
- check_admin_referer($action);
- $members_id = $_POST['member_id'];
-
- $members = explode(',', $members_id);
- if($members) {
- foreach($members as $member_id) {
- $member = new M_Membership($member_id);
-
- $fromgateway = $_POST['fromgateway'];
- $togateway = $_POST['togateway'];
- if(!empty($fromgateway) && !empty($togateway)) {
-
- $relationships = $member->get_relationships();
- foreach($relationships as $rel) {
- if($rel->usinggateway == $fromgateway) {
- $member->update_relationship_gateway( $rel->rel_id, $fromgateway, $togateway );
-
- }
- }
- }
- }
- }
-
- wp_safe_redirect( add_query_arg( 'msg', 3, wp_get_original_referer() ) );
- break;
-
- }
-
- }
-
- function handle_edit_member() {
-
- global $action, $page;
-
- wp_reset_vars( array('action', 'page') );
-
- }
-
- function handle_member_gateway_op( $operation = 'move', $member_id = false ) {
-
- global $action, $page, $action2, $M_Gateways;
-
- wp_reset_vars( array('action', 'page', 'action2') );
-
- if(empty($action) && !empty($action2)) $action = $action2;
-
- $gateways = apply_filters('M_gateways_list', array());
-
- $active = get_option('membership_activated_gateways', array());
-
- if(isset($_GET['fromgateway']) && !empty($_GET['fromgateway'])) {
- $fromgateway = stripslashes($_GET['fromgateway']);
- } else {
- $fromgateway = '';
- }
-
- switch($operation) {
-
- case 'move': $title = __('Move subscription to another gateway','membership');
- $formdescription = __('A subscription gateway handles the payment and renewal forms displayed for a subscription. Changing this should not be undertaken lightly, it can seriously mess up the subscriptions of your members.','membership') . "<br/><br/>";
-
- $html = "<h3>" . __('Gateway to move from for this / these member(s)','membership') . "</h3>";
- $html .= "<div class='level-details'>";
- $html .= "<select name='fromgateway' id='fromgateway' class='wide'>\n";
- $html .= "<option value='0'>" . __('Select the gateway to move from.','membership') . "</option>\n";
- $html .= "<option value='admin'>" . esc_html('admin' . " - " . "admin default gateway") . "</option>\n";
- if($gateways) {
- foreach($gateways as $key => $gateway) {
- if(in_array($key, $active)) {
- $html .= "<option value='" . esc_attr($key) . "'";
- if( $fromgateway == $key ) {
- $html .= " selected='selected'";
- }
- $html .= ">" . esc_html($key . " - " . $gateway) . "</option>\n";
- }
- }
- }
- $html .= "</select>\n";
- $html .= "</div>";
-
- $html .= "<h3>" . __('Gateway to move to for this / these member(s)','membership') . "</h3>";
- $html .= "<div class='level-details'>";
- $html .= "<select name='togateway' id='togateway' class='wide'>\n";
- $html .= "<option value='0'>" . __('Select the gateway to move to.','membership') . "</option>\n";
- $html .= "<option value='admin'>" . esc_html('admin' . " - " . "admin default gateway") . "</option>\n";
- reset($gateways);
- if($gateways) {
- foreach($gateways as $key => $gateway) {
- if(in_array($key, $active)) {
- $html .= "<option value='" . esc_attr($key) . "'>" . esc_html($key . " - " . $gateway) . "</option>\n";
- }
- }
- }
- $html .= "</select>\n";
- $html .= "</div>";
-
- $button = "Move";
- break;
-
- }
-
- ?>
- <div class='wrap nosubsub'>
- <div class="icon32" id="icon-users"><br></div>
- <h2><?php echo $title; ?></h2>
- <form action='admin.php?page=<?php echo $page; ?>' method='post'>
-
- <div class='level-liquid-left'>
-
- <div id='level-left'>
- <div id='edit-level' class='level-holder-wrap'>
- <div class='sidebar-name no-movecursor'>
- <h3><?php echo esc_html($title); ?></h3>
- </div>
- <div class='level-holder'>
- <br />
- <p class='description'><?php echo $formdescription; ?></p>
- <?php
- echo $html;
- ?>
-
- <div class='buttons'>
- <?php
- wp_original_referer_field(true, 'previous'); wp_nonce_field($action . '-gateway-complete');
- ?>
- <a href='?page=<?php echo $page; ?>' class='cancellink' title='Cancel add'><?php _e('Cancel', 'membership'); ?></a>
- <input type='submit' value='<?php _e($button, 'membership'); ?>' class='button-primary' />
- <input type='hidden' name='action' value='<?php esc_attr_e($action . '-gateway-complete'); ?>' />
- <?php
- if(is_array($member_id)) {
- ?>
- <input type='hidden' name='member_id' value='<?php esc_attr_e(implode(',',$member_id)); ?>' />
- <?php
- } else {
- ?>
- <input type='hidden' name='member_id' value='<?php esc_attr_e($member_id); ?>' />
- <?php
- }
-
- ?>
- </div>
-
- </div>
- </div>
- </div>
-
- </div> <!-- level-liquid-left -->
-
- </form>
- </div> <!-- wrap -->
- <?php
-
- }
-
- function handle_member_level_op($operation = 'add', $member_id = false) {
-
- global $action, $page, $action2;
-
- wp_reset_vars( array('action', 'page', 'action2') );
-
- if(empty($action) && !empty($action2)) $action = $action2;
-
- if(isset($_GET['fromlevel']) && !empty($_GET['fromlevel'])) {
- $fromlevel = $_GET['fromlevel'];
- } else {
- $fromlevel = '';
- }
-
- switch($operation) {
-
- case 'add': $title = __('Add member to a level','membership');
- $formdescription = __('A membership level controls the amount of access to the sites content this member will have.','membership') . "<br/><br/>";
- $formdescription .= __('By adding a membership level, you may actually be removing existing access to content.','membership');
-
- $html = "<h3>" . __('Level to add for this / these member(s)','membership') . "</h3>";
- $html .= "<div class='level-details'>";
- $html .= "<select name='tolevel_id' id='tolevel_id' class='wide'>\n";
- $html .= "<option value='0'>" . __('Select the level to add.','membership') . "</option>\n";
- $levels = $this->get_membership_levels(array('level_id' => 'active'));
- if($levels) {
- foreach($levels as $key => $level) {
- $html .= "<option value='" . esc_attr($level->id) . "'";
- $html .= ">" . esc_html($level->level_title) . "</option>\n";
- }
- }
- $html .= "</select>\n";
- $html .= "</div>";
-
- $button = "Add";
-
- break;
-
- case 'move': $title = __('Move member to another level','membership');
- $formdescription = __('A membership level controls the amount of access to the sites content this member will have.','membership') . "<br/><br/>";
-
- $html = "<h3>" . __('Level to move from for this / these member(s)','membership') . "</h3>";
- $html .= "<div class='level-details'>";
- $html .= "<select name='fromlevel_id' id='fromlevel_id' class='wide'>\n";
- $html .= "<option value='0'>" . __('Select the level to move from.','membership') . "</option>\n";
- $levels = $this->get_membership_levels(array('level_id' => 'active'));
- if($levels) {
- foreach($levels as $key => $level) {
- $html .= "<option value='" . esc_attr($level->id) . "'";
- if($fromlevel == $level->id) $html .= " selected='selected'";
- $html .= ">" . esc_html($level->level_title) . "</option>\n";
- }
- }
- $html .= "</select>\n";
- $html .= "</div>";
-
- $html .= "<h3>" . __('Level to move to for this / these member(s)','membership') . "</h3>";
- $html .= "<div class='level-details'>";
- $html .= "<select name='tolevel_id' id='tolevel_id' class='wide'>\n";
- $html .= "<option value='0'>" . __('Select the level to move to.','membership') . "</option>\n";
- reset($levels);
- if($levels) {
- foreach($levels as $key => $level) {
- $html .= "<option value='" . esc_attr($level->id) . "'";
- $html .= ">" . esc_html($level->level_title) . "</option>\n";
- }
- }
- $html .= "</select>\n";
- $html .= "</div>";
-
- $button = "Move";
- break;
-
- case 'drop': $title = __('Drop member from level','membership');
-
- $formdescription = __('A membership level controls the amount of access to the sites content this member will have.','membership') . "<br/><br/>";
- $formdescription .= __('By removing a membership level, you may actually be increasing existing access to content.','membership');
-
- $html = "<h3>" . __('Level to drop for this / these member(s)','membership') . "</h3>";
- $html .= "<div class='level-details'>";
- $html .= "<select name='fromlevel_id' id='fromlevel_id' class='wide'>\n";
- $html .= "<option value=''>" . __('Select the level to remove.','membership') . "</option>\n";
- $levels = $this->get_membership_levels(array('level_id' => 'active'));
- if($levels) {
- foreach($levels as $key => $level) {
- $html .= "<option value='" . esc_attr($level->id) . "'";
- if($fromlevel == $level->id) $html .= " selected='selected'";
- $html .= ">" . esc_html($level->level_title) . "</option>\n";
- }
- }
- $html .= "</select>\n";
- $html .= "</div>";
-
- $button = "Drop";
-
- break;
-
-
- }
-
- ?>
- <div class='wrap nosubsub'>
- <div class="icon32" id="icon-users"><br></div>
- <h2><?php echo $title; ?></h2>
- <form action='admin.php?page=<?php echo $page; ?>' method='post'>
-
- <div class='level-liq…
Large files files are truncated, but you can click here to view the full file