Subversion Repositories cheapmusic

Rev

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