-
Notifications
You must be signed in to change notification settings - Fork 0
/
newsletters.php
450 lines (395 loc) · 22.8 KB
/
newsletters.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
<?php
/*
Copyright (c) 2002 - 2006 SystemsManager.Net
SystemsManager Technologies
oscMall System Version 4
http://www.systemsmanager.net
Portions Copyright (c) 2002 osCommerce
This source file is subject to version 2.0 of the GPL license,
that is bundled with this package in the file LICENSE. If you
did not receive a copy of the oscMall System license and are unable
to obtain it through the world-wide-web, please send a note to
license@systemsmanager.net so we can mail you a copy immediately.
*/
require('includes/application_top.php');
$action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : '');
if (smn_not_null($action)) {
switch ($action) {
case 'lock':
case 'unlock':
$newsletter_id = smn_db_prepare_input($HTTP_GET_VARS['nID']);
$status = (($action == 'lock') ? '1' : '0');
smn_db_query("update " . TABLE_NEWSLETTERS . " set locked = '" . $status . "' where newsletters_id = '" . (int)$newsletter_id . "'");
smn_redirect(smn_href_link(FILENAME_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'] . '&nID=' . $HTTP_GET_VARS['nID']));
break;
case 'insert':
case 'update':
if (isset($HTTP_POST_VARS['newsletter_id'])) $newsletter_id = smn_db_prepare_input($HTTP_POST_VARS['newsletter_id']);
$newsletter_module = smn_db_prepare_input($HTTP_POST_VARS['module']);
$title = smn_db_prepare_input($HTTP_POST_VARS['title']);
$content = smn_db_prepare_input($HTTP_POST_VARS['content']);
$newsletter_error = false;
if (empty($title)) {
$messageStack->add(ERROR_NEWSLETTER_TITLE, 'error');
$newsletter_error = true;
}
if (empty($module)) {
$messageStack->add(ERROR_NEWSLETTER_MODULE, 'error');
$newsletter_error = true;
}
if ($newsletter_error == false) {
$sql_data_array = array('title' => $title,
'content' => $content,
'module' => $newsletter_module);
if ($action == 'insert') {
$sql_data_array['date_added'] = 'now()';
$sql_data_array['status'] = '0';
$sql_data_array['locked'] = '0';
$sql_data_array['store_id'] = $store_id;
smn_db_perform(TABLE_NEWSLETTERS, $sql_data_array);
$newsletter_id = smn_db_insert_id();
} elseif ($action == 'update') {
smn_db_perform(TABLE_NEWSLETTERS, $sql_data_array, 'update', "newsletters_id = '" . (int)$newsletter_id . "'");
}
smn_redirect(smn_href_link(FILENAME_NEWSLETTERS, (isset($HTTP_GET_VARS['page']) ? 'page=' . $HTTP_GET_VARS['page'] . '&' : '') . 'nID=' . $newsletter_id));
} else {
$action = 'new';
}
break;
case 'deleteconfirm':
$newsletter_id = smn_db_prepare_input($HTTP_GET_VARS['nID']);
smn_db_query("delete from " . TABLE_NEWSLETTERS . " where newsletters_id = '" . (int)$newsletter_id . "'");
smn_redirect(smn_href_link(FILENAME_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page']));
break;
case 'delete':
case 'new': if (!isset($HTTP_GET_VARS['nID'])) break;
case 'send':
case 'confirm_send':
$newsletter_id = smn_db_prepare_input($HTTP_GET_VARS['nID']);
$check_query = smn_db_query("select locked from " . TABLE_NEWSLETTERS . " where newsletters_id = '" . (int)$newsletter_id . "' and store_id = '". $store_id ."'");
$check = smn_db_fetch_array($check_query);
if ($check['locked'] < 1) {
switch ($action) {
case 'delete': $error = ERROR_REMOVE_UNLOCKED_NEWSLETTER; break;
case 'new': $error = ERROR_EDIT_UNLOCKED_NEWSLETTER; break;
case 'send': $error = ERROR_SEND_UNLOCKED_NEWSLETTER; break;
case 'confirm_send': $error = ERROR_SEND_UNLOCKED_NEWSLETTER; break;
}
$messageStack->add_session($error, 'error');
smn_redirect(smn_href_link(FILENAME_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'] . '&nID=' . $HTTP_GET_VARS['nID']));
}
break;
}
}
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
<script type="text/javascript" src="external/FCKeditor/2.0b1/fckeditor.js"></script>
<script language="javascript" src="includes/general.js"></script>
<!-- ---------------------------------------------------------------------- -->
<!-- START : EDITOR HEADER - INCLUDE THIS IN ANY FILES USING EDITOR -->
<script language="Javascript1.2" src="<?php echo HTTP_SERVER . DIR_WS_ADMIN; ?>editor.js"></script>
<script>
// set this to the URL of editor direcory (with trailing forward slash)
// NOTE: _editor_url MUST be on the same domain as this page or the popups
// won't work (due to IE cross frame/cross window security restrictions).
// example: http://www.hostname.com/editor/
_editor_url = "<?php echo HTTP_SERVER. DIR_WS_ADMIN; ?>";
</script>
<style type="text/css"><!--
.btn { BORDER-WIDTH: 1; width: 26px; height: 24px; }
.btnDN { BORDER-WIDTH: 1; width: 26px; height: 24px; BORDER-STYLE: inset; BACKGROUND-COLOR: buttonhighlight; }
.btnNA { BORDER-WIDTH: 1; width: 26px; height: 24px; filter: alpha(opacity=25); }
--></style>
<!-- END : EDITOR HEADER -->
<!-- ---------------------------------------------------------------------- -->
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">
<div id="spiffycalendar" class="text"></div>
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->
<!-- body //-->
<table border="0" width="100%" cellspacing="2" cellpadding="2">
<tr>
<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
<!-- left_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
<!-- left_navigation_eof //-->
</table></td>
<!-- body_text //-->
<td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
<tr>
<td><table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
<td class="pageHeading" align="right"><?php echo smn_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
</tr>
</table></td>
</tr>
<?php
if ($action == 'new') {
$form_action = 'insert';
$parameters = array('title' => '',
'content' => '',
'module' => '');
$nInfo = new objectInfo($parameters);
if (isset($HTTP_GET_VARS['nID'])) {
$form_action = 'update';
$nID = smn_db_prepare_input($HTTP_GET_VARS['nID']);
$newsletter_query = smn_db_query("select title, content, module from " . TABLE_NEWSLETTERS . " where newsletters_id = '" . (int)$nID . "'");
$newsletter = smn_db_fetch_array($newsletter_query);
$nInfo->objectInfo($newsletter);
} elseif ($HTTP_POST_VARS) {
$nInfo->objectInfo($HTTP_POST_VARS);
}
$file_extension = substr($PHP_SELF, strrpos($PHP_SELF, '.'));
$directory_array = array();
if ($dir = dir(DIR_WS_MODULES . 'newsletters/')) {
while ($file = $dir->read()) {
if (!is_dir(DIR_WS_MODULES . 'newsletters/' . $file)) {
if (substr($file, strrpos($file, '.')) == $file_extension) {
$directory_array[] = $file;
}
}
}
sort($directory_array);
$dir->close();
}
for ($i=0, $n=sizeof($directory_array); $i<$n; $i++) {
$modules_array[] = array('id' => substr($directory_array[$i], 0, strrpos($directory_array[$i], '.')), 'text' => substr($directory_array[$i], 0, strrpos($directory_array[$i], '.')));
}
?>
<tr>
<td><?php echo smn_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
</tr>
<tr><?php echo smn_draw_form('newsletter', FILENAME_NEWSLETTERS, (isset($HTTP_GET_VARS['page']) ? 'page=' . $HTTP_GET_VARS['page'] . '&' : '') . 'action=' . $form_action); if ($form_action == 'update') echo smn_draw_hidden_field('newsletter_id', $nID); ?>
<td><table border="0" cellspacing="0" cellpadding="2">
<tr>
<td class="main"><?php echo TEXT_NEWSLETTER_MODULE; ?></td>
<td class="main"><?php echo smn_draw_pull_down_menu('module', $modules_array, $nInfo->module); ?></td>
</tr>
<tr>
<td colspan="2"><?php echo smn_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
</tr>
<tr>
<td class="main"><?php echo TEXT_NEWSLETTER_TITLE; ?></td>
<td class="main"><?php echo smn_draw_input_field('title', $nInfo->title, '', true); ?></td>
</tr>
<tr>
<td colspan="2"><?php echo smn_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
</tr>
<tr>
<td td colspan="2 class="main" valign="top"><?php echo TEXT_NEWSLETTER_CONTENT; ?></td>
</tr>
<tr>
<td colspan="2>
<?php
include(DIR_FS_ADMIN . 'fckeditor.php') ;
// Automatically calculates the editor base path based on the _samples directory.
// This is usefull only for these samples. A real application should use something like this:
$oFCKeditor->BasePath = DIR_FS_ADMIN;
// FCKeditoris the default value.
$oFCKeditor = new FCKeditor('content') ;
$oFCKeditor->Value = $nInfo->content;
$oFCKeditor->Create() ;
?>
</td>
</tr>
</tr>
</table></td>
</tr>
<tr>
<td><?php echo smn_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
</tr>
<tr>
<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
<tr>
<td class="main" align="right"><?php echo (($form_action == 'insert') ? smn_image_submit('button_save.gif', IMAGE_SAVE) : smn_image_submit('button_update.gif', IMAGE_UPDATE)). ' <a href="' . smn_href_link(FILENAME_NEWSLETTERS, (isset($HTTP_GET_VARS['page']) ? 'page=' . $HTTP_GET_VARS['page'] . '&' : '') . (isset($HTTP_GET_VARS['nID']) ? 'nID=' . $HTTP_GET_VARS['nID'] : '')) . '">' . smn_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>'; ?></td>
</tr>
</table></td>
</form></tr>
<?php
} elseif ($action == 'preview') {
$nID = smn_db_prepare_input($HTTP_GET_VARS['nID']);
$newsletter_query = smn_db_query("select title, content, module from " . TABLE_NEWSLETTERS . " where newsletters_id = '" . (int)$nID . "'");
$newsletter = smn_db_fetch_array($newsletter_query);
$nInfo = new objectInfo($newsletter);
?>
<tr>
<td><?php echo smn_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
</tr>
<tr>
<td><tt><?php echo nl2br($nInfo->content); ?></tt></td>
</tr>
<tr>
<td align="right"><?php echo '<a href="' . smn_href_link(FILENAME_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'] . '&nID=' . $HTTP_GET_VARS['nID'] . '&action=new') . '">' . smn_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . smn_href_link(FILENAME_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'] . '&nID=' . $HTTP_GET_VARS['nID']) . '">' . smn_image_button('button_back.gif', IMAGE_BACK) . '</a>'; ?></td>
</tr>
<?php
} elseif ($action == 'send') {
$nID = smn_db_prepare_input($HTTP_GET_VARS['nID']);
$newsletter_query = smn_db_query("select title, content, module from " . TABLE_NEWSLETTERS . " where newsletters_id = '" . (int)$nID . "'");
$newsletter = smn_db_fetch_array($newsletter_query);
$nInfo = new objectInfo($newsletter);
include(DIR_WS_LANGUAGES . $language . '/modules/newsletters/' . $nInfo->module . substr($PHP_SELF, strrpos($PHP_SELF, '.')));
include(DIR_WS_MODULES . 'newsletters/' . $nInfo->module . substr($PHP_SELF, strrpos($PHP_SELF, '.')));
$module_name = $nInfo->module;
$module = new $module_name($nInfo->title, $nInfo->content);
?>
<tr>
<td><?php if ($module->show_choose_audience) { echo $module->choose_audience(); } else { echo $module->confirm(); } ?></td>
</tr>
<?php
} elseif ($action == 'confirm') {
$nID = smn_db_prepare_input($HTTP_GET_VARS['nID']);
$newsletter_query = smn_db_query("select title, content, module from " . TABLE_NEWSLETTERS . " where newsletters_id = '" . (int)$nID . "'");
$newsletter = smn_db_fetch_array($newsletter_query);
$nInfo = new objectInfo($newsletter);
include(DIR_WS_LANGUAGES . $language . '/modules/newsletters/' . $nInfo->module . substr($PHP_SELF, strrpos($PHP_SELF, '.')));
include(DIR_WS_MODULES . 'newsletters/' . $nInfo->module . substr($PHP_SELF, strrpos($PHP_SELF, '.')));
$module_name = $nInfo->module;
$module = new $module_name($nInfo->title, $nInfo->content);
?>
<tr>
<td><?php echo $module->confirm(); ?></td>
</tr>
<?php
} elseif ($action == 'confirm_send') {
$nID = smn_db_prepare_input($HTTP_GET_VARS['nID']);
$newsletter_query = smn_db_query("select newsletters_id, title, content, module from " . TABLE_NEWSLETTERS . " where newsletters_id = '" . (int)$nID . "'");
$newsletter = smn_db_fetch_array($newsletter_query);
$nInfo = new objectInfo($newsletter);
include(DIR_WS_LANGUAGES . $language . '/modules/newsletters/' . $nInfo->module . substr($PHP_SELF, strrpos($PHP_SELF, '.')));
include(DIR_WS_MODULES . 'newsletters/' . $nInfo->module . substr($PHP_SELF, strrpos($PHP_SELF, '.')));
$module_name = $nInfo->module;
$module = new $module_name($nInfo->title, $nInfo->content);
?>
<tr>
<td><table border="0" cellspacing="0" cellpadding="2">
<tr>
<td class="main" valign="middle"><?php echo smn_image(DIR_WS_IMAGES . 'ani_send_email.gif', IMAGE_ANI_SEND_EMAIL); ?></td>
<td class="main" valign="middle"><b><?php echo TEXT_PLEASE_WAIT; ?></b></td>
</tr>
</table></td>
</tr>
<?php
smn_set_time_limit(0);
flush();
$module->send($nInfo->newsletters_id);
?>
<tr>
<td><?php echo smn_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
</tr>
<tr>
<td class="main"><font color="#ff0000"><b><?php echo TEXT_FINISHED_SENDING_EMAILS; ?></b></font></td>
</tr>
<tr>
<td><?php echo smn_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
</tr>
<tr>
<td><?php echo '<a href="' . smn_href_link(FILENAME_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'] . '&nID=' . $HTTP_GET_VARS['nID']) . '">' . smn_image_button('button_back.gif', IMAGE_BACK) . '</a>'; ?></td>
</tr>
<?php
} else {
?>
<tr>
<td><table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
<tr class="dataTableHeadingRow">
<td class="dataTableHeadingContent"><?php echo TABLE_HEADING_NEWSLETTERS; ?></td>
<td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_SIZE; ?></td>
<td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_MODULE; ?></td>
<td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_SENT; ?></td>
<td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_STATUS; ?></td>
<td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?> </td>
</tr>
<?php
$newsletters_query_raw = "select newsletters_id, title, length(content) as content_length, module, date_added, date_sent, status, locked from " . TABLE_NEWSLETTERS . " where store_id = '" .$store_id . "' order by date_added desc";
$newsletters_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $newsletters_query_raw, $newsletters_query_numrows);
$newsletters_query = smn_db_query($newsletters_query_raw);
while ($newsletters = smn_db_fetch_array($newsletters_query)) {
if ((!isset($HTTP_GET_VARS['nID']) || (isset($HTTP_GET_VARS['nID']) && ($HTTP_GET_VARS['nID'] == $newsletters['newsletters_id']))) && !isset($nInfo) && (substr($action, 0, 3) != 'new')) {
$nInfo = new objectInfo($newsletters);
}
if (isset($nInfo) && is_object($nInfo) && ($newsletters['newsletters_id'] == $nInfo->newsletters_id) ) {
echo ' <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . smn_href_link(FILENAME_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'] . '&nID=' . $nInfo->newsletters_id . '&action=preview') . '\'">' . "\n";
} else {
echo ' <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . smn_href_link(FILENAME_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'] . '&nID=' . $newsletters['newsletters_id']) . '\'">' . "\n";
}
?>
<td class="dataTableContent"><?php echo '<a href="' . smn_href_link(FILENAME_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'] . '&nID=' . $newsletters['newsletters_id'] . '&action=preview') . '">' . smn_image(DIR_WS_ICONS . 'preview.gif', ICON_PREVIEW) . '</a> ' . $newsletters['title']; ?></td>
<td class="dataTableContent" align="right"><?php echo number_format($newsletters['content_length']) . ' bytes'; ?></td>
<td class="dataTableContent" align="right"><?php echo $newsletters['module']; ?></td>
<td class="dataTableContent" align="center"><?php if ($newsletters['status'] == '1') { echo smn_image(DIR_WS_ICONS . 'tick.gif', ICON_TICK); } else { echo smn_image(DIR_WS_ICONS . 'cross.gif', ICON_CROSS); } ?></td>
<td class="dataTableContent" align="center"><?php if ($newsletters['locked'] > 0) { echo smn_image(DIR_WS_ICONS . 'locked.gif', ICON_LOCKED); } else { echo smn_image(DIR_WS_ICONS . 'unlocked.gif', ICON_UNLOCKED); } ?></td>
<td class="dataTableContent" align="right"><?php if (isset($nInfo) && is_object($nInfo) && ($newsletters['newsletters_id'] == $nInfo->newsletters_id) ) { echo smn_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '<a href="' . smn_href_link(FILENAME_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'] . '&nID=' . $newsletters['newsletters_id']) . '">' . smn_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?> </td>
</tr>
<?php
}
?>
<tr>
<td colspan="6"><table border="0" width="100%" cellspacing="0" cellpadding="2">
<tr>
<td class="smallText" valign="top"><?php echo $newsletters_split->display_count($newsletters_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $HTTP_GET_VARS['page'], TEXT_DISPLAY_NUMBER_OF_NEWSLETTERS); ?></td>
<td class="smallText" align="right"><?php echo $newsletters_split->display_links($newsletters_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page']); ?></td>
</tr>
<tr>
<td align="right" colspan="2"><?php echo '<a href="' . smn_href_link(FILENAME_NEWSLETTERS, 'action=new') . '">' . smn_image_button('button_new_newsletter.gif', IMAGE_NEW_NEWSLETTER) . '</a>'; ?></td>
</tr>
</table></td>
</tr>
</table></td>
<?php
$heading = array();
$contents = array();
switch ($action) {
case 'delete':
$heading[] = array('text' => '<b>' . $nInfo->title . '</b>');
$contents = array('form' => smn_draw_form('newsletters', FILENAME_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'] . '&nID=' . $nInfo->newsletters_id . '&action=deleteconfirm'));
$contents[] = array('text' => TEXT_INFO_DELETE_INTRO);
$contents[] = array('text' => '<br><b>' . $nInfo->title . '</b>');
$contents[] = array('align' => 'center', 'text' => '<br>' . smn_image_submit('button_delete.gif', IMAGE_DELETE) . ' <a href="' . smn_href_link(FILENAME_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'] . '&nID=' . $HTTP_GET_VARS['nID']) . '">' . smn_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
break;
default:
if (is_object($nInfo)) {
$heading[] = array('text' => '<b>' . $nInfo->title . '</b>');
if ($nInfo->locked > 0) {
$contents[] = array('align' => 'center', 'text' => '<a href="' . smn_href_link(FILENAME_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'] . '&nID=' . $nInfo->newsletters_id . '&action=new') . '">' . smn_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . smn_href_link(FILENAME_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'] . '&nID=' . $nInfo->newsletters_id . '&action=delete') . '">' . smn_image_button('button_delete.gif', IMAGE_DELETE) . '</a> <a href="' . smn_href_link(FILENAME_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'] . '&nID=' . $nInfo->newsletters_id . '&action=preview') . '">' . smn_image_button('button_preview.gif', IMAGE_PREVIEW) . '</a> <a href="' . smn_href_link(FILENAME_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'] . '&nID=' . $nInfo->newsletters_id . '&action=send') . '">' . smn_image_button('button_send.gif', IMAGE_SEND) . '</a> <a href="' . smn_href_link(FILENAME_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'] . '&nID=' . $nInfo->newsletters_id . '&action=unlock') . '">' . smn_image_button('button_unlock.gif', IMAGE_UNLOCK) . '</a>');
} else {
$contents[] = array('align' => 'center', 'text' => '<a href="' . smn_href_link(FILENAME_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'] . '&nID=' . $nInfo->newsletters_id . '&action=preview') . '">' . smn_image_button('button_preview.gif', IMAGE_PREVIEW) . '</a> <a href="' . smn_href_link(FILENAME_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'] . '&nID=' . $nInfo->newsletters_id . '&action=lock') . '">' . smn_image_button('button_lock.gif', IMAGE_LOCK) . '</a>');
}
$contents[] = array('text' => '<br>' . TEXT_NEWSLETTER_DATE_ADDED . ' ' . smn_date_short($nInfo->date_added));
if ($nInfo->status == '1') $contents[] = array('text' => TEXT_NEWSLETTER_DATE_SENT . ' ' . smn_date_short($nInfo->date_sent));
}
break;
}
if ( (smn_not_null($heading)) && (smn_not_null($contents)) ) {
echo ' <td width="25%" valign="top">' . "\n";
$box = new box;
echo $box->infoBox($heading, $contents);
echo ' </td>' . "\n";
}
?>
</tr>
</table></td>
</tr>
<?php
}
?>
</table></td>
<!-- body_text_eof //-->
</tr>
</table>
<!-- body_eof //-->
<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
<br>
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>