????

Your IP : 216.73.216.174


Current Path : /home2/morganrand/www/store/
Upload File :
Current File : /home2/morganrand/www/store/checkout_success.php

<?php
/*
  $Id$
  Modified for Consolidated Login Page with Guest Checkout
  osCommerce, Open Source E-Commerce Solutions
  http://www.oscommerce.com

  Copyright (c) 2010 osCommerce
  Copyright (c) 2012 osCbyJetta
  Released under the GNU General Public License
*/

  require('includes/application_top.php');

// GUEST CHECKOUT START
if (!tep_session_is_registered('guest')) {
// GUEST CHECKOUT END
/* One Page Checkout - BEGIN */
  if (ONEPAGE_CHECKOUT_ENABLED == 'True'){
      if (!tep_session_is_registered('onepage')){
          if (!tep_session_is_registered('customer_id')) {
              tep_redirect(tep_href_link(FILENAME_SHOPPING_CART));
          }
      }else{
          require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CHECKOUT);
          require_once('includes/functions/password_funcs.php');
          require('includes/classes/onepage_checkout.php');
          $onePageCheckout = new osC_onePageCheckout();
          $onePageCheckout->createCustomerAccount();
      }
  }else{
      if (!tep_session_is_registered('customer_id')) {
          tep_redirect(tep_href_link(FILENAME_SHOPPING_CART));
      }
  }
/* One Page Checkout - END */
// if the customer is not logged on, redirect them to the shopping cart page
/*  if (!tep_session_is_registered('customer_id')) {
    tep_redirect(tep_href_link(FILENAME_SHOPPING_CART));
  }*/

  if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'update')) {
    $notify_string = '';

    if (isset($HTTP_POST_VARS['notify']) && !empty($HTTP_POST_VARS['notify'])) {
      $notify = $HTTP_POST_VARS['notify'];

      if (!is_array($notify)) {
        $notify = array($notify);
      }

      for ($i=0, $n=sizeof($notify); $i<$n; $i++) {
        if (is_numeric($notify[$i])) {
          $notify_string .= 'notify[]=' . $notify[$i] . '&';
        }
      }

      if (!empty($notify_string)) {
        $notify_string = 'action=notify&' . substr($notify_string, 0, -1);
      }
    }

    tep_redirect(tep_href_link(FILENAME_DEFAULT, $notify_string));
  }
// GUEST CHECKOUT START
}
// GUEST CHECKOUT END

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

  $breadcrumb->add(NAVBAR_TITLE_1);
  $breadcrumb->add(NAVBAR_TITLE_2);

// GUEST CHECKOUT START
if (!tep_session_is_registered('guest')) {
// GUEST CHECKOUT END
  $global_query = tep_db_query("select global_product_notifications from " . TABLE_CUSTOMERS_INFO . " where customers_info_id = '" . (int)$customer_id . "'");
  $global = tep_db_fetch_array($global_query);

  if ($global['global_product_notifications'] != '1') {
    $orders_query = tep_db_query("select orders_id from " . TABLE_ORDERS . " where customers_id = '" . (int)$customer_id . "' order by date_purchased desc limit 1");
    $orders = tep_db_fetch_array($orders_query);

    $products_array = array();
    $products_query = tep_db_query("select products_id, products_name from " . TABLE_ORDERS_PRODUCTS . " where orders_id = '" . (int)$orders['orders_id'] . "' order by products_name");
    while ($products = tep_db_fetch_array($products_query)) {
      $products_array[] = array('id' => $products['products_id'],
                                'text' => $products['products_name']);
    }
  }
// GUEST CHECKOUT START
}
// GUEST CHECKOUT END

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

<h1><?php echo HEADING_TITLE; ?></h1>

<!-- GUEST CHECKOUT START -->
<?php if (!tep_session_is_registered('guest')) { ?>
<?php echo tep_draw_form('order', tep_href_link(FILENAME_CHECKOUT_SUCCESS, 'action=update', 'SSL')); ?>
<?php } ?>
<!-- GUEST CHECKOUT END -->

<div class="contentContainer">
  <div class="contentText">
    <?php echo TEXT_SUCCESS; ?>
  </div>

  <div class="contentText">

<?php
// GUEST CHECKOUT START
if (!tep_session_is_registered('guest')) {
// GUEST CHECKOUT END
  if ($global['global_product_notifications'] != '1') {
    echo TEXT_NOTIFY_PRODUCTS . '<br /><p class="productsNotifications">';

    $products_displayed = array();
    for ($i=0, $n=sizeof($products_array); $i<$n; $i++) {
      if (!in_array($products_array[$i]['id'], $products_displayed)) {
        echo tep_draw_checkbox_field('notify[]', $products_array[$i]['id']) . ' ' . $products_array[$i]['text'] . '<br />';
        $products_displayed[] = $products_array[$i]['id'];
      }
    }

    echo '</p>';
  }

  echo TEXT_SEE_ORDERS . '<br /><br />' . TEXT_CONTACT_STORE_OWNER;
// GUEST CHECKOUT START
}
  else echo TEXT_CONTACT_STORE_OWNER;
// GUEST CHECKOUT END
?>

  </div>

  <div class="contentText">
    <h3><?php echo TEXT_THANKS_FOR_SHOPPING; ?></h3>
  </div>

<?php
  if (DOWNLOAD_ENABLED == 'true') {
    include(DIR_WS_MODULES . 'downloads.php');
  }
?>

<!-- GUEST CHECKOUT START -->
<?php if (!tep_session_is_registered('guest')) { ?>
<!-- GUEST CHECKOUT END -->
  <div class="buttonSet">
    <span class="buttonAction"><?php echo tep_draw_button(IMAGE_BUTTON_CONTINUE, 'triangle-1-e', null, 'primary'); ?></span>
  </div>
<!-- GUEST CHECKOUT START -->
<?php } ?>
<!-- GUEST CHECKOUT END -->
</div>

<!-- GUEST CHECKOUT START -->
<?php if (!tep_session_is_registered('guest')) { ?>
<!-- GUEST CHECKOUT END -->
</form>
<!-- GUEST CHECKOUT START -->
<?php } ?>
<!-- GUEST CHECKOUT END -->

<?php
// GUEST CHECKOUT START
if (tep_session_is_registered('guest')) {
	tep_session_unregister('guest');
	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('cart_id');
	$cart->reset();
	}
// GUEST CHECKOUT END
  require(DIR_WS_INCLUDES . 'template_bottom.php');
  require(DIR_WS_INCLUDES . 'application_bottom.php');
?>