/
confirm.php
executable file
·154 lines (128 loc) · 5.09 KB
/
confirm.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
<?php
require "_admin/_globals.php";
require CLASS_SHOPPING_CART;
$scart = new handleShoppingCart;
if(isset($_POST["submit"])){
$message = null;
if($_POST["agreement"] != "yes") $message = "2 You must agree to the terms and conditions below in order to purchase gift card(s).";
if($message == null){
getPaymentClass();
$pay = new handlePayment;
$pay->preloadPayment($scart->getTotal());
$pay->savePaymentRecord();
$result = $pay->processInvoice();
$scart->closeCards($pay->id);
sendMail("giftcard",$pay->id);
$message = $result["message"];
}
}
?>
<?php getHeader("public","yes"); ?>
<div id="link-column-container">
</div>
<div id="content-column-content">
<div class="content-title">Check Out</div>
<div style="margin:10px;">
<?php echo buildMessage($message); ?>
<h3>Buyer's Information</h3>
<table class="form">
<tr>
<td class="field-name">First Name:</td>
<td class="field-value"><?php echo stripslashes($_SESSION[SHOPPING_SESSION_ID]["field"]["fname"]); ?></td>
</tr>
<tr>
<td class="field-name">Last Name:</td>
<td class="field-value"><?php echo stripslashes($_SESSION[SHOPPING_SESSION_ID]["field"]["lname"]); ?></td>
</tr>
<tr>
<td class="field-name">Address:</td>
<td class="field-value"><?php echo stripslashes($_SESSION[SHOPPING_SESSION_ID]["field"]["address"]); ?></td>
</tr>
<tr>
<td class="field-name">City:</td>
<td class="field-value"><?php echo stripslashes($_SESSION[SHOPPING_SESSION_ID]["field"]["city"]); ?></td>
</tr>
<tr>
<td class="field-name">State:</td>
<td class="field-value"><?php echo stripslashes($_SESSION[SHOPPING_SESSION_ID]["field"]["state"]); ?></td>
</tr>
<tr>
<td class="field-name">Zip Code:</td>
<td class="field-value"><?php echo stripslashes($_SESSION[SHOPPING_SESSION_ID]["field"]["zip"]); ?></td>
</tr>
<tr>
<td class="field-name">Email Address:</td>
<td class="field-value"><?php echo stripslashes($_SESSION[SHOPPING_SESSION_ID]["field"]["email"]); ?></td>
</tr>
<tr>
<td class="field-name">Phone Number:</td>
<td class="field-value">(<?php echo stripslashes($_SESSION[SHOPPING_SESSION_ID]["field"]["areacode"]); ?>) <?php echo stripslashes($_SESSION[SHOPPING_SESSION_ID]["field"]["citycode"]); ?>-<?php echo stripslashes($_SESSION[SHOPPING_SESSION_ID]["field"]["numbcode"]); ?></td>
</tr>
</table>
<h3>Shipping Information</h3>
<table class="form">
<tr>
<td class="field-name">First Name:</td>
<td class="field-value"><?php echo stripslashes($_SESSION[SHOPPING_SESSION_ID]["field"]["ship_fname"]); ?></td>
</tr>
<tr>
<td class="field-name">Last Name:</td>
<td class="field-value"><?php echo stripslashes($_SESSION[SHOPPING_SESSION_ID]["field"]["ship_lname"]); ?></td>
</tr>
<tr>
<td class="field-name">Address:</td>
<td class="field-value"><?php echo stripslashes($_SESSION[SHOPPING_SESSION_ID]["field"]["ship_address"]); ?></td>
</tr>
<tr>
<td class="field-name">City:</td>
<td class="field-value"><?php echo stripslashes($_SESSION[SHOPPING_SESSION_ID]["field"]["ship_city"]); ?></td>
</tr>
<tr>
<td class="field-name">State:</td>
<td class="field-value"><?php echo stripslashes($_SESSION[SHOPPING_SESSION_ID]["field"]["ship_state"]); ?></td>
</tr>
<tr>
<td class="field-name">Zip Code:</td>
<td class="field-value"><?php echo stripslashes($_SESSION[SHOPPING_SESSION_ID]["field"]["ship_zip"]); ?></td>
</tr>
</table>
<h3>Credit Card Information</h3>
<table class="form">
<tr>
<td class="field-name">Name on Card:</td>
<td class="field-value"><?php echo stripslashes($_SESSION[SHOPPING_SESSION_ID]["field"]["cc_name"]); ?></td>
</tr>
<tr>
<td class="field-name">Card Number:</td>
<td class="field-value">**** **** **** <?php echo substr($_SESSION[SHOPPING_SESSION_ID]["field"]["cc_number"],-4); ?></td>
</tr>
<tr>
<td class="field-name">Card Expiration:</td>
<td class="field-value">**/****</td>
</tr>
<tr>
<td class="field-name">Security Code:</td>
<td class="field-value">***</td>
</tr>
<tr>
<td class="field-name">Card Zip Code:</td>
<td class="field-value">*****</td>
</tr>
</table>
<h3>Purchase Information</h3>
<?php echo $scart->showCartCheckOut(); ?>
<br/>
<?php if($result["result"] != "1") { ?>
<form action="<?php echo $_SERVER["PHP_SELF"];?>" method="post">
<?php echo loadTemplate("terms.conditions.giftcards.php", $rec);?>
<input type="checkbox" name="agreement" value="yes"> I AGREE TO THE ABOVE STATEMENT
<br/>
<br/>
<input type="submit" name="submit" value="Submit Order" onclick="document.getElementById('processing-box').style.display='block';document.getElementById('submit-box').style.display='none';"> <a href="checkout.php" class="blue small">Make Changes</a>
<p style="display: none;" id="processing-box">Processing your request. Do not refresh the page or you will be charged twice.</p>
</form>
<?php } ?>
<?php if($result["result"] == "1") $scart->clearCart(); ?>
</div>
</div>
<?php getFooter("public"); ?>