[ Index ]

PHP Cross Reference of osCMax 2.0.4

title

Body

[close]

/admin/ -> affiliate_newsletters.php (source)

   1  <?php
   2  /*

   3    $Id: affiliate_newsletters.php,v 2.00 2003/10/12

   4  

   5    OSC-Affiliate

   6  

   7    Contribution based on:

   8  

   9    osCommerce, Open Source E-Commerce Solutions

  10    http://www.oscommerce.com

  11  

  12    Copyright (c) 2002 - 2003 osCommerce

  13  

  14    Released under the GNU General Public License

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


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