Subversion Repositories cheapmusic

Rev

Rev 154 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
127 - 1
<?php
143 - 2
// title
3
function headTitle($page) {
4
    switch ($page) {
5
        case "terms":
6
            $titleText = "Find Cheap Music | Terms of Service";
153 - 7
            $canonicalLink = "https://" . $_SERVER['SERVER_NAME'] . "/terms.php";
143 - 8
            break;
9
 
10
        case "privacy":
11
            $titleText = "Find Cheap Music | Privacy Policy";
153 - 12
            $canonicalLink = "https://" . $_SERVER['SERVER_NAME'] . "/privacy.php";
143 - 13
            break;
14
 
15
        case "help":
16
            $titleText = "Find Cheap Music | Help Page";
153 - 17
            $canonicalLink = "https://" . $_SERVER['SERVER_NAME'] . "/help.php";
143 - 18
            break;
19
 
20
        case "wishlist":
21
            $titleText = "Find Cheap Music | Wishlist";
153 - 22
            $canonicalLink = "https://" . $_SERVER['SERVER_NAME'] . "/index.php?submit=wishlist";
143 - 23
            break;
24
 
25
        case "coupons":
26
            $titleText = "Find Cheap Music | Coupons";
153 - 27
            $canonicalLink = "https://" . $_SERVER['SERVER_NAME'] . "/index.php?submit=coupons";
143 - 28
            break;
29
 
30
        case "priceMonitor":
31
            $titleText = "Find Cheap Music | Price Monitor";
153 - 32
            $canonicalLink = "https://" . $_SERVER['SERVER_NAME'] . "/index.php?submit=priceMonitor";
143 - 33
            break;
34
 
35
        case "random":
36
            $titleText = "Find Cheap Music | Random Albums";
153 - 37
            $canonicalLink = "https://" . $_SERVER['SERVER_NAME'] . "/index.php?submit=random";
143 - 38
            break;
39
 
154 - 40
        case "barcode":
41
            $titleText = "Find Cheap Music | Barcode Checker";
42
            $canonicalLink = "https://" . $_SERVER['SERVER_NAME'] . "/index.php?submit=barcode";
43
            break;
44
 
143 - 45
        default:
46
            $titleText = "Find Cheap Music | CDs, Records, Digital, Books and Sheets";
153 - 47
            $canonicalLink = "https://" . $_SERVER['SERVER_NAME'] . "/index.php";
143 - 48
            break;
49
    }
50
 
154 - 51
    return ('<title>' . $titleText . '</title><link rel="canonical" href="' . $canonicalLink . '" />');
143 - 52
}
53
 
54
// meta description
55
function metaDescription($page) {
56
    switch ($page) {
57
        case "terms":
58
            $metaText = "By visiting our site and/or purchasing something from us, you engage in our Service and agree to be bound by these terms and conditions.";
59
            break;
60
 
61
        case "privacy":
62
            $metaText = "In our User Privacy Notice, we have compiled all essential information about our handling of your personal data and your corresponding rights for you.";
63
            break;
64
 
65
        case "help":
66
            $metaText = "The help page explains the basic functionality of the search page with its various sections of supporting information.";
67
            break;
68
 
69
        case "wishlist":
70
            $metaText = "Maintain a wishlist at FindCheapMusic to keep track of your favorite music albums or to receive price drop alerts right to your email. Free login required.";
71
            break;
72
 
73
        case "coupons":
74
            $metaText = "Weekly updated coupons and special offers from various music online stores. When they are gone, they are gone. Free login required.";
75
            break;
76
 
77
        case "priceMonitor":
78
            $metaText = "Explore your personal price monitor results. Results will be updated at user-defined intervals and published via email. Free login required.";
79
            break;
80
 
81
        case "random":
82
            $metaText = "See several completely random music album suggestions.";
83
            break;
84
 
85
        default:
86
            $metaText = "Search dozens of online stores at once for low-priced or hard to find Compact Discs, Vinyl Records, MP3s, Music Sheets and Music related books.";
87
            break;
88
    }
89
 
90
    return ('<meta name="description" content="' . $metaText . '">');
91
}
92
 
127 - 93
function htmlHeader() {
94
    $xh = new Html;
95
    $xh->init($_SESSION["htmlIndent"]);
107 - 96
 
127 - 97
    $xh->add_attribute("name", "viewport");
98
    $xh->add_attribute("content", "width=device-width, initial-scale=1");
99
    $xh->single_tag('meta');
100
    $xh->add_attribute("http-equiv", "Content-Type");
101
    $xh->add_attribute("content", "text/html; charset=utf-8");
102
    $xh->single_tag('meta');
119 - 103
 
127 - 104
    $xh->add_attribute("href", "https://maxcdn.bootstrapcdn.com");
105
    $xh->add_attribute("rel", "preconnect");
106
    $xh->add_attribute("crossorigin", "");
107
    $xh->single_tag('link');
108
    $xh->add_attribute("href", "https://fonts.googleapis.com");
109
    $xh->add_attribute("rel", "preconnect");
110
    $xh->add_attribute("crossorigin", "");
111
    $xh->single_tag('link');
112
    $xh->add_attribute("href", "https://ajax.googleapis.com");
113
    $xh->add_attribute("rel", "preconnect");
114
    $xh->add_attribute("crossorigin", "");
115
    $xh->single_tag('link');
116
    $xh->add_attribute("href", "https://cdnjs.cloudflare.com");
117
    $xh->add_attribute("rel", "preconnect");
118
    $xh->add_attribute("crossorigin", "");
119
    $xh->single_tag('link');
143 - 120
    $xh->add_attribute("href", "https://cdn.datatables.net");
121
    $xh->add_attribute("rel", "preconnect");
122
    $xh->add_attribute("crossorigin", "");
123
    $xh->single_tag('link');
107 - 124
 
127 - 125
    $xh->add_attribute("nonce", base64_encode($_SESSION["nonce"]));
126
    $xh->tag('script', "window.dataLayer = window.dataLayer || [];");
107 - 127
 
134 - 128
    if (!empty($_SESSION["gtmId"])) {
127 - 129
        $xh->add_attribute("href", "https://www.googletagmanager.com");
130
        $xh->add_attribute("rel", "preconnect");
131
        $xh->add_attribute("crossorigin", "");
132
        $xh->single_tag('link');
133
        $xh->add_attribute("href", "https://www.google-analytics.com");
134
        $xh->add_attribute("rel", "preconnect");
135
        $xh->add_attribute("crossorigin", "");
136
        $xh->single_tag('link');
137
        $xh->add_attribute("href", "https://connect.facebook.net");
138
        $xh->add_attribute("rel", "preconnect");
139
        $xh->add_attribute("crossorigin", "");
140
        $xh->single_tag('link');
141
        $xh->add_attribute("nonce", base64_encode($_SESSION["nonce"]));
142
        $xh->tag('script');
134 - 143
        $xh->write("(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src='https://www.googletagmanager.com/gtm.js?id='+i+dl;var n=d.querySelector('[nonce]');n&&j.setAttribute('nonce',n.nonce||n.getAttribute('nonce'));f.parentNode.insertBefore(j,f);})(window,document,'script','dataLayer','" . $_SESSION["gtmId"] . "');");
127 - 144
        $xh->close();
145
    }
104 - 146
 
127 - 147
    $xh->add_attribute("rel", "stylesheet");
148
    $xh->add_attribute("href", "https://fonts.googleapis.com/css?family=Material+Icons&display=swap");
149
    $xh->add_attribute("nonce",  base64_encode($_SESSION["nonce"]));
150
    $xh->single_tag('link');
151
    $xh->add_attribute("rel", "stylesheet");
158 - 152
    $xh->add_attribute("href", "https://maxcdn.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css");
153
    $xh->add_attribute("integrity", "sha384-9aIt2nRpC12Uk9gS9baDl411NQApFmC26EwAOH8WgZl5MYYxFfc+NcPb1dKGj7Sk");
127 - 154
    $xh->add_attribute("crossorigin", "anonymous");
155
    $xh->single_tag('link');
156
    $xh->add_attribute("rel", "stylesheet");
141 - 157
    $xh->add_attribute("href",  timeStampUrl("css/theme-" . (!empty($_SESSION["colorTheme"]) ? $_SESSION["colorTheme"] : "default") . ".min.css"));
158
    $xh->add_attribute("integrity", "sha384-" . base64_encode(hash_file("sha384", "css/theme-" . (!empty($_SESSION["colorTheme"]) ? $_SESSION["colorTheme"] : "default") . ".min.css", true)));
127 - 159
    $xh->add_attribute("crossorigin", "anonymous");
160
    $xh->single_tag('link');
161
    $xh->add_attribute("rel", "stylesheet");
162
    $xh->add_attribute("href",  timeStampUrl("css/style.min.css"));
163
    $xh->add_attribute("integrity", "sha384-" . base64_encode(hash_file("sha384", "css/style.min.css", true)));
164
    $xh->add_attribute("crossorigin", "anonymous");
165
    $xh->single_tag('link');
114 - 166
 
127 - 167
    $xh->add_attribute("async", "");
168
    $xh->add_attribute("defer", "");
158 - 169
    $xh->add_attribute("src", "https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js");
170
    $xh->add_attribute("integrity", "sha384-ZvpUoO/+PpLXR1lu4jmpXWu80pZlYUAfxl5NsBMWOEPSjUn/6Z/hRTt8+pR6L4N2");
127 - 171
    $xh->add_attribute("crossorigin", "anonymous");
172
    $xh->tag('script', '');
173
 
134 - 174
    if (in_array(getPGV('submitBtn'), array("terms", "privacy"))) {
127 - 175
        $xh->add_attribute("src",  timeStampUrl("js/email.min.js"));
176
        $xh->add_attribute("integrity", "sha384-" . base64_encode(hash_file("sha384", "js/email.min.js", true)));
177
        $xh->add_attribute("crossorigin", "anonymous");
178
        $xh->tag('script', '');
179
    }
180
 
181
    $xh->add_attribute("rel", "shortcut icon");
182
    $xh->add_attribute("href", "/favicon.ico");
183
    $xh->add_attribute("type", "image/x-icon");
184
    $xh->single_tag('link');
185
    $xh->add_attribute("rel", "icon");
186
    $xh->add_attribute("href", "/favicon.ico");
187
    $xh->add_attribute("type", "image/x-icon");
188
    $xh->single_tag('link');
189
    $xh->add_attribute("rel", "apple-touch-icon");
190
    $xh->add_attribute("sizes", "57x57");
191
    $xh->add_attribute("href", "/images/favicon/apple-icon-57x57.png");
192
    $xh->single_tag('link');
193
    $xh->add_attribute("rel", "apple-touch-icon");
194
    $xh->add_attribute("sizes", "60x60");
195
    $xh->add_attribute("href", "/images/favicon/apple-icon-60x60.png");
196
    $xh->single_tag('link');
197
    $xh->add_attribute("rel", "apple-touch-icon");
198
    $xh->add_attribute("sizes", "72x72");
199
    $xh->add_attribute("href", "/images/favicon/apple-icon-72x72.png");
200
    $xh->single_tag('link');
201
    $xh->add_attribute("rel", "apple-touch-icon");
202
    $xh->add_attribute("sizes", "76x76");
203
    $xh->add_attribute("href", "/images/favicon/apple-icon-76x76.png");
204
    $xh->single_tag('link');
205
    $xh->add_attribute("rel", "apple-touch-icon");
206
    $xh->add_attribute("sizes", "114x114");
207
    $xh->add_attribute("href", "/images/favicon/apple-icon-114x114.png");
208
    $xh->single_tag('link');
209
    $xh->add_attribute("rel", "apple-touch-icon");
210
    $xh->add_attribute("sizes", "120x120");
211
    $xh->add_attribute("href", "/images/favicon/apple-icon-120x120.png");
212
    $xh->single_tag('link');
213
    $xh->add_attribute("rel", "apple-touch-icon");
214
    $xh->add_attribute("sizes", "144x144");
215
    $xh->add_attribute("href", "/images/favicon/apple-icon-144x144.png");
216
    $xh->single_tag('link');
217
    $xh->add_attribute("rel", "apple-touch-icon");
218
    $xh->add_attribute("sizes", "152x152");
219
    $xh->add_attribute("href", "/images/favicon/apple-icon-152x152.png");
220
    $xh->single_tag('link');
221
    $xh->add_attribute("rel", "apple-touch-icon");
222
    $xh->add_attribute("sizes", "180x180");
223
    $xh->add_attribute("href", "/images/favicon/apple-icon-180x180.png");
224
    $xh->single_tag('link');
225
    $xh->add_attribute("rel", "icon");
226
    $xh->add_attribute("type", "image/png");
227
    $xh->add_attribute("sizes", "192x192");
228
    $xh->add_attribute("href", "/images/favicon/android-icon-192x192.png");
229
    $xh->single_tag('link');
230
    $xh->add_attribute("rel", "icon");
231
    $xh->add_attribute("type", "image/png");
232
    $xh->add_attribute("sizes", "32x32");
233
    $xh->add_attribute("href", "/images/favicon/favicon-32x32.png");
234
    $xh->single_tag('link');
235
    $xh->add_attribute("rel", "icon");
236
    $xh->add_attribute("type", "image/png");
237
    $xh->add_attribute("sizes", "96x96");
238
    $xh->add_attribute("href", "/images/favicon/favicon-96x96.png");
239
    $xh->single_tag('link');
240
    $xh->add_attribute("rel", "icon");
241
    $xh->add_attribute("type", "image/png");
242
    $xh->add_attribute("sizes", "16x16");
243
    $xh->add_attribute("href", "/images/favicon/favicon-16x16.png");
244
    $xh->single_tag('link');
245
    $xh->add_attribute("rel", "manifest");
246
    $xh->add_attribute("href", "/manifest.json");
247
    $xh->single_tag('link');
248
    $xh->add_attribute("name", "msapplication-TileColor");
249
    $xh->add_attribute("content", "#ffffff");
250
    $xh->single_tag('meta');
251
    $xh->add_attribute("name", "msapplication-TileImage");
252
    $xh->add_attribute("content", "/images/favicon/ms-icon-144x144.png");
253
    $xh->single_tag('meta');
254
    $xh->add_attribute("name", "theme-color");
255
    $xh->add_attribute("content", "#ffffff");
256
    $xh->single_tag('meta');
257
 
258
    $html = $xh->flush();
259
    //error_log(print_r($html, 1));
260
    return $html;
261
}
143 - 262
 
