| 1 | <?php |
|---|
| 2 | /* |
|---|
| 3 | $Id: checkout_success.php 1749 2007-12-21 04:23:36Z hpdl $ |
|---|
| 4 | |
|---|
| 5 | osCommerce, Open Source E-Commerce Solutions |
|---|
| 6 | http://www.oscommerce.com |
|---|
| 7 | |
|---|
| 8 | Copyright (c) 2007 osCommerce |
|---|
| 9 | |
|---|
| 10 | Released under the GNU General Public License |
|---|
| 11 | */ |
|---|
| 12 | |
|---|
| 13 | require('includes/application_top.php'); |
|---|
| 14 | |
|---|
| 15 | // if the customer is not logged on, redirect them to the shopping cart page |
|---|
| 16 | if (!tep_session_is_registered('customer_id')) { |
|---|
| 17 | tep_redirect(tep_href_link(FILENAME_SHOPPING_CART)); |
|---|
| 18 | } |
|---|
| 19 | |
|---|
| 20 | if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'update')) { |
|---|
| 21 | $notify_string = ''; |
|---|
| 22 | |
|---|
| 23 | if (isset($HTTP_POST_VARS['notify']) && !empty($HTTP_POST_VARS['notify'])) { |
|---|
| 24 | $notify = $HTTP_POST_VARS['notify']; |
|---|
| 25 | |
|---|
| 26 | if (!is_array($notify)) { |
|---|
| 27 | $notify = array($notify); |
|---|
| 28 | } |
|---|
| 29 | |
|---|
| 30 | for ($i=0, $n=sizeof($notify); $i<$n; $i++) { |
|---|
| 31 | if (is_numeric($notify[$i])) { |
|---|
| 32 | $notify_string .= 'notify[]=' . $notify[$i] . '&'; |
|---|
| 33 | } |
|---|
| 34 | } |
|---|
| 35 | |
|---|
| 36 | if (!empty($notify_string)) { |
|---|
| 37 | $notify_string = 'action=notify&' . substr($notify_string, 0, -1); |
|---|
| 38 | } |
|---|
| 39 | } |
|---|
| 40 | |
|---|
| 41 | tep_redirect(tep_href_link(FILENAME_DEFAULT, $notify_string)); |
|---|
| 42 | } |
|---|
| 43 | |
|---|
| 44 | require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CHECKOUT_SUCCESS); |
|---|
| 45 | |
|---|
| 46 | $breadcrumb->add(NAVBAR_TITLE_1); |
|---|
| 47 | $breadcrumb->add(NAVBAR_TITLE_2); |
|---|
| 48 | |
|---|
| 49 | $global_query = tep_db_query("select global_product_notifications from " . TABLE_CUSTOMERS_INFO . " where customers_info_id = '" . (int)$customer_id . "'"); |
|---|
| 50 | $global = tep_db_fetch_array($global_query); |
|---|
| 51 | |
|---|
| 52 | if ($global['global_product_notifications'] != '1') { |
|---|
| 53 | $orders_query = tep_db_query("select orders_id from " . TABLE_ORDERS . " where customers_id = '" . (int)$customer_id . "' order by date_purchased desc limit 1"); |
|---|
| 54 | $orders = tep_db_fetch_array($orders_query); |
|---|
| 55 | |
|---|
| 56 | $products_array = array(); |
|---|
| 57 | $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"); |
|---|
| 58 | while ($products = tep_db_fetch_array($products_query)) { |
|---|
| 59 | $products_array[] = array('id' => $products['products_id'], |
|---|
| 60 | 'text' => $products['products_name']); |
|---|
| 61 | } |
|---|
| 62 | } |
|---|
| 63 | ?> |
|---|
| 64 | <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN"> |
|---|
| 65 | <html <?php echo HTML_PARAMS; ?>> |
|---|
| 66 | <head> |
|---|
| 67 | <meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>"> |
|---|
| 68 | <title><?php echo TITLE; ?></title> |
|---|
| 69 | <base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>"> |
|---|
| 70 | <link rel="stylesheet" type="text/css" href="stylesheet.css"> |
|---|
| 71 | </head> |
|---|
| 72 | <body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0"> |
|---|
| 73 | <!-- header //--> |
|---|
| 74 | <?php require(DIR_WS_INCLUDES . 'header.php'); ?> |
|---|
| 75 | <!-- header_eof //--> |
|---|
| 76 | |
|---|
| 77 | <!-- body //--> |
|---|
| 78 | <table border="0" width="100%" cellspacing="3" cellpadding="3"> |
|---|
| 79 | <tr> |
|---|
| 80 | <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2"> |
|---|
| 81 | <!-- left_navigation //--> |
|---|
| 82 | <?php require(DIR_WS_INCLUDES . 'column_left.php'); ?> |
|---|
| 83 | <!-- left_navigation_eof //--> |
|---|
| 84 | </table></td> |
|---|
| 85 | <!-- body_text //--> |
|---|
| 86 | <td width="100%" valign="top"><?php echo tep_draw_form('order', tep_href_link(FILENAME_CHECKOUT_SUCCESS, 'action=update', 'SSL')); ?><table border="0" width="100%" cellspacing="0" cellpadding="0"> |
|---|
| 87 | <tr> |
|---|
| 88 | <td><table border="0" width="100%" cellspacing="4" cellpadding="2"> |
|---|
| 89 | <tr> |
|---|
| 90 | <td valign="top"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_man_on_board.gif', HEADING_TITLE); ?></td> |
|---|
| 91 | <td valign="top" class="main"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?><div align="center" class="pageHeading"><?php echo HEADING_TITLE; ?></div><br><?php echo TEXT_SUCCESS; ?><br><br> |
|---|
| 92 | <?php |
|---|
| 93 | if ($global['global_product_notifications'] != '1') { |
|---|
| 94 | echo TEXT_NOTIFY_PRODUCTS . '<br><p class="productsNotifications">'; |
|---|
| 95 | |
|---|
| 96 | $products_displayed = array(); |
|---|
| 97 | for ($i=0, $n=sizeof($products_array); $i<$n; $i++) { |
|---|
| 98 | if (!in_array($products_array[$i]['id'], $products_displayed)) { |
|---|
| 99 | echo tep_draw_checkbox_field('notify[]', $products_array[$i]['id']) . ' ' . $products_array[$i]['text'] . '<br>'; |
|---|
| 100 | $products_displayed[] = $products_array[$i]['id']; |
|---|
| 101 | } |
|---|
| 102 | } |
|---|
| 103 | |
|---|
| 104 | echo '</p>'; |
|---|
| 105 | } else { |
|---|
| 106 | echo TEXT_SEE_ORDERS . '<br><br>' . TEXT_CONTACT_STORE_OWNER; |
|---|
| 107 | } |
|---|
| 108 | ?> |
|---|
| 109 | <h3><?php echo TEXT_THANKS_FOR_SHOPPING; ?></h3></td> |
|---|
| 110 | </tr> |
|---|
| 111 | </table></td> |
|---|
| 112 | </tr> |
|---|
| 113 | <tr> |
|---|
| 114 | <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> |
|---|
| 115 | </tr> |
|---|
| 116 | <tr> |
|---|
| 117 | <td align="right" class="main"><?php echo tep_image_submit('button_continue.gif', IMAGE_BUTTON_CONTINUE); ?></td> |
|---|
| 118 | </tr> |
|---|
| 119 | <tr> |
|---|
| 120 | <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> |
|---|
| 121 | </tr> |
|---|
| 122 | <tr> |
|---|
| 123 | <td><table border="0" width="100%" cellspacing="0" cellpadding="0"> |
|---|
| 124 | <tr> |
|---|
| 125 | <td width="25%"><table border="0" width="100%" cellspacing="0" cellpadding="0"> |
|---|
| 126 | <tr> |
|---|
| 127 | <td width="50%" align="right"><?php echo tep_draw_separator('pixel_silver.gif', '1', '5'); ?></td> |
|---|
| 128 | <td width="50%"><?php echo tep_draw_separator('pixel_silver.gif', '100%', '1'); ?></td> |
|---|
| 129 | </tr> |
|---|
| 130 | </table></td> |
|---|
| 131 | <td width="25%"><?php echo tep_draw_separator('pixel_silver.gif', '100%', '1'); ?></td> |
|---|
| 132 | <td width="25%"><?php echo tep_draw_separator('pixel_silver.gif', '100%', '1'); ?></td> |
|---|
| 133 | <td width="25%"><table border="0" width="100%" cellspacing="0" cellpadding="0"> |
|---|
| 134 | <tr> |
|---|
| 135 | <td width="50%"><?php echo tep_draw_separator('pixel_silver.gif', '100%', '1'); ?></td> |
|---|
| 136 | <td width="50%"><?php echo tep_image(DIR_WS_IMAGES . 'checkout_bullet.gif'); ?></td> |
|---|
| 137 | </tr> |
|---|
| 138 | </table></td> |
|---|
| 139 | </tr> |
|---|
| 140 | <tr> |
|---|
| 141 | <td align="center" width="25%" class="checkoutBarFrom"><?php echo CHECKOUT_BAR_DELIVERY; ?></td> |
|---|
| 142 | <td align="center" width="25%" class="checkoutBarFrom"><?php echo CHECKOUT_BAR_PAYMENT; ?></td> |
|---|
| 143 | <td align="center" width="25%" class="checkoutBarFrom"><?php echo CHECKOUT_BAR_CONFIRMATION; ?></td> |
|---|
| 144 | <td align="center" width="25%" class="checkoutBarCurrent"><?php echo CHECKOUT_BAR_FINISHED; ?></td> |
|---|
| 145 | </tr> |
|---|
| 146 | </table></td> |
|---|
| 147 | </tr> |
|---|
| 148 | <?php if (DOWNLOAD_ENABLED == 'true') include(DIR_WS_MODULES . 'downloads.php'); ?> |
|---|
| 149 | <?php |
|---|
| 150 | //---PayPal WPP Modification START ---// |
|---|
| 151 | tep_paypal_wpp_checkout_completed($ec_enabled); |
|---|
| 152 | //---PayPal WPP Modification END ---// |
|---|
| 153 | ?> |
|---|
| 154 | </table></form></td> |
|---|
| 155 | <!-- body_text_eof //--> |
|---|
| 156 | <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2"> |
|---|
| 157 | <!-- right_navigation //--> |
|---|
| 158 | <?php require(DIR_WS_INCLUDES . 'column_right.php'); ?> |
|---|
| 159 | <!-- right_navigation_eof //--> |
|---|
| 160 | </table></td> |
|---|
| 161 | </tr> |
|---|
| 162 | </table> |
|---|
| 163 | <!-- body_eof //--> |
|---|
| 164 | |
|---|
| 165 | <!-- footer //--> |
|---|
| 166 | <?php require(DIR_WS_INCLUDES . 'footer.php'); ?> |
|---|
| 167 | <!-- footer_eof //--> |
|---|
| 168 | <br> |
|---|
| 169 | </body> |
|---|
| 170 | </html> |
|---|
| 171 | <?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?> |
|---|