| 1 |
- |
1 |
<?php
|
| 5 |
- |
2 |
include_once('php/exchangeRates.php');
|
|
|
3 |
include_once('php/countryCodes.php');
|
|
|
4 |
include_once('php/constants.php');
|
|
|
5 |
include_once('php/ebay.php');
|
| 1 |
- |
6 |
|
| 5 |
- |
7 |
// search
|
|
|
8 |
function performSearch() {
|
|
|
9 |
$_SESSION["currentView"] = 'All';
|
|
|
10 |
$_SESSION["barcode"]["Type"] = clsLibGTIN::GTINCheck($_SESSION["searchTerm"], false, 1);
|
|
|
11 |
$_SESSION["barcode"]["Value"] = clsLibGTIN::GTINCheck($_SESSION["searchTerm"]);
|
| 1 |
- |
12 |
|
| 5 |
- |
13 |
$_SESSION["resultArr"] = [];
|
|
|
14 |
$_SESSION["resultArr"] = searchAll($_SESSION["searchTerm"]);
|
|
|
15 |
|
|
|
16 |
$_SESSION["lowestPrice"]["Used"] = findLowest("Used");
|
|
|
17 |
$_SESSION["lowestPrice"]["New"] = findLowest("New");
|
|
|
18 |
$_SESSION["lowestPrice"]["Digital"] = findLowest("Digital");
|
|
|
19 |
$_SESSION["lowestPrice"]["All"] = 0.00;
|
|
|
20 |
if (array_sum($_SESSION["lowestPrice"]) > 0) {
|
|
|
21 |
$_SESSION["lowestPrice"]["All"] = minNotNull($_SESSION["lowestPrice"]);
|
|
|
22 |
}
|
|
|
23 |
}
|
|
|
24 |
|
|
|
25 |
// search for items on all sites
|
|
|
26 |
function searchAll($searchKey)
|
|
|
27 |
{
|
|
|
28 |
$arr = [];
|
|
|
29 |
$newArr = [];
|
|
|
30 |
if ($_SESSION["filterCondition"]["New"]) {
|
|
|
31 |
$arr = get_ebay($searchKey, constant("NEW"));
|
|
|
32 |
}
|
|
|
33 |
if ($_SESSION["filterCondition"]["Used"]) {
|
|
|
34 |
$newArr = get_ebay($searchKey, constant("USED"));
|
|
|
35 |
}
|
|
|
36 |
$arr = array_merge($arr, $newArr);
|
|
|
37 |
|
|
|
38 |
$arr = applyExchangeRates($arr);
|
|
|
39 |
usort($arr, 'compare_price');
|
|
|
40 |
|
|
|
41 |
return $arr;
|
|
|
42 |
}
|
|
|
43 |
|
|
|
44 |
// check search filters
|
|
|
45 |
function checkSearchFilters() {
|
|
|
46 |
$_SESSION["filterWarnings"] = "";
|
|
|
47 |
$filterOk = true;
|
|
|
48 |
|
|
|
49 |
if (!$_SESSION["filterCondition"]["New"] && !$_SESSION["filterCondition"]["Used"]) {
|
|
|
50 |
$_SESSION["filterWarnings"] .= '<div class="alert alert-danger"><i class="fas fa-filter mr-1"></i> Please select at least one Condition (New or Used)</div>';
|
|
|
51 |
$filterOk = false;
|
|
|
52 |
}
|
|
|
53 |
|
|
|
54 |
if (!$_SESSION["filterMediaType"]["CD"] && !$_SESSION["filterMediaType"]["Record"] && !$_SESSION["filterMediaType"]["Digital"]) {
|
|
|
55 |
$_SESSION["filterWarnings"] .= '<div class="alert alert-danger"><i class="fas fa-filter mr-1"></i> Please select at least one Media Type (CD, Record or Digital)</div>';
|
|
|
56 |
$filterOk = false;
|
|
|
57 |
}
|
|
|
58 |
|
|
|
59 |
return($filterOk);
|
|
|
60 |
}
|
|
|
61 |
|
|
|
62 |
// filter results for types All, New, Used or Digital
|
|
|
63 |
function filterResults()
|
|
|
64 |
{
|
|
|
65 |
foreach ($_SESSION["resultArr"] as &$value) {
|
|
|
66 |
if ($_SESSION["currentView"] == 'All') {
|
|
|
67 |
$value["Show"] = true;
|
|
|
68 |
} else {
|
|
|
69 |
$value["Show"] = ($_SESSION["currentView"] == $value["Type"]);
|
|
|
70 |
}
|
|
|
71 |
}
|
|
|
72 |
}
|
| 1 |
- |
73 |
|
|
|
74 |
// build HTML table from array
|
| 5 |
- |
75 |
function buildTable()
|
|
|
76 |
{
|
|
|
77 |
$str = "<div>";
|
|
|
78 |
$str .= "<table class=\"table table-striped table-condensed small\">";
|
|
|
79 |
$str .= "<thead class=\"thead-dark sticky-top\"><tr><th>Image</th><th class=\"text-left\">Title / Merchant</th><th>Condition</th><th class=\"hide-small\">Price</th><th class=\"hide-small\">S/H</th><th>Total</th><th class=\"hide-extra-small\"></th></tr></thead>";
|
|
|
80 |
$str .= "<tbody>";
|
| 1 |
- |
81 |
|
| 5 |
- |
82 |
foreach ($_SESSION["resultArr"] as $value) {
|
|
|
83 |
if (!$value["Show"]) {
|
|
|
84 |
continue;
|
|
|
85 |
}
|
| 1 |
- |
86 |
|
| 5 |
- |
87 |
$url = base64_encode($value["URL"]);
|
|
|
88 |
|
|
|
89 |
$str .= "<tr>";
|
| 1 |
- |
90 |
|
|
|
91 |
// Image
|
| 5 |
- |
92 |
$str .= "<td><a href=\"/redirect.php?target=" . $url . "\" target=\"_blank\"><img class=\"img-fluid\" src=\"" . $value["Image"] . "\" alt=\"Item Image\"></a></td>";
|
| 1 |
- |
93 |
|
|
|
94 |
// Title / Merchant
|
| 5 |
- |
95 |
$str .= "<td class=\"text-left\"><span class=\"font-weight-bold\"><a href=\"/redirect.php?target=" . $url . "\" target=\"_blank\">" . $value["Title"] . "</a></span><br/><br/>";
|
|
|
96 |
$str .= "<span class=\"font-weight-bold\">" . $value["Merchant"] . "</span>";
|
|
|
97 |
$str .= "<span class=\"hide-extra-small\"><br/>" . $value["SellerName"] . " (" . number_format($value["FeedbackScore"], 0, "", ",") . " / " . $value["FeedbackPercent"] . "%)</span></td>";
|
| 1 |
- |
98 |
|
|
|
99 |
// Condition
|
| 5 |
- |
100 |
$str .= "<td>";
|
|
|
101 |
$categoryIcon = "";
|
|
|
102 |
$categoryStyle = "";
|
|
|
103 |
$tooltip = "";
|
|
|
104 |
switch ($value["Category"]) {
|
|
|
105 |
case "CD":
|
|
|
106 |
$categoryIcon = "fas fa-compact-disc";
|
|
|
107 |
$categoryStyle = "color:silver;";
|
|
|
108 |
$tooltip = "Compact Disc";
|
|
|
109 |
break;
|
| 1 |
- |
110 |
|
| 5 |
- |
111 |
case "Record":
|
|
|
112 |
$categoryIcon = "fas fa-dot-circle";
|
|
|
113 |
$tooltip = "Vinyl Record";
|
|
|
114 |
break;
|
|
|
115 |
|
|
|
116 |
case "Digital":
|
|
|
117 |
$categoryIcon = "digital";
|
|
|
118 |
$tooltip = "Digital Download";
|
|
|
119 |
break;
|
|
|
120 |
}
|
|
|
121 |
$str .= "<span class=\"font-weight-bold\">" . $value["Condition"] . "</span>";
|
|
|
122 |
$str .= "<br/><br/>";
|
|
|
123 |
$str .= "<i class=\"" . $categoryIcon . "\" style=\"font-size:32px;text-shadow:2px 2px 4px #000000;" . $categoryStyle . "\" title=\"" . $tooltip . "\" data-toggle=\"tooltip\" data-placement=\"right\" data-delay=\"200\"></i>";
|
|
|
124 |
$str .= "</td>";
|
|
|
125 |
|
| 1 |
- |
126 |
// Price
|
| 5 |
- |
127 |
$str .= "<td class=\"hide-small\">" . print_monetary($value["Price"], $value["Currency"]);
|
|
|
128 |
if ($value["Currency"] != $_SESSION["buyer"]["Currency"]) {
|
|
|
129 |
$str .= "<br/>≈ " . print_monetary($value["ConvertedPrice"], $_SESSION["buyer"]["Currency"]);
|
|
|
130 |
}
|
|
|
131 |
$str .= "</td>";
|
| 1 |
- |
132 |
|
|
|
133 |
// Shipping and Handling Cost
|
| 5 |
- |
134 |
$str .= "<td class=\"hide-small\">";
|
|
|
135 |
if ($value["ShippingCost"] == 0.00) {
|
|
|
136 |
$str .= "Free Shipping";
|
|
|
137 |
} else {
|
|
|
138 |
$str .= print_monetary($value["ShippingCost"], $value["ShippingCurrency"]);
|
|
|
139 |
}
|
|
|
140 |
if ($value["ShippingCost"] > 0.00 && $value["ShippingCurrency"] != $_SESSION["buyer"]["Currency"]) {
|
|
|
141 |
$str .= "<br/>≈ " . print_monetary($value["ConvertedShippingCost"], $_SESSION["buyer"]["Currency"]);
|
|
|
142 |
}
|
|
|
143 |
$str .= "<br/><img class=\"img-fluid\" title=\"Ships from " . getCountry($value["Country"]) . "\" data-toggle=\"tooltip\" data-placement=\"right\" data-delay=\"200\" src=\"/images/flags/" . $value["Country"] . ".png\" alt=\"" . getCountry($value["Country"]) . " Flag\"></td>";
|
| 1 |
- |
144 |
|
|
|
145 |
// Total Price
|
| 5 |
- |
146 |
$str .= "<td class=\"font-weight-bolder\">" . print_monetary($value["ConvertedTotalPrice"], $_SESSION["buyer"]["Currency"]) . "</td>";
|
| 1 |
- |
147 |
|
|
|
148 |
// Link
|
| 5 |
- |
149 |
$str .= "<td class=\"hide-extra-small\"><a class=\"btn btn-danger\" role=\"button\" href=\"/redirect.php?target=" . $url . "\" target=\"_blank\"><i class=\"fas fa-shopping-cart\" style=\"font-size:20px\"></i><span class=\"hide-small\"><br>Buy It Now</span></a></td>";
|
| 1 |
- |
150 |
|
| 5 |
- |
151 |
$str .= "</tr>";
|
|
|
152 |
}
|
| 1 |
- |
153 |
|
| 5 |
- |
154 |
$str .= "</tbody>";
|
|
|
155 |
$str .= "<tfoot class=\"text-right\"><tr><td colspan=\"7\">Prices retrieved on " . gmdate("Y-m-d H:i") . " UTC<br>Daily exchange rates update</td></tr></tfoot>";
|
|
|
156 |
$str .= "</table>";
|
|
|
157 |
$str .= "</div>";
|
| 1 |
- |
158 |
|
| 5 |
- |
159 |
return ($str);
|
|
|
160 |
}
|
|
|
161 |
|
| 1 |
- |
162 |
// print summary/header on top of listing table
|
| 5 |
- |
163 |
function printTableHeader()
|
|
|
164 |
{
|
|
|
165 |
$str = '<form method="post" action="/index.php">';
|
|
|
166 |
$str .= '<div class="d-flex flex-wrap justify-content-center p-2">';
|
|
|
167 |
$str .= ' <button name="submit" value="All" type="' . getButtonType("All") . '" class="btn mx-2 ' . getBackgroundColor("All") . '"';
|
|
|
168 |
if ($_SESSION["lowestPrice"]["All"] <= 0) {
|
|
|
169 |
$str .= ' disabled';
|
|
|
170 |
}
|
|
|
171 |
$str .= '><span class="display-4 font-weight-bolder">All</span> from<br><span class="display-5 font-weight-bolder">' . print_monetary($_SESSION["lowestPrice"]["All"], $_SESSION["buyer"]["Currency"]) . '</span>';
|
|
|
172 |
$str .= ' </button>';
|
|
|
173 |
$str .= ' <button name="submit" value="New" type="' . getButtonType("New") . '" class="btn mx-2 ' . getBackgroundColor("New") . '"';
|
|
|
174 |
if ($_SESSION["lowestPrice"]["New"] <= 0) {
|
|
|
175 |
$str .= ' disabled';
|
|
|
176 |
}
|
|
|
177 |
$str .= '><span class="display-4 font-weight-bolder">New</span> from<br><span class="display-5 font-weight-bolder">' . print_monetary($_SESSION["lowestPrice"]["New"], $_SESSION["buyer"]["Currency"]) . '</span>';
|
|
|
178 |
$str .= ' </button>';
|
|
|
179 |
$str .= ' <button name="submit" value="Used" type="' . getButtonType("Used") . '" class="btn mx-2 ' . getBackgroundColor("Used") . '"';
|
|
|
180 |
if ($_SESSION["lowestPrice"]["Used"] <= 0) {
|
|
|
181 |
$str .= ' disabled';
|
|
|
182 |
}
|
|
|
183 |
$str .= '><span class="display-4 font-weight-bolder">Used</span> from<br><span class="display-5 font-weight-bolder">' . print_monetary($_SESSION["lowestPrice"]["Used"], $_SESSION["buyer"]["Currency"]) . '</span>';
|
|
|
184 |
$str .= ' </button>';
|
|
|
185 |
/*
|
|
|
186 |
$str .= ' <button name="submit" value="Digital" type="' . getButtonType("Digital") . '" class="btn mx-2 ' . getBackgroundColor("Digital"). '"';
|
|
|
187 |
if ($_SESSION["lowestPrice"]["Digital"] <= 0) {
|
|
|
188 |
$str .= ' disabled';
|
| 1 |
- |
189 |
}
|
| 5 |
- |
190 |
$str .= '><span class="display-4 font-weight-bolder">Digital</span> from<br><span class="display-5 font-weight-bolder">' . print_monetary($_SESSION["lowestPrice"]["Digital"], $_SESSION["buyer"]["Currency"]) . '</span>';
|
|
|
191 |
$str .= ' </button>';
|
|
|
192 |
*/
|
|
|
193 |
$str .= '</div>';
|
|
|
194 |
$str .= '</form>';
|
| 1 |
- |
195 |
|
| 5 |
- |
196 |
return $str;
|
|
|
197 |
}
|
| 1 |
- |
198 |
|
| 5 |
- |
199 |
// get top button background color
|
|
|
200 |
function getBackgroundColor($sel)
|
|
|
201 |
{
|
|
|
202 |
if ($_SESSION["currentView"] == $sel) {
|
|
|
203 |
return ("btn-primary active");
|
|
|
204 |
}
|
|
|
205 |
|
|
|
206 |
return ("btn-primary text-dark");
|
|
|
207 |
}
|
|
|
208 |
|
|
|
209 |
// get top button type
|
|
|
210 |
function getButtonType($sel)
|
|
|
211 |
{
|
|
|
212 |
if ($_SESSION["currentView"] == $sel) {
|
|
|
213 |
return ("button");
|
|
|
214 |
}
|
|
|
215 |
|
|
|
216 |
return ("submit");
|
|
|
217 |
}
|
|
|
218 |
|
| 1 |
- |
219 |
// compare price for sort low to high
|
| 5 |
- |
220 |
function compare_price($a, $b)
|
|
|
221 |
{
|
|
|
222 |
return strnatcmp($a['ConvertedTotalPrice'], $b['ConvertedTotalPrice']);
|
|
|
223 |
}
|
| 1 |
- |
224 |
|
|
|
225 |
// print monetary values with correct symbol and thousands/decimal delimiters
|
| 5 |
- |
226 |
function print_monetary($num, $curr)
|
|
|
227 |
{
|
|
|
228 |
if ($curr == "USD") {
|
|
|
229 |
return ("$" . number_format($num, 2, '.', ','));
|
|
|
230 |
} else if ($curr == "CAD") {
|
|
|
231 |
return ("C $" . number_format($num, 2, '.', ','));
|
|
|
232 |
} else if ($curr == "EUR") {
|
|
|
233 |
return (number_format($num, 2, ',', '.') . "€");
|
|
|
234 |
} else if ($curr == "GBP") {
|
|
|
235 |
return ("£" . number_format($num, 2, '.', ','));
|
|
|
236 |
} else if ($curr == "AUD") {
|
|
|
237 |
return ("AU $" . number_format($num, 2, '.', ','));
|
|
|
238 |
}
|
| 1 |
- |
239 |
|
| 5 |
- |
240 |
return ($curr . " " . number_format($num, 2, '.', ','));
|
|
|
241 |
}
|
| 1 |
- |
242 |
|
|
|
243 |
// find lowest used / new prices and return their array index
|
| 5 |
- |
244 |
function findLowest($type)
|
|
|
245 |
{
|
|
|
246 |
foreach ($_SESSION["resultArr"] as $value) {
|
|
|
247 |
if (!$value["Show"]) {
|
|
|
248 |
continue;
|
|
|
249 |
}
|
| 1 |
- |
250 |
|
| 5 |
- |
251 |
if ($type == $value["Type"]) {
|
|
|
252 |
return ($value["ConvertedTotalPrice"]);
|
|
|
253 |
}
|
|
|
254 |
}
|
|
|
255 |
|
|
|
256 |
return (0);
|
|
|
257 |
}
|
|
|
258 |
|
|
|
259 |
// find lowest non-zero double value in array
|
|
|
260 |
function minNotNull(Array $values)
|
|
|
261 |
{
|
|
|
262 |
return min(array_diff(array_map('doubleval', $values), array(0)));
|
|
|
263 |
}
|
| 1 |
- |
264 |
// apply exchange rates
|
| 5 |
- |
265 |
function applyExchangeRates($arr)
|
|
|
266 |
{
|
|
|
267 |
foreach ($arr as &$value) {
|
|
|
268 |
$value["ConvertedPrice"] = $value["Price"];
|
|
|
269 |
$value["ConvertedShippingCost"] = $value["ShippingCost"];
|
| 1 |
- |
270 |
|
| 5 |
- |
271 |
if ($_SESSION["buyer"]["Currency"] != $value["Currency"]) {
|
|
|
272 |
$value["ConvertedPrice"] = number_format($value["Price"] / getExchangeRate($_SESSION["buyer"]["Currency"], $value["Currency"]), 2, '.', '');
|
|
|
273 |
}
|
| 1 |
- |
274 |
|
| 5 |
- |
275 |
if ($_SESSION["buyer"]["Currency"] != $value["ShippingCurrency"]) {
|
|
|
276 |
$value["ConvertedShippingCost"] = number_format($value["ShippingCost"] / getExchangeRate($_SESSION["buyer"]["Currency"], $value["ShippingCurrency"]), 2, '.', '');
|
|
|
277 |
}
|
| 1 |
- |
278 |
|
| 5 |
- |
279 |
$value["ConvertedTotalPrice"] = number_format($value["ConvertedPrice"] + $value["ConvertedShippingCost"], 2, '.', '');
|
|
|
280 |
}
|
|
|
281 |
|
|
|
282 |
return ($arr);
|
|
|
283 |
}
|
|
|
284 |
|
| 1 |
- |
285 |
// sanitize user input
|
| 5 |
- |
286 |
function sanitizeInput($data)
|
|
|
287 |
{
|
|
|
288 |
$data = trim($data);
|
|
|
289 |
$data = stripslashes($data);
|
|
|
290 |
$data = htmlspecialchars($data);
|
|
|
291 |
return $data;
|
|
|
292 |
}
|
| 1 |
- |
293 |
|
|
|
294 |
// get a SESSION value, return empty string if not set
|
| 5 |
- |
295 |
function getSV($var)
|
|
|
296 |
{
|
|
|
297 |
if (!isset($_SESSION[$var])) {
|
|
|
298 |
return ('');
|
|
|
299 |
}
|
| 1 |
- |
300 |
|
| 5 |
- |
301 |
return ($_SESSION[$var]);
|
|
|
302 |
}
|
|
|
303 |
|
| 1 |
- |
304 |
// initialize a SESSION value if not set
|
| 5 |
- |
305 |
function initSV($var, $value)
|
|
|
306 |
{
|
|
|
307 |
if (!isset($_SESSION[$var])) {
|
|
|
308 |
$_SESSION[$var] = $value;
|
|
|
309 |
}
|
|
|
310 |
}
|
| 1 |
- |
311 |
|
| 5 |
- |
312 |
// initialize sessions variables
|
|
|
313 |
function initSessionVariables()
|
|
|
314 |
{
|
|
|
315 |
initSV("resultArr", []);
|
|
|
316 |
initSV("barcode", array("Type" => "", "Value" => ""));
|
|
|
317 |
initSV("buyer", array("Country" => "United States", "Currency" => "USD", "Zip" => ""));
|
|
|
318 |
initSV("filterCondition", array("New" => true, "Used" => true));
|
|
|
319 |
initSV("filterMediaType", array("CD" => true, "Record" => false, "Digital" => false));
|
|
|
320 |
initSV("currentView", "All");
|
|
|
321 |
initSV("lowestPrice", array("Used" => 0.00, "New" => 0.00, "Digital" => 0.00, "All" => 0.00));
|
|
|
322 |
initSV("filterWarnings", "");
|
|
|
323 |
}
|
|
|
324 |
|
| 1 |
- |
325 |
// check POST value, return true if set and false if not
|
| 5 |
- |
326 |
function checkPV($var)
|
|
|
327 |
{
|
|
|
328 |
if (isset($_POST[$var])) {
|
|
|
329 |
return (true);
|
|
|
330 |
}
|
| 1 |
- |
331 |
|
| 5 |
- |
332 |
return (false);
|
|
|
333 |
}
|
|
|
334 |
|
| 1 |
- |
335 |
// print search filter modal with current selection
|
| 5 |
- |
336 |
function printSearchFilterModal()
|
|
|
337 |
{
|
|
|
338 |
$str = '';
|
|
|
339 |
$str .= '<div class="modal fade" id="filterModal">';
|
|
|
340 |
$str .= ' <div class="modal-dialog">';
|
|
|
341 |
$str .= ' <div class="modal-content">';
|
|
|
342 |
$str .= '';
|
|
|
343 |
$str .= ' <div class="modal-header bg-primary">';
|
|
|
344 |
$str .= ' <h4 class="modal-title">Search Filters</h4>';
|
|
|
345 |
$str .= ' </div>';
|
|
|
346 |
$str .= '';
|
|
|
347 |
$str .= ' <form method="post" action="/index.php">';
|
|
|
348 |
$str .= ' <div class="modal-body">';
|
|
|
349 |
$str .= ' <div class="card-group">';
|
|
|
350 |
$str .= '';
|
|
|
351 |
$str .= ' <div class="card m-2">';
|
|
|
352 |
$str .= ' <div class="card-header font-weight-bold">Condition</div>';
|
|
|
353 |
$str .= ' <div class="card-body">';
|
|
|
354 |
$str .= ' <div class="form-check">';
|
|
|
355 |
$str .= ' <label class="form-check-label">';
|
|
|
356 |
$str .= ' <input name="filterConditionNew" type="checkbox" class="form-check-input" value="New"' . ($_SESSION["filterCondition"]["New"] ? " checked" : "") . '>New';
|
|
|
357 |
$str .= ' </label>';
|
|
|
358 |
$str .= ' </div>';
|
|
|
359 |
$str .= ' <div class="form-check">';
|
|
|
360 |
$str .= ' <label class="form-check-label">';
|
|
|
361 |
$str .= ' <input name="filterConditionUsed" type="checkbox" class="form-check-input" value="Used"' . ($_SESSION["filterCondition"]["Used"] ? " checked" : "") . '>Used';
|
|
|
362 |
$str .= ' </label>';
|
|
|
363 |
$str .= ' </div>';
|
|
|
364 |
$str .= ' </div>';
|
|
|
365 |
$str .= ' </div>';
|
|
|
366 |
$str .= '';
|
|
|
367 |
$str .= ' <div class="card m-2">';
|
|
|
368 |
$str .= ' <div class="card-header font-weight-bold">Media Type</div>';
|
|
|
369 |
$str .= ' <div class="card-body">';
|
|
|
370 |
$str .= ' <div class="form-check">';
|
|
|
371 |
$str .= ' <label class="form-check-label">';
|
|
|
372 |
$str .= ' <input name="filterMediaTypeCD" type="checkbox" class="form-check-input" value="CD"' . ($_SESSION["filterMediaType"]["CD"] ? " checked" : "") . '><i class="fas fa-compact-disc" style="color:silver;"></i> Compact Disc';
|
|
|
373 |
$str .= ' </label>';
|
|
|
374 |
$str .= ' </div>';
|
|
|
375 |
$str .= ' <div class="form-check">';
|
|
|
376 |
$str .= ' <label class="form-check-label">';
|
|
|
377 |
$str .= ' <input name="filterMediaTypeRecord" type="checkbox" class="form-check-input" value="Record"' . ($_SESSION["filterMediaType"]["Record"] ? " checked" : "") . '><i class="fas fa-dot-circle"></i> Vinyl Record';
|
|
|
378 |
$str .= ' </label>';
|
|
|
379 |
$str .= ' </div>';
|
|
|
380 |
$str .= ' <div class="form-check">';
|
|
|
381 |
$str .= ' <label class="form-check-label">';
|
|
|
382 |
$str .= ' <input name="filterMediaTypeDigital" type="checkbox" class="form-check-input" value="Digital"' . ($_SESSION["filterMediaType"]["Digital"] ? " checked" : "") . '><i class="fas fa-download"></i> Digital';
|
|
|
383 |
$str .= ' </label>';
|
|
|
384 |
$str .= ' </div>';
|
|
|
385 |
$str .= ' </div>';
|
|
|
386 |
$str .= ' </div>';
|
|
|
387 |
$str .= ' </div>';
|
|
|
388 |
$str .= ' </div>';
|
|
|
389 |
$str .= '';
|
|
|
390 |
$str .= ' <div class="modal-footer bg-primary">';
|
|
|
391 |
$str .= ' <button id="save" type="submit" class="btn btn-success" name="submit" value="Save">Save</button>';
|
|
|
392 |
$str .= ' <button id="discard" type="button" class="btn btn-danger" data-dismiss="modal">Discard</button>';
|
|
|
393 |
$str .= ' </div>';
|
|
|
394 |
$str .= ' </form>';
|
|
|
395 |
$str .= ' </div>';
|
|
|
396 |
$str .= ' </div>';
|
|
|
397 |
$str .= '</div>';
|
| 1 |
- |
398 |
|
| 5 |
- |
399 |
return ($str);
|
| 1 |
- |
400 |
}
|
| 3 |
- |
401 |
|
|
|
402 |
// print search info modal
|
| 5 |
- |
403 |
function printSearchInfoModal()
|
|
|
404 |
{
|
|
|
405 |
$str = '';
|
|
|
406 |
$str .= '<div class="modal fade" id="searchInfoModal">';
|
|
|
407 |
$str .= ' <div class="modal-dialog">';
|
|
|
408 |
$str .= ' <div class="modal-content">';
|
|
|
409 |
$str .= '';
|
|
|
410 |
$str .= ' <div class="modal-header bg-primary">';
|
|
|
411 |
$str .= ' <h4 class="modal-title">Search Tips</h4>';
|
|
|
412 |
$str .= ' <button type="button" class="close" data-dismiss="modal"><i class="fas fa-window-close" style="font-size:24px"></i></button>';
|
|
|
413 |
$str .= ' </div>';
|
|
|
414 |
$str .= '';
|
|
|
415 |
$str .= ' <div class="modal-body">';
|
|
|
416 |
$str .= ' <h4>Search Keywords</h4>';
|
|
|
417 |
$str .= '';
|
|
|
418 |
$str .= ' <p><span class=font-weight-bold>Barcode:</span>';
|
|
|
419 |
$str .= ' <br>The 12 or 13 digit barcode, normally located on the back, offers the best chance to find a specific album.</p>';
|
|
|
420 |
$str .= '';
|
|
|
421 |
$str .= ' <p><span class=font-weight-bold>Artist and Title:</span>';
|
|
|
422 |
$str .= ' <br>The full name of the album, including artist and title, will usually lead to a specific album.</p>';
|
|
|
423 |
$str .= '';
|
|
|
424 |
$str .= ' <p><span class=font-weight-bold>Just Artist or Title:</span>';
|
|
|
425 |
$str .= ' <br>Searches for artist or title alone will bring up random albums.</p>';
|
|
|
426 |
$str .= ' </div>';
|
|
|
427 |
$str .= ' </div>';
|
|
|
428 |
$str .= ' </div>';
|
|
|
429 |
$str .= '</div>';
|
| 3 |
- |
430 |
|
| 5 |
- |
431 |
return ($str);
|
| 3 |
- |
432 |
}
|
| 5 |
- |
433 |
?>
|