public function user_manager() { /** check permission **/ wpl_global::min_access('administrator'); $possible_orders = array('u.id', 'u.user_registered'); $orderby = in_array(wpl_request::getVar('orderby'), $possible_orders) ? wpl_request::getVar('orderby') : $possible_orders[0]; $order = in_array(strtoupper(wpl_request::getVar('order')), array('ASC', 'DESC')) ? wpl_request::getVar('order') : 'ASC'; $page_size = trim(wpl_request::getVar('page_size')) != '' ? wpl_request::getVar('page_size') : NULL; $this->show_all = wpl_request::getVar('show_all', 0); $this->filter = wpl_request::getVar('filter', ''); $this->membership_id = wpl_request::getVar('membership_id', ''); $where_query = wpl_db::create_query(); if (trim($this->filter)) { $where_query = " AND (`user_login` LIKE '%" . $this->filter . "%' OR `user_email` LIKE '%" . $this->filter . "%' OR `first_name` LIKE '%" . $this->filter . "%' OR `last_name` LIKE '%" . $this->filter . "%')"; } if (trim($this->membership_id)) { $where_query = " AND `membership_id`='" . $this->membership_id . "'"; } $num_result = wpl_db::num("SELECT COUNT(u.ID) FROM `#__users` AS u " . ($this->show_all ? 'LEFT' : 'INNER') . " JOIN `#__wpl_users` AS wpl ON u.ID = wpl.id WHERE 1 {$where_query}"); $this->pagination = wpl_pagination::get_pagination($num_result, $page_size); $where_query .= " ORDER BY {$orderby} {$order} " . $this->pagination->limit_query; if ($this->show_all) { $this->wp_users = wpl_users::get_wp_users($where_query); } else { $this->wp_users = wpl_users::get_wpl_users($where_query); } $this->memberships = wpl_users::get_wpl_memberships(); /** import tpl **/ parent::render($this->tpl_path, $this->tpl); }
public function modify() { $this->notification = wpl_notifications::get_notifications("AND `id`='" . wpl_db::escape($this->id) . "'", 'loadObject'); $this->additional_memberships = explode(',', $this->notification->additional_memberships); $this->additional_users = explode(',', $this->notification->additional_users); $this->additional_emails = explode(',', $this->notification->additional_emails); $this->users = wpl_users::get_wpl_users(); $this->memberships = wpl_users::get_wpl_memberships(); $this->memberships_array = self::unset_additional_receipts($this->additional_memberships, $this->memberships); $this->users_array = self::unset_additional_receipts($this->additional_users, $this->users); $this->template_path = wpl_notifications::get_template_path($this->notification->template); $this->template = wpl_notifications::get_template_content($this->template_path, true); $this->template = '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">' . $this->template; parent::render($this->tpl_path, $this->tpl); }
/** * Generates modify form of a dbst field * @author Howard R <*****@*****.**> * @static * @param string $dbst_type * @param int $dbst_id * @param int $kind * @return void */ public static function generate_modify_form($dbst_type = 'text', $dbst_id = 0, $kind = 0) { /** first validation **/ if (!$dbst_type) { return; } $dbst_data = $dbst_id != 0 ? self::get_field($dbst_id) : new stdClass(); $done_this = false; $type = $dbst_type; $values = $dbst_data; $options = isset($values->options) ? json_decode($values->options, true) : array(); $__prefix = 'wpl_flex_modify'; _wpl_import('libraries.listing_types'); _wpl_import('libraries.property_types'); $dbcats = self::get_categories(0, $kind); $listings = wpl_listing_types::get_listing_types(); $property_types = wpl_property_types::get_property_types(); $user_types = wpl_users::get_user_types(1, 'loadAssocList'); $memberships = wpl_users::get_wpl_memberships(); /** get files **/ $dbst_modifypath = WPL_ABSPATH . DS . 'libraries' . DS . 'dbst_modify'; $files = array(); if (wpl_folder::exists($dbst_modifypath)) { $files = wpl_folder::files($dbst_modifypath, '.php$'); foreach ($files as $file) { include $dbst_modifypath . DS . $file; } if (!$done_this) { /** include default file **/ include _wpl_import('libraries.dbst_modify.main.default', true, true); } } }
?> value="<?php echo $membership_type->id; ?> "><?php echo __($membership_type->name, WPL_TEXTDOMAIN); ?> </option> <?php } ?> </select> </div> <?php $memberships = wpl_users::get_wpl_memberships(); ?> <div> <label for="<?php echo $this->get_field_id('data_membership'); ?> "><?php echo __('Membership', WPL_TEXTDOMAIN); ?> : </label> <select id="<?php echo $this->get_field_id('data_membership'); ?> " name="<?php echo $this->get_field_name('data'); ?>
private function generate_edit_page($user_id = '') { $this->user_info = wpl_users::get_user($user_id); $this->fields = wpl_db::columns('wpl_users'); $this->user_data = wpl_users::get_wpl_user($user_id); $this->data = $this->user_data; $this->units = wpl_units::get_units(4); $this->listings = wpl_listing_types::get_listing_types(); $this->property_types = wpl_property_types::get_property_types(); $this->memberships = wpl_users::get_wpl_memberships(); $this->membership_types = wpl_users::get_membership_types(); parent::render($this->tpl_path, 'edit'); exit; }
$any = false; $label = true; break; case 'radios': $show = 'radios'; $any = false; $label = true; break; case 'radios_any': $show = 'radios'; $any = true; $label = true; break; } /** current value **/ $raw_options = $type == 'user_type' ? wpl_users::get_user_types(1) : wpl_users::get_wpl_memberships(); $options = array(); foreach ($raw_options as $raw_option) { $options[$raw_option->id] = array('key' => $raw_option->id, 'value' => isset($raw_option->membership_name) ? $raw_option->membership_name : $raw_option->name); } $current_value = wpl_request::getVar('sf_select_' . $field_data['table_column'], ''); if ($label) { $html .= '<label>' . __($field['name'], WPL_TEXTDOMAIN) . '</label>'; } if ($show == 'select') { $html .= '<select name="sf' . $widget_id . '_select_' . $field_data['table_column'] . '" class="wpl_search_widget_field_' . $field['id'] . '" id="sf' . $widget_id . '_select_' . $field_data['table_column'] . '">'; if ($any) { $html .= '<option value="">' . __($field['name'], WPL_TEXTDOMAIN) . '</option>'; } foreach ($options as $option) { $html .= '<option value="' . $option['key'] . '" ' . ($current_value == $option['key'] ? 'selected="selected"' : '') . '>' . __($option['value'], WPL_TEXTDOMAIN) . '</option>';