263
function mainSearchForm() {
264
    $xh = new Html;
265
    $xh->init($_SESSION["htmlIndent"]);
266
 
267
    $class = "container bg-secondary pt-3";
268
    if ($_SESSION["mode"] !== SIMPLE_SEARCH ||
269
        in_array(getPGV('submitBtn') , array("terms", "privacy", "coupons", "wishlist", "priceMonitor", "help", "barcode", "unsubscribe"))) {
270
        $class .= " d-none";
271
    }
272
    $xh->add_attribute("class", $class);
273
    $xh->add_attribute("id", "simpleSearchDiv");
274
    $xh->tag('div');
275
        $xh->add_attribute("class", "form-inline");
276
        $xh->add_attribute("id", "searchForm");
277
        $xh->add_attribute("method", "post");
278
        $xh->add_attribute("action", "/index.php");
279
        $xh->tag('form');
280
            $xh->insert_code(inputSessionId(true));
281
            $xh->insert_code(inputSessionTab());
282
            $xh->insert_code(inputNonce());
283
            $xh->add_attribute("class", "hidden-default-btn");
284
            $xh->tag('div');
285
                $xh->add_attribute("type", "submit");
286
                $xh->add_attribute("name", "submitBtn");
287
                $xh->add_attribute("value", "Search");
288
                $xh->tag('button', "Hidden Submit Button");
289
            $xh->close(); // div
290
            $xh->add_attribute("class", "form-group");
291
            $xh->tag('div');
292
                $xh->add_attribute("class", "btn-group");
293
                $xh->tag('div');
294
                    $xh->add_attribute("class", "btn btn-info input-group-text mx-1 rounded");
295
                    $xh->add_attribute("id", "searchTipsBtn");
296
                    $xh->add_attribute("type", "button");
297
                    $xh->add_attribute("data-toggle", "modal");
298
                    $xh->add_attribute("data-target", "#searchInfoModal");
299
                    $xh->add_attribute("data-toggle2", "tooltip");
300
                    $xh->add_attribute("title", "Search Tips");
301
                    $xh->add_attribute("aria-label", "Search Tips");
302
                    $xh->tag('button');
303
                        $xh->add_attribute("class", "material-icons");
304
                        $xh->tag('i', "info_outline");
305
                    $xh->close(); // button
306
 
307
                    $xh->add_attribute("class", "btn btn-info input-group-text mx-1 rounded py-0");
308
                    $xh->add_attribute("id", "barcodeBtn");
309
                    $xh->add_attribute("type", "submit");
310
                    $xh->add_attribute("name", "submitBtn");
311
                    $xh->add_attribute("value", "barcode");
312
                    $xh->add_attribute("data-toggle", "tooltip");
313
                    $xh->add_attribute("title", "Barcode Checker");
314
                    $xh->add_attribute("aria-label", "Barcode Checker");
315
                    $xh->tag('button');
316
                        $xh->add_attribute("class", "svg-24");
317
                        $xh->add_attribute("viewbox", "0 0 24 24");
318
                        $xh->tag('svg');
319
                            $xh->add_attribute("fill", "currentColor");
320
                            $xh->add_attribute("d", "M2,6H4V18H2V6M5,6H6V18H5V6M7,6H10V18H7V6M11,6H12V18H11V6M14,6H16V18H14V6M17,6H20V18H17V6M21,6H22V18H21V6Z");
321
                            $xh->single_tag('path');
322
                        $xh->close(); // button
323
                    $xh->close(); // button
324
                $xh->close(); // div
325
        	$xh->close(); // div
326
            $xh->add_attribute("class", "form-group mx-1");
327
            $xh->tag('div');
328
                $xh->add_attribute("class", "form-control flexdatalist searchTerm-width clearable");
329
                $xh->add_attribute("id", "searchTerm");
330
                $xh->add_attribute("list", "searchHistory");
331
                $xh->add_attribute("name", "searchTerm");
332
                $xh->add_attribute("type", "text");
333
                $xh->add_attribute("placeholder", "Search by Barcode, Artist, Title, ...");
334
                $xh->add_attribute("aria-label", "Search Term Input");
335
                $xh->add_attribute("value", getSV("searchTerm"));
336
        	    $xh->single_tag('input');
337
                $xh->add_attribute("id", "searchHistory");
338
                $xh->tag('datalist');
339
            	    $xh->insert_code(getSearchHistory());
340
                $xh->close(); // datalist
341
            $xh->close(); // div
342
            $xh->add_attribute("class", "form-group");
343
            $xh->tag('div');
344
                $xh->add_attribute("class", "btn btn-success mx-1 rounded");
345
                $xh->add_attribute("id", "searchBtn");
346
                $xh->add_attribute("type", "submit");
347
                $xh->add_attribute("name", "submitBtn");
348
                $xh->add_attribute("value", "Search");
349
                $xh->tag('button');
350
                    $xh->add_attribute("class", "material-icons material-text");
351
                    $xh->tag('i', "search");
352
                    $xh->add_attribute("class", "d-none d-md-inline");
353
                    $xh->tag('span', "Search");
354
                $xh->close(); // button
355
            $xh->close(); // div
356
        $xh->close(); // form
357
        $xh->add_attribute("class", "text-left small");
358
        $xh->tag('div');
359
            $xh->add_attribute("class", "btn btn-link text-reset");
360
            $xh->add_attribute("id", "advFormBtn");
361
            $xh->add_attribute("href", "");
362
            $xh->add_attribute("role", "button");
363
            $xh->tag('a');
364
                $xh->add_attribute("class", "material-icons md-12");
365
                $xh->tag('i', "settings");
366
                $xh->add_attribute("class", "small");
367
                $xh->tag('span', " Switch to advanced search");
368
            $xh->close(); // a
369
        $xh->close(); // div
370
        $xh->add_attribute("nonce", base64_encode($_SESSION["nonce"]));
371
        $xh->tag('script');
372
            $str  = my_trim('document.addEventListener("DOMContentLoaded", function() {');
373
            $str .= my_trim('    document.getElementById("advFormBtn").addEventListener("click", function () {');
374
            $str .= my_trim('        event.preventDefault();');
375
            $str .= my_trim('        document.getElementById("simpleSearchDiv").classList.add("d-none");');
376
            $str .= my_trim('        var div = document.getElementById("advSearchDiv");');
377
            $str .= my_trim('        div.classList.remove("d-none");');
378
            $str .= my_trim('        $("input.clearable").trigger("change");');
379
            $str .= my_trim('        window.dataLayer.push({ "event" : "trackEvent", "eventCategory" : "Search Form", "eventAction" : "Switch", "eventLabel" : "Advanced"});');
380
            $str .= my_trim('    });');
381
            $str .= my_trim('    document.getElementById("searchForm").addEventListener("submit", function (event) {');
382
            $str .= my_trim('        var t = document.getElementById("searchTerm-flexdatalist").value.toString().toProperCase().replace(/  +/g, " ");');
383
            $str .= my_trim('        if (t.length > 0) {');
384
            $str .= my_trim('            progressBar("Searching for:<br><br><strong>" + t + "</strong>");');
385
            $str .= my_trim('            document.getElementById("searchBtn").innerHTML = "<span class=\"spinner-border spinner-border-sm\"></span> Searching, please wait...";');
386
            $str .= my_trim('            if (window.google_tag_manager && window.ga && ga.create) {');
387
            $str .= my_trim('                event.preventDefault();');
388
            $str .= my_trim('                form = event.target.closest("form");');
389
            $str .= my_trim('                var input = document.createElement("input");');
390
            $str .= my_trim('                input.setAttribute("type", "hidden");');
391
            $str .= my_trim('                input.setAttribute("name", "submitBtn");');
392
            $str .= my_trim('                input.setAttribute("value", "Search");');
393
            $str .= my_trim('                form.appendChild(input);');
394
            $str .= my_trim('                window.dataLayer.push({ "event": "search", "search_term": t, "eventTimeout" : 2000, "eventCallback": function(){form.submit();} });');
395
            $str .= my_trim('            }');
396
            $str .= my_trim('        }');
397
            $str .= my_trim('    });');
398
            $str .= my_trim('');
399
            $str .= my_trim('    document.getElementById("searchTipsBtn").addEventListener("click", function (event) {');
400
            $str .= my_trim('        window.dataLayer.push({ "event" : "trackEvent", "eventCategory" : "Search Tips", "eventAction" : "Click", "eventLabel" : ""});');
401
            $str .= my_trim('    });');
402
            $str .= my_trim('    document.getElementById("barcodeBtn").addEventListener("click", function (event) {');
403
            $str .= my_trim('        document.getElementById("searchTerm").value = "";');
404
            $str .= my_trim('        document.getElementById("searchTerm-flexdatalist").value = "";');
405
            $str .= my_trim('    });');
406
            $str .= my_trim('});');
407
            $xh->insert_code($str);
408
        $xh->close(); // script
409
    $xh->close(); // div
410
 
411
    $html = $xh->flush();
412
    //error_log(print_r($html, 1));
413
 
414
    return $html;
415
}
416
 
417
function mainAdvSearchForm() {
418
    $xh = new Html;
419
    $xh->init($_SESSION["htmlIndent"]);
420
 
421
    $class = "container bg-secondary pt-3";
422
    if ($_SESSION["mode"] !== ADVANCED_SEARCH ||
423
        in_array(getPGV('submitBtn') , array("terms", "privacy", "coupons", "wishlist", "priceMonitor", "help", "barcode", "unsubscribe"))) {
424
        $class .= " d-none";
425
    }
426
    $xh->add_attribute("class", $class);
427
    $xh->add_attribute("id", "advSearchDiv");
428
    $xh->tag('div');
429
        $xh->add_attribute("class", "alert alert-danger d-none");
430
        $xh->add_attribute("id", "advSearchFormError");
431
        $xh->tag('p', "");
432
        $xh->add_attribute("id", "advSearchForm");
433
        $xh->add_attribute("method", "post");
434
        $xh->add_attribute("action", "/index.php");
435
        $xh->tag('form');
436
            $xh->insert_code(inputSessionId());
437
            $xh->insert_code(inputSessionTab());
438
            $xh->insert_code(inputNonce());
439
            $xh->add_attribute("id", "advSearchTerm");
440
            $xh->add_attribute("name", "searchTerm");
441
            $xh->add_attribute("type", "hidden");
442
    	    $xh->single_tag('input');
443
            $xh->add_attribute("class", "form-group form-row mb-md-3 mb-0");
444
            $xh->tag('div');
445
                $xh->add_attribute("for", "advArtist");
446
                $xh->add_attribute("class", "col-form-label col-md-1 col-sm-2");
447
                $xh->tag('label', "Artist:");
448
                $xh->add_attribute("type", "text");
449
                $xh->add_attribute("class", "form-control col-md-5 col-sm-10 clearable");
450
                $xh->add_attribute("id", "advArtist");
451
                $xh->add_attribute("name", "advArtist");
452
                $xh->add_attribute("value", !empty($_SESSION["advSearch"]["Artist"]) ? $_SESSION["advSearch"]["Artist"] : "");
453
                $xh->single_tag('input');
454
                $xh->add_attribute("for", "advTitle");
455
                $xh->add_attribute("class", "col-form-label col-md-1 col-sm-2");
456
                $xh->tag('label', "Title:");
457
                $xh->add_attribute("type", "text");
458
                $xh->add_attribute("class", "form-control col-md-5 col-sm-10 clearable");
459
                $xh->add_attribute("id", "advTitle");
460
                $xh->add_attribute("name", "advTitle");
461
                $xh->add_attribute("value", !empty($_SESSION["advSearch"]["Title"]) ? $_SESSION["advSearch"]["Title"] : "");
462
                $xh->single_tag('input');
463
    		$xh->close(); // div
464
            $xh->add_attribute("class", "form-group form-row mb-md-3 mb-0");
465
            $xh->tag('div');
466
                $xh->add_attribute("for", "advTrack");
467
                $xh->add_attribute("class", "col-form-label col-md-1 col-sm-2");
468
                $xh->tag('label', "Track:");
469
                $xh->add_attribute("type", "text");
470
                $xh->add_attribute("class", "form-control col-md-5 col-sm-10 clearable");
471
                $xh->add_attribute("id", "advTrack");
472
                $xh->add_attribute("name", "advTrack");
473
                $xh->add_attribute("value", !empty($_SESSION["advSearch"]["Track"]) ? $_SESSION["advSearch"]["Track"] : "");
474
                $xh->single_tag('input');
475
                $xh->add_attribute("for", "advBarcode");
476
                $xh->add_attribute("class", "col-form-label col-md-1 col-sm-2");
477
                $xh->tag('label', "Barcode:");
478
                $xh->add_attribute("type", "text");
479
                $xh->add_attribute("class", "form-control col-md-5 col-sm-10 clearable");
480
                $xh->add_attribute("id", "advBarcode");
481
                $xh->add_attribute("name", "advBarcode");
482
                $xh->add_attribute("value", !empty($_SESSION["advSearch"]["Barcode"]) ? $_SESSION["advSearch"]["Barcode"] : "");
483
                $xh->single_tag('input');
484
    		$xh->close(); // div
485
            $xh->add_attribute("class", "form-group form-row mb-md-3 mb-0");
486
            $xh->tag('div');
487
                $xh->add_attribute("for", "advCatno");
488
                $xh->add_attribute("class", "col-form-label col-md-1 col-sm-2");
489
                $xh->tag('label', "Cat #:");
490
                $xh->add_attribute("type", "text");
491
                $xh->add_attribute("class", "form-control col-md-2 col-sm-4 clearable");
492
                $xh->add_attribute("id", "advCatno");
493
                $xh->add_attribute("name", "advCatno");
494
                $xh->add_attribute("value", !empty($_SESSION["advSearch"]["Catno"]) ? $_SESSION["advSearch"]["Catno"] : "");
495
                $xh->single_tag('input');
496
                $xh->add_attribute("for", "advLabel");
497
                $xh->add_attribute("class", "col-form-label col-md-1 col-sm-2");
498
                $xh->tag('label', "Label:");
499
                $xh->add_attribute("type", "text");
500
                $xh->add_attribute("class", "form-control col-md-2 col-sm-4 clearable");
501
                $xh->add_attribute("id", "advLabel");
502
                $xh->add_attribute("name", "advLabel");
503
                $xh->add_attribute("value", !empty($_SESSION["advSearch"]["Label"]) ? $_SESSION["advSearch"]["Label"] : "");
504
                $xh->single_tag('input');
505
                $xh->add_attribute("for", "advCountry");
506
                $xh->add_attribute("class", "col-form-label col-md-1 col-sm-2");
507
                $xh->tag('label', "Country:");
508
                $xh->add_attribute("type", "text");
509
                $xh->add_attribute("class", "form-control col-md-2 col-sm-4 clearable");
510
                $xh->add_attribute("id", "advCountry");
511
                $xh->add_attribute("name", "advCountry");
512
                $xh->add_attribute("value", !empty($_SESSION["advSearch"]["Country"]) ? $_SESSION["advSearch"]["Country"] : "");
513
                $xh->single_tag('input');
514
                $xh->add_attribute("for", "advYear");
515
                $xh->add_attribute("class", "col-form-label col-md-1 col-sm-2");
516
                $xh->tag('label', "Year:");
517
                $xh->add_attribute("type", "text");
518
                $xh->add_attribute("class", "form-control col-md-2 col-sm-4 clearable");
519
                $xh->add_attribute("id", "advYear");
520
                $xh->add_attribute("name", "advYear");
521
                $xh->add_attribute("value", !empty($_SESSION["advSearch"]["Year"]) ? $_SESSION["advSearch"]["Year"] : "");
522
                $xh->single_tag('input');
523
    		$xh->close(); // div
524
            $xh->add_attribute("class", "form-group d-flex mt-2 mb-0");
525
            $xh->tag('div');
526
                $xh->add_attribute("class", "btn btn-sm btn-danger mr-auto");
527
                $xh->add_attribute("id", "advSearchResetBtn");
528
                $xh->add_attribute("type", "button");
529
                $xh->tag('button', "Reset");
530
                $xh->add_attribute("class", "btn btn-success ml-auto");
531
                $xh->add_attribute("id", "advSearchBtn");
532
                $xh->add_attribute("type", "submit");
533
                $xh->add_attribute("name", "submitBtn");
534
                $xh->add_attribute("value", "advSearch");
535
                $xh->tag('button');
536
                    $xh->add_attribute("class", "material-icons material-text");
537
                    $xh->tag('i', "search");
538
                    $xh->tag('span', " Search");
539
                $xh->close(); // button
540
            $xh->close(); // div
541
            $xh->add_attribute("class", "form-group d-flex my-0");
542
            $xh->tag('div');
543
                $xh->add_attribute("class", "btn btn-link text-reset ml-auto");
544
                $xh->add_attribute("id", "simpleFormBtn");
545
                $xh->add_attribute("role", "button");
546
                $xh->add_attribute("href", "");
547
                $xh->tag('a');
548
                    $xh->add_attribute("class", "material-icons md-12");
549
                    $xh->tag('i', "settings");
550
                    $xh->add_attribute("class", "small");
551
                    $xh->tag('span', "  Switch to simple search");
552
                $xh->close(); // a
553
            $xh->close(); // div
554
        $xh->close(); // form
555
        $xh->add_attribute("nonce", base64_encode($_SESSION["nonce"]));
556
        $xh->tag('script');
557
            $str  = my_trim('document.addEventListener("DOMContentLoaded", function() {');
558
            $str .= my_trim('    document.getElementById("simpleFormBtn").addEventListener("click", function (event) {');
559
            $str .= my_trim('        event.preventDefault();');
560
            $str .= my_trim('        document.getElementById("advSearchFormError").classList.remove("d-block");');
561
            $str .= my_trim('        var form = event.target.closest("form");');
562
            $str .= my_trim('        for (var i = 0; i < form.length; i++) { form[i].classList.remove("is-valid", "is-invalid"); }');
563
            $str .= my_trim('        document.getElementById("advSearchDiv").classList.add("d-none");');
564
            $str .= my_trim('        document.getElementById("simpleSearchDiv").classList.remove("d-none");');
565
            $str .= my_trim('        $("input.clearable").trigger("change");');
566
            $str .= my_trim('        window.dataLayer.push({ "event" : "trackEvent", "eventCategory" : "Search Form", "eventAction" : "Switch", "eventLabel" : "Simple"});');
567
            $str .= my_trim('    });');
568
            $str .= my_trim('    document.getElementById("advSearchResetBtn").addEventListener("click", function () {');
569
            $str .= my_trim('        document.getElementById("advSearchFormError").classList.remove("d-block");');
570
            $str .= my_trim('        var form = event.target.closest("form");');
571
            $str .= my_trim('        for (var i = 0; i < form.length; i++) { form[i].classList.remove("is-valid", "is-invalid"); }');
572
            $str .= my_trim('        document.getElementById("advTitle").value = "";');
573
            $str .= my_trim('        document.getElementById("advArtist").value = "";');
574
            $str .= my_trim('        document.getElementById("advTrack").value = "";');
575
            $str .= my_trim('        document.getElementById("advBarcode").value = "";');
576
            $str .= my_trim('        document.getElementById("advCatno").value = "";');
577
            $str .= my_trim('        document.getElementById("advLabel").value = "";');
578
            $str .= my_trim('        document.getElementById("advCountry").value = "";');
579
            $str .= my_trim('        document.getElementById("advYear").value = "";');
580
            $str .= my_trim('        $("input.clearable").trigger("change");');
581
            $str .= my_trim('    });');
582
            $str .= my_trim('    document.getElementById("advSearchForm").addEventListener("submit", function (event) {');
583
            $str .= my_trim('        var errFlag = false;');
584
            $str .= my_trim('        for (var i = 0; i < event.target.length; i++) { event.target[i].classList.remove("is-valid", "is-invalid"); }');
585
            $str .= my_trim('        var title = document.getElementById("advTitle").value.toString().toProperCase().trim();');
586
            $str .= my_trim('        var artist = document.getElementById("advArtist").value.toString().toProperCase().trim();');
587
            $str .= my_trim('        var trackTitle = document.getElementById("advTrack").value.toString().toProperCase().trim();');
588
            $str .= my_trim('        var barcode = document.getElementById("advBarcode").value.toString().replace(/\D/g,"").trim();');
589
            $str .= my_trim('        var catno = document.getElementById("advCatno").value.toString().toUpperCase().trim();');
590
            $str .= my_trim('        var label = document.getElementById("advLabel").value.toString().toProperCase().trim();');
591
            $str .= my_trim('        var country = document.getElementById("advCountry").value.toString().toUpperCase().trim();');
592
            $str .= my_trim('        var year = document.getElementById("advYear").value.toString().replace(/\D/g,"").trim();');
593
            $str .= my_trim('        if (barcode.length == 0 && document.getElementById("advBarcode").value.length > 0) { errFlag = true; document.getElementById("advBarcode").classList.add("is-invalid"); }');
594
            $str .= my_trim('        if (year.length == 0 && document.getElementById("advYear").value.length > 0) { errFlag = true; document.getElementById("advYear").classList.add("is-invalid"); }');
595
            $str .= my_trim('        if (year.length > 0 && (Number(year) < 1900 || Number(year) > new Date().getFullYear())) { errFlag = true; document.getElementById("advYear").classList.add("is-invalid"); }');
596
            $str .= my_trim('        if (title.length > 0) {document.getElementById("advTitle").classList.add("is-valid"); }');
597
            $str .= my_trim('        if (artist.length > 0) {document.getElementById("advArtist").classList.add("is-valid"); }');
598
            $str .= my_trim('        if (trackTitle.length > 0) {document.getElementById("advTrack").classList.add("is-valid"); }');
599
            $str .= my_trim('        if (barcode.length > 0) {document.getElementById("advBarcode").classList.add("is-valid"); }');
600
            $str .= my_trim('        if (catno.length > 0) {document.getElementById("advCatno").classList.add("is-valid"); }');
601
            $str .= my_trim('        if (label.length > 0) {document.getElementById("advLabel").classList.add("is-valid"); }');
602
            $str .= my_trim('        if (country.length > 0) {document.getElementById("advCountry").classList.add("is-valid"); }');
603
            $str .= my_trim('        if (year.length > 0) {document.getElementById("advYear").classList.add("is-valid"); }');
604
            $str .= my_trim('        var len = title.length + artist.length + trackTitle.length + barcode.length + catno.length + label.length + country.length + year.length;');
605
            $str .= my_trim('        var searchTerm = (title + " " + artist + " " + trackTitle + " " + barcode + " " + catno + " " + label + " " + country + " " + year).trim().replace(/  +/g, " ");');
606
            $str .= my_trim('        if (len > 0 && !errFlag) {');
607
            $str .= my_trim('            document.getElementById("advTitle").value = title;');
608
            $str .= my_trim('            document.getElementById("advArtist").value = artist;');
609
            $str .= my_trim('            document.getElementById("advTrack").value = trackTitle;');
610
            $str .= my_trim('            document.getElementById("advBarcode").value = barcode;');
611
            $str .= my_trim('            document.getElementById("advCatno").value = catno;');
612
            $str .= my_trim('            document.getElementById("advLabel").value = label;');
613
            $str .= my_trim('            document.getElementById("advCountry").value = country;');
614
            $str .= my_trim('            document.getElementById("advYear").value = year;');
615
            $str .= my_trim('            document.getElementById("advSearchFormError").classList.remove("d-block");');
616
            $str .= my_trim('            document.getElementById("advSearchTerm").value = searchTerm;');
617
            $str .= my_trim('            pbTxt = "Advanced Searching:<br><strong>";');
618
            $str .= my_trim('            if (artist.length > 0) pbTxt += "<br>Artist: " + artist;');
619
            $str .= my_trim('            if (title.length > 0) pbTxt += "<br>Title: " + title;');
620
            $str .= my_trim('            if (trackTitle.length > 0) pbTxt += "<br>Track: " + trackTitle;');
621
            $str .= my_trim('            if (barcode.length > 0) pbTxt += "<br>Barcode: " + barcode;');
622
            $str .= my_trim('            if (catno.length > 0) pbTxt += "<br>Catalog #: " + catno;');
623
            $str .= my_trim('            if (label.length > 0) pbTxt += "<br>Label: " + label;');
624
            $str .= my_trim('            if (country.length > 0) pbTxt += "<br>Country: " + country;');
625
            $str .= my_trim('            if (year.length > 0) pbTxt += "<br>Year: " + year;');
626
            $str .= my_trim('            pbTxt += "</strong>";');
627
            $str .= my_trim('            progressBar(pbTxt);');
628
            $str .= my_trim('            document.getElementById("advSearchBtn").innerHTML = "<span class=\"spinner-border spinner-border-sm\"></span> Searching, please wait...";');
629
            $str .= my_trim('            if (window.google_tag_manager && window.ga && ga.create) {');
630
            $str .= my_trim('                event.preventDefault();');
631
            $str .= my_trim('                form = event.target.closest("form");');
632
            $str .= my_trim('                var input = document.createElement("input");');
633
            $str .= my_trim('                input.setAttribute("type", "hidden");');
634
            $str .= my_trim('                input.setAttribute("name", "submitBtn");');
635
            $str .= my_trim('                input.setAttribute("value", "advSearch");');
636
            $str .= my_trim('                form.appendChild(input);');
637
            $str .= my_trim('                window.dataLayer.push({ "event": "search", "search_term": searchTerm, "eventTimeout" : 2000, "eventCallback": function(){form.submit();} });');
638
            $str .= my_trim('            }');
639
            $str .= my_trim('        } else {');
640
            $str .= my_trim('            x = document.getElementById("advSearchFormError");');
641
            $str .= my_trim('            x.innerHTML = (errFlag ? "Please correct the criteria." : "Please enter at least one criteria.");');
642
            $str .= my_trim('            x.classList.add("d-block");');
151 - 643
            $str .= my_trim('            x.scrollIntoView();');
143 - 644
            $str .= my_trim('            event.preventDefault();');
645
            $str .= my_trim('        }');
646
            $str .= my_trim('    });');
647
            $str .= my_trim('');
648
            $str .= my_trim('});');
649
            $xh->insert_code($str);
650
        $xh->close(); // script
651
    $xh->close(); // div
652
 
653
    $html = $xh->flush();
654
    //error_log(print_r($html, 1));
655
 
656
    return $html;
657
}
658
 
