}
-
-
-
-
-
-
-
-
-
-
-
-
-
- /*
-
+ /* Left in case we want to use this
// Filter by text string supplied
if (isset($_REQUEST['filterText'])) {
}
}
}
-
-/*
- public function modelAction($actionData = false) {
-
-// $filterArchived = false;
- $loggedInMember = false;
- $filterText = false;
- $haveFilter = false;
- $contactsList = false;
- $haveContacts = false;
- $numbContacts = false;
- $numbDisplayed = false;
- $lastDisplayed = false;
- $paging = true;
- $prevStart = false;
- $nextStart = false;
- $start = 1;
- $limit = 20; // Set to the number of listings per page
- $namesList = false;
-
- // Only list member contacts for the selected member
- $where = "true";
-
- // If this is a logged in member user, then show their contacts only
- if (isset($this->config['loggedInUser']['contactUser'])) {
- $contactUser = $this->config['loggedInUser']['contactUser'];
- if ($contactUser['ref_type'] = $this->config['ref_type_numb']['Member']
- && $contactUser['ref_dest'] ) {
- $where .= " AND ref_type = ".$this->config['ref_type_numb']['Member']."
- AND ref_dest = ".$contactUser['ref_dest'];
- $loggedInMember = $contactUser['ref_dest'];
- }
- }
-
- // Filter by text string supplied
- if (isset($_REQUEST['filterText'])) {
- $filterText = esc_sql($_REQUEST['filterText']);
- $where .= " AND (
- lname LIKE '%$filterText%' OR
- fname LIKE '%$filterText%' OR
- org LIKE '%$filterText%' OR
- descr LIKE '%$filterText%'
- )";
- $haveFilter = true;
- }
-
- // Get the total number of contacts listed
- $numbContacts = $this->getStats($where);
-
- // If the number of events is less than a page, don't do paging
- if ($numbContacts <= $limit) {
- $paging = false;
- }
-
- // Get full list of names matching this where clause for search box
- $namesList = $this->getIdName($where);
-
- // Check if we're doing paging
- if (isset($_REQUEST['pageSelect'])) {
-
- // If request is for Next
- if ($_REQUEST['pageSelect'][0] == 'N') {
- $newStart = $_REQUEST['nextStart'] - 0;
-
- // Otherwise it must be Previous
- } else {
- $newStart = $_REQUEST['prevStart'] - 0;
- }
-
- if ($newStart > 0) {
- $start = $newStart;
- }
- }
-
- // Get list of contacts
- $contactsList = $this->getSimplified($where, false, 'lname, fname', true, 'id', $start, $limit );
-
- if ($contactsList != false) {
-
- // Get paging results
- $numbDisplayed = $contactsList['returned'];
- $lastDisplayed = $contactsList['last'];
- if ($start == 1) {
- $prevStart = false;
- } else {
- $prevStart = $start - $limit;
- if ($start < 1) {
- $start = 1;
- }
- }
- if ($contactsList['returned'] == $limit) {
- $nextStart = $start + $limit;
- }
-
- if (count($contactsList['list']) > 0) {
- $haveContacts = true;
- }
-
- }
-
- // Compile template data
- $templateData = array(
- 'haveContacts' => $haveContacts,
- 'contacts' => $contactsList['list'],
- 'numbContacts' => $numbContacts,
- 'filterText' => $filterText,
- 'haveFilter' => $haveFilter,
- 'numbDisplayed' => $numbDisplayed,
- 'lastDisplayed' => $lastDisplayed,
- 'paging' => $paging,
- 'prevStart' => $prevStart,
- 'nextStart' => $nextStart,
- 'start' => $start = 1,
- 'limit' => $limit,
- 'namesList' => $namesList
- );
-
- // Return status, any suggested view, and any data to controller
- return array(
- 'status' => true,
- 'modelRedirect' => false,
- 'view' => 'admin/contacts/index.html',
- 'data' => $templateData
- );
-
- }
-
-*/
}
?>
\ No newline at end of file