/
contribute.php
398 lines (352 loc) · 14.1 KB
/
contribute.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
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
<?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 is for a contribution only order; no products are shown,
// and other in progress orders are ignored.
require_once( '../bit_setup_inc.php' );
require('./functions.php');
// ========== start of variable loading ==========
// load passed variables and cookie variables
// int or double cast the numbers, no exceptions
// custid cookie is mime encoded, don't escape
$CookieCustID = getcookie("Cookie${instid}CustID");
$CookieCart = getcookie("Cookie${instid}Cart");
$cartid = getparam('cartid');
$zid = (int)getparam('zid');
$lid = (int)getparam('lid');
// ========== end of variable loading ==========
require('./public.php');
require('./flags.php');
require('./cartid.php');
require('./languages.php');
$fcc = new FC_SQL;
$fcw = new FC_SQL;
$fcclnks = new FC_SQL;
$fcview = new FC_SQL;
$fcal = new FC_SQL;
$ccexp_years = 8;
if(isset($purchid)){
// purchid provided by cartid.php
$fcc->query("select * from cust where custid=$purchid");
$cc = $fcc->next_record();
}else{
$custid=0;
}
$fcz=new FC_SQL;
$fcz->query("select zonecurrsym,zflag1 from zone where zoneid=$zid");
if($fcz->next_record()){
$csym=stripslashes($fcz->f("zonecurrsym"));
$csym=trim($csym);
$zflag1=$fcz->f("zflag1");
}else{
$csym="";
$zflag1=0;
}
$fcz->free_result();
if( $zflag1 & $flag_zonepwcatalog ){
// password controlled access
require('./pw.php');
}
// get the language templates
$fcl=new FC_SQL;
$fcl->query(
"select langproc,langcopy,langterms from lang where langid=$lid");
$fcl->next_record('langterms');
$proc=$fcl->f("langproc");
$copy=$fcl->f("langcopy");
$lterms=$fcl->f("langterms");
$fcl->free_result();
// END OF ESSENTIAL CART DISPLAY CODE FROM LINE 1 TO HERE ?>
<html>
<head>
<link rel="stylesheet" ID href="style.css" type="text/css" />
<title>
</title>
</head>
<body<?php
if($fcw->f("webback")){?> background="<?php echo $fcw->f("webback")?>"<?php }
if($fcw->f("webtext")){?> text="<?php echo $fcw->f("webtext")?>"<?php }
if($fcw->f("weblink")){?> link="<?php echo $fcw->f("weblink")?>"<?php }
if($fcw->f("webvlink")){?> link="<?php echo $fcw->f("webvlink")?>"<?php }
if($fcw->f("webalink")){?> link="<?php echo $fcw->f("webalink")?>"<?php }
if($fcw->f("webbg")){?> bgcolor="<?php echo $fcw->f("webbg")?>"<?php }
?>
marginheight="0" marginwidth="0" topmargin="0" leftmargin="0">
<h2 align="center"></h2>
<h3 align="center"><?php echo fc_text('contribution'); ?></h3>
<center>
<?php // START OF ESSENTIAL CART DISPLAY CODE ?>
<!--BEGIN CATEGORY LINKS TABLE-->
<table border="0" cellpadding="5" cellspacing="0" width="780">
<tr><td class="navtext" align="left" valign="top" width="135">
<?php include('fc_leftnav.php');?>
</td><td align="left" valign="top">
<!--OPEN CELL FOR FISHCART CODE-->
<table class="text" border="0" cellpadding="0" cellspacing="0" width="580">
<!-- FIRST COLUMN -->
<tr><td align="left" valign="top" width="10">
<img src="clearpixel.gif" width="10" height="1" /></td>
<!-- SECOND COLUMN -->
<td valign="top">
<table class="text" border="0" cellpadding="5" cellspacing="1" width="580" bgcolor="#666666">
<tr><td class="subdivrow" colspan="2" align="left" valign="middle" bgcolor="#FFFFFF">
<b><?php echo fc_text('contribamount'); ?></b><br />
</td><td class="contributecell" colspan="2" align="left" valign="top" bgcolor="#FFFFFF">
<form method="post" name="oform" action="<?php echo $securl.$secdir.'/'.$proc ?>"
onSubmit="
if( document.oform.contamt.value == '' ){
alert('<?php echo fc_text('jscontrib'); ?>');
return false;
}else if( document.oform.contamt.value > 99999.00 ){
alert('<?php echo fc_text('jscontriblim'); ?>');
return false;
} else if( document.oform.billing_country.options.selectedIndex == 0 ){
alert('<?php echo fc_text('jscountry'); ?>');
return false;
} else if( document.oform.ccexp_month.options.selectedIndex == 0 ){
alert('<?php echo fc_text('jsccexp'); ?>');
return false;
} else if( document.oform.ccexp_year.options.selectedIndex == 0 ){
alert('<?php echo fc_text('jsccexp'); ?>');
return false;
} else if( document.oform.cc_name.value == '' ){
alert('<?php echo fc_text('jsccname'); ?>');
return false;
} else if( document.oform.cc_number.value == '' ){
alert('<?php echo fc_text('jsccnum'); ?>');
return false;
} else if( document.oform.billing_email.value == '' ){
alert('<?php echo fc_text('jsbemail'); ?>');
return false;
} else if( document.oform.billing_first.value == '' ){
alert('<?php echo fc_text('jsbfname'); ?>');
return false;
} else if( document.oform.billing_last.value == '' ){
alert('<?php echo fc_text('jsblname'); ?>');
return false;
} else if( document.oform.billing_address1.value == '' ){
alert('<?php echo fc_text('jsbaddr'); ?>');
return false;
} else if( document.oform.billing_city.value == '' ){
alert('<?php echo fc_text('jsbcity'); ?>');
return false;
} else if( document.oform.billing_state.value == '' ){
alert('<?php echo fc_text('jsbstate'); ?>');
return false;
} else if( document.oform.billing_zip.value == '' ){
alert('<?php echo fc_text('jsbzip'); ?>');
return false;
} else if( !document.oform.cctype[0].checked &&
!document.oform.cctype[1].checked &&
!document.oform.cctype[2].checked &&
!document.oform.cctype[3].checked ){
alert('<?php echo fc_text('jscctype'); ?>');
return false;
}else{
alert('<?php echo fc_text('jsplaced'); ?>');
return true;
}
">
<?php echo $csym?><input type="text" name="contamt" size="8" />
</td></tr>
<tr><td class="divrow" colspan="4" align="center" bgcolor="#CCCCCC">
<b><?php echo fc_text('billinfo'); ?></b><br />
</td></tr>
<tr><td class="contributecell" colspan="4" bgcolor="#FFFFFF">
<?php echo fc_text('reqtext'); ?>
<p>
<?php echo fc_text('emailaddr') . fc_text('reqflag'); ?><br />
<input type="text" name="billing_email" size="40" maxsize="30"
value="<?php if($cc){echo $fcc->f("custbemail");}?>" /><br />
<table class="text" border="0" cellpadding="0">
<tr><td class="contributecell" bgcolor="#FFFFFF">
<?php echo fc_text('firstname') . fc_text('reqflag'); ?><br />
</td><td class="contributecell" bgcolor="#FFFFFF">
<?php echo fc_text('lastname') . fc_text('reqflag'); ?><br />
</td></tr>
<tr><td class="contributecell" bgcolor="#FFFFFF">
<input type="text" name="billing_first" size="15" maxsize="15"
value="<?php if($cc){echo $fcc->f("custbfname");}?>" />
</td><td class="contributecell" bgcolor="#FFFFFF">
<input type="text" name="billing_last" size="20" maxsize="20"
value="<?php if($cc){echo $fcc->f("custblname");}?>" /><br />
</td></tr>
</table>
<?php echo fc_text('address') . fc_text('reqflag'); ?><br />
<input type="text" name="billing_address1" size="40" maxsize="30"
value="<?php if($cc){echo $fcc->f("custbaddr1");}?>" /><br />
<input type="text" name="billing_address2" size="40" maxsize="30"
value="<?php if($cc){echo $fcc->f("custbaddr2");}?>" /><br />
<table class="text" border="0" cellpadding="0">
<tr><td class="contributecell" bgcolor="#FFFFFF">
<?php echo fc_text('city') . fc_text('reqflag'); ?><br />
</td><td class="contributecell" bgcolor="#FFFFFF">
<?php echo fc_text('state') . fc_text('reqflag'); ?><br />
</td><td class="contributecell" bgcolor="#FFFFFF">
<?php echo fc_text('zip') . fc_text('reqflag'); ?><br />
</td><td class="contributecell" bgcolor="#FFFFFF">
<?php echo fc_text('country') . fc_text('reqflag'); ?><br />
</td></tr>
<tr><td class="contributecell" bgcolor="#FFFFFF">
<input type="text" name="billing_city" size="30" maxsize="30"
value="<?php if($cc){echo $fcc->f("custbcity");}?>" />
</td><td class="contributecell" bgcolor="#FFFFFF">
<input type="text" name="billing_state" size="3" maxsize="2"
value="<?php if($cc){echo $fcc->f("custbstate");}?>" />
</td><td class="contributecell" bgcolor="#FFFFFF">
<input type="text" name="billing_zip" size="11" maxsize="10"
value="<?php if($cc){echo $fcc->f("custbzip");}?>" />
</td><td class="contributecell" bgcolor="#FFFFFF">
<select name="billing_country" size="1">
<option value="">[ <?php echo fc_text('selectctry');?> ]</option>
<?php
if($cc){ $billiso=$fcc->f("custbnatl"); }else{ $billiso=''; }
print show_countries( $zid, $lid, $billiso, $lang_iso );
?>
</select>
</td></tr>
</table>
<table class="text" border="0" cellpadding="0">
<tr><td class="contributecell" bgcolor="#FFFFFF">
<?php echo fc_text('dayphone') . fc_text('reqflag'); ?><br />
<input type="text" name="billing_acode" size="3" maxsize="3"
value="<?php if($cc){echo $fcc->f("custbacode");}?>" />
<input type="text" name="billing_phone" size="8" maxsize="7"
value="<?php if($cc){echo $fcc->f("custbphone");}?>" /><br />
</td></tr>
</table>
</td></tr>
<tr><td class="divrow" colspan="4" align="center" bgcolor="#CCCCCC">
<b><?php echo fc_text('creditinfo'); ?></b><br />
</td></tr>
<tr><td class="contributecell" align="left" valign="middle" colspan="2" bgcolor="#FFFFFF">
<?php echo fc_text('ccname') . fc_text('reqflag'); ?><br />
<input type="text" name="cc_name" size="40" maxsize="30" /><br />
</td><td class="contributecell" colspan="2" valign="middle" align="center" bgcolor="#FFFFFF">
<?php echo fc_text('ccnumber') . fc_text('reqflag'); ?><br />
<input type="text" name="cc_number" size="21" maxsize="19" /><br />
</td></tr>
<tr><td class="contributecell" align="left" valign="middle" colspan="2" bgcolor="#FFFFFF">
<?php // ADD ALL CREDIT CARD TYPES HERE ?>
<?php echo fc_text('cctype') . fc_text('reqflag'); ?><br />
<input type="radio" name="cctype" value="Visa" />VISA<br />
<input type="radio" name="cctype" value="Mastercard" />Mastercard<br />
<input type="radio" name="cctype" value="Discover" />Discover<br />
<input type="radio" name="cctype" value="American Express" />American Express<br />
</td><td class="contributecell" align="center" valign="middle" colspan="2" bgcolor="#FFFFFF">
<?php echo fc_text('ccexpire'); ?><br />
<table class="text" border="0">
<tr><td class="contributecell" align="center "valign="top" bgcolor="#FFFFFF">
<?php echo fc_text('month') . fc_text('reqflag'); ?><br />
</td><td class="contributecell" align="center" valign="top" bgcolor="#FFFFFF">
<?php echo fc_text('year') . fc_text('reqflag'); ?><br />
</td></tr><tr><td class="contributecell" align="center" valign="top" bgcolor="#FFFFFF">
<select name="ccexp_month" size="1">
<option value="0">[month]</option>
<?php
$i=1;
while($i<13){
$mn=sprintf("%02d",$i);
echo '<option value="'.$mn.'">'.$mn."\n";?>
</option>
<?php
$i++;
} ?>
</select>
<br />
</td><td class="contributecell" align="center" valign="top" bgcolor="#FFFFFF">
<select name="ccexp_year" size="1">
<option value="0">[year]</option>
<?php
$i=1;
$thisyr=date("Y",time());
while($i<10){
echo '<option value="'.$thisyr.'">'.$thisyr."\n";?>
</option>
<?php
$thisyr++;
$i++;
} ?>
</select>
</td></tr>
</table>
</td></tr>
<tr><td class="contributecell" align="center" colspan="4" bgcolor="#FFFFFF" bgcolor="#FFFFFF">
<?php
if( isset($CookieCustID) ){
$checked = ' checked';
}else{
$checked = '';
}
?>
<input type="checkbox" name="retain_addr" value="1"<?php echo $checked; ?> />
<?php echo fc_text('retain_addr'); ?><br />
</td></tr>
<tr><td class="contributecell" colspan="4" align="center" bgcolor="#FFFFFF">
<input type="hidden" name="shipping_first"
value="<?php if($cc){echo $fcc->f("custsfname");}?>" />
<input type="hidden" name="shipping_last"
value="<?php if($cc){echo $fcc->f("custslname");}?>" />
<input type="hidden" name="shipping_address1"
value="<?php if($cc){echo $fcc->f("custsaddr1");}?>" />
<input type="hidden" name="shipping_address2"
value="<?php if($cc){echo $fcc->f("custbsaddr2");}?>" />
<input type="hidden" name="shipping_city"
value="<?php if($cc){echo $fcc->f("custscity");}?>" />
<input type="hidden" name="shipping_state"
value="<?php if($cc){echo $fcc->f("custsstate");}?>" />
<input type="hidden" name="shipping_zip"
value="<?php if($cc){echo $fcc->f("custszip");}?>" />
<input type="hidden" name="shipping_country"
value="<?php if($cc){echo $fcc->f("custsnatl");}?>" />
<input type="hidden" name="shipping_acode"
value="<?php if($cc){echo $fcc->f("custsacode");}?>" />
<input type="hidden" name="shipping_phone"
value="<?php if($cc){echo $fcc->f("custsphone");}?>" />
<input type="hidden" name="onoff" value="on" />
<input type="hidden" name="stotal" value="0.0" />
<input type="hidden" name="shamt" value="0.0" />
<input type="hidden" name="stax" value="0.0" />
<input type="hidden" name="ototal" value="0.0" />
<input type="hidden" name="ttotal" value="0.0" />
<input type="hidden" name="custid" value="<?php echo $custid?>" />
<input type="hidden" name="itot" value="0" />
<input type="hidden" name="cartid" value="<?php echo $cartid?>" />
<input type="hidden" name="zid" value="<?php echo $zid?>" />
<input type="hidden" name="lid" value="<?php echo $lid?>" />
<input type="hidden" name="referer" value="<?php echo $REMOTE_ADDR?>" />
<input type="hidden" name="ccexp_years" value="<?php echo $ccexp_years?>" />
<input type="hidden" name="contrib_only" value="1" />
<input type="submit" value="<?php echo fc_text('contribsubmit'); ?>" />
</form>
</td></tr></table>
<!--CLOSE CELL/ROW/TABLE OF THE MAIN 100% WRAPPER TABLE-->
</td></tr></table>
</td></tr></table>
<?php // VENDOR INFORMATION
include ('vendinfo.php');
//END OF VENDOR INFORMATION ?>
<?php // END OF ESSENTIAL CART DISPLAY CODE ?>
</center>
<?php require_once( BITCART_PKG_PATH.'bitcart_footer_inc.php' ); ?>