659
function downloadAtOnload() {
660
    $xh = new Html;
661
    $xh->init($_SESSION["htmlIndent"]);
662
 
663
    $xh->add_attribute("nonce", base64_encode($_SESSION["nonce"]));
664
    $xh->tag('script');
665
        $str  = my_trim('function downloadAtOnload() {');
666
        $str .= my_trim('var i, element;');
667
        $str .= my_trim('var linkArr = [');
668
        $str .= my_trim('                  { fn:"' . timeStampUrl("css/jquery.flexdatalist.min.css") . '", hash:"sha384-' . base64_encode(hash_file("sha384", "css/jquery.flexdatalist.min.css", true)) . '" },');
669
        $str .= my_trim('                  { fn:"https://cdn.datatables.net/v/bs4/dt-1.10.20/b-1.6.1/b-colvis-1.6.1/b-print-1.6.1/r-2.2.3/datatables.min.css", hash:"sha384-A6mMt/FRtf7afy5tvbeUM9oILonoc/SgFN+PJGQ5vzjemTa7QjI9fS0wigS7URyy" }');
670
        $str .= my_trim('                ];');
671
        $str .= my_trim('var scriptArr = [');
672
        $str .= my_trim('                  { fn:"https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js", hash:"sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" },');
673
        $str .= my_trim('                  { fn:"https://cdn.datatables.net/v/bs4/dt-1.10.20/b-1.6.1/b-colvis-1.6.1/b-print-1.6.1/r-2.2.3/datatables.min.js", hash:"sha384-iaJmlk/Rs9bPXyjHenhI8wFmIBMnXvjSieMasaZVSDkrv7sCZedSuJce8woADAHJ" },');
674
        $str .= my_trim('                  { fn:"' . timeStampUrl("js/jquery.flexdatalist.min.js") . '", hash:"sha384-' . base64_encode(hash_file("sha384", "js/jquery.flexdatalist.min.js", true)) . '" },');
675
        $str .= my_trim('                  { fn:"' . timeStampUrl("js/paginate.min.js") . '", hash:"sha384-' . base64_encode(hash_file("sha384", "js/paginate.min.js", true)) . '" },');
676
        $str .= my_trim('                  { fn:"' . timeStampUrl("js/lazysizes.min.js") . '", hash:"sha384-' . base64_encode(hash_file("sha384", "js/lazysizes.min.js", true)) . '" },');
151 - 677
        $str .= my_trim('                  { fn:"' . timeStampUrl("js/jquery.touchSwipe.min.js") . '", hash:"sha384-' . base64_encode(hash_file("sha384", "js/jquery.touchSwipe.min.js", true)) . '" },');
149 - 678
        $str .= my_trim('                  { fn:"' . timeStampUrl("js/dr.min.js") . '", hash:"sha384-' . base64_encode(hash_file("sha384", "js/dr.min.js", true)) . '" }');
143 - 679
        $str .= my_trim('                ];');
680
        $str .= my_trim('');
681
        if (isLoggedIn()) {
682
            $str .= my_trim('window.dataLayer.push({ "event" : "addinginCustomDimData", "IsLoggedIn" :  "Yes"});');
683
        }
684
        $str .= my_trim('    if (window.performance) {');
685
        $str .= my_trim('        var timeSincePageLoad = Math.round(performance.now());');
686
        $str .= my_trim('        window.dataLayer.push({"event": "timing", ');
687
        $str .= my_trim('            "timingVar": "page load",');
688
        $str .= my_trim('            "timingValue": timeSincePageLoad,');
689
        $str .= my_trim('            "timingCategory": "client",');
690
        $str .= my_trim('            "timingLabel": "load"');
691
        $str .= my_trim('          });');
692
        $str .= my_trim('    }');
693
        $str .= my_trim('');
694
        $str .= my_trim('for (i=0; i < linkArr.length; i++) {');
695
        $str .= my_trim('    element = document.createElement("link");');
696
        $str .= my_trim('    element.rel = "stylesheet";');
697
        $str .= my_trim('    element.type = "text/css";');
698
        $str .= my_trim('    element.href = linkArr[i].fn;');
699
        $str .= my_trim('    element.setAttribute("crossorigin", "anonymous");');
700
        $str .= my_trim('    element.setAttribute("integrity", linkArr[i].hash);');
701
        $str .= my_trim('    document.head.appendChild(element);');
702
        $str .= my_trim('}');
703
        $str .= my_trim('');
704
        $str .= my_trim('for (i=0; i < scriptArr.length; i++) {');
705
        $str .= my_trim('    element = document.createElement("script");');
706
        $str .= my_trim('    element.src = scriptArr[i].fn;');
707
        $str .= my_trim('    element.async = true;');
708
        $str .= my_trim('    element.setAttribute("crossorigin", "anonymous");');
709
        $str .= my_trim('    element.setAttribute("integrity", scriptArr[i].hash);');
710
        $str .= my_trim('    document.body.appendChild(element);');
711
        $str .= my_trim('}');
712
        $str .= my_trim('');
713
        $str .= my_trim('    function loadDepend() {');
714
        $str .= my_trim('        if (typeof Popper == "undefined") {');
715
        $str .= my_trim('            window.setTimeout(function() { loadDepend(); }, 100);');
716
        $str .= my_trim('        } else {');
717
        $str .= my_trim('            element = document.createElement("script");');
158 - 718
        $str .= my_trim('            element.src = "https://maxcdn.bootstrapcdn.com/bootstrap/4.5.0/js/bootstrap.min.js";');
143 - 719
        $str .= my_trim('            element.async = true;');
720
        $str .= my_trim('            element.setAttribute("crossorigin", "anonymous");');
158 - 721
        $str .= my_trim('            element.setAttribute("integrity", "sha384-OgVRvuATP1z7JjHLkuOU7Xw704+h835Lr+6QL9UvYjZE3Ipu6Tp75j7Bh/kR0JKI");');
143 - 722
        $str .= my_trim('            document.body.appendChild(element);');
723
        $str .= my_trim('        }');
724
        $str .= my_trim('    }');
725
        $str .= my_trim('');
726
        $str .= my_trim('    loadDepend();');
727
        $str .= my_trim('}');
728
        $str .= my_trim('');
729
        $str .= my_trim('window.addEventListener("load", function() { downloadAtOnload(); }, {passive: true});');
730
        $xh->insert_code($str);
731
    $xh->close(); // script
732
 
733
    $html = $xh->flush();
734
    //error_log(print_r($html, 1));
735
 
736
    return $html;
737
}
738
 
739
function headerQuoteSlides() {
740
    $xh = new Html;
741
    $xh->init($_SESSION["htmlIndent"]);
742
 
743
    $xh->add_attribute("nonce", base64_encode($_SESSION["nonce"]));
744
    $xh->tag('script');
745
 
746
    $str = 'var quotes = [';
747
    if ($file = fopen("snippets/headerQuotes.txt", "r")) {
748
        while (($line = fgets($file)) !== false) {
749
            $str .= '"' . trim($line) . '",';
750
        }
751
        fclose($file);
752
    }
753
    $str .= ']; setInterval(function() { $("#textslide").html(quotes[Math.floor(Math.random() * (quotes.length + 1))]); }, 5 * 1000);';
754
 
755
    $xh->insert_code($str);
756
    $xh->close(); // script
757
 
758
    $html = $xh->flush();
759
    //error_log(print_r($html, 1));
760
 
761
    return $html;
762
}
763
 
