set_snapshot(); tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL')); } // needs to be included earlier to set the success message in the messageStack require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_ACCOUNT_NEWSLETTERS); $newsletter_query = tep_db_query("select customers_newsletter from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$customer_id . "'"); $newsletter = tep_db_fetch_array($newsletter_query); if (isset($HTTP_POST_VARS['action']) && ($HTTP_POST_VARS['action'] == 'process')) { if (isset($HTTP_POST_VARS['newsletter_general']) && is_numeric($HTTP_POST_VARS['newsletter_general'])) { $newsletter_general = tep_db_prepare_input($HTTP_POST_VARS['newsletter_general']); } else { $newsletter_general = '0'; } if ($newsletter_general != $newsletter['customers_newsletter']) { $newsletter_general = (($newsletter['customers_newsletter'] == '1') ? '0' : '1'); tep_db_query("update " . TABLE_CUSTOMERS . " set customers_newsletter = '" . (int)$newsletter_general . "' where customers_id = '" . (int)$customer_id . "'"); } $messageStack->add_session('account', SUCCESS_NEWSLETTER_UPDATED, 'success'); tep_redirect(tep_href_link(FILENAME_ACCOUNT, '', 'SSL')); } $breadcrumb->add(NAVBAR_TITLE_1, tep_href_link(FILENAME_ACCOUNT, '', 'SSL')); $breadcrumb->add(NAVBAR_TITLE_2, tep_href_link(FILENAME_ACCOUNT_NEWSLETTERS, '', 'SSL')); ?> > <?php echo TITLE; ?>
 
' . tep_image_button('button_back.gif', IMAGE_BUTTON_BACK) . ''; ?>