<?php
/*
  www.oscGold.com (C) Kamelia-Net Jacek Krysiak
  modul oscGold wer 4.0
*/

  require('includes/application_top.php');

  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_LOGOFF);

  $breadcrumb->add(NAVBAR_TITLE);

// PWA BOF 2b
//delete the temporary account
  $pwa_query = tep_db_query("select guest_account from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$customer_id . "'");
  $pwa = tep_db_fetch_array($pwa_query);
  if ($pwa['guest_account'] == 1) {
  tep_db_query("delete from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$customer_id . "'");
  tep_db_query("delete from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . (int)$customer_id . "'");
  tep_db_query("delete from " . TABLE_CUSTOMERS_INFO . " where customers_info_id = '" . (int)$customer_id . "'");
  tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET . " where customers_id = '" . (int)$customer_id . "'");
  tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " where customers_id = '" . (int)$customer_id . "'");
  // wyszukuje produkt (razem z cechami) i kasuje
  tep_db_query("delete from customers_basket_text_attributes where session_id = '" .(int)$customer_id. "'");
  /// eof denuz text attr DODATKOWE POLA - CECHY TEKSTOWE
  }

  //tep_session_unregister('guest_account');
  tep_session_unregister('customer_is_guest');
// PWA EOF

  tep_session_unregister('customer_id');
  tep_session_unregister('customer_default_address_id');
  tep_session_unregister('customer_first_name');
  tep_session_unregister('customer_country_id');
  tep_session_unregister('customer_zone_id');
  tep_session_unregister('comments');
  tep_session_unregister('mao_accepted_offer');
  tep_session_unregister('shipping');
  tep_session_unregister('cart_sid');
  //kgt - discount coupons
  tep_session_unregister('coupon');
  //end kgt - discount coupons
  tep_session_unregister('recently_viewed'); // for customer's security, this line of code removes the recently_viewed info after logoff

#### Points/Rewards Module V2.1rc2a balance customer points EOF ####*/
  if (tep_session_is_registered('customer_shopping_points')) tep_session_unregister('customer_shopping_points');
  if (tep_session_is_registered('customer_shopping_points_spending')) tep_session_unregister('customer_shopping_points_spending');
  if (tep_session_is_registered('customer_referral')) tep_session_unregister('customer_referral');
#### Points/Rewards Module V2.1rc2a balance customer points EOF ####*/

  $cart->reset();
  $wishlist->reset();

  $content = CONTENT_LOGOFF;

  include (bts_select('main', $content_template)); // BTSv1.5

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