-
Notifications
You must be signed in to change notification settings - Fork 0
/
proddispecho.php
194 lines (167 loc) · 4.91 KB
/
proddispecho.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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
<?php /*
FishCart: an online catalog management / shopping system
Copyright (C) 1997-2002 FishNet, Inc.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
USA.
N. Michael Brennen
FishNet(R), Inc.
850 S. Greenville, Suite 102
Richardson, TX 75081
http://www.fni.com/
mbrennen@fni.com
voice: 972.669.0041
fax: 972.669.8972
This file echos product info in fixed space format; it is used
typically for email orders and confirmations.
*/
// SQL INJECTION AVOIDENCE
$zid=(int) $zid;
$lid=(int) $lid;
$subz=(int) $subz;
$qty=(int) $qty;
if( empty($contrib_only) && empty($payment_only) ){
echo "\n";
// echo "ITEM QTY PRICE PRODUCT\n";
echo fc_text('itemcapfix').fc_text('qtycapfix').fc_text('pricecapfix').fc_text('productcapfix')."\n";
$fco = new FC_SQL;
$fcp = new FC_SQL;
$fco->query("select subz from ohead where orderid='$cartid'");
$fco->next_record();
$subz=$fco->f("subz");
$fco->free_result();
if( !empty($subz) ){
$fco->query("select subzdescr from subzone where subzsid=$subz");
$fco->next_record();
$subzdescr=$fco->f("subzdescr");
$fco->free_result();
}else{
$subzdescr="";
}
$tqty=0;
$fco->query("select sku,compsku,qty,olid from oline where orderid='$cartid'");
while($fco->next_record()){
$qty=$fco->f("qty");
$sku=$fco->f("sku");
$csku=$fco->f("compsku");
$olid=(int)$fco->f("olid");
$fcp->query("select prodname from prodlang ".
"where prodlzid=$zid and prodlid=$lid and prodlsku='$sku'");
$fcp->next_record();
// strip any HTML tags
$dsc=ereg_replace("<[^>]+>"," ",$fcp->f("prodname"));
$dsc=substr($dsc,0,35);
$fcp->free_result();
// accumulate $popttotal, $poptsettot
while( get_prodopts($csku) ){
}
// figure options modified product price, accumulate $prodsetttot
// sets various globals
$prodprice = prod_price ( $sku );
$ltotal = line_total( $qty, $prodprice );
$tqty=rnd($tqty+$qty);
if( $csku ){
$tmp =sprintf("\n%10s",$csku); // ProductNumber
}else{
$tmp =sprintf("\n%10s",$sku); // ProductNumber
}
$tmp.=' ';
$tmp.=sprintf("%3d",$qty); // Quantity
$tmp.=' ';
$tmp.=sprintf("%8.2f",$ltotal); // ExtPrice
$tmp.=' ';
$tmp.=sprintf("%s",$dsc); // Description
$tmp.="\n";
echo $tmp;
// now display the product options
if( $sku != $csku ){
echo fc_text('basepricefix').sprintf("%s%.2f\n",$csym,$prodbaseprice);
}
while( get_prodopts($csku) ){
echo fc_text('optionfix').$poptname."\n";
if($poptqty){
echo fc_text('qtyfix').$poptqty."\n".
fc_text('totalfix').sprintf("%s%.2f\n",$csym,$poptextension);
}else{
echo fc_text('totalfix').sprintf("%s%.2f\n",$csym,$poptextension);
}
if($poptsetup){
echo fc_text('setupfix').sprintf("%s%.2f\n",$csym,$poptsetup);
}
}
}
$fco->free_result();
echo "\n";
if( $prodsettot ){
echo fc_text('setuptotalfix').sprintf("%8.2f\n",$prodsettot);
}
if( $zflag1 & $flag_zonecoupon ){
if( $cpndisc > 0 ){
echo fc_text('discountfix').sprintf("%8.2f\n",$cpndisc);
}
}
if($stotal){
echo fc_text('subtotalfix').sprintf("%8.2f\n",$stotal);
echo fc_text('shippingfix').sprintf("%8.2f %s\n",$shamt,$shipdescr);
} // if stotal
$staxn=(double)$staxn;
$staxs=(double)$staxs;
if($staxn){
if( $staxcmtn ){
echo sprintf(" %9s: %8.2f\n",$staxcmtn,$staxn);
}else{
echo fc_text('salestaxfix').sprintf("%8.2f\n",$staxn);
}
}
if($staxs){
if( $staxcmts ){
echo sprintf(" %9s: %8.2f\n",$staxcmts,$staxs);
}else{
echo fc_text('salestaxfix').sprintf("%8.2f\n",$staxs);
}
}
} // end of contrib_only
if($contamt>0){
echo fc_text('contributefix').sprintf("%8.2f\n",$contamt);
}
if( !empty($payment_only) ){
echo fc_text('paymentfix').sprintf("%8.2f\n",$payment);
}
if( empty($contrib_only) && empty($payment_only) && $ttotal ){
echo fc_text('ordertotalfix').sprintf("%8.2f\n",$ttotal);
}
if( $ttotal && $ptotal){
echo "\n";
}
if($mtotal){
echo fc_text('psubtotalfix').sprintf("%8.2f\n",$mtotal);
}
$pstaxn=(double)$pstaxn;
$pstaxs=(double)$pstaxs;
if($pstaxn){
if( $staxcmtn ){
echo sprintf(" %9s: %8.2f\n",$staxcmtn,$pstaxn);
}else{
echo fc_text('psalestaxfix').sprintf("%8.2f\n",$pstaxn);
}
}
if($pstaxs){
if( $staxcmts ){
echo sprintf(" %9s: %8.2f\n",$staxcmts,$pstaxs);
}else{
echo fc_text('psalestaxfix').sprintf("%8.2f\n",$pstaxs);
}
}
if( empty($contrib_only) && empty($payment_only) && $ptotal ){
echo fc_text('ptotalfix').sprintf("%8.2f\n",$ptotal);
}
?>