764
function barcodePage() {
765
    $xh = new Html;
766
    $xh->init($_SESSION["htmlIndent"]);
767
 
768
    $xh->add_attribute("class", "container py-4 bg-light border d-flex justify-content-center align-items-center");
769
    $xh->tag('div');
770
        $xh->add_attribute("class", "my-3");
771
        $xh->tag('div');
772
            $xh->tag('p');
773
                $xh->tag('span', "This tool verifies Music CD barcodes or calculates the check digit.");
774
                $xh->brnl();
775
                $xh->tag('span', "See our ");
776
                $blHref = "https://blog.findcheapmusic.com/2020/03/music-cd-barcodes-and-identifiers.html";
777
                $xh->add_attribute("id", "blBarcodeLink");
778
                $xh->add_attribute("href", $blHref);
779
                $xh->add_attribute("target", "blank");
780
                $xh->add_attribute("rel", "noopener noreferrer");
781
                $xh->tag('a', "blog post");
782
                $xh->tag('span', " for more information about music barcodes.");
783
            $xh->close(); // p
784
            $xh->add_attribute("nonce", base64_encode($_SESSION["nonce"]));
785
            $xh->tag('script');
786
                $str  = my_trim('document.addEventListener("DOMContentLoaded", function() {');
787
                $str .= my_trim('    document.getElementById("blBarcodeLink").addEventListener("click", function() {');
788
                $str .= my_trim('        window.dataLayer.push({ "event": "social", "socialNetwork": "Blogger", "socialAction": "Link", "socialTarget": "' . $blHref . '"});');
789
                $str .= my_trim('    });');
790
                $str .= my_trim('});');
791
                $xh->insert_code($str);
792
            $xh->close(); // script
793
            $xh->add_attribute("id", "barcodeForm");
794
            $xh->tag('form');
795
                $xh->insert_code(inputSessionTab());
127 - 796
                $xh->insert_code(inputSearchTerm());
797
                $xh->insert_code(inputNonce());
143 - 798
                $xh->add_attribute("class", "input-group mb-3");
799
                $xh->tag('div');
146 - 800
                    $xh->add_attribute("class", "clearable");
143 - 801
                    $xh->add_attribute("id", "barcode");
802
                    $xh->add_attribute("name", "barcode");
803
                    $xh->add_attribute("type", "text");
804
                    $xh->add_attribute("placeholder", "Enter Barcode...");
805
                    $xh->add_attribute("aria-label", "Barcode Input");
806
                    $xh->single_tag('input');
807
                    $xh->add_attribute("class", "input-group-append");
808
                    $xh->tag('div');
809
                        $xh->add_attribute("class", "btn btn-success barcodeButton");
810
                        $xh->add_attribute("id", "barcodeFormVerify");
811
                        $xh->add_attribute("type", "submit");
812
                        $xh->add_attribute("name", "submitBtn");
813
                        $xh->add_attribute("value", "check");
814
                        $xh->tag('button', "Verify");
815
                        $xh->add_attribute("class", "btn btn-info barcodeButton");
816
                        $xh->add_attribute("id", "barcodeFormCalc");
817
                        $xh->add_attribute("type", "submit");
818
                        $xh->add_attribute("name", "submitBtn");
819
                        $xh->add_attribute("value", "calc");
820
                        $xh->tag('button', "Calculate");
821
                    $xh->close(); // div
822
                $xh->close(); // div
823
            $xh->close(); // form
824
            $xh->add_attribute("nonce", base64_encode($_SESSION["nonce"]));
825
            $xh->tag('script');
826
                $str  = my_trim('document.addEventListener("DOMContentLoaded", function() {');
827
                $str .= my_trim('    document.getElementById("barcodeFormVerify").addEventListener("click", function() {');
828
                $str .= my_trim('        window.dataLayer.push({ "event": "trackEvent", "eventCategory": "Barcode", "eventAction": "Verify" });');
829
                $str .= my_trim('    });');
830
                $str .= my_trim('    document.getElementById("barcodeFormCalc").addEventListener("click", function() {');
831
                $str .= my_trim('        window.dataLayer.push({ "event": "trackEvent", "eventCategory": "Barcode", "eventAction": "Check Digit" });');
832
                $str .= my_trim('    });');
833
                $str .= my_trim('});');
834
                $xh->insert_code($str);
835
            $xh->close(); // script
836
            $xh->add_attribute("id", "barcodeResult");
837
            $xh->tag('div', "");
838
        $xh->close(); // div
839
    $xh->close(); // div
840
 
841
    $html = $xh->flush();
842
    //error_log(print_r($html, 1));
843
 
844
    return $html;
845
}
846
 
847
function htmlFooter() {
848
    $xh = new Html;
849
    $xh->init($_SESSION["htmlIndent"]);
850
 
851
    $xh->add_attribute("class", "container-fluid text-center bg-primary py-5");
852
    $xh->tag('footer');
853
        if (!empty($_SESSION["searchTerm"]) || getPGV('submitBtn') == "priceMonitor") {
854
            $xh->tag('p', "Disclaimer: As an Associate we earn from qualifying purchases");
855
        }
856
        $xh->add_attribute("class", "btn-group mb-3");
857
        $xh->tag('div');
858
            $fbHref = "https://www.facebook.com/FindCheapMusic";
859
            $xh->add_attribute("id", "fbLink");
860
            $xh->add_attribute("href", $fbHref);
861
            $xh->add_attribute("target", "_blank");
862
            $xh->add_attribute("rel", "noopener noreferrer");
863
            $xh->tag('a');
864
                $xh->add_attribute("class", "socialBtn pr-4 lazyload");
865
                $xh->add_attribute("src", PIXEL);
866
                $xh->add_attribute("data-src", "images/f_logo_RGB-Blue_58.png");
867
                $xh->add_attribute("alt", "Facebook Logo");
868
                $xh->single_tag('img');
869
            $xh->close(); // a
870
 
871
            $twHref = "https://twitter.com/findcheapmusic";
872
            $xh->add_attribute("id", "twLink");
873
            $xh->add_attribute("href", $twHref);
874
            $xh->add_attribute("target", "_blank");
875
            $xh->add_attribute("rel", "noopener noreferrer");
876
            $xh->tag('a');
877
                $xh->add_attribute("class", "socialBtn pr-4 lazyload");
878
                $xh->add_attribute("src", PIXEL);
879
                $xh->add_attribute("data-src", "images/Twitter_Social_Icon_Circle_Color.png");
880
                $xh->add_attribute("alt", "Twitter Logo");
881
                $xh->single_tag('img');
882
            $xh->close(); // a
883
 
151 - 884
            $ytHref = "https://www.youtube.com/channel/UC7qafAeO7dfroo7lzRkvUBg";
885
            $xh->add_attribute("id", "ytLink");
886
            $xh->add_attribute("href", $ytHref);
887
            $xh->add_attribute("target", "_blank");
888
            $xh->add_attribute("rel", "noopener noreferrer");
889
            $xh->tag('a');
890
                $xh->add_attribute("class", "socialBtn pr-4 lazyload");
891
                $xh->add_attribute("src", PIXEL);
892
                $xh->add_attribute("data-src", "images/youtube_social_circle_red.png");
893
                $xh->add_attribute("alt", "Youtube Logo");
894
                $xh->single_tag('img');
895
            $xh->close(); // a
896
 
143 - 897
            $blHref = "https://blog.findcheapmusic.com";
898
            $xh->add_attribute("id", "blLink");
899
            $xh->add_attribute("href", $blHref);
900
            $xh->add_attribute("target", "_blank");
901
            $xh->add_attribute("rel", "noopener noreferrer");
902
            $xh->tag('a');
903
                $xh->add_attribute("class", "socialBtn pr-4 lazyload");
904
                $xh->add_attribute("src", PIXEL);
151 - 905
                $xh->add_attribute("data-src", "images/blogger_logo.png");
143 - 906
                $xh->add_attribute("alt", "Blogger Logo");
907
                $xh->single_tag('img');
908
            $xh->close(); // a
909
 
910
        $xh->close(); // div
911
        $xh->tag('p', "Copyright &#169; " . @date("Y") . " FindCheapMusic.com. All rights reserved.");
912
 
913
        $xh->add_attribute("class", "d-lg-none");
914
        $xh->add_attribute("method", "post");
915
        $xh->add_attribute("action", "/index.php");
916
        $xh->tag('form');
917
            $xh->insert_code(inputSessionTab());
127 - 918
            $xh->insert_code(inputSearchTerm());
143 - 919
            $xh->add_attribute("class", "list-inline text-center");
920
            $xh->tag('ul');
921
                $xh->add_attribute("class", "list-inline-item");
922
                $xh->tag('li');
923
                    $xh->add_attribute("class", "btn btn-sm btn-light");
924
                    $xh->add_attribute("type", "submit");
925
                    $xh->add_attribute("name", "submitBtn");
926
                    $xh->add_attribute("value", "terms");
927
                    $xh->tag('button', "Terms of Service");
928
                $xh->close(); // li
929
                $xh->add_attribute("class", "list-inline-item");
930
                $xh->tag('li');
931
                    $xh->add_attribute("class", "btn btn-sm btn-light");
932
                    $xh->add_attribute("type", "submit");
933
                    $xh->add_attribute("name", "submitBtn");
934
                    $xh->add_attribute("value", "privacy");
935
                    $xh->tag('button', "Privacy Policy");
936
                $xh->close(); // li
937
            $xh->close(); // ul
938
        $xh->close(); // form
939
    $xh->close(); // footer
940
 
941
    $xh->add_attribute("nonce", base64_encode($_SESSION["nonce"]));
942
    $xh->tag('script');
943
        $str  = my_trim('document.addEventListener("DOMContentLoaded", function() {');
944
        $str .= my_trim('	document.getElementById("fbLink").addEventListener("click", function() {');
945
        $str .= my_trim('    dataLayer.push({ "event": "social", "socialNetwork": "Facebook", "socialAction": "Link", "socialTarget": "' . $fbHref . '"});');
946
        $str .= my_trim('  });');
947
        $str .= my_trim('	document.getElementById("twLink").addEventListener("click", function() {');
948
        $str .= my_trim('    dataLayer.push({ "event": "social", "socialNetwork": "Twitter", "socialAction": "Link", "socialTarget": "' . $twHref . '"});');
949
        $str .= my_trim('  });');
151 - 950
        $str .= my_trim('	document.getElementById("ytLink").addEventListener("click", function() {');
951
        $str .= my_trim('    dataLayer.push({ "event": "social", "socialNetwork": "Youtube", "socialAction": "Link", "socialTarget": "' . $ytHref . '"});');
952
        $str .= my_trim('  });');
143 - 953
        $str .= my_trim('	document.getElementById("blLink").addEventListener("click", function() {');
954
        $str .= my_trim('    dataLayer.push({ "event": "social", "socialNetwork": "Blogger", "socialAction": "Link", "socialTarget": "' . $blHref . '"});');
955
        $str .= my_trim('  });');
956
        $str .= my_trim('});');
957
        $xh->insert_code($str);
958
    $xh->close(); // script
959
 
960
    $html = $xh->flush();
961
    //error_log(print_r($html, 1));
962
 
963
    return $html;
964
}
965
 
