2 /************************************************************************
3 * Mailer v0.2.1-FINAL Start: 10/07/2008 *
4 * =================== Last change: 10/07/2008 *
6 * -------------------------------------------------------------------- *
7 * File : what-list_notifications.php *
8 * -------------------------------------------------------------------- *
9 * Short description : See all notification emails (beg/active rallye) *
10 * -------------------------------------------------------------------- *
11 * Kurzbeschreibung : Alle Benachrichtigungen sehen (Bettel-/Aktiv-R.) *
12 * -------------------------------------------------------------------- *
15 * $Tag:: 0.2.1-FINAL $ *
17 * -------------------------------------------------------------------- *
18 * Copyright (c) 2003 - 2009 by Roland Haeder *
19 * Copyright (c) 2009 - 2012 by Mailer Developer Team *
20 * For more information visit: http://mxchange.org *
22 * This program is free software; you can redistribute it and/or modify *
23 * it under the terms of the GNU General Public License as published by *
24 * the Free Software Foundation; either version 2 of the License, or *
25 * (at your option) any later version. *
27 * This program is distributed in the hope that it will be useful, *
28 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
29 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
30 * GNU General Public License for more details. *
32 * You should have received a copy of the GNU General Public License *
33 * along with this program; if not, write to the Free Software *
34 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, *
36 ************************************************************************/
38 // Some security stuff...
39 if ((!defined('__SECURITY')) || (!isAdmin())) {
43 // Add description as navigation point
44 addYouAreHereLink('admin', __FILE__);
50 // Set offset an current page to default values
51 if (!isGetRequestElementSet('page')) setGetRequestElement('page' , 1);
52 if (!isGetRequestElementSet('offset')) setGetRequestElement('offset', getMailsPage());
54 if (isExtensionActive('bonus')) {
55 // Bonus mails sent by you
57 `id`, `subject`, `text`, `receivers`, `points`, `time`, `data_type`, `timestamp`, `url`, `cat_id`, `target_send`,
58 `mails_sent`, `clicks`, (`mails_sent` - `clicks`) AS `unconfirmed`
60 `{?_MYSQL_PREFIX?}_bonus`
66 // Check for maximum pages
67 $result_max = SQL_QUERY($SQL2, __FILE__, __LINE__);
69 // Bonus extension required!
70 displayMessage('{%pipe,generateExtensionInactiveNotInstalledMessage=bonus%}');
73 // Create limitation line
74 $add = ' LIMIT ' . (bigintval(getRequestElement('offset')) * bigintval(getRequestElement('page')) - bigintval(getRequestElement('offset'))) . ', ' . bigintval(getRequestElement('offset'));
77 if (!empty($SQL2)) $SQL2 .= $add;
79 if ((isExtensionActive('bonus')) && (!SQL_HASZERONUMS($result_max)) && (!empty($SQL2))) {
80 // Run SQL query for notification mails
81 $result_bonus = SQL_QUERY($SQL2, __FILE__, __LINE__);
83 // Load bonus mails only when extension is active
84 if (!SQL_HASZERONUMS($result_bonus)) {
86 $numPages = round(SQL_NUMROWS($result_bonus) / getMailsPage() + 0.5);
89 $OUT = ''; $content = array();
90 while ($content = SQL_FETCHARRAY($result_bonus)) {
91 // Add "unconfirmed-link"
92 $content['unconfirmed_content'] = generateUnconfirmedAdminLink($content['id'], $content['unconfirmed']);
95 $content['timestamp'] = generateDateTime($content['timestamp'], 0);
98 $OUT .= loadTemplate('admin_list_notify_emails_row', true, $content);
101 // Add navigation (without change box but with colspan=3)
102 $content['nav'] = addEmailNavigation($numPages, getMailsPage(), false, 3, true);
105 $content['rows'] = $OUT;
107 // Load main template
108 loadTemplate('admin_list_notify_emails', false, $content);
110 } elseif ((SQL_NUMROWS($result_max) === 0) && (is_resource($result_max))) {
111 // No notifications found
112 displayMessage('{--ADMIN_NO_NOTIFICATIONS--}');