-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcheckout_success.php
66 lines (46 loc) · 1.8 KB
/
checkout_success.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<?php
/*
$Id$
osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com
Copyright (c) 2010 osCommerce
Released under the GNU General Public License
*/
require('includes/application_top.php');
// if the customer is not logged on, redirect them to the shopping cart page
if (!isset($_SESSION['customer_id'])) {
tep_redirect(tep_href_link(FILENAME_SHOPPING_CART));
}
$orders_query = tep_db_query("select orders_id from " . TABLE_ORDERS . " where customers_id = '" . (int)$customer_id . "' order by date_purchased desc limit 1");
// redirect to shopping cart page if no orders exist
if ( !tep_db_num_rows($orders_query) ) {
tep_redirect(tep_href_link(FILENAME_SHOPPING_CART));
}
$orders = tep_db_fetch_array($orders_query);
$order_id = $orders['orders_id'];
$page_content = $oscTemplate->getContent('checkout_success');
if ( isset($_GET['action']) && ($_GET['action'] == 'update') ) {
tep_redirect(tep_href_link(FILENAME_DEFAULT));
}
require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CHECKOUT_SUCCESS);
$breadcrumb->add(NAVBAR_TITLE_1);
$breadcrumb->add(NAVBAR_TITLE_2);
require(DIR_WS_INCLUDES . 'template_top.php');
?>
<div class="page-header">
<h1><?php echo HEADING_TITLE; ?></h1>
</div>
<?php echo tep_draw_form('order', tep_href_link(FILENAME_CHECKOUT_SUCCESS, 'action=update', 'SSL', 'class="form-horizontal"')); ?>
<div class="contentContainer">
<?php echo $page_content; ?>
</div>
<div class="contentContainer">
<div class="buttonSet">
<div class="text-right"><?php echo tep_draw_button(IMAGE_BUTTON_CONTINUE, 'glyphicon glyphicon-chevron-right', null, 'primary', null, 'btn-success'); ?></div>
</div>
</div>
</form>
<?php
require(DIR_WS_INCLUDES . 'template_bottom.php');
require(DIR_WS_INCLUDES . 'application_bottom.php');
?>