966
function navigationPane() {
967
    $xh = new Html;
968
    $xh->init($_SESSION["htmlIndent"]);
969
 
970
    $xh->add_attribute("method", "post");
971
    $xh->add_attribute("action", "/index.php");
972
    $xh->tag('form');
973
        $xh->insert_code(inputSessionTab(true));
127 - 974
        $xh->insert_code(inputSearchTerm());
975
        $xh->insert_code(inputNonce());
143 - 976
        $xh->add_attribute("class", "navbar navbar-expand-sm bg-black navbar-dark fixed-top");
977
        $xh->tag('nav');
978
            $xh->add_attribute("class", "navbar-header");
979
            $xh->tag('div');
980
                $xh->add_attribute("class", "btn text-white");
981
                $xh->add_attribute("type", "submit");
982
                $xh->add_attribute("name", "submitBtn");
983
                $xh->add_attribute("value", "Home");
984
                $xh->add_attribute("aria-label", "Go to home page");
985
                $xh->tag('button', "Find Cheap Music");
986
            $xh->close(); // div
987
            $xh->add_attribute("class", "navbar-toggler");
988
            $xh->add_attribute("type", "button");
989
            $xh->add_attribute("data-toggle", "collapse");
990
            $xh->add_attribute("data-target", "#collapsibleNavbar");
991
            $xh->add_attribute("aria-label", "Open Menu");
992
            $xh->tag('button');
993
                $xh->add_attribute("class", "navbar-toggler-icon");
994
                $xh->tag('span', "");
995
            $xh->close(); // button
127 - 996
 
143 - 997
            $xh->add_attribute("class", "collapse navbar-collapse");
998
            $xh->add_attribute("id", "collapsibleNavbar");
999
            $xh->tag('div');
1000
                $xh->add_attribute("class", "navbar-nav mr-auto");
1001
                $xh->tag('ul');
1002
                    $xh->add_attribute("class", "nav-item");
1003
                    $xh->tag('li');
1004
                        $xh->add_attribute("class", "nav-item");
1005
                        $xh->add_attribute("class", "nav-link btn");
1006
                        $xh->add_attribute("type", "submit");
1007
                        $xh->add_attribute("name", "submitBtn");
1008
                        $xh->add_attribute("value", "Home");
1009
                        $xh->add_attribute("aria-label", "Go to home page");
1010
                        $xh->tag('button');
1011
                            $xh->add_attribute("class", "material-icons");
1012
                            $xh->tag('i', "home");
1013
                        $xh->close(); // button
1014
                    $xh->close(); // li
1015
                    if (isLoggedIn()) {
1016
                        $xh->add_attribute("class", "nav-item");
1017
                        $xh->tag('li');
1018
                            $xh->add_attribute("class", "nav-link btn");
1019
                            $xh->add_attribute("type", "submit");
1020
                            $xh->add_attribute("name", "submitBtn");
1021
                            $xh->add_attribute("value", "coupons");
1022
                            $xh->tag('button', "Coupons");
1023
                        $xh->close(); // li
1024
                        $xh->add_attribute("class", "nav-item");
1025
                        $xh->tag('li');
1026
                            $xh->add_attribute("class", "nav-link btn");
1027
                            $xh->add_attribute("type", "submit");
1028
                            $xh->add_attribute("name", "submitBtn");
1029
                            $xh->add_attribute("value", "wishlist");
1030
                            $xh->tag('button');
1031
                                $xh->tag('span', "Wishlist");
1032
                                if (!empty($_SESSION['priceMonitor']['newFlag']) && $_SESSION['priceMonitor']['newFlag'] === true) {
1033
                                    $xh->add_attribute("class", "badge badge-pill badge-light");
1034
                                    $xh->tag('span', "New");
1035
                                }
1036
                            $xh->close(); // button
1037
                        $xh->close(); // li
1038
                    }
1039
                    $xh->add_attribute("class", "nav-item  d-none d-lg-block");
1040
                    $xh->tag('li');
1041
                        $xh->add_attribute("class", "nav-link btn");
1042
                        $xh->add_attribute("type", "submit");
1043
                        $xh->add_attribute("name", "submitBtn");
1044
                        $xh->add_attribute("value", "terms");
1045
                        $xh->tag('button', "Terms of Service");
1046
                    $xh->close(); // li
1047
                    $xh->add_attribute("class", "nav-item  d-none d-lg-block");
1048
                    $xh->tag('li');
1049
                        $xh->add_attribute("class", "nav-link btn");
1050
                        $xh->add_attribute("type", "submit");
1051
                        $xh->add_attribute("name", "submitBtn");
1052
                        $xh->add_attribute("value", "privacy");
1053
                        $xh->tag('button', "Privacy Policy");
1054
                    $xh->close(); // li
1055
                    $xh->add_attribute("class", "nav-item");
1056
                    $xh->tag('li');
1057
                        $blHref = "https://blog.findcheapmusic.com";
1058
                        $xh->add_attribute("class", "nav-link");
1059
                        $xh->add_attribute("id", "blNavLink");
1060
                        $xh->add_attribute("role", "button");
1061
                        $xh->add_attribute("href", $blHref);
1062
                        $xh->add_attribute("target", "_blank");
1063
                        $xh->add_attribute("rel", "noreferrer noopener");
1064
                        $xh->tag('a', "Blog");
1065
                    $xh->close(); // li
1066
                    $xh->add_attribute("nonce", base64_encode($_SESSION["nonce"]));
1067
                    $xh->tag('script');
1068
                        $str  = my_trim('document.addEventListener("DOMContentLoaded", function() {');
1069
                        $str .= my_trim('    document.getElementById("blNavLink").addEventListener("click", function() {');
1070
                        $str .= my_trim('        dataLayer.push({ "event": "social", "socialNetwork": "Blogger", "socialAction": "Link", "socialTarget": "' . $blHref . '"});');
1071
                        $str .= my_trim('    });');
1072
                        $str .= my_trim('});');
1073
                        $xh->insert_code($str);
1074
                    $xh->close(); // script
1075
                    $xh->add_attribute("class", "nav-item");
1076
                    $xh->tag('li');
1077
                        $xh->add_attribute("class", "nav-link btn");
1078
                        $xh->add_attribute("type", "submit");
1079
                        $xh->add_attribute("name", "submitBtn");
1080
                        $xh->add_attribute("value", "help");
1081
                        $xh->add_attribute("aria-label", "Go to Help Page");
1082
                        $xh->tag('button');
1083
                            $xh->add_attribute("class", "material-icons");
1084
                            $xh->tag('i', "help_outline");
1085
                        $xh->close(); // button
1086
                    $xh->close(); // li
1087
                    $xh->close(); // ul
1088
                    $xh->add_attribute("class", "navbar-nav");
1089
                    $xh->tag('ul');
1090
                    if (!isLoggedIn()) {
1091
                        $xh->add_attribute("class", "nav-item");
1092
                        $xh->tag('li');
1093
                            $xh->add_attribute("class", "nav-link");
1094
                            $xh->add_attribute("href", "/login/index.php");
1095
                            $xh->tag('a');
1096
                                $xh->add_attribute("class", "svg-24");
1097
                                $xh->add_attribute("viewBox", "0 0 24 24");
1098
                                $xh->tag('svg');
1099
                                    $xh->add_attribute("fill", "currentColor");
1100
                                    $xh->add_attribute("d", "M10,17V14H3V10H10V7L15,12L10,17M10,2H19A2,2 0 0,1 21,4V20A2,2 0 0,1 19,22H10A2,2 0 0,1 8,20V18H10V20H19V4H10V6H8V4A2,2 0 0,1 10,2Z");
1101
                                    $xh->single_tag('path');
1102
                                $xh->close(); // svg
1103
                                $xh->tag('span', "Login");
1104
                            $xh->close(); // a
1105
                        $xh->close(); // li
1106
                    } else {
1107
                        $xh->add_attribute("class", "nav-item");
1108
                        $xh->tag('li');
1109
                            $xh->add_attribute("class", "img-fluid hide-extra-small hide-small user-img");
1110
                            $xh->add_attribute("src", timeStampUrl($_SESSION["userPicture"]));
1111
                            $xh->add_attribute("alt", "User Image");
1112
                            $xh->single_tag('img');
1113
                        $xh->close(); // li
1114
                        $xh->add_attribute("class", "nav-item dropdown");
1115
                        $xh->tag('li');
1116
                            $xh->add_attribute("class", "nav-link dropdown-toggle");
1117
                            $xh->add_attribute("href", "#");
1118
                            $xh->add_attribute("id", "navbardrop");
1119
                            $xh->add_attribute("data-toggle", "dropdown");
1120
                            $xh->tag('a');
1121
                                $xh->add_attribute("class", "material-icons material-text");
1122
                                $xh->tag('i', "account_box");
1123
                                $xh->tag('span', "Account");
1124
                            $xh->close(); // a
1125
                            $xh->add_attribute("class", "dropdown-menu dropdown-menu-right");
1126
                            $xh->tag('div');
1127
                                $xh->add_attribute("class", "dropdown-item btn");
1128
                                $xh->add_attribute("formaction", "/login/account.php");
1129
                                $xh->add_attribute("type", "submit");
1130
                                $xh->add_attribute("name", "submitBtn");
1131
                                $xh->add_attribute("value", "account");
1132
                                $xh->tag('button');
1133
                                    $xh->add_attribute("class", "svg-24");
1134
                                    $xh->add_attribute("viewBox", "0 0 24 24");
1135
                                    $xh->tag('svg');
1136
                                        $xh->add_attribute("fill", "currentColor");
1137
                                        $xh->add_attribute("d", "M12,4A4,4 0 0,1 16,8A4,4 0 0,1 12,12A4,4 0 0,1 8,8A4,4 0 0,1 12,4M12,14C16.42,14 20,15.79 20,18V20H4V18C4,15.79 7.58,14 12,14Z");
1138
                                        $xh->single_tag('path');
1139
                                    $xh->close(); // svg
1140
                                    $xh->tag('span', "Information");
1141
                                $xh->close(); // button
1142
 
1143
                                $xh->add_attribute("class", "dropdown-item btn");
1144
                                $xh->add_attribute("formaction", "/login/editAccount.php");
1145
                                $xh->add_attribute("type", "submit");
1146
                                $xh->add_attribute("name", "submitBtn");
1147
                                $xh->add_attribute("value", "editAccount");
1148
                                $xh->tag('button');
1149
                                    $xh->add_attribute("class", "svg-24");
1150
                                    $xh->add_attribute("viewBox", "0 0 24 24");
1151
                                    $xh->tag('svg');
1152
                                        $xh->add_attribute("fill", "currentColor");
1153
                                        $xh->add_attribute("d", "M21.7,13.35L20.7,14.35L18.65,12.3L19.65,11.3C19.86,11.09 20.21,11.09 20.42,11.3L21.7,12.58C21.91,12.79 21.91,13.14 21.7,13.35M12,18.94L18.06,12.88L20.11,14.93L14.06,21H12V18.94M12,14C7.58,14 4,15.79 4,18V20H10V18.11L14,14.11C13.34,14.03 12.67,14 12,14M12,4A4,4 0 0,0 8,8A4,4 0 0,0 12,12A4,4 0 0,0 16,8A4,4 0 0,0 12,4Z");
1154
                                        $xh->single_tag('path');
1155
                                    $xh->close(); // svg
1156
                                    $xh->tag('span', "Edit Account");
1157
                                $xh->close(); // button
1158
 
1159
                                if (empty($_SESSION['sessData']['loginType']) || $_SESSION['sessData']['loginType'] != 'social') {
1160
                                    $xh->add_attribute("class", "dropdown-item btn");
1161
                                    $xh->add_attribute("formaction", "/login/changePassword.php");
1162
                                    $xh->add_attribute("type", "submit");
1163
                                    $xh->add_attribute("name", "submitBtn");
1164
                                    $xh->add_attribute("value", "changePassword");
1165
                                    $xh->tag('button');
1166
                                        $xh->add_attribute("class", "svg-24");
1167
                                        $xh->add_attribute("viewBox", "0 0 24 24");
1168
                                        $xh->tag('svg');
1169
                                            $xh->add_attribute("fill", "currentColor");
1170
                                            $xh->add_attribute("d", "M12.63,2C18.16,2 22.64,6.5 22.64,12C22.64,17.5 18.16,22 12.63,22C9.12,22 6.05,20.18 4.26,17.43L5.84,16.18C7.25,18.47 9.76,20 12.64,20A8,8 0 0,0 20.64,12A8,8 0 0,0 12.64,4C8.56,4 5.2,7.06 4.71,11H7.47L3.73,14.73L0,11H2.69C3.19,5.95 7.45,2 12.63,2M15.59,10.24C16.09,10.25 16.5,10.65 16.5,11.16V15.77C16.5,16.27 16.09,16.69 15.58,16.69H10.05C9.54,16.69 9.13,16.27 9.13,15.77V11.16C9.13,10.65 9.54,10.25 10.04,10.24V9.23C10.04,7.7 11.29,6.46 12.81,6.46C14.34,6.46 15.59,7.7 15.59,9.23V10.24M12.81,7.86C12.06,7.86 11.44,8.47 11.44,9.23V10.24H14.19V9.23C14.19,8.47 13.57,7.86 12.81,7.86Z");
1171
                                            $xh->single_tag('path');
1172
                                        $xh->close(); // svg
1173
                                        $xh->tag('span', "Change Password");
1174
                                    $xh->close(); // button
1175
                                }
1176
 
1177
                                $xh->add_attribute("class", "dropdown-item btn");
1178
                                $xh->add_attribute("formaction", "/login/userAccount.php?logoutSubmit=1");
1179
                                $xh->add_attribute("type", "submit");
1180
                                $xh->add_attribute("name", "submitBtn");
1181
                                $xh->add_attribute("value", "logout");
1182
                                $xh->tag('button');
1183
                                    $xh->add_attribute("class", "svg-24");
1184
                                    $xh->add_attribute("viewBox", "0 0 24 24");
1185
                                    $xh->tag('svg');
1186
                                        $xh->add_attribute("fill", "currentColor");
1187
                                        $xh->add_attribute("d", "M16,17V14H9V10H16V7L21,12L16,17M14,2A2,2 0 0,1 16,4V6H14V4H5V20H14V18H16V20A2,2 0 0,1 14,22H5A2,2 0 0,1 3,20V4A2,2 0 0,1 5,2H14Z");
1188
                                        $xh->single_tag('path');
1189
                                    $xh->close(); // svg
1190
                                    $xh->tag('span', "Logout");
1191
                                $xh->close(); // button
1192
                            $xh->close(); // div
1193
                        $xh->close(); // li
1194
                    }
1195
                $xh->close(); // ul
1196
            $xh->close(); // div
1197
        $xh->close(); // nav
1198
    $xh->close(); // form
1199
 
1200
    $html = $xh->flush();
1201
    //error_log(print_r($html, 1));
1202
 
1203
    return $html;
1204
}
1205
 
1206
function productTableEventListeners() {
1207
    $xh = new Html;
1208
    $xh->init($_SESSION["htmlIndent"]);
1209
 
1210
    $xh->add_attribute("nonce", base64_encode($_SESSION["nonce"]));
1211
    $xh->tag('script');
1212
        $str  = my_trim('document.addEventListener("DOMContentLoaded", function() {');
1213
        $str .= my_trim('    document.getElementById("productTable").addEventListener("click", function(event) {');
1214
        $str .= my_trim('        e = event.target.closest("button") || event.target.closest("a");');
1215
        $str .= my_trim('        if (e && e.id == "resultViewToggle") {');
1216
        $str .= my_trim('            $("[data-toggle=\"tooltip\"]").tooltip("hide");');
1217
        $str .= my_trim('            window.dataLayer.push({ "event" : "trackEvent", "eventCategory" : "Result View", "eventAction" : "Toggle", "eventLabel" : "' . ($_SESSION["currentLayout"] == "CardView" ? "Table View" : "Card View") . '"});');
1218
        $str .= my_trim('        }');
1219
        $str .= my_trim('        if (e && e.id == "detailTab") {');
1220
        $str .= my_trim('            window.dataLayer.push({ "event" : "trackEvent", "eventCategory" : "Filter", "eventAction" : (document.getElementById("detailFilter").style.display == "block" ? "Open" : "Close" ), "eventLabel" : ""});');
1221
        $str .= my_trim('        }');
1222
        $str .= my_trim('        if (e && e.id == "detailTabSubmit") {');
1223
        $str .= my_trim('            window.dataLayer.push({ "event" : "trackEvent", "eventCategory" : "Filter", "eventAction" : "Apply", "eventLabel" : ""});');
1224
        $str .= my_trim('        }');
1225
        $str .= my_trim('        if (e && e.id == "detailTabReset") {');
1226
        $str .= my_trim('            window.dataLayer.push({ "event" : "trackEvent", "eventCategory" : "Filter", "eventAction" : "Reset", "eventLabel" : ""});');
1227
        $str .= my_trim('        }');
1228
        $str .= my_trim('        if (event.target.classList.contains("affiliate-link-table")) {');
1229
        $str .= my_trim('            var tr = event.target.closest("tr");');
1230
        $str .= my_trim('            window.dataLayer.push({ "event" :  "trackEvent",  "eventCategory" :  "Affiliate",  "eventAction" :  "Click",  "eventLabel" :  tr.getAttribute("data-merchant")});');
1231
        $str .= my_trim('            saveTransfer(tr.getAttribute("data-url"));');
1232
        $str .= my_trim('        }');
1233
        $str .= my_trim('        if (event.target.classList.contains("affiliate-link-card")) {');
1234
        $str .= my_trim('            var card = event.target.closest(".card");');
1235
        $str .= my_trim('            window.dataLayer.push({ "event" :  "trackEvent",  "eventCategory" :  "Affiliate",  "eventAction" :  "Click",  "eventLabel" :  card.getAttribute("data-merchant")});');
1236
        $str .= my_trim('            saveTransfer(card.getAttribute("data-url"));');
1237
        $str .= my_trim('        }');
1238
        $str .= my_trim('    });');
1239
        $str .= my_trim('});');
1240
    $xh->insert_code($str);
1241
    $xh->close(); // script
1242
 
1243
    $html = $xh->flush();
1244
    //error_log(print_r($html, 1));
1245
 
1246
    return $html;
1247
}
1248
 
1249
function printHelp() {
1250
 
1251
    $outer = "shadow p-4 mb-4 bg-light";
1252
    $head = "bg-info px-2 py-2";
1253
    $image = "img-fluid border border-dark lazyload";
1254
    $list = "btn btn-link align-baseline";
149 - 1255
    $icon = "material-icons material-text material-nlm material-nrm md-18";
143 - 1256
 
1257
    $xh = new Html;
1258
    $xh->init($_SESSION["htmlIndent"]);
1259
 
1260
 
1261
$xh->add_attribute("class", "container bg-3");
1262
$xh->tag('div');
1263
    $xh->add_attribute("class", "mt-3");
1264
    $xh->tag('p');
1265
        $xh->tag('span', "In a nutshell, ");
1266
        $xh->tag('b', "Find Cheap Music");
1267
        $xh->tag('span', " is for the serious collector or bargain hunter. It searches dozens of online stores for cheap Compact Discs, Vinyl Records, Digital Downloads, Music Sheets and Music related books without displaying any additional ads.");
1268
    $xh->close(); // p
1269
 
1270
    $xh->add_attribute("class", $outer);
1271
    $xh->tag('div');
1272
 
1273
        $xh->add_attribute("id", "contents");
1274
        $xh->add_attribute("class", "bg-primary px-2 py-2");
1275
        $xh->tag('h2',"Table of Contents");
1276
        $xh->tag('ol');
1277
            $xh->tag('li');
1278
                $xh->add_attribute("class", $list);
1279
                $xh->add_attribute("href", "#mainnav");
1280
                $xh->tag('a', "Main Navigation Menu");
1281
            $xh->close(); // li
1282
            $xh->tag('li');
1283
                $xh->add_attribute("class", $list);
1284
                $xh->add_attribute("href", "#homescreen");
1285
                $xh->tag('a', "Main / Home Screen");
1286
            $xh->close(); // li
1287
            $xh->tag('li');
1288
                $xh->add_attribute("class", $list);
1289
                $xh->add_attribute("href", "#search");
1290
                $xh->tag('a', "Search Results");
1291
            $xh->close(); // li
1292
            $xh->tag('li');
1293
                $xh->add_attribute("class", $list);
1294
                $xh->add_attribute("href", "#random");
1295
                $xh->tag('a', "Random Results");
1296
            $xh->close(); // li
1297
            $xh->tag('li');
1298
                $xh->add_attribute("class", $list);
1299
                $xh->add_attribute("href", "#coupons");
1300
                $xh->tag('a', "Coupons and Special Offers");
1301
            $xh->close(); // li
1302
            $xh->tag('li');
1303
                $xh->add_attribute("class", $list);
1304
                $xh->add_attribute("href", "#wishlist");
1305
                $xh->tag('a', "Wishlist");
1306
            $xh->close(); // li
1307
            $xh->tag('li');
1308
                $xh->add_attribute("class", $list);
1309
                $xh->add_attribute("href", "#login");
1310
                $xh->tag('a', "Login / Registration");
1311
            $xh->close(); // li
1312
        $xh->close(); // ol
1313
    $xh->close(); // div
1314
 
1315
    $xh->add_attribute("class", $outer);
1316
    $xh->tag('div');
1317
        $xh->add_attribute("class", $head);
1318
        $xh->add_attribute("id", "mainnav");
1319
        $xh->tag('h2', "1. Main Navigation Menu");
1320
        $xh->add_attribute("class", $outer);
1321
        $xh->tag('div');
1322
            $xh->add_attribute("class", $image);
1323
            $xh->add_attribute("src", PIXEL);
1324
            $xh->add_attribute("data-src", timeStampUrl("images/help/main_menu.png"));
1325
            $xh->add_attribute("alt", "Main Menu");
1326
            $xh->single_tag('img');
1327
            $xh->add_attribute("class", "mt-3");
1328
            $xh->tag('p');
1329
                $xh->tag('span', "The main menu contains the home button (");
1330
                $xh->add_attribute("class", $icon);
1331
                $xh->tag('i', "home");
1332
                $xh->tag('span', "), links to the terms of service, the privacy policy, our blog as well as a link to this help page (");
1333
                $xh->add_attribute("class", $icon);
1334
                $xh->tag('i', "help_outline");
1335
                $xh->tag('span', "). Located on the right-hand side is the login button. The main menu expands with links to the coupons / special offers and wishlist after logging in:");
1336
            $xh->close(); // p
1337
            $xh->add_attribute("class", $image);
1338
            $xh->add_attribute("src", PIXEL);
1339
            $xh->add_attribute("data-src", timeStampUrl("images/help/main_menu_full.png"));
1340
            $xh->add_attribute("alt", "Main Menu after login");
1341
            $xh->single_tag('img');
149 - 1342
            $xh->add_attribute("class", "mt-3");
143 - 1343
            $xh->tag('p', "After registration or a quick social login - using your Google, Facebook or Twitter account - you get access to a list of store coupons and special offers, are able to maintain an album wishlist, receive price alert emails, set your search preferences or change the color theme.");
1344
        $xh->close(); // div
1345
 
1346
        $xh->insert_code(backToTOC());
1347
   $xh->close(); // div
1348
 
1349
    $xh->add_attribute("class", $outer);
1350
    $xh->tag('div');
1351
        $xh->add_attribute("class", $head);
1352
        $xh->add_attribute("id", "homescreen");
1353
        $xh->tag('h2', "2. Main / Home Screen");
1354
 
1355
        $xh->tag('h3', "Simple Search");
1356
        $xh->add_attribute("class", $image);
1357
        $xh->add_attribute("src", PIXEL);
1358
        $xh->add_attribute("data-src", timeStampUrl("images/help/search_bar.png"));
1359
        $xh->add_attribute("alt", "Search Bar");
1360
        $xh->single_tag('img');
1361
        $xh->add_attribute("class", "mt-3");
149 - 1362
        $xh->tag('p', "The search bar consists of a popup button with search tips, a link to the barcode checker and the search term input box.");
143 - 1363
 
1364
        $xh->add_attribute("class", "bg-light text-dark");
1365
        $xh->tag('div');
1366
            $xh->add_attribute("class", $outer);
1367
            $xh->tag('div');
1368
                $xh->tag('h4');
1369
                    $xh->add_attribute("class", $icon);
1370
                    $xh->tag('i', "search");
1371
                    $xh->tag('span', "Search Terms");
1372
                $xh->close(); // h4
1373
                $xh->add_attribute("class", $image);
1374
                $xh->add_attribute("src", PIXEL);
1375
                $xh->add_attribute("data-src", timeStampUrl("images/help/search_term.png"));
1376
                $xh->add_attribute("alt", "Search Term");
1377
                $xh->single_tag('img');
1378
                $xh->add_attribute("class", "mt-3");
1379
                $xh->tag('p', 'The search algorithm is optimized to find the cheapest store offers for a specific album. Searches with generic keywords like “country music” or “rock”, or established artists like “Elvis Presley” or “Beatles”, will bring up too many results.');
1380
 
1381
                $xh->add_attribute("class", "font-weight-bold");
1382
                $xh->tag('P', "Simple Search or Advanced Search");
1383
                $xh->tag('p', "The simple search with the name of the artist and the title of the album will in most cases suffice to find the desired album. You should switch to the advanced search in case you do not have the name of the artist and the title of the album or you want to explore albums. Here you can search by any combination of artist, title, track (song), barcode, record label, record label catalog number, country and year. Once you found your album in the matching albums section, trigger a store offer search from it to see the cheapest store offers.");
1384
 
1385
                $xh->add_attribute("class", "font-weight-bold");
1386
                $xh->tag('p', "Barcode");
1387
                $xh->tag('p');
149 - 1388
                $xh->tag('span', "The 12- or 13-digit barcode, normally located on the back, offers the best chance to find a specific album. You should use our barcode checker (");
1389
                $xh->add_attribute("class", "svg-24 align-text-top mx-n1");
143 - 1390
                $xh->add_attribute("viewbox", "0 0 24 24");
1391
                $xh->tag('svg');
1392
                    $xh->add_attribute("fill", "currentColor");
1393
                    $xh->add_attribute("d", "M2,6H4V18H2V6M5,6H6V18H5V6M7,6H10V18H7V6M11,6H12V18H11V6M14,6H16V18H14V6M17,6H20V18H17V6M21,6H22V18H21V6Z");
1394
                    $xh->single_tag('path');
1395
                $xh->close(); // svg
1396
                $xh->tag('span', ") to verify the barcode and then search for store offers. See our ");
1397
                $xh->add_attribute("href", "https://blog.findcheapmusic.com/2020/03/music-cd-barcodes-and-identifiers.html");
1398
                $xh->add_attribute("target", "_blank");
1399
                $xh->add_attribute("rel", "noopener noreferrer");
1400
                $xh->tag('a', "blog post");
1401
                $xh->tag('span', " for more information about music barcodes.");
1402
                $xh->close(); // p
1403
            $xh->close(); // div
1404
            $xh->add_attribute("class", $outer);
1405
            $xh->tag('div');
1406
                $xh->tag('p', "During the search, a popup with a percentage bar shows the progress. The percentage bar does not always move equally since some online stores provide the search results faster than others.");
1407
                $xh->add_attribute("class", $image);
1408
                $xh->add_attribute("src", PIXEL);
1409
                $xh->add_attribute("data-src", timeStampUrl("images/help/progress_bar.png"));
1410
                $xh->add_attribute("alt", "Search Progress Bar");
1411
                $xh->single_tag('img');
1412
            $xh->close(); // div
1413
            $xh->add_attribute("class", $outer);
1414
            $xh->tag('div');
1415
                $xh->tag('p');
1416
                    $xh->tag('span', "The last 50 search terms are saved for convenience. The list is filtered as soon as you start typing; to see the full list, empty the search field by hitting the ");
1417
                    $xh->add_attribute("class", $icon);
1418
                    $xh->tag('i', "cancel_presentation");
1419
                    $xh->tag('span', " at the end or press the down-arrow key. When you select a saved search term it will remember and restore an advanced search. The search results are cached for about 1 hour to accelerate switching back and forth between your searches.");
1420
                $xh->close(); // p
1421
                $xh->add_attribute("class", $image);
1422
                $xh->add_attribute("src", PIXEL);
1423
                $xh->add_attribute("data-src", timeStampUrl("images/help/search_history.png"));
1424
                $xh->add_attribute("alt", "Search History Dropdown List");
1425
                $xh->single_tag('img');
1426
            $xh->close(); // div
1427
 
1428
            $xh->tag('h3', "Advanced Search");
1429
            $xh->add_attribute("class", $image);
1430
            $xh->add_attribute("src", PIXEL);
1431
            $xh->add_attribute("data-src", timeStampUrl("images/help/advanced_search_bar.png"));
1432
            $xh->add_attribute("alt", "Advanced Search Bar");
1433
            $xh->single_tag('img');
1434
            $xh->add_attribute("class", "mt-3");
1435
            $xh->tag('p', "The advanced search screen offers individual fields for the criteria which leads to better results.");
1436
 
1437
            $xh->add_attribute("class", "bg-light text-dark");
1438
            $xh->tag('div');
1439
                $xh->add_attribute("class", $outer);
1440
                $xh->tag('div');
1441
                    $xh->tag('h4');
1442
                        $xh->add_attribute("class", $icon);
1443
                        $xh->tag('i', "search");
1444
                        $xh->tag('span', "Advanced Search Terms");
1445
                    $xh->close(); // h4
1446
                    $xh->add_attribute("class", $image);
1447
                    $xh->add_attribute("src", PIXEL);
1448
                    $xh->add_attribute("data-src", timeStampUrl("images/help/advanced_search_term.png"));
1449
                    $xh->add_attribute("alt", "Search Term");
1450
                    $xh->single_tag('img');
1451
                    $xh->add_attribute("class", "mt-3");
149 - 1452
                    $xh->tag('p', 'Use as much or as little criteria as you like; one criterion is necessary for a search. Capitalization is not important, only correct spelling.');
143 - 1453
                    $xh->tag('p');
1454
                        $xh->add_attribute("class", "font-weight-bold");
1455
                        $xh->tag('span', "Artist: ");
1456
                        $xh->tag('span', "The name of the artist or band. Do not use 'Various'.");
1457
                    $xh->close(); // p
1458
                    $xh->tag('p');
1459
                        $xh->add_attribute("class", "font-weight-bold");
1460
                        $xh->tag('span', "Title: ");
1461
                        $xh->tag('span', "The title of the album.");
1462
                    $xh->close(); // p
1463
                    $xh->tag('p');
1464
                        $xh->add_attribute("class", "font-weight-bold");
1465
                        $xh->tag('span', "Track: ");
1466
                        $xh->tag('span', "The name of a track / song on the album.");
1467
                    $xh->close(); // p
1468
                    $xh->tag('p');
1469
                        $xh->add_attribute("class", "font-weight-bold");
1470
                        $xh->tag('span', "Barcode: ");
1471
                        $xh->tag('span', "The 12- or 13-digit barcode.");
1472
                    $xh->close(); // p
1473
                    $xh->tag('p');
1474
                        $xh->add_attribute("class", "font-weight-bold");
1475
                        $xh->tag('span', "Cat #: ");
1476
                        $xh->tag('span', "The record label catalog number. Usually on the spine or sometimes the back of the album.");
1477
                    $xh->close(); // p
1478
                    $xh->tag('p');
1479
                        $xh->add_attribute("class", "font-weight-bold");
1480
                        $xh->tag('span', "Label: ");
1481
                        $xh->tag('span', "The record label name.");
1482
                    $xh->close(); // p
1483
                    $xh->tag('p');
1484
                        $xh->add_attribute("class", "font-weight-bold");
1485
                        $xh->tag('span', "Country: ");
1486
                        $xh->tag('span', "The country of manufacture. Use 'US' for 'United States'.");
1487
                    $xh->close(); // p
1488
                    $xh->tag('p');
1489
                        $xh->add_attribute("class", "font-weight-bold");
1490
                        $xh->tag('span', "Year: ");
1491
                        $xh->tag('span', "The release year.");
1492
                    $xh->close(); // p
1493
                $xh->close(); // div
1494
            $xh->close(); // div
1495
 
1496
 
1497
            $xh->add_attribute("class", $outer);
1498
            $xh->tag('div');
1499
                $xh->tag('h3', "Barcode Checker");
1500
                $xh->tag('p');
1501
                    $xh->tag('span', "The barcode checker verifies Music CD barcodes or calculates a missing check digit. Online stores will not be able to find any results for invalid barcodes. The verified barcode can then be used for an online store search right away.");
1502
                    $xh->brnl();
1503
                    $xh->tag('span', "See our ");
1504
                    $blHref = "https://blog.findcheapmusic.com/2020/03/music-cd-barcodes-and-identifiers.html";
1505
                    $xh->add_attribute("id", "blLinkHelp");
1506
                    $xh->add_attribute("href", $blHref);
1507
                    $xh->add_attribute("target", "_blank");
1508
                    $xh->add_attribute("rel", "noopener noreferrer");
1509
                    $xh->tag('a', "blog post");
1510
                    $xh->tag('span', " for more information about music barcodes.");
1511
                $xh->close(); // p
1512
                $xh->add_attribute("nonce", base64_encode($_SESSION["nonce"]));
1513
                $xh->tag('script');
1514
                    $str  = my_trim('document.addEventListener("DOMContentLoaded", function() {');
1515
                    $str .= my_trim('    document.getElementById("blLinkHelp").addEventListener("click", function() {');
1516
                    $str .= my_trim('        dataLayer.push({ "event": "social", "socialNetwork": "Blogger", "socialAction": "Link", "socialTarget": "' . $blHref . '"});');
1517
                    $str .= my_trim('    });');
1518
                    $str .= my_trim('});');
1519
                    $xh->insert_code($str);
1520
                $xh->close(); // script
1521
                $xh->tag('p', "Verifying a barcode:");
1522
                $xh->add_attribute("class", $image . " mb-3 lazyload");
1523
                $xh->add_attribute("src", PIXEL);
1524
                $xh->add_attribute("data-src", timeStampUrl("images/help/barcode_verify.png"));
1525
                $xh->add_attribute("alt", "Barcode Verification");
1526
                $xh->single_tag('img');
1527
                $xh->add_attribute("class", "mt-3");
1528
                $xh->tag('p', "Calculating the check digit for a barcode:");
1529
                $xh->add_attribute("class", $image . " mb-3 lazyload");
1530
                $xh->add_attribute("src", PIXEL);
1531
                $xh->add_attribute("data-src", timeStampUrl("images/help/barcode_calc.png"));
1532
                $xh->add_attribute("alt", "Barcode Check Digit Calculation");
1533
                $xh->single_tag('img');
1534
           $xh->close(); // div
1535
        $xh->close(); // div
1536
        $xh->insert_code(backToTOC());
1537
   $xh->close(); // div
1538
 
1539
    $xh->add_attribute("class", $outer);
1540
    $xh->tag('div');
1541
        $xh->add_attribute("class", $head);
1542
        $xh->add_attribute("id", "search");
1543
        $xh->tag('h2', "3. Search Results");
1544
        $xh->tag('p', "The search delivers two different results. At the top is a card deck with up to 6 albums matching the search criteria. Below it is a table with online listings sorted by total price ascending.");
1545
        $xh->add_attribute("class", $outer);
1546
        $xh->tag('div');
1547
            $xh->tag('h3', "Matching Albums Card Deck (Results Part 1)");
151 - 1548
            $xh->tag('p', "Each card shows the name and artist of the album on top along with a thumbnail. Clicking on the thumbnail opens a modal with detailed information and track list. To keep the search efficient, the track list is only shown for the first 9 albums. The following buttons are located at the footer of the card:");
143 - 1549
            $xh->add_attribute("class", "list-unstyled");
1550
            $xh->tag('ul');
1551
                $xh->tag('li');
1552
                    $xh->add_attribute("class", $icon);
1553
                    $xh->tag('i', "library_add");
1554
                    $xh->tag('span', " - Add album to wishlist");
1555
                $xh->close(); // li
1556
                $xh->tag('li');
1557
                    $xh->add_attribute("class", $icon);
1558
                    $xh->tag('i', "library_add_check");
1559
                    $xh->tag('span', " - Album already on wishlist");
1560
                $xh->close(); // li
1561
                $xh->tag('li');
1562
                    $xh->add_attribute("class", $icon);
1563
                    $xh->tag('i', "videocam");
1564
                    $xh->tag('span', " - Open Modal with list of videos for this album");
1565
                $xh->close(); // li
1566
                $xh->tag('li');
1567
                    $xh->add_attribute("class", $icon);
1568
                    $xh->tag('i', "search");
1569
                    $xh->tag('span', "Offer - Search for cheap online store listings");
1570
                $xh->close(); // li
1571
            $xh->close(); // ul
1572
            $xh->add_attribute("class", $image . " mb-3 lazyload");
1573
            $xh->add_attribute("src", PIXEL);
1574
            $xh->add_attribute("data-src", timeStampUrl("images/help/matching_albums.png"));
1575
            $xh->add_attribute("alt", "Matching Albums");
1576
            $xh->single_tag('img');
151 - 1577
            $xh->add_attribute("class", "pt-3");
1578
            $xh->tag('p');
1579
                $xh->add_attribute("class", "font-italic");
1580
                $xh->tag('span');
1581
                    $xh->tag('b', "Tip:");
1582
                $xh->tag('span', " You can swipe the album pages on a touchscreen or with the mouse on a desktop.");
1583
                $xh->close(); // span
1584
            $xh->close(); // p
143 - 1585
        $xh->close(); // div
1586
        $xh->add_attribute("class", $outer);
1587
        $xh->tag('div');
1588
            $xh->tag('h3', "Detailed Album Information");
1589
            $xh->tag('p', "This pop up shows the detailed album information including the track listing.");
1590
            $xh->add_attribute("class", $image . " mb-3 lazyload");
1591
            $xh->add_attribute("src", PIXEL);
1592
            $xh->add_attribute("data-src", timeStampUrl("images/help/album_info.png"));
1593
            $xh->add_attribute("alt", "Album Information");
1594
            $xh->single_tag('img');
1595
        $xh->close(); // div
1596
        $xh->add_attribute("class", $outer);
1597
        $xh->tag('div');
1598
            $xh->tag('h3', "Album Videos");
1599
            $xh->tag('p', "This pop up shows the available videos.");
1600
            $xh->add_attribute("class", $image . " mb-3 lazyload");
1601
            $xh->add_attribute("src", PIXEL);
1602
            $xh->add_attribute("data-src", timeStampUrl("images/help/album_videos.png"));
1603
            $xh->add_attribute("alt", "Album Video Information");
1604
            $xh->single_tag('img');
1605
        $xh->close(); // div
1606
        $xh->add_attribute("class", $outer);
1607
        $xh->tag('div');
1608
            $xh->tag('h3', "Matching Listings (Results Part 2)");
1609
            $xh->tag('p');
1610
                $xh->tag('span', "This section displays the cheapest available listings from dozens of online stores. The results list can be toggled between a table view (");
1611
                $xh->add_attribute("class", $icon);
1612
                $xh->tag('i', "view_list");
1613
                $xh->tag('span', ") or a card view (");
1614
                $xh->add_attribute("class", $icon);
1615
                $xh->tag('i', "view_module");
1616
                $xh->tag('span', ").");
1617
            $xh->close(); // p
1618
 
1619
            $xh->add_attribute("class", "font-weight-bold");
1620
            $xh->tag('p', "Table View:");
1621
            $xh->add_attribute("class", $image . " mb-3 lazyload");
1622
            $xh->add_attribute("src", PIXEL);
1623
            $xh->add_attribute("data-src", timeStampUrl("images/help/search_results_table.png"));
1624
            $xh->add_attribute("alt", "Search Results Table View");
1625
            $xh->single_tag('img');
1626
            $xh->add_attribute("class", "font-weight-bold");
1627
            $xh->tag('p', "Table View (small):");
1628
            $xh->tag('p', "On smaller screens some of the information is hidden on a card that opens when pressing the + sign in front of the row.");
1629
            $xh->add_attribute("class", $image . " mb-3 lazyload");
1630
            $xh->add_attribute("src", PIXEL);
1631
            $xh->add_attribute("data-src", timeStampUrl("images/help/small_search_results_table.png"));
1632
            $xh->add_attribute("alt", "Small Search Results Table View");
1633
            $xh->single_tag('img');
1634
            $xh->add_attribute("class", "mt-3 font-weight-bold");
1635
            $xh->tag('p', "Card View:");
1636
            $xh->add_attribute("class", $image . " mb-3 lazyload");
1637
            $xh->add_attribute("src", PIXEL);
1638
            $xh->add_attribute("data-src", timeStampUrl("images/help/search_results_cards.png"));
1639
            $xh->add_attribute("alt", "Search Results Card View");
1640
            $xh->single_tag('img');
1641
            $xh->add_attribute("class", "pt-3");
1642
            $xh->tag('p');
1643
                $xh->add_attribute("class", "font-italic");
1644
                $xh->tag('span');
1645
                    $xh->tag('b', "Note:");
149 - 1646
                $xh->tag('span', " Every online merchant uses a slightly different search algorithm. Most return only results which contain all search words. There are some though who check for any of the search words and thereby deliver many unrelated results.");
143 - 1647
                $xh->close(); // span
1648
            $xh->close(); // p
1649
        $xh->close(); // div
1650
        $xh->add_attribute("class", $outer);
1651
        $xh->tag('div');
1652
            $xh->tag('h3', "Result Filtering");
149 - 1653
            $xh->tag('p', "The detailed filter allows selection by any combination of Condition, Media Type, Merchant or Shipping Origination. The number next to the individual criteria indicates the number of matching results in the list. After the filter is applied, the number of selected listings is shown in the title line.");
143 - 1654
            $xh->add_attribute("class", $image . " mb-3 lazyload");
1655
            $xh->add_attribute("src", PIXEL);
1656
            $xh->add_attribute("data-src", timeStampUrl("images/help/detailed_filter.png"));
1657
            $xh->add_attribute("alt", "Detailed Filter Options");
1658
            $xh->single_tag('img');
1659
        $xh->close(); // div
1660
        $xh->insert_code(backToTOC());
1661
    $xh->close(); // div
1662
 
1663
    $xh->add_attribute("class", $outer);
1664
    $xh->tag('div');
1665
        $xh->add_attribute("class", $head);
1666
        $xh->add_attribute("id", "random");
1667
        $xh->tag('h2', "4. Random Results");
1668
        $xh->add_attribute("class", $outer);
1669
        $xh->tag('div');
1670
            $xh->tag('p', "The random album suggestion button is only shown on the front page when you visit the site for the first time (or haven't visited the site in a while). It gives new users a quick start into the website's features.");
1671
            $xh->add_attribute("class", $image . " mb-3 lazyload");
1672
            $xh->add_attribute("src", PIXEL);
1673
            $xh->add_attribute("data-src", timeStampUrl("images/help/random_album_button.png"));
1674
            $xh->add_attribute("alt", "Random Album Button");
1675
            $xh->single_tag('img');
1676
        $xh->close(); // div
1677
        $xh->add_attribute("class", $outer);
1678
        $xh->tag('div');
1679
            $xh->tag('p', "The random album list looks exactly like the matching album list.");
1680
            $xh->add_attribute("class", $image . " mb-3 lazyload");
1681
            $xh->add_attribute("src", PIXEL);
1682
            $xh->add_attribute("data-src", timeStampUrl("images/help/random_albums.png"));
1683
            $xh->add_attribute("alt", "Random Album result cards");
1684
            $xh->single_tag('img');
1685
        $xh->close(); // div
1686
        $xh->insert_code(backToTOC());
1687
       $xh->close(); // div
1688
 
1689
    $xh->add_attribute("class", $outer);
1690
    $xh->tag('div');
1691
        $xh->add_attribute("class", $head);
1692
        $xh->add_attribute("id", "coupons");
1693
        $xh->tag('h2', "5. Coupons and Special Offers");
1694
        $xh->add_attribute("class", $outer);
1695
        $xh->tag('div');
1696
            $xh->add_attribute("class", "mt-3");
1697
            $xh->tag('p', "This page shows the currently active coupons and special offers. The entries are updated on a weekly basis.");
1698
            $xh->add_attribute("class", $image . " mb-3 lazyload");
1699
            $xh->add_attribute("src", PIXEL);
1700
            $xh->add_attribute("data-src", timeStampUrl("images/help/coupons.png"));
1701
            $xh->add_attribute("alt", "Coupons and Special Offers List");
1702
            $xh->single_tag('img');
1703
        $xh->close(); // div
1704
        $xh->insert_code(backToTOC());
1705
    $xh->close(); // div
1706
 
1707
    $xh->add_attribute("class", $outer);
1708
    $xh->tag('div');
1709
        $xh->add_attribute("class", $head);
1710
        $xh->add_attribute("id", "wishlist");
1711
        $xh->tag('h2', "6. Wishlist");
1712
        $xh->add_attribute("class", $outer);
1713
        $xh->tag('div');
1714
            $xh->tag('p');
149 - 1715
                $xh->tag('span', "This page allows managing the wishlist. Clicking on the heading (&#x2191;&#x2193;) for artist, title, barcode, format or ceiling price toggles the sort order between ascending and descending. The search filter (");
143 - 1716
                $xh->add_attribute("class", $icon);
1717
                $xh->tag('i', "search");
149 - 1718
                $xh->tag('span', ") on top of the table hides all rows which do not contain the search phrase.");
143 - 1719
            $xh->close(); // p
1720
            $xh->tag('p', "The following buttons are available for each entry:");
1721
            $xh->add_attribute("class", "list-unstyled");
1722
            $xh->tag('ul');
1723
                $xh->tag('li');
1724
                    $xh->add_attribute("class", $icon);
1725
                    $xh->tag('i', "edit");
1726
                    $xh->tag('span', " - Edit artist, title, barcode, condition, format and ceiling price");
1727
                $xh->close(); // li
1728
                $xh->tag('li');
1729
                    $xh->add_attribute("class", $icon);
1730
                    $xh->tag('i', "cancel_presentation");
1731
                    $xh->tag('span', "  - Delete wishlist entry (after confirmation)");
1732
                $xh->close(); // li
1733
                $xh->tag('li');
1734
                    $xh->add_attribute("class", $icon);
1735
                    $xh->tag('i', "info_outline");
1736
                    $xh->tag('span', "  - Get detailed album information");
1737
                $xh->close(); // li
1738
                $xh->tag('li');
1739
                    $xh->add_attribute("class", $icon);
1740
                    $xh->tag('i', "search");
1741
                    $xh->tag('span', "  - Search for cheap online store listings");
1742
                $xh->close(); // li
1743
            $xh->close(); // ul
1744
            $xh->add_attribute("class", $image . " mb-3 lazyload");
1745
            $xh->add_attribute("src", PIXEL);
1746
            $xh->add_attribute("data-src", timeStampUrl("images/help/wishlist.png"));
1747
            $xh->add_attribute("alt", "Wishlist Table");
1748
            $xh->single_tag('img');
1749
            $xh->tag('p', "On smaller screens some of the information is hidden on a card that opens when pressing the + sign in front of the row.");
1750
            $xh->add_attribute("class", $image . " mb-3 lazyload");
1751
            $xh->add_attribute("src", PIXEL);
1752
            $xh->add_attribute("data-src", timeStampUrl("images/help/small_wishlist.png"));
1753
            $xh->add_attribute("alt", "Wishlist Table");
1754
            $xh->single_tag('img');
1755
        $xh->close(); // div
1756
        $xh->add_attribute("class", $outer);
1757
        $xh->tag('div');
1758
            $xh->tag('h3', "Edit wishlist entry");
1759
            $xh->tag('p', "Any wishlist entry with a non-zero ceiling price is picked up by our nightly price monitor search. This search checks for new cheap listings below your maximum price and emails a notification. To cut down on unnecessary emails, we only send emails with actual results. The standard search frequency is initially set to weekly but can be changed at the user account to daily, weekly, bi-weekly or monthly.");
1760
            $xh->add_attribute("class", $image . " mb-3 lazyload");
1761
            $xh->add_attribute("src", PIXEL);
1762
            $xh->add_attribute("data-src", timeStampUrl("images/help/wishlist_edit.png"));
1763
            $xh->add_attribute("alt", "Edit Wishlist Entry");
1764
            $xh->single_tag('img');
1765
        $xh->close(); // div
1766
        $xh->add_attribute("class", $outer);
1767
        $xh->tag('div');
1768
            $xh->tag('p', "New price monitor results are indicated at the wishlist menu entry at top");
1769
            $xh->add_attribute("class", $image . " mb-3 lazyload");
1770
            $xh->add_attribute("src", PIXEL);
1771
            $xh->add_attribute("data-src", timeStampUrl("images/help/wishlist_menu_flag.png"));
1772
            $xh->add_attribute("alt", "Menu with new price monitor flag");
1773
            $xh->single_tag('img');
1774
            $xh->add_attribute("class", "mt-2");
1775
            $xh->tag('p', "and the header at the wishlist page.");
1776
            $xh->add_attribute("class", $image . " mb-3 lazyload");
1777
            $xh->add_attribute("src", PIXEL);
1778
            $xh->add_attribute("data-src", timeStampUrl("images/help/wishlist_flag.png"));
1779
            $xh->add_attribute("alt", "Wishlist with new price monitor flag");
1780
            $xh->single_tag('img');
1781
            $xh->add_attribute("class", "mt-2");
1782
            $xh->tag('p', "Once you checked your price monitor list, the new flag will disappear.");
1783
        $xh->close(); // div
1784
        $xh->add_attribute("class", $outer);
1785
        $xh->tag('div');
1786
            $xh->tag('p', 'The price monitor results page is static. The system regenerates it at the interval set at your account if the account setting "Email Price Checks" is set to Yes.');
1787
            $xh->tag('p', "The table of contents shows the albums from your wishlist, where the system found music listings below your ceiling price. The number of cheap offers is next to each entry. You can jump back and forth between the table of contents and the result list via the links.");
1788
            $xh->add_attribute("class", $image . " mb-3 lazyload");
1789
            $xh->add_attribute("src", PIXEL);
1790
            $xh->add_attribute("data-src", timeStampUrl("images/help/pricemonitor.png"));
1791
            $xh->add_attribute("alt", "Price monitor result list");
1792
            $xh->single_tag('img');
1793
        $xh->close(); // div
1794
        $xh->insert_code(backToTOC());
1795
    $xh->close(); // div
1796
 
1797
    $xh->add_attribute("class", $outer);
1798
    $xh->tag('div');
1799
        $xh->add_attribute("class", $head);
1800
        $xh->add_attribute("id", "login");
1801
        $xh->tag('h2', "7. Login / Registration");
1802
        $xh->add_attribute("class", $outer);
1803
        $xh->tag('div');
1804
            $xh->tag('p');
1805
                $xh->tag('span', "You can log in with your social account (Google, Facebook or Twitter) or register to create a new login for this site. Either way, you have to agree to the ");
1806
                $xh->add_attribute("href", "terms.php");
1807
                $xh->add_attribute("target", "_blank");
1808
                $xh->tag('a', "terms of service");
1809
                $xh->tag('span', "and the ");
1810
                $xh->add_attribute("href", "privacy.php");
1811
                $xh->add_attribute("target", "_blank");
1812
                $xh->tag('a', "privacy policy");
1813
                $xh->tag('span', ". The webpage is fully functional without a login but the registration gives you access to the coupons / special offers, wishlist, price alerts, search preferences, and layout setup.");
1814
            $xh->close(); // p
1815
            $xh->add_attribute("class", $image . " mb-3 lazyload");
1816
            $xh->add_attribute("src", PIXEL);
1817
            $xh->add_attribute("data-src", timeStampUrl("images/help/login_screen.png"));
1818
            $xh->add_attribute("alt", "Logon / Sign Up Screen");
1819
            $xh->single_tag('img');
1820
        $xh->close(); // div
1821
        $xh->add_attribute("class", $outer);
1822
        $xh->tag('div');
1823
            $xh->tag('p', "Once you are logged in, the site preferences can be changed. The user image is optional and shows up in the top navigation bar. First name and email address are the only mandatory fields. It is recommended though to enter the zip code to get the accurate shipping cost for items listed using a shipping rate table.");
1824
            $xh->tag('p', "The Layout section allows changing the color theme for the website and the initial result layout (table or card).");
1825
            $xh->tag('p', "The Search Filter Preferences section allows limiting the search results by condition or media type. The default behavior is to search for all conditions and media types. Every time you log back into the website, these settings will overwrite the default search filters.");
1826
            $xh->tag('p', "The Wishlist section governs the periodic price monitor emails for all items on your wishlist with a non-zero price cap. By default, weekly emails are turned on. The frequency can be set to daily, weekly, bi-weekly and monthly.");
1827
            $xh->add_attribute("class", $image . " mb-3 lazyload");
1828
            $xh->add_attribute("src", PIXEL);
1829
            $xh->add_attribute("data-src", timeStampUrl("images/help/account_info.png"));
1830
            $xh->add_attribute("alt", "Account information Screen");
1831
            $xh->single_tag('img');
1832
        $xh->close(); // div
1833
        $xh->insert_code(backToTOC());
1834
    $xh->close(); // div
127 - 1835
 
143 - 1836
1837
 
1838
    //error_log(print_r($html, 1));
1839
1840
 
1841
}
129 - 1842
143 - 1843
 
1844
    $xh = new Html;
1845
    $xh->init($_SESSION["htmlIndent"]);
1846
1847
 
1848
    $xh->tag('div');
1849
1850
 
1851
        $xh->add_attribute("href", "#contents");
1852
        $xh->add_attribute("title", "Back to Table of Contents");
1853
        $xh->add_attribute("data-toggle2", "tooltip");
1854
        $xh->add_attribute("aria-label", "Go to table of contents");
1855
        $xh->tag('a');
1856
            $xh->add_attribute("class", "material-icons");
1857
            $xh->tag('i', "arrow_upward");
1858
        $xh->close(); // a
1859
    $xh->close(); // div
1860
1861
 
1862
    //error_log(print_r($html, 1));
1863
1864
 
1865
}
1866
1867
 
1868
function printProgessbarModal() {
1869
    $xh = new Html;
1870
    $xh->init($_SESSION["htmlIndent"]);
1871
1872
 
1873
    $xh->add_attribute("id", "progressBarDiv");
1874
    $xh->tag('div');
1875
        $xh->add_attribute("class", "modal-dialog modal-dialog-centered");
1876
        $xh->tag('div');
1877
            $xh->add_attribute("class", "modal-content");
1878
            $xh->tag('div');
1879
                $xh->add_attribute("class", "modal-header");
1880
                $xh->tag('div');
1881
                    $xh->add_attribute("class", "display-6");
1882
                    $xh->add_attribute("id", "progressBarHeader");
1883
                    $xh->tag('p', "Searching");
1884
                $xh->close(); // div
1885
                $xh->add_attribute("class", "modal-body");
1886
                $xh->tag('div');
1887
                    $xh->add_attribute("class", "progress");
1888
                    $xh->tag('div');
1889
                        $xh->add_attribute("class", "progress-bar bg-success");
1890
                        $xh->add_attribute("id", "progressBar");
1891
                        $xh->tag('div', "0");
1892
                    $xh->close(); // div
1893
                $xh->close(); // div
1894
                $xh->add_attribute("class", "modal-footer");
1895
                $xh->tag('div');
1896
                    $xh->add_attribute("id", "progressBarMessage");
1897
                    $xh->tag('span', "");
1898
                $xh->close(); // div
1899
            $xh->close(); // div
1900
        $xh->close(); // div
1901
    $xh->close(); // div
1902
1903
 
1904
    //error_log(print_r($html, 1));
1905
1906
 
1907
}
1908
1909
 
1910
function printSocialIconBar() {
1911
    $xh = new Html;
1912
    $xh->init($_SESSION["htmlIndent"]);
1913
1914
 
1915
 
1916
    $xh->add_attribute("class", "social-icon-bar btn-group d-none");
151 - 1917
    $xh->tag('div');
143 - 1918
1919
 
1920
        $xh->add_attribute("class", "btn cfacebook");
1921
        $xh->add_attribute("id", "fbShare");
1922
        $xh->add_attribute("role", "button");
1923
        $xh->add_attribute("title", "Share on Facebook");
1924
        $xh->add_attribute("href", $fbHref);
1925
        $xh->add_attribute("target", "_blank");
1926
        $xh->add_attribute("rel", "noopener noreferrer");
1927
        $xh->tag('a');
1928
            $xh->add_attribute("class", "social-icon-svg");
1929
            $xh->add_attribute("viewBox", "0 0 24 24");
1930
            $xh->tag('svg');
1931
                $xh->add_attribute("fill", "#fff");
1932
                $xh->add_attribute("d", "M12 2.04C6.5 2.04 2 6.53 2 12.06C2 17.06 5.66 21.21 10.44 21.96V14.96H7.9V12.06H10.44V9.85C10.44 7.34 11.93 5.96 14.22 5.96C15.31 5.96 16.45 6.15 16.45 6.15V8.62H15.19C13.95 8.62 13.56 9.39 13.56 10.18V12.06H16.34L15.89 14.96H13.56V21.96A10 10 0 0 0 22 12.06C22 6.53 17.5 2.04 12 2.04Z");
1933
                $xh->single_tag('path');
1934
            $xh->close(); // svg
1935
        $xh->close(); // a
1936
1937
 
1938
        $xh->add_attribute("class", "btn ctwitter");
1939
        $xh->add_attribute("id", "twShare");
1940
        $xh->add_attribute("role", "button");
1941
        $xh->add_attribute("title", "Share on Twitter");
1942
        $xh->add_attribute("href", $twHref . "&text=" . rawurlencode("Find cheap and rare music. Check it out."));
1943
        $xh->add_attribute("target", "_blank");
1944
        $xh->add_attribute("rel", "noopener noreferrer");
1945
        $xh->tag('a');
1946
            $xh->add_attribute("class", "social-icon-svg");
1947
            $xh->add_attribute("viewBox", "0 0 24 24");
1948
            $xh->tag('svg');
1949
                $xh->add_attribute("fill", "#fff");
1950
                $xh->add_attribute("d", "M22.46,6C21.69,6.35 20.86,6.58 20,6.69C20.88,6.16 21.56,5.32 21.88,4.31C21.05,4.81 20.13,5.16 19.16,5.36C18.37,4.5 17.26,4 16,4C13.65,4 11.73,5.92 11.73,8.29C11.73,8.63 11.77,8.96 11.84,9.27C8.28,9.09 5.11,7.38 3,4.79C2.63,5.42 2.42,6.16 2.42,6.94C2.42,8.43 3.17,9.75 4.33,10.5C3.62,10.5 2.96,10.3 2.38,10C2.38,10 2.38,10 2.38,10.03C2.38,12.11 3.86,13.85 5.82,14.24C5.46,14.34 5.08,14.39 4.69,14.39C4.42,14.39 4.15,14.36 3.89,14.31C4.43,16 6,17.26 7.89,17.29C6.43,18.45 4.58,19.13 2.56,19.13C2.22,19.13 1.88,19.11 1.54,19.07C3.44,20.29 5.7,21 8.12,21C16,21 20.33,14.46 20.33,8.79C20.33,8.6 20.33,8.42 20.32,8.23C21.16,7.63 21.88,6.87 22.46,6Z");
1951
                $xh->single_tag('path');
1952
            $xh->close(); // svg
1953
        $xh->close(); // a
1954
1955
 
1956
        $xh->add_attribute("class", "btn jump-top");
1957
        $xh->add_attribute("role", "button");
1958
        $xh->add_attribute("href", "#");
1959
        $xh->add_attribute("title", "Go to top");
1960
        $xh->tag('a');
1961
            $xh->add_attribute("class", "material-icons align-middle md-24");
151 - 1962
            $xh->tag('i', "arrow_upward");
143 - 1963
        $xh->close(); // a
1964
    $xh->close(); // div
1965
1966
 
1967
    $xh->tag('script');
1968
        $str  = my_trim('document.addEventListener("DOMContentLoaded", function() {');
1969
        $str .= my_trim('	document.getElementById("topBtn").addEventListener("click", function() {');
1970
        $str .= my_trim('    topFunction();');
1971
        $str .= my_trim('  });');
1972
        $str .= my_trim('	document.getElementById("fbShare").addEventListener("click", function() {');
1973
        $str .= my_trim('    dataLayer.push({ "event": "social", "socialNetwork": "Facebook", "socialAction": "Share", "socialTarget": "' . $fbHref . '"});');
1974
        $str .= my_trim('  });');
1975
        $str .= my_trim('	document.getElementById("twShare").addEventListener("click", function() {');
1976
        $str .= my_trim('    dataLayer.push({ "event": "social", "socialNetwork": "Twitter", "socialAction": "Share", "socialTarget": "' . $twHref . '"});');
1977
        $str .= my_trim('  });');
1978
        $str .= my_trim('});');
1979
        $str .= my_trim('function scrollFunction() { mySocialBar.classList.add("d-none"), setTimeout(showSocialBar, 5e3) }');
151 - 1980
        $str .= my_trim('function showSocialBar() { mySocialBar.classList.remove("d-none"); }');
1981
        $str .= my_trim('mySocialBar = document.getElementById("social-icon-bar"), setTimeout(showSocialBar, 5e3), window.onscroll = function() { scrollFunction() };');
1982
        $xh->insert_code($str);
143 - 1983
    $xh->close(); // script
1984
1985
 
1986
    //error_log(print_r($html, 1));
1987
1988
 
1989
}
1990
1991
 
1992
    $xh = new Html;
1993
    $xh->init($_SESSION["htmlIndent"]);
1994
1995
 
1996
    $xh->tag('h2', "Store Offers");
1997
1998
 
1999
    //error_log(print_r($html, 1));
2000
2001
 
2002
}
2003
2004
 
2005
function printNoResultsWarning() {
2006
    $xh = new Html;
2007
    $xh->init($_SESSION["htmlIndent"]);
2008
    $xh->add_attribute("class", "text-center p-3 rounded bg-warning");
2009
    $xh->tag('div');
2010
    $xh->add_attribute("class", "display-5 font-weight-bold");
2011
    $xh->tag('p', "Your search returned no store offers");
2012
    $xh->tag('p', "You may want to try the following:");
2013
    $xh->tag('ul');
2014
    $xh->tag('li', "Check the spelling");
2015
    $xh->tag('li', "Try using fewer words");
2016
    $xh->tag('li', "Try using artist and title if you used a barcode");
2017
    $xh->close(); // ul
2018
    $xh->close(); // div
2019
2020
 
2021
    //error_log(print_r($html, 1));
2022
    return $html;
2023
}
2024
2025
 
2026
function printSearchInfoModal() {
2027
    $xh = new Html;
2028
    $xh->init($_SESSION["htmlIndent"]);
2029
2030
 
2031
    $xh->add_attribute("id", "searchInfoModal");
2032
    $xh->tag('div');
2033
    $xh->add_attribute("class", "modal-dialog");
2034
    $xh->tag('div');
2035
    $xh->add_attribute("class", "modal-content");
2036
    $xh->tag('div');
2037
    $xh->add_attribute("class", "modal-header");
2038
    $xh->tag('div');
2039
    $xh->add_attribute("class", "modal-title display-5");
2040
    $xh->tag('p', "Search Tips");
2041
    $xh->add_attribute("type", "button");
2042
    $xh->add_attribute("class", "close");
2043
    $xh->add_attribute("data-dismiss", "modal");
2044
    $xh->tag('button');
2045
    $xh->add_attribute("class", "material-icons btn-dismiss");
2046
    $xh->tag('i', "cancel_presentation");
2047
    $xh->close(); // button
2048
    $xh->close(); // div
2049
    $xh->add_attribute("class", "modal-body");
2050
    $xh->tag('div');
2051
    $xh->add_attribute("class", "shadow p-4");
2052
    $xh->tag('div');
2053
    $xh->add_attribute("class", "display-6");
2054
2055
 
2056
    $xh->add_attribute("class", "material-icons material-text md-36");
2057
    $xh->tag('i', "search");
2058
    $xh->tag('span', " Search Keywords");
2059
    $xh->close(); // p
2060
2061
 
2062
2063
 
2064
    $xh->tag('P', "Simple Search or Advanced Search");
2065
    $xh->tag('p', "The simple search with the name of the artist and the title of the album will in most cases suffice to find the desired album. You should switch to the advanced search in case you do not have the name of the artist and the title of the album or you want to explore albums. Here you can search by any combination of artist, title, track (song), barcode, record label, record label catalog number, country and year. Once you found your album in the matching albums section, trigger a store offer search from it to see the cheapest store offers.");
2066
2067
 
2068
    $xh->tag('p', "Barcode");
2069
    $xh->tag('p');
2070
    $xh->tag('span', "The 12 or 13 digit barcode, normally located on the back, offers the best chance to find a specific album. You should use our barcode checker (");
2071
    $xh->add_attribute("class", "svg-24 align-text-top mx-n1");
149 - 2072
    $xh->add_attribute("viewbox", "0 0 24 24");
143 - 2073
    $xh->tag('svg');
2074
        $xh->add_attribute("fill", "currentColor");
2075
        $xh->add_attribute("d", "M2,6H4V18H2V6M5,6H6V18H5V6M7,6H10V18H7V6M11,6H12V18H11V6M14,6H16V18H14V6M17,6H20V18H17V6M21,6H22V18H21V6Z");
2076
        $xh->single_tag('path');
2077
    $xh->close(); // svg
2078
    $xh->tag('span', ") to verify the barcode and then search for store offers. See our ");
2079
    $xh->add_attribute("href", "https://blog.findcheapmusic.com/2020/03/music-cd-barcodes-and-identifiers.html");
2080
    $xh->add_attribute("target", "_blank");
2081
    $xh->add_attribute("rel", "noopener noreferrer");
2082
    $xh->tag('a', "blog post");
2083
    $xh->tag('span', " for more information about music barcodes.");
2084
    $xh->close(); // p
2085
2086
 
2087
    $xh->close(); // div
2088
    $xh->add_attribute("class", "modal-footer");
2089
    $xh->tag('div');
2090
    $xh->add_attribute("type", "button");
2091
    $xh->add_attribute("class", "btn btn-danger");
2092
    $xh->add_attribute("data-dismiss", "modal");
2093
    $xh->tag('button', "Close");
2094
    $xh->close(); // div
2095
    $xh->close(); // div
2096
    $xh->close(); // div
2097
    $xh->close(); // div
2098
2099
 
2100
    //error_log(print_r($html, 1));
2101
2102
 
2103
}
2104
2105
 
2106
    $xh = new Html;
2107
    $xh->init($_SESSION["htmlIndent"]);
2108
2109
 
2110
    $xh->add_attribute("type", "hidden");
2111
    $xh->add_attribute("name", "sessionTab");
2112
    $xh->add_attribute("value", MySessionHandler::getSessionTab());
2113
    $xh->single_tag('input');
2114
2115
 
2116
    //error_log(print_r($html, 1));
2117
2118
 
2119
}
2120
2121
 
2122
    $xh = new Html;
2123
    $xh->init($_SESSION["htmlIndent"]);
2124
2125
 
2126
    $xh->add_attribute("name", "nonce");
2127
    $xh->add_attribute("value", $_SESSION['nonce']);
2128
    $xh->single_tag('input');
2129
2130
 
2131
    //error_log(print_r($html, 1));
2132
2133
 
2134
}
2135
2136
 
2137
    $xh = new Html;
2138
    $xh->init($_SESSION["htmlIndent"]);
2139
2140
 
2141
    $xh->add_attribute("name", "searchTerm");
2142
    $xh->add_attribute("value", getSV("searchTerm"));
2143
    $xh->single_tag('input');
2144
2145
 
2146
    //error_log(print_r($html, 1));
2147
2148
 
2149
}
2150
2151
 
2152
    $xh = new Html;
2153
    $xh->init($_SESSION["htmlIndent"]);
2154
2155
 
2156
    $xh->add_attribute("type", "hidden");
2157
    $xh->add_attribute("name", "sessionId");
2158
    $xh->add_attribute("value", session_id());
2159
    $xh->single_tag('input');
2160
2161
 
2162
    //error_log(print_r($html, 1));
2163
2164
 
2165
}
2166
2167
 
2168
    $xh = new Html;
2169
    $xh->init($_SESSION["htmlIndent"]);
2170
2171
 
2172
    $xh->tag('div');
2173
        $xh->add_attribute("method", "post");
2174
        $xh->add_attribute("action", "/index.php");
2175
        $xh->tag('form');
2176
            $xh->insert_code(inputSessionTab());
2177
            $xh->insert_code(inputSearchTerm());
2178
            $xh->insert_code(inputNonce());
2179
            $xh->add_attribute("class", "btn btn-success mt-5 rounded");
2180
            $xh->add_attribute("id", "randomBtn");
2181
            $xh->add_attribute("type", "submit");
2182
            $xh->add_attribute("name", "submitBtn");
2183
            $xh->add_attribute("value", "random");
2184
            $xh->tag('button', "Random Album Suggestions");
2185
        $xh->close(); // form
2186
    $xh->close(); // div
2187
    $xh->add_attribute("nonce", base64_encode($_SESSION["nonce"]));
2188
    $xh->tag('script');
2189
        $str  = my_trim('document.addEventListener("DOMContentLoaded", function() {');
2190
        $str .= my_trim('    document.getElementById("randomBtn").addEventListener("click", function(event) {');
2191
        $str .= my_trim('        window.dataLayer.push({ "event" : "trackEvent", "eventCategory" : "Random Album", "eventAction" : "Click", "eventLabel" : ""});');
2192
        $str .= my_trim('    });');
2193
        $str .= my_trim('});');
2194
    $xh->insert_code($str);
2195
    $xh->close(); // script
2196
2197
 
2198
    $xh->tag('div');
2199
        $xh->add_attribute("class", "text-center py-2");
2200
        $xh->tag('h2', "Getting Started");
2201
        $xh->tag('p');
2202
            $xh->tag('span', "Welcome to Find Cheap Music. Here you can search dozens of trusted online stores at once. The below information details the major website features and is also available via the link to the help page (");
2203
            $xh->add_attribute("class", "material-icons material-text md-18");
2204
            $xh->tag('i', "help_outline");
2205
            $xh->tag('span', ") up top.");
2206
        $xh->close(); // p
2207
        $xh->single_tag('hr');
2208
        $xh->insert_code(printHelp());
2209
    $xh->close(); // div
2210
2211
 
2212
    //error_log(print_r($html, 1));
2213
2214
 
2215
}
2216
2217
 
2218
    $xh = new Html;
2219
    $xh->init($_SESSION["htmlIndent"]);
2220
2221
 
2222
    $xh->tag('script');
2223
        $str  = trim('window.addEventListener("load", function() {');
2224
        $str .= trim('    window.location.assign("#' . $section . '")');
2225
        $str .= trim('});');
2226
        $xh->insert_code($str);
2227
    $xh->close(); // script
2228
2229
 
2230
    //error_log(print_r($html, 1));
2231
2232
 
2233
}
2234