This repository has been archived by the owner on Sep 25, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 124
/
fees.php
124 lines (117 loc) · 5.16 KB
/
fees.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
<?php
/***************************************************************************
* copyright : (C) 2008 - 2017 WeBid
* site : http://www.webidsupport.com/
***************************************************************************/
/***************************************************************************
* 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. Although none of the code may be
* sold. If you have been sold this script, get a refund.
***************************************************************************/
include 'common.php';
if ($system->SETTINGS['fees'] == 'n') {
header('location: index.php');
exit;
}
// get fees
$query = "SELECT * FROM " . $DBPrefix . "fees ORDER BY fee_from ASC";
$db->direct_query($query);
$setup = $buyer_fee = $endauc_fee = false;
$i = 0;
while ($row = $db->fetch()) {
if ($row['type'] == 'setup_fee') {
if ($row['fee_from'] != $row['fee_to']) {
$setup = true;
$template->assign_block_vars('setup_fees', array(
'BGCOLOUR' => (!($i % 2)) ? '' : 'class="alt-row"',
'FROM' => $system->print_money($row['fee_from']),
'TO' => $system->print_money($row['fee_to']),
'VALUE' => ($row['fee_type'] == 'flat') ? $system->print_money($row['value']) : $row['value'] . '%'
));
}
} elseif ($row['type'] == 'buyer_fee') {
if ($row['fee_from'] != $row['fee_to']) {
$buyer_fee = true;
$template->assign_block_vars('buyer_fee', array(
'BGCOLOUR' => (!($i % 2)) ? '' : 'class="alt-row"',
'FROM' => $system->print_money($row['fee_from']),
'TO' => $system->print_money($row['fee_to']),
'VALUE' => ($row['fee_type'] == 'flat') ? $system->print_money($row['value']) : $row['value'] . '%'
));
}
} elseif ($row['type'] == 'endauc_fee') {
if ($row['fee_from'] != $row['fee_to']) {
$endauc_fee = true;
$template->assign_block_vars('endauc_fee', array(
'BGCOLOUR' => (!($i % 2)) ? '' : 'class="alt-row"',
'FROM' => $system->print_money($row['fee_from']),
'TO' => $system->print_money($row['fee_to']),
'VALUE' => ($row['fee_type'] == 'flat') ? $system->print_money($row['value']) : $row['value'] . '%'
));
}
} elseif ($row['type'] == 'signup_fee') {
$template->assign_vars(array(
'B_SIGNUP_FEE' => ($row['value'] > 0),
'SIGNUP_FEE' => $system->print_money($row['value'])
));
} elseif ($row['type'] == 'featured_fee') {
$template->assign_vars(array(
'B_HPFEAT_FEE' => ($row['value'] > 0),
'HPFEAT_FEE' => $system->print_money($row['value'])
));
} elseif ($row['type'] == 'bold_fee') {
$template->assign_vars(array(
'B_BOLD_FEE' => ($row['value'] > 0),
'BOLD_FEE' => $system->print_money($row['value'])
));
} elseif ($row['type'] == 'highlighted_fee') {
$template->assign_vars(array(
'B_HL_FEE' => ($row['value'] > 0),
'HL_FEE' => $system->print_money($row['value'])
));
} elseif ($row['type'] == 'reserve_fee') {
$template->assign_vars(array(
'B_RP_FEE' => ($row['value'] > 0),
'RP_FEE' => $system->print_money($row['value'])
));
} elseif ($row['type'] == 'picture_fee') {
$template->assign_vars(array(
'B_PICTURE_FEE' => ($row['value'] > 0),
'PICTURE_FEE' => $system->print_money($row['value'])
));
} elseif ($row['type'] == 'relist_fee') {
$template->assign_vars(array(
'B_RELIST_FEE' => ($row['value'] > 0),
'RELIST_FEE' => $system->print_money($row['value'])
));
} elseif ($row['type'] == 'buynow_fee') {
$template->assign_vars(array(
'B_BUYNOW_FEE' => ($row['value'] > 0),
'BUYNOW_FEE' => $system->print_money($row['value'])
));
} elseif ($row['type'] == 'extracat_fee') {
$template->assign_vars(array(
'B_EXCAT_FEE' => ($row['value'] > 0),
'EXCAT_FEE' => $system->print_money($row['value'])
));
} elseif ($row['type'] == 'subtitle_fee') {
$template->assign_vars(array(
'B_SUBTITLE_FEE' => ($row['value'] > 0),
'SUBTITLE_FEE' => $system->print_money($row['value'])
));
}
$i++;
}
$template->assign_vars(array(
'B_SETUP_FEE' => $setup,
'B_BUYER_FEE' => $buyer_fee,
'B_ENDAUC_FEE' => $endauc_fee
));
include 'header.php';
$template->set_filenames(array(
'body' => 'fees.tpl'
));
$template->display('body');
include 'footer.php';