[ Index ]

PHP Cross Reference of osCMax 2.0.4

title

Body

[close]

/ -> affiliate_newsletter.php (source)

   1  <?php
   2  /*

   3    $Id: affiliate_newsletter.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    if (!tep_session_is_registered('affiliate_id')) {
  20      $navigation->set_snapshot();
  21      tep_redirect(tep_href_link(FILENAME_AFFILIATE, '', 'SSL'));
  22    }
  23  
  24  // needs to be included earlier to set the success message in the messageStack

  25    require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_AFFILIATE_NEWSLETTER);
  26  
  27    $newsletter_query = tep_db_query("select affiliate_newsletter from " . TABLE_AFFILIATE . " where affiliate_id = '" . (int)$affiliate_id . "'");
  28    $newsletter = tep_db_fetch_array($newsletter_query);
  29  
  30    if (isset($HTTP_POST_VARS['action']) && ($HTTP_POST_VARS['action'] == 'process')) {
  31      if (isset($HTTP_POST_VARS['newsletter_affiliate']) && is_numeric($HTTP_POST_VARS['newsletter_affiliate'])) {
  32        $newsletter_affiliate = tep_db_prepare_input($HTTP_POST_VARS['newsletter_affiliate']);
  33      } else {
  34        $newsletter_affiliate = '0';
  35      }
  36  
  37      if ($newsletter_affiliate != $newsletter['affiliate_newsletter']) {
  38        $newsletter_affiliate = (($newsletter['affiliate_newsletter'] == '1') ? '0' : '1');
  39  
  40        tep_db_query("update " . TABLE_AFFILIATE . " set affiliate_newsletter = '" . (int)$newsletter_affiliate . "' where affiliate_id = '" . (int)$affiliate_id . "'");
  41      }
  42  
  43      $messageStack->add_session('account', SUCCESS_NEWSLETTER_UPDATED, 'success');
  44  
  45      tep_redirect(tep_href_link(FILENAME_AFFILIATE_SUMMARY, '', 'SSL'));
  46    }
  47  
  48    $breadcrumb->add(NAVBAR_TITLE_1, tep_href_link(FILENAME_AFFILIATE_SUMMARY, '', 'SSL'));
  49    $breadcrumb->add(NAVBAR_TITLE_2, tep_href_link(FILENAME_AFFILIATE_NEWSLETTER, '', 'SSL'));
  50    $content = affiliate_newsletter; 
  51    include (bts_select('main', $content_template)); // BTSv1.5

  52     require (DIR_WS_INCLUDES . 'application_bottom.php'); ?>


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