[ Index ]

PHP Cross Reference of osCMax 2.0.4

title

Body

[close]

/admin/ -> newsletters.php (source)

   1  <?php
   2  /*

   3  $Id: newsletters.php 3 2006-05-27 04:59:07Z user $

   4  

   5    osCMax Power E-Commerce

   6    http://oscdox.com

   7  

   8    Copyright 2006 osCMax

   9  

  10    Released under the GNU General Public License

  11  */
  12  
  13    require ('includes/application_top.php');
  14  // LINE ADDED: MOD - FCKEditor

  15    require (DIR_FCKEDITOR . 'fckeditor.php');
  16    $action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : '');
  17  
  18    if (tep_not_null($action)) {
  19      switch ($action) {
  20        case 'lock':
  21        case 'unlock':
  22          $newsletter_id = tep_db_prepare_input($HTTP_GET_VARS['nID']);
  23          $status = (($action == 'lock') ? '1' : '0');
  24  
  25          tep_db_query("update " . TABLE_NEWSLETTERS . " set locked = '" . $status . "' where newsletters_id = '" . (int)$newsletter_id . "'");
  26  
  27          tep_redirect(tep_href_link(FILENAME_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'] . '&nID=' . $HTTP_GET_VARS['nID']));
  28          break;
  29        case 'insert':
  30        case 'update':
  31          if (isset($HTTP_POST_VARS['newsletter_id'])) $newsletter_id = tep_db_prepare_input($HTTP_POST_VARS['newsletter_id']);
  32          $newsletter_module = tep_db_prepare_input($HTTP_POST_VARS['module']);
  33          $title = tep_db_prepare_input($HTTP_POST_VARS['title']);
  34          $content = tep_db_prepare_input($HTTP_POST_VARS['content']);
  35  
  36          $newsletter_error = false;
  37          if (empty($title)) {
  38            $messageStack->add(ERROR_NEWSLETTER_TITLE, 'error');
  39            $newsletter_error = true;
  40          }
  41  
  42          if (empty($newsletter_module)) {
  43            $messageStack->add(ERROR_NEWSLETTER_MODULE, 'error');
  44            $newsletter_error = true;
  45          }
  46  
  47          if ($newsletter_error == false) {
  48            $sql_data_array = array('title' => $title,
  49                                    'content' => $content,
  50                                    'module' => $newsletter_module);
  51  
  52            if ($action == 'insert') {
  53              $sql_data_array['date_added'] = 'now()';
  54              $sql_data_array['status'] = '0';
  55              $sql_data_array['locked'] = '0';
  56  
  57              tep_db_perform(TABLE_NEWSLETTERS, $sql_data_array);
  58              $newsletter_id = tep_db_insert_id();
  59            } elseif ($action == 'update') {
  60              tep_db_perform(TABLE_NEWSLETTERS, $sql_data_array, 'update', "newsletters_id = '" . (int)$newsletter_id . "'");
  61            }
  62  
  63            tep_redirect(tep_href_link(FILENAME_NEWSLETTERS, (isset($HTTP_GET_VARS['page']) ? 'page=' . $HTTP_GET_VARS['page'] . '&' : '') . 'nID=' . $newsletter_id));
  64          } else {
  65            $action = 'new';
  66          }
  67          break;
  68        case 'deleteconfirm':
  69          $newsletter_id = tep_db_prepare_input($HTTP_GET_VARS['nID']);
  70  
  71          tep_db_query("delete from " . TABLE_NEWSLETTERS . " where newsletters_id = '" . (int)$newsletter_id . "'");
  72  
  73          tep_redirect(tep_href_link(FILENAME_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page']));
  74          break;
  75        case 'delete':
  76        case 'new': if (!isset($HTTP_GET_VARS['nID'])) break;
  77        case 'send':
  78        case 'confirm_send':
  79          $newsletter_id = tep_db_prepare_input($HTTP_GET_VARS['nID']);
  80  
  81          $check_query = tep_db_query("select locked from " . TABLE_NEWSLETTERS . " where newsletters_id = '" . (int)$newsletter_id . "'");
  82          $check = tep_db_fetch_array($check_query);
  83  
  84          if ($check['locked'] < 1) {
  85            switch ($action) {
  86              case 'delete': $error = ERROR_REMOVE_UNLOCKED_NEWSLETTER; break;
  87              case 'new': $error = ERROR_EDIT_UNLOCKED_NEWSLETTER; break;
  88              case 'send': $error = ERROR_SEND_UNLOCKED_NEWSLETTER; break;
  89              case 'confirm_send': $error = ERROR_SEND_UNLOCKED_NEWSLETTER; break;
  90            }
  91  
  92            $messageStack->add_session($error, 'error');
  93  
  94            tep_redirect(tep_href_link(FILENAME_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'] . '&nID=' . $HTTP_GET_VARS['nID']));
  95          }
  96          break;
  97      }
  98    }
  99  ?>
 100  <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
 101  <html <?php echo HTML_PARAMS; ?>>
 102  <head>
 103  <meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
 104  <title><?php echo TITLE; ?></title>
 105  <link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
 106  <script language="javascript" src="includes/general.js"></script>
 107  </head>
 108  <body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">
 109  <div id="spiffycalendar" class="text"></div>
 110  <!-- header //-->
 111  <?php require (DIR_WS_INCLUDES . 'header.php'); ?>
 112  <!-- header_eof //-->
 113  
 114  <!-- body //-->
 115  <table border="0" width="100%" cellspacing="2" cellpadding="2">
 116    <tr>
 117      <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
 118  <!-- left_navigation //-->
 119  <?php require (DIR_WS_INCLUDES . 'column_left.php'); ?>
 120  <!-- left_navigation_eof //-->
 121      </table></td>
 122  <!-- body_text //-->
 123      <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
 124        <tr>
 125          <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
 126            <tr>
 127              <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
 128              <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
 129            </tr>
 130          </table></td>
 131        </tr>
 132  <?php
 133    if ($action == 'new') {
 134      $form_action = 'insert';
 135  
 136      $parameters = array('title' => '',
 137                          'content' => '',
 138                          'module' => '');
 139  
 140      $nInfo = new objectInfo($parameters);
 141  
 142      if (isset($HTTP_GET_VARS['nID'])) {
 143        $form_action = 'update';
 144  
 145        $nID = tep_db_prepare_input($HTTP_GET_VARS['nID']);
 146  
 147        $newsletter_query = tep_db_query("select title, content, module from " . TABLE_NEWSLETTERS . " where newsletters_id = '" . (int)$nID . "'");
 148        $newsletter = tep_db_fetch_array($newsletter_query);
 149  
 150        $nInfo->objectInfo($newsletter);
 151      } elseif ($HTTP_POST_VARS) {
 152        $nInfo->objectInfo($HTTP_POST_VARS);
 153      }
 154  
 155      $file_extension = substr($PHP_SELF, strrpos($PHP_SELF, '.'));
 156      $directory_array = array();
 157      if ($dir = dir(DIR_WS_MODULES . 'newsletters/')) {
 158        while ($file = $dir->read()) {
 159          if (!is_dir(DIR_WS_MODULES . 'newsletters/' . $file)) {
 160            if (substr($file, strrpos($file, '.')) == $file_extension) {
 161              $directory_array[] = $file;
 162            }
 163          }
 164        }
 165        sort($directory_array);
 166        $dir->close();
 167      }
 168  
 169      for ($i=0, $n=sizeof($directory_array); $i<$n; $i++) {
 170        $modules_array[] = array('id' => substr($directory_array[$i], 0, strrpos($directory_array[$i], '.')), 'text' => substr($directory_array[$i], 0, strrpos($directory_array[$i], '.')));
 171      }
 172  ?>
 173        <tr>
 174          <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
 175        </tr>
 176        <tr><?php echo tep_draw_form('newsletter', FILENAME_NEWSLETTERS, (isset($HTTP_GET_VARS['page']) ? 'page=' . $HTTP_GET_VARS['page'] . '&' : '') . 'action=' . $form_action); if ($form_action == 'update') echo tep_draw_hidden_field('newsletter_id', $nID); ?>
 177          <td><table border="0" cellspacing="0" cellpadding="2">
 178            <tr>
 179              <td class="main"><?php echo TEXT_NEWSLETTER_MODULE; ?></td>
 180              <td class="main"><?php echo tep_draw_pull_down_menu('module', $modules_array, $nInfo->module); ?></td>
 181            </tr>
 182            <tr>
 183              <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
 184            </tr>
 185            <tr>
 186              <td class="main"><?php echo TEXT_NEWSLETTER_TITLE; ?></td>
 187              <td class="main"><?php echo tep_draw_input_field('title', $nInfo->title, '', true); ?></td>
 188            </tr>
 189            <tr>
 190              <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
 191            </tr>
 192            <tr>
 193              <td class="main" valign="top"><?php echo TEXT_NEWSLETTER_CONTENT; ?></td>
 194  <?php // BOF: MOD - WYSIWYG HTML Area Box
 195  /*          <td class="main"><?php echo tep_draw_textarea_field('content', 'soft', '100%', '20', $nInfo->content); ?></td> */ ?>
 196              <td class="main"><?php if (HTML_AREA_WYSIWYG_DISABLE_NEWSLETTER == 'Enable') {
 197                   echo tep_draw_fckeditor('content', HTML_AREA_WYSIWYG_EDITOR_WIDTH, HTML_AREA_WYSIWYG_EDITOR_HEIGHT, $nInfo->content) . '</td>';
 198                  } else { echo tep_draw_textarea_field('content', 'soft', '100%', '20', $nInfo->content) . '</td>';
 199               }
 200              ?>
 201  <?php /* EOF: MOD - WYSIWYG HTML Area Box */ ?>
 202            </tr>
 203          </table></td>
 204        </tr>
 205        <tr>
 206          <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
 207        </tr>
 208        <tr>
 209          <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
 210            <tr>
 211              <td class="main" align="right"><?php echo (($form_action == 'insert') ? tep_image_submit('button_save.gif', IMAGE_SAVE) : tep_image_submit('button_update.gif', IMAGE_UPDATE)). '&nbsp;&nbsp;<a href="' . tep_href_link(FILENAME_NEWSLETTERS, (isset($HTTP_GET_VARS['page']) ? 'page=' . $HTTP_GET_VARS['page'] . '&' : '') . (isset($HTTP_GET_VARS['nID']) ? 'nID=' . $HTTP_GET_VARS['nID'] : '')) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>'; ?></td>
 212            </tr>
 213          </table></td>
 214        </form></tr>
 215  <?php
 216    } elseif ($action == 'preview') {
 217      $nID = tep_db_prepare_input($HTTP_GET_VARS['nID']);
 218  
 219      $newsletter_query = tep_db_query("select title, content, module from " . TABLE_NEWSLETTERS . " where newsletters_id = '" . (int)$nID . "'");
 220      $newsletter = tep_db_fetch_array($newsletter_query);
 221  
 222      $nInfo = new objectInfo($newsletter);
 223  ?>
 224        <tr>
 225          <td align="right"><?php echo '<a href="' . tep_href_link(FILENAME_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'] . '&nID=' . $HTTP_GET_VARS['nID']) . '">' . tep_image_button('button_back.gif', IMAGE_BACK) . '</a>'; ?></td>
 226        </tr>
 227        <tr>
 228          <td><tt><?php echo nl2br($nInfo->content); ?></tt></td>
 229        </tr>
 230        <tr>
 231          <td align="right"><?php echo '<a href="' . tep_href_link(FILENAME_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'] . '&nID=' . $HTTP_GET_VARS['nID']) . '">' . tep_image_button('button_back.gif', IMAGE_BACK) . '</a>'; ?></td>
 232        </tr>
 233  <?php
 234    } elseif ($action == 'send') {
 235      $nID = tep_db_prepare_input($HTTP_GET_VARS['nID']);
 236  
 237      $newsletter_query = tep_db_query("select title, content, module from " . TABLE_NEWSLETTERS . " where newsletters_id = '" . (int)$nID . "'");
 238      $newsletter = tep_db_fetch_array($newsletter_query);
 239  
 240      $nInfo = new objectInfo($newsletter);
 241  
 242      include(DIR_WS_LANGUAGES . $language . '/modules/newsletters/' . $nInfo->module . substr($PHP_SELF, strrpos($PHP_SELF, '.')));
 243      include(DIR_WS_MODULES . 'newsletters/' . $nInfo->module . substr($PHP_SELF, strrpos($PHP_SELF, '.')));
 244      $module_name = $nInfo->module;
 245      $module = new $module_name($nInfo->title, $nInfo->content);
 246  ?>
 247        <tr>
 248          <td><?php if ($module->show_choose_audience) { echo $module->choose_audience(); } else { echo $module->confirm(); } ?></td>
 249        </tr>
 250  <?php
 251    } elseif ($action == 'confirm') {
 252      $nID = tep_db_prepare_input($HTTP_GET_VARS['nID']);
 253  
 254      $newsletter_query = tep_db_query("select title, content, module from " . TABLE_NEWSLETTERS . " where newsletters_id = '" . (int)$nID . "'");
 255      $newsletter = tep_db_fetch_array($newsletter_query);
 256  
 257      $nInfo = new objectInfo($newsletter);
 258  
 259      include(DIR_WS_LANGUAGES . $language . '/modules/newsletters/' . $nInfo->module . substr($PHP_SELF, strrpos($PHP_SELF, '.')));
 260      include(DIR_WS_MODULES . 'newsletters/' . $nInfo->module . substr($PHP_SELF, strrpos($PHP_SELF, '.')));
 261      $module_name = $nInfo->module;
 262      $module = new $module_name($nInfo->title, $nInfo->content);
 263  ?>
 264        <tr>
 265          <td><?php echo $module->confirm(); ?></td>
 266        </tr>
 267  <?php
 268    } elseif ($action == 'confirm_send') {
 269      $nID = tep_db_prepare_input($HTTP_GET_VARS['nID']);
 270  
 271      $newsletter_query = tep_db_query("select newsletters_id, title, content, module from " . TABLE_NEWSLETTERS . " where newsletters_id = '" . (int)$nID . "'");
 272      $newsletter = tep_db_fetch_array($newsletter_query);
 273  
 274      $nInfo = new objectInfo($newsletter);
 275  
 276      include(DIR_WS_LANGUAGES . $language . '/modules/newsletters/' . $nInfo->module . substr($PHP_SELF, strrpos($PHP_SELF, '.')));
 277      include(DIR_WS_MODULES . 'newsletters/' . $nInfo->module . substr($PHP_SELF, strrpos($PHP_SELF, '.')));
 278      $module_name = $nInfo->module;
 279      $module = new $module_name($nInfo->title, $nInfo->content);
 280  ?>
 281        <tr>
 282          <td><table border="0" cellspacing="0" cellpadding="2">
 283            <tr>
 284              <td class="main" valign="middle"><?php echo tep_image(DIR_WS_IMAGES . 'ani_send_email.gif', IMAGE_ANI_SEND_EMAIL); ?></td>
 285              <td class="main" valign="middle"><b><?php echo TEXT_PLEASE_WAIT; ?></b></td>
 286            </tr>
 287          </table></td>
 288        </tr>
 289  <?php
 290    tep_set_time_limit(0);
 291    flush();
 292    $module->send($nInfo->newsletters_id);
 293  ?>
 294        <tr>
 295          <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
 296        </tr>
 297        <tr>
 298          <td class="main"><font color="#ff0000"><b><?php echo TEXT_FINISHED_SENDING_EMAILS; ?></b></font></td>
 299        </tr>
 300        <tr>
 301          <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
 302        </tr>
 303        <tr>
 304          <td><?php echo '<a href="' . tep_href_link(FILENAME_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'] . '&nID=' . $HTTP_GET_VARS['nID']) . '">' . tep_image_button('button_back.gif', IMAGE_BACK) . '</a>'; ?></td>
 305        </tr>
 306  <?php
 307    } else {
 308  ?>
 309        <tr>
 310          <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
 311            <tr>
 312              <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
 313                <tr class="dataTableHeadingRow">
 314                  <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_NEWSLETTERS; ?></td>
 315                  <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_SIZE; ?></td>
 316                  <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_MODULE; ?></td>
 317                  <td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_SENT; ?></td>
 318                  <td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_STATUS; ?></td>
 319                  <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?>&nbsp;</td>
 320                </tr>
 321  <?php
 322      $newsletters_query_raw = "select newsletters_id, title, length(content) as content_length, module, date_added, date_sent, status, locked from " . TABLE_NEWSLETTERS . " order by date_added desc";
 323      $newsletters_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $newsletters_query_raw, $newsletters_query_numrows);
 324      $newsletters_query = tep_db_query($newsletters_query_raw);
 325      while ($newsletters = tep_db_fetch_array($newsletters_query)) {
 326      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')) {
 327          $nInfo = new objectInfo($newsletters);
 328        }
 329  
 330        if (isset($nInfo) && is_object($nInfo) && ($newsletters['newsletters_id'] == $nInfo->newsletters_id) ) {
 331          echo '                  <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'] . '&nID=' . $nInfo->newsletters_id . '&action=preview') . '\'">' . "\n";
 332        } else {
 333          echo '                  <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'] . '&nID=' . $newsletters['newsletters_id']) . '\'">' . "\n";
 334        }
 335  ?>
 336                  <td class="dataTableContent"><?php echo '<a href="' . tep_href_link(FILENAME_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'] . '&nID=' . $newsletters['newsletters_id'] . '&action=preview') . '">' . tep_image(DIR_WS_ICONS . 'preview.gif', ICON_PREVIEW) . '</a>&nbsp;' . $newsletters['title']; ?></td>
 337                  <td class="dataTableContent" align="right"><?php echo number_format($newsletters['content_length']) . ' bytes'; ?></td>
 338                  <td class="dataTableContent" align="right"><?php echo $newsletters['module']; ?></td>
 339                  <td class="dataTableContent" align="center"><?php if ($newsletters['status'] == '1') { echo tep_image(DIR_WS_ICONS . 'tick.gif', ICON_TICK); } else { echo tep_image(DIR_WS_ICONS . 'cross.gif', ICON_CROSS); } ?></td>
 340                  <td class="dataTableContent" align="center"><?php if ($newsletters['locked'] > 0) { echo tep_image(DIR_WS_ICONS . 'locked.gif', ICON_LOCKED); } else { echo tep_image(DIR_WS_ICONS . 'unlocked.gif', ICON_UNLOCKED); } ?></td>
 341                  <td class="dataTableContent" align="right"><?php if (isset($nInfo) && is_object($nInfo) && ($newsletters['newsletters_id'] == $nInfo->newsletters_id) ) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '<a href="' . tep_href_link(FILENAME_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'] . '&nID=' . $newsletters['newsletters_id']) . '">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?>&nbsp;</td>
 342                </tr>
 343  <?php
 344      }
 345  ?>
 346                <tr>
 347                  <td colspan="6"><table border="0" width="100%" cellspacing="0" cellpadding="2">
 348                    <tr>
 349                      <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>
 350                      <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>
 351                    </tr>
 352                    <tr>
 353                      <td align="right" colspan="2"><?php echo '<a href="' . tep_href_link(FILENAME_NEWSLETTERS, 'action=new') . '">' . tep_image_button('button_new_newsletter.gif', IMAGE_NEW_NEWSLETTER) . '</a>'; ?></td>
 354                    </tr>
 355                  </table></td>
 356                </tr>
 357              </table></td>
 358  <?php
 359    $heading = array();
 360    $contents = array();
 361  
 362    switch ($action) {
 363      case 'delete':
 364        $heading[] = array('text' => '<b>' . $nInfo->title . '</b>');
 365  
 366        $contents = array('form' => tep_draw_form('newsletters', FILENAME_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'] . '&nID=' . $nInfo->newsletters_id . '&action=deleteconfirm'));
 367        $contents[] = array('text' => TEXT_INFO_DELETE_INTRO);
 368        $contents[] = array('text' => '<br><b>' . $nInfo->title . '</b>');
 369        $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_delete.gif', IMAGE_DELETE) . ' <a href="' . tep_href_link(FILENAME_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'] . '&nID=' . $HTTP_GET_VARS['nID']) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
 370        break;
 371      default:
 372        if (is_object($nInfo)) {
 373          $heading[] = array('text' => '<b>' . $nInfo->title . '</b>');
 374  
 375          if ($nInfo->locked > 0) {
 376            $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'] . '&nID=' . $nInfo->newsletters_id . '&action=new') . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . tep_href_link(FILENAME_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'] . '&nID=' . $nInfo->newsletters_id . '&action=delete') . '">' . tep_image_button('button_delete.gif', IMAGE_DELETE) . '</a> <a href="' . tep_href_link(FILENAME_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'] . '&nID=' . $nInfo->newsletters_id . '&action=preview') . '">' . tep_image_button('button_preview.gif', IMAGE_PREVIEW) . '</a> <a href="' . tep_href_link(FILENAME_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'] . '&nID=' . $nInfo->newsletters_id . '&action=send') . '">' . tep_image_button('button_send.gif', IMAGE_SEND) . '</a> <a href="' . tep_href_link(FILENAME_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'] . '&nID=' . $nInfo->newsletters_id . '&action=unlock') . '">' . tep_image_button('button_unlock.gif', IMAGE_UNLOCK) . '</a>');
 377          } else {
 378            $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'] . '&nID=' . $nInfo->newsletters_id . '&action=preview') . '">' . tep_image_button('button_preview.gif', IMAGE_PREVIEW) . '</a> <a href="' . tep_href_link(FILENAME_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'] . '&nID=' . $nInfo->newsletters_id . '&action=lock') . '">' . tep_image_button('button_lock.gif', IMAGE_LOCK) . '</a>');
 379          }
 380          $contents[] = array('text' => '<br>' . TEXT_NEWSLETTER_DATE_ADDED . ' ' . tep_date_short($nInfo->date_added));
 381          if ($nInfo->status == '1') $contents[] = array('text' => TEXT_NEWSLETTER_DATE_SENT . ' ' . tep_date_short($nInfo->date_sent));
 382        }
 383        break;
 384    }
 385  
 386    if ( (tep_not_null($heading)) && (tep_not_null($contents)) ) {
 387      echo '            <td width="25%" valign="top">' . "\n";
 388  
 389      $box = new box;
 390      echo $box->infoBox($heading, $contents);
 391  
 392      echo '            </td>' . "\n";
 393    }
 394  ?>
 395            </tr>
 396          </table></td>
 397        </tr>
 398  <?php
 399    }
 400  ?>
 401      </table></td>
 402  <!-- body_text_eof //-->
 403    </tr>
 404  </table>
 405  <!-- body_eof //-->
 406  
 407  <!-- footer //-->
 408  <?php require (DIR_WS_INCLUDES . 'footer.php'); ?>
 409  <!-- footer_eof //-->
 410  <br>
 411  </body>
 412  </html>
 413  <?php require (DIR_WS_INCLUDES . 'application_bottom.php');
 414  ?>


Generated: Fri Jan 1 13:43:16 2010 Cross-referenced by PHPXref 0.7