public function queryWidgetLists( &$widgetData = false ) {
foreach ( $widgetData['components'] as &$widgetComponent ) {
- echo "<br>Order: ";
- var_dump($widgetComponent['order']);
if ( $widgetComponent['template'] == 'list' && isset($widgetComponent['fields']) && isset($widgetComponent['table']) ) {
} else {
$where = " TRUE ";
}
+
$resultsQuery = "SELECT " . $widgetComponent['fields'] . " FROM " . $widgetComponent['table'] . " WHERE " . $where . " LIMIT 5;";
$widgetComponent['sql'] = $resultsQuery;
$widgetComponent['listItems'] = $this->wpdb->get_results($resultsQuery);
// in url vs config array reference to ref_type (e.g. member vs Member, and member vs members)
$listItem->ref_type = strtolower($this->config['ref_type'][$listItem->ref_type]);
}
+ if ( isset($listItem->expire_date)) {
+
+ }
}
}
$countQuery = "SELECT COUNT(id) FROM " . $widgetComponent['table'] . " WHERE " . $where . ";";
session_start();
}
});
+
+add_filter(
+ GLM_MEMBERS_PLUGIN_SLUG .'-dashboard-widget',
+ function ( $member = null ) {
+ $membersIndexPage = GLM_MEMBERS_PLUGIN_ADMIN_URL . '?page=glm-members-admin-menu-members';
+ $memberIndexPage = GLM_MEMBERS_PLUGIN_ADMIN_URL . '?page=glm-members-admin-menu-member';
+ $membersTable = GLM_MEMBERS_PLUGIN_PREFIX . "members";
+ $membersEditPage = GLM_MEMBERS_PLUGIN_ADMIN_MENU_URL_BASE.'member&glm_action=memberInfo';
+
+ /*
+ * For list components: pass ref_type and ref_dest as part of the 'fields' string if you want to
+ * make these options part of the href of each <li> link
+ *
+ */
+
+ $content = [
+ 'title' => 'Members',
+ 'components' => [
+ [
+ 'id' => 'topButtons',
+ 'order' => -1,
+ 'template' => 'buttons',
+ 'buttons' => [
+ 'add-member' => [
+ 'content' => 'Add Member',
+ 'url' => $memberIndexPage . "&glm_action=memberEdit&option=add",
+ 'classes' => '',
+ ],
+ ],
+ ],
+ [
+ 'id' => 'quickLinks',
+ 'order' => 0,
+ 'template' => 'quickLinks',
+ 'quickLinks' => [
+ 'dashboard' => [
+ 'content' => 'Dashboard',
+ 'url' => $membersIndexPage . "&option=dashboard",
+ ],
+ 'search' => [
+ 'content' => 'Advanced Search',
+ 'url' => $membersIndexPage . "&option=search",
+ ],
+ 'settings' => [
+ 'content' => 'Settings',
+ 'url' => '#set',
+ ]
+ ],
+ ],
+ [
+ 'id' => 'entityAmount',
+ 'order' => 1,
+ 'template' => 'entityAmount',
+ 'table' => $membersTable,
+ 'url' => $membersIndexPage . "&option=search",
+ ],
+ [
+ 'id' => 'textSearch',
+ 'order' => 2,
+ 'template' => 'textSearch',
+ 'entityID' => 'id',
+ 'table' => $membersTable,
+ 'fields' => "id, title as name, image",
+ 'where' => 'title',
+ 'resultUrl' => $memberIndexPage . "&option=edit",
+ ],
+ [
+ 'id' => 'pending',
+ 'title' => "Pending Members",
+ 'slug' => "pending-members",
+ 'order' => 3,
+ 'template' => 'list',
+ 'entityID' => 'id',
+ 'table' => $membersTable,
+ 'fields' => "id, title, ref_type, ref_dest",
+ 'where' => 'status='.$this->config['status_numb']['Pending'],
+ 'resultUrl' => $membersIndexPage,
+ ],
+ [
+ 'id' => 'active',
+ 'title' => "Bad Locaction Data",
+ 'slug' => "bad-location-data",
+ 'order' => 4,
+ 'template' => 'list',
+ 'entityID' => 'id',
+ 'table' => $membersTable,
+ 'fields' => "id, title, ref_type, ref_dest",
+ 'where' => 'status='.$this->config['status_numb']['Active'],
+ 'resultUrl' => $membersIndexPage,
+ ],
+ ]
+ ];
+
+ return $content;
+ },
+ 13,
+ 1
+);
\ No newline at end of file