Subversion Repositories cheapmusic

Rev

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