Subversion Repositories cheapmusic

Rev

Rev 113 | Rev 116 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 - 1
<?php
107 - 2
 
65 - 3
include_once ($_SERVER['DOCUMENT_ROOT'] . "/php/dnsexit.php");
4
include_once ($_SERVER['DOCUMENT_ROOT'] . "/php/sessions_db.php");
5
include_once ($_SERVER['DOCUMENT_ROOT'] . "/php/cryptor.php");
6
include_once ($_SERVER['DOCUMENT_ROOT'] . "/php/vendors.php");
7
include_once ($_SERVER['DOCUMENT_ROOT'] . "/php/tools.php");
8
include_once ($_SERVER['DOCUMENT_ROOT'] . "/php/wishlist.php");
7 - 9
 
9 - 10
error_reporting(E_ALL);
11
 
35 - 12
$userData = [];
57 - 13
$userTheme = 'default';
70 - 14
$configFile = parse_ini_file($_SERVER['DOCUMENT_ROOT'] . FCM_CONFIGFILE, true);
7 - 15
$crypt = Cryptor::getInstance($configFile['cryptor']);
107 - 16
$tmpSessionTab = (!empty(getPGV("sessionTab")) && getPGV("sessionTab") > 0 ? getPGV("sessionTab"): null);
7 - 17
$handler = MySessionHandler::getInstance($tmpSessionTab, $configFile['mysqli']);
9 - 18
$vendors = Vendors::getInstance();
83 - 19
Vendors::setAllVendors($configFile, $vendors);
7 - 20
unset($configFile);
21
 
2 - 22
ini_set("session.cookie_httponly", 1);
23
ini_set("session.cookie_secure", 1);
7 - 24
session_set_save_handler($handler, true);
35 - 25
if (!empty($_COOKIE['PHPSESSID'])) {
26
    session_id($_COOKIE['PHPSESSID']);
27
}
2 - 28
session_start();
35 - 29
 
30
// Check whether user ID is available in cookie
65 - 31
if (!empty($_COOKIE['rememberUserId']) && !empty($_COOKIE['hash']) && empty($_SESSION['sessData']['loginType'])) {
35 - 32
    require_once 'login/includes/config.php';
33
    require_once 'login/includes/User.class.php';
34
    require_once 'login/includes/password.php';
35
    $user = new User();
36
    $conditions['where'] = array(
37
        'id' => $_COOKIE['rememberUserId']
38
    );
39
    $conditions['return_type'] = 'single';
40
    $userData = $user->getRows($conditions);
41
    if (!empty($userData) && password_verify($userData['password'] . $userData['id'], $_COOKIE['hash'])) {
65 - 42
        $_SESSION['sessData']['userLoggedIn'] = true;
35 - 43
        $_SESSION['sessData']['userID'] = $_COOKIE['rememberUserId'];
36 - 44
        $userPicture = getUserImage($userData);
57 - 45
        $userTheme = $userData['theme'];
59 - 46
        $_SESSION["currentLayout"] = ($userData['cardView'] == '1' ? 'CardView' : 'TableView');
57 - 47
        if (empty($_SESSION["manualFilter"])) {
48
            $_SESSION['buyer']['Zip'] = $userData['zip'];
49
            $_SESSION['buyer']['Country'] = 'United States';
50
            $_SESSION['buyer']['Currency'] = 'USD';
65 - 51
            $_SESSION["filterCondition"]["New"] = $userData['conditionNew'];
52
            $_SESSION["filterCondition"]["Used"] = $userData['conditionUsed'];
53
            $_SESSION["filterMediaType"]["CD"] = $userData['mediaCD'];
54
            $_SESSION["filterMediaType"]["Record"] = $userData['mediaRecord'];
55
            $_SESSION["filterMediaType"]["Digital"] = $userData['mediaDigital'];
56
            $_SESSION["filterMediaType"]["Book"] = $userData['mediaBook'];
57
        }
58
    }
59
    else {
35 - 60
        unsetSessData();
61
    }
65 - 62
    // or if the user has already logged in
114 - 63
 
65 - 64
}
65
else if (isLoggedIn()) {
35 - 66
    require_once 'login/includes/config.php';
67
    require_once 'login/includes/User.class.php';
68
    require_once 'login/includes/password.php';
69
    $user = new User();
70
    $conditions['where'] = array(
71
        'id' => $_SESSION['sessData']['userID']
72
    );
73
    $conditions['return_type'] = 'single';
74
    $userData = $user->getRows($conditions);
57 - 75
 
35 - 76
    if (!empty($userData)) {
36 - 77
        $userPicture = getUserImage($userData);
57 - 78
        $userTheme = $userData['theme'];
59 - 79
        $_SESSION["currentLayout"] = ($userData['cardView'] == '1' ? 'CardView' : 'TableView');
57 - 80
        if (empty($_SESSION["manualFilter"])) {
35 - 81
            $_SESSION['buyer']['Zip'] = $userData['zip'];
82
            $_SESSION['buyer']['Country'] = 'United States';
83
            $_SESSION['buyer']['Currency'] = 'USD';
65 - 84
            $_SESSION["filterCondition"]["New"] = $userData['conditionNew'];
85
            $_SESSION["filterCondition"]["Used"] = $userData['conditionUsed'];
86
            $_SESSION["filterMediaType"]["CD"] = $userData['mediaCD'];
87
            $_SESSION["filterMediaType"]["Record"] = $userData['mediaRecord'];
88
            $_SESSION["filterMediaType"]["Digital"] = $userData['mediaDigital'];
89
            $_SESSION["filterMediaType"]["Book"] = $userData['mediaBook'];
35 - 90
        }
65 - 91
    }
92
    else {
35 - 93
        unsetSessData();
94
    }
65 - 95
    // not logged in
114 - 96
 
65 - 97
}
98
else {
35 - 99
    unsetSessData();
100
}
57 - 101
 
78 - 102
checkPriceMonitor();
2 - 103
?>
104
<!DOCTYPE html>
105
<html lang="en-US">
106
<head>
107 - 107
    <title>Find Cheap Music | CDs, Records, Digital, Books and Sheets</title>
114 - 108
    <meta name="keywords" content="Cheap,Music,Album,Single,Promo,CD,Compact Disc,Vinyl,Record,Digital,Download,Sheet,Book">
109
    <?php echo metaDescription(getPGV('submit')); ?>
70 - 110
    <?php include_once ($_SERVER['DOCUMENT_ROOT'] . "/php/header.php"); ?>
114 - 111
 
107 - 112
    <?php echo file_get_contents('snippets/fb_tw.txt'); ?>
2 - 113
</head>
114
<body>
115
 
116
<?php
5 - 117
initSessionVariables();
2 - 118
 
119
if ($_SERVER["REQUEST_METHOD"] == "POST") {
65 - 120
    if ($_POST["submit"] == "Search") {
35 - 121
        if (empty($_SESSION['buyer']['Zip'])) {
65 - 122
            $zip = (empty($_POST['buyerZip']) ? "" : sanitizeInput($_POST['buyerZip']));
123
            if (strlen($zip) == 5 && preg_match("/^[0-9 ]*$/", $zip)) {
57 - 124
                if ($_SESSION["buyer"]["Zip"] != $zip) {
65 - 125
                    $_SESSION["manualFilter"] = true;
126
                    $_SESSION["buyer"]["Zip"] = $zip;
127
                }
128
            }
129
            else if (strlen($zip) == 0) {
130
                $_SESSION["buyer"]["Zip"] = "";
131
            }
132
        }
2 - 133
 
46 - 134
        $_SESSION["discogsTitle"] = "";
135
        $_SESSION["discogsArtist"] = "";
65 - 136
        $searchTerm = (empty($_POST['searchTerm']) ? "" : searchFriendlyString($_POST['searchTerm']));
137
        if (empty($searchTerm)) {
138
            resetSessionVars();
139
        }
140
        else {
141
            $_SESSION["searchTerm"] = $searchTerm;
2 - 142
 
5 - 143
            if (checkSearchFilters()) {
65 - 144
                performSearch();
145
            }
146
        }
147
    }
148
    else if ($_POST["submit"] == "Save") {
149
        $_SESSION["manualFilter"] = true;
66 - 150
        if (!isset($_POST["filterCondition"])) {$_POST["filterCondition"] = []; }
151
        if (!is_array($_POST["filterCondition"])) { $_POST["filterCondition"] = [ $_POST["filterCondition"] ];}
152
        $_SESSION["filterCondition"]["New"] = in_array("New", $_POST["filterCondition"]);
153
        $_SESSION["filterCondition"]["Used"] = in_array("Used", $_POST["filterCondition"]);
154
        if (!isset($_POST["filterMediaType"])) {$_POST["filterMediaType"] = []; }
155
        if (!is_array($_POST["filterMediaType"])) { $_POST["filterMediaType"] = [ $_POST["filterMediaType"] ];}
156
        $_SESSION["filterMediaType"]["CD"] = in_array("CD", $_POST["filterMediaType"]);
157
        $_SESSION["filterMediaType"]["Record"] = in_array("Record", $_POST["filterMediaType"]);
158
        $_SESSION["filterMediaType"]["Digital"] = in_array("Digital", $_POST["filterMediaType"]);
159
        $_SESSION["filterMediaType"]["Book"] = in_array("Book", $_POST["filterMediaType"]);
2 - 160
 
46 - 161
        $_SESSION["discogsTitle"] = "";
162
        $_SESSION["discogsArtist"] = "";
65 - 163
        $searchTerm = searchFriendlyString($_POST['searchTerm']);
164
        if (empty($searchTerm)) {
165
            resetSessionVars();
166
        }
167
        else {
168
            $_SESSION["searchTerm"] = $searchTerm;
27 - 169
 
170
            if (checkSearchFilters()) {
65 - 171
                performSearch();
172
            }
173
        }
174
    }
175
    else if ($_POST["submit"] == "discogsSearch") {
50 - 176
        $searchTerm = "";
177
        if (!empty($_POST['discogsBarcode'])) {
65 - 178
            $searchTerm = searchFriendlyString($_POST['discogsBarcode']);
179
        }
180
        else {
50 - 181
            if (!empty($_POST['discogsTitle'])) {
182
                $searchTerm = $_POST['discogsTitle'];
183
            }
58 - 184
 
50 - 185
            if (!empty($_POST['discogsArtist'])) {
186
                $searchTerm .= " " . $_POST['discogsArtist'];
187
            }
58 - 188
 
50 - 189
            $searchTerm = trim($searchTerm);
190
        }
191
 
65 - 192
        if (empty($searchTerm)) {
193
            resetSessionVars();
194
        }
195
        else {
196
            $_SESSION["searchTerm"] = $searchTerm;
46 - 197
            if (isset($_POST['discogsTitle'])) {
198
                $_SESSION["discogsTitle"] = searchFriendlyString($_POST['discogsTitle']);
199
            }
200
            if (isset($_POST['discogsArtist'])) {
201
                $_SESSION["discogsArtist"] = searchFriendlyString($_POST['discogsArtist']);
202
            }
14 - 203
 
204
            if (checkSearchFilters()) {
65 - 205
                performSearch();
206
            }
207
        }
208
    }
73 - 209
    else if ($_POST["submit"] == "unsubscribe") {
210
// bugbug
211
    }
65 - 212
}
213
else if ($_SERVER["REQUEST_METHOD"] == "GET") {
214
    if (isset($_GET['z'])) {
215
        $_SESSION["buyer"]["Zip"] = "";
216
        $zip = sanitizeInput($_GET['z']);
217
        if (strlen($zip) == 5 && preg_match("/^[0-9 ]*$/", $zip)) {
218
            $_SESSION["buyer"]["Zip"] = $zip;
219
        }
220
    }
2 - 221
 
9 - 222
    $_SESSION["searchTerm"] = "";
65 - 223
    if (isset($_GET['q'])) {
224
        $_SESSION["searchTerm"] = searchFriendlyString($_GET["q"]);
5 - 225
        if (checkSearchFilters()) {
65 - 226
            performSearch();
227
        }
228
    }
2 - 229
}
230
?>
14 - 231
    <form method="post" action="/index.php">
20 - 232
        <input type="hidden" name="sessionTab" value="<?php echo MySessionHandler::getSessionTab(); ?>">
14 - 233
       	<input type="hidden" name="searchTerm" value="<?php echo getSV("searchTerm") ?>">
81 - 234
        <nav class="navbar navbar-expand-sm bg-black navbar-dark fixed-top">
35 - 235
            <div class="navbar-header">
107 - 236
                <button type="submit" name="submit" value="Search" class="btn text-white" aria-label="Go to home page">Find Cheap Music</button>
35 - 237
            </div>
107 - 238
            <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#collapsibleNavbar" aria-label="Open Menu">
14 - 239
                <span class="navbar-toggler-icon"></span>
240
            </button>
241
            <div class="collapse navbar-collapse" id="collapsibleNavbar">
35 - 242
                <ul class="navbar-nav mr-auto">
14 - 243
                    <li class="nav-item">
107 - 244
                        <button type="submit" name="submit" value="Search" class="nav-link btn" aria-label="Go to home page"><i class="fas fa-home"></i></button>
35 - 245
                    </li>
246
                    <?php if (isLoggedIn()) { ?>
247
                        <li class="nav-item">
248
                            <button type="submit" name="submit" value="coupons" class="nav-link btn">Coupons</button>
249
                        </li>
45 - 250
                        <li class="nav-item">
79 - 251
                            <button type="submit" name="submit" value="wishlist" class="nav-link btn">Wishlist
252
                            <?php if (!empty($_SESSION['priceMonitor']['newFlag']) && $_SESSION['priceMonitor']['newFlag'] === true) { echo '<scan class="badge badge-pill badge-light">New</scan>'; } ?>
253
                            </button>
45 - 254
                        </li>
65 - 255
                    <?php
256
} ?>
35 - 257
                    <li class="nav-item">
15 - 258
                        <button type="submit" name="submit" value="terms" class="nav-link btn">Terms of Service</button>
14 - 259
                    </li>
260
                    <li class="nav-item">
15 - 261
                        <button type="submit" name="submit" value="privacy" class="nav-link btn">Privacy Policy</button>
14 - 262
                    </li>
57 - 263
                    <li class="nav-item">
114 - 264
                        <a href="https://blog.findcheapmusic.com" target="_blank" rel="noreferrer noopener" class="nav-link" role="button">Blog</a>
57 - 265
                    </li>
107 - 266
                    <li class="nav-item">
267
                        <button type="submit" name="submit" value="help" class="nav-link btn" aria-label="Go to Help Page"><i class="far fa-question-circle"></i></button>
268
                    </li>
14 - 269
                </ul>
35 - 270
                <ul class="navbar-nav">
271
                    <?php if (!isLoggedIn()) { ?>
272
                    <li class="nav-item">
114 - 273
                        <a href="/login/index.php" class="nav-link"><i class='fas fa-sign-in-alt'></i> Login</a>
35 - 274
                    </li>
65 - 275
                    <?php
276
}
277
else { ?>
36 - 278
                        <li class="nav-item">
108 - 279
                            <img class="img-fluid hide-extra-small hide-small user-img" src="<?php echo timeStampUrl($userPicture); ?>" alt="User Image">
36 - 280
                        </li>
35 - 281
                        <li class="nav-item dropdown">
47 - 282
                          <a class="nav-link dropdown-toggle" href="#" id="navbardrop" data-toggle="dropdown"><i class="fas fa-user-cog"></i> Account</a>
35 - 283
                          <div class="dropdown-menu dropdown-menu-right">
47 - 284
                              <button formaction="/login/account.php" type="submit" name="submit" value="account" class="dropdown-item btn"><i class="fas fa-info-circle"></i> Information</button>
285
                              <button formaction="/login/editAccount.php" type="submit" name="submit" value="editAccount" class="dropdown-item btn"><i class="fas fa-edit"></i> Edit Account</button>
36 - 286
                              <?php if (empty($_SESSION['sessData']['loginType']) || $_SESSION['sessData']['loginType'] != 'social') { ?>
47 - 287
                                  <button formaction="/login/changePassword.php" type="submit" name="submit" value="changePassword" class="dropdown-item btn"><i class="fas fa-key"></i> Change Password</button>
65 - 288
                              <?php
289
    } ?>
47 - 290
                              <button formaction="/login/userAccount.php?logoutSubmit=1" type="submit" name="submit" value="logout" class="dropdown-item btn"><i class='fas fa-sign-out-alt'></i> Logout</button>
35 - 291
                          </div>
292
                        </li>
65 - 293
                    <?php
294
} ?>
35 - 295
                </ul>
14 - 296
            </div>
297
        </nav>
298
    </form>
2 - 299
 
3 - 300
    <div class="page-header bg-primary">
301
        <div class="container text-center py-3">
14 - 302
        <?php
65 - 303
if (getPGV('submit') == "terms") {
304
    echo file_get_contents('snippets/headerTerms.txt');
305
}
306
else if (getPGV('submit') == "privacy") {
307
    echo file_get_contents('snippets/headerPrivacy.txt');
308
}
309
else if (getPGV('submit') == "coupons") {
310
    echo file_get_contents('snippets/headerCoupons.txt');
311
}
312
else if (getPGV('submit') == "wishlist") {
313
    echo file_get_contents('snippets/headerWishlist.txt');
78 - 314
    if (!empty($_SESSION['priceMonitor'])) {
315
    ?>
316
    <form method="post" action="/index.php">
317
        <input type="hidden" name="sessionTab" value="<?php echo MySessionHandler::getSessionTab(); ?>">
79 - 318
        <button id="priceMonitor" type="submit" class="btn btn-success rounded" name="submit" value="priceMonitor">Price Monitor Results
319
        <?php if (!empty($_SESSION['priceMonitor']['newFlag']) && $_SESSION['priceMonitor']['newFlag'] === true) { echo '<scan class="badge badge-pill badge-dark">New</scan>'; } ?>
320
        </button>
78 - 321
    </form>
322
    <?php
323
    }
65 - 324
}
78 - 325
else if (getPGV('submit') == "priceMonitor") {
326
    echo file_get_contents('snippets/headerPriceMonitor.txt');
327
}
65 - 328
else if (getPGV('submit') == "help") {
329
    echo file_get_contents('snippets/headerHelp.txt');
330
}
113 - 331
else if (getPGV('submit') == "barcode") {
332
    echo file_get_contents('snippets/headerBarcode.txt');
333
}
73 - 334
else if (getPGV('submit') == "unsubscribe") {
335
    echo file_get_contents('snippets/unsubscribeWishlist.txt');
336
}
65 - 337
else {
114 - 338
    echo '<h1>Find Cheap CDs, Records, Digital, Books and Sheets</h1>';
107 - 339
    echo '<p id="textslide" class="d-none d-sm-block">Bookmark FindCheapMusic.com</p>';
65 - 340
}
341
?>
2 - 342
        </div>
343
    </div>
344
 
3 - 345
	<div class="container-fluid bg-primary py-3">
5 - 346
        <?php
65 - 347
if (!in_array(getPGV('submit') , array(
348
    "terms",
349
    "privacy",
350
    "coupons",
351
    "wishlist",
78 - 352
    "priceMonitor",
73 - 353
    "help",
113 - 354
    "barcode",
73 - 355
    "unsubscribe"
65 - 356
))) {
357
    echo $_SESSION["filterWarnings"];
358
}
359
?>
360
        <form <?php if (in_array(getPGV('submit') , array(
361
    "terms",
362
    "privacy",
363
    "coupons",
364
    "wishlist",
78 - 365
    "priceMonitor",
73 - 366
    "help",
113 - 367
    "barcode",
73 - 368
    "unsubscribe"
369
 
65 - 370
))) {
107 - 371
    echo "hidden=\"hidden\"";
372
} ?> id="searchForm" method="post" action="/index.php" class="form-inline"
58 - 373
            onsubmit="if (document.getElementById('searchTerm').value != '') { progressBar('Searching for:<br><br><strong>' + document.getElementById('searchTerm').value.toLowerCase().replace(/(?:(^.{1})|\ [a-z]{1})/g, function(a){return a.toUpperCase();}) + '</strong>');document.getElementById('searchBtn').innerHTML = '&lt;span class=\'spinner-border spinner-border-sm\'&gt;&lt;/span&gt; Searching, please wait...'; }">
15 - 374
            <input id="sessionId" type="hidden" name="sessionId" value="<?php echo session_id(); ?>">
20 - 375
            <input id="sessionTab" type="hidden" name="sessionTab" value="<?php echo MySessionHandler::getSessionTab(); ?>">
113 - 376
            <div style="width: 0; height: 0; overflow: hidden;">
377
                <button type="submit"name="submit" value="Search">Hidden Sumit Button</button>
378
            </div>
379
            <div class="form-group">
17 - 380
                <div class="btn-group">
107 - 381
                    <button class="btn input-group-text mx-1 rounded" type="button" data-toggle="modal" data-target="#searchInfoModal" data-toggle2="tooltip" title="Search Tips" aria-label="Search Tips"><i class="fas fa-info-circle btn-search"></i></button>
114 - 382
                    <button class="btn input-group-text mx-1 rounded" type="submit" name="submit" value="barcode" data-toggle="tooltip" title="Barcode Checker" aria-label="Barcode Checker" onclick="document.getElementById('searchTerm').value=''"><i class="fas fa-barcode btn-search"></i></button>
2 - 383
                </div>
384
        	</div>
20 - 385
        	<div class="form-group mx-1">
107 - 386
        	    <input id="searchTerm" list="searchHistory" name="searchTerm" type="text" class="form-control flexdatalist searchTerm-width" placeholder="Search by Barcode, Artist, Title, ..." aria-label="Search Term Input" value="<?php echo getSV("searchTerm") ?>">
17 - 387
        	    <datalist id="searchHistory">
388
            	    <?php echo getSearchHistory(); ?>
389
            	</datalist>
390
            </div>
391
        	<div class="form-group">
392
                <button id="searchBtn" type="submit" class="btn btn-success mx-1 rounded" name="submit" value="Search">Go</button>
393
            </div>
2 - 394
        </form>
395
    </div>
396
 
5 - 397
    <?php
65 - 398
if (getPGV('submit') == "terms") {
399
    echo file_get_contents('snippets/terms.txt');
400
}
401
else if (getPGV('submit') == "privacy") {
402
    echo file_get_contents('snippets/privacy.txt');
403
}
404
else if (getPGV('submit') == "help") {
108 - 405
    include 'php/help.php';
65 - 406
}
113 - 407
else if (getPGV('submit') == "barcode") {
408
    echo '
114 - 409
<div class="container py-4 bg-light border">
113 - 410
    <div class="my-3">
411
    <p>This tool verifies Music CD barcodes or calculates the check digit.<br>See our <a href="https://blog.findcheapmusic.com/2020/03/music-cd-barcodes-and-identifiers.html" target="_blank" rel="noopener noreferrer">blog post</a> for more information about music barcodes.</p>
412
        <form id="barcodeForm">
413
    	    <input type="hidden" name="sessionTab" value="' . MySessionHandler::getSessionTab() . '">
414
            <input type="hidden" name="searchTerm" value="' . getSV("searchTerm") . '">
415
            <div class="input-group mb-3">
416
        	    <input id="barcode" name="barcode" type="text" class="" placeholder="Enter Barcode..." aria-label="Barcode Input">
417
                    <div class="input-group-append">
418
                        <button type="submit" class="btn btn-success barcodeButton" name="submit" value="check">Verify</button>
419
                        <button type="submit" class="btn btn-info barcodeButton" name="submit" value="calc">Calculate</button>
420
                    </div>
421
            </div>
422
        </form>
423
        <div id="barcodeResult"></div>
424
    </div>
425
</div>
426
';
427
}
65 - 428
else if (getPGV('submit') == "coupons") {
429
    //get_linkshareCoupons(); // bugbug
430
    echo getCouponCodes();
431
}
432
else if (getPGV('submit') == "wishlist") {
433
    echo getWishlist();
434
}
78 - 435
else if (getPGV('submit') == "priceMonitor") {
436
    echo "<div id=\"productTable\" class=\"container bg-secondary border pt-2\">";
437
    echo getPriceMonitor(); // bugbug
438
    echo "</div>";
439
}
73 - 440
else if (getPGV('submit') == "unsubscribe") {
441
    echo unsubscribeWishlist($_GET);
442
}
65 - 443
else if (getPGV('submit') == "random") {
444
    findDiscogsMaster("***RANDOM***");
445
    echo $_SESSION["discogs"];
446
}
447
else {
448
    if ($_SESSION["lowestPrice"]["All"] > 0.00 || !empty($_SESSION["searchTerm"])) {
38 - 449
        echo $_SESSION["discogs"];
104 - 450
        echo "<div id=\"productTable\" class=\"container bg-secondary border py-2\">";
107 - 451
        echo "<h2 class=\"text-center py-2\">Store Offers</h2>";
104 - 452
        if ($_SESSION["lowestPrice"]["All"] > 0.00) {
453
            echo printResultHeader();
454
        }
65 - 455
        echo printResult();
456
        echo "</div>";
457
    }
458
    else if (!empty($_SESSION["discogs"])) {
459
        echo $_SESSION["discogs"];
460
    }
461
    else {
462
?>
110 - 463
    <div class="container-fluid text-center mb-2">
38 - 464
    <form method="post" action="/index.php">
465
        <input type="hidden" name="sessionTab" value="<?php echo MySessionHandler::getSessionTab(); ?>">
466
       	<input type="hidden" name="searchTerm" value="<?php echo getSV("searchTerm") ?>">
43 - 467
        <button id="randomBtn" type="submit" class="btn btn-success mt-5 rounded" name="submit" value="random">Random Album Suggestions</button>
38 - 468
    </form>
469
    </div>
110 - 470
    <div class="container bg-secondary border py-2 mt-4">
471
    <h2 class="text-center py-2">Getting Started</h2>
472
    <p>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 (<i class="far fa-question-circle"></i>) up top.</p>
473
    <hr>
108 - 474
    <?php include 'php/help.php'; ?>
110 - 475
    </div>
65 - 476
        <?php
14 - 477
    }
65 - 478
    echo printSearchFilterModal();
479
    echo printSearchInfoModal();
480
}
481
?>
2 - 482
 
14 - 483
    <div class="modal" id="progressBarDiv">
17 - 484
        <div class="modal-dialog modal-dialog-centered">
14 - 485
            <div class="modal-content">
486
                <div class="modal-header">
107 - 487
                    <p id="progressBarHeader" class="display-6">Searching</p>
14 - 488
                </div>
489
                <div class="modal-body">
490
                    <div class="progress">
491
                        <div id="progressBar" class="progress-bar" style="width:0%">0%</div>
492
                    </div>
493
                </div>
15 - 494
                <div class="modal-footer">
495
                    <span id="progressBarMessage"></span>
496
                </div>
14 - 497
            </div>
498
        </div>
499
    </div>
500
 
81 - 501
    <button onclick="topFunction()" id="topBtn" title="Go to top">Top</button>
502
 
64 - 503
    <footer class="container-fluid text-center bg-primary py-5">
78 - 504
        <?php if (!empty($_SESSION["searchTerm"]) || getPGV('submit') == "priceMonitor") {
114 - 505
            echo "<p>Disclaimer: As an Associate we earn from qualifying purchases.</p>";
506
        } ?>
507
        <p>
508
            <a href="https://www.facebook.com/FindCheapMusic" target="_blank" rel="noopener noreferrer"><img class="socialBtn lazyload" src="data:image/png;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=" data-src="images/f_logo_RGB-Blue_58.png" alt="Facebook Logo" /></a>
509
            <a href="https://twitter.com/findcheapmusic" target="_blank" rel="noopener noreferrer"><img class="socialBtn lazyload" src="data:image/png;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=" data-src="images/Twitter_Social_Icon_Circle_Color.png" alt="Twitter Logo" /></a>
510
        </p>
17 - 511
        <p>Copyright &#169; <?php echo @date("Y"); ?> FindCheapMusic.com. All rights reserved.</p>
2 - 512
    </footer>
513
 
36 - 514
    <script>var quotes = [
38 - 515
    <?php
65 - 516
if ($file = fopen("snippets/header.txt", "r")) {
517
    while (($line = fgets($file)) !== false) {
518
        echo "\"" . trim($line) . "\",";
519
    }
520
    fclose($file);
521
}
522
?>
83 - 523
    ]; setInterval(function() { $("#textslide").html(quotes[Math.floor(Math.random() * (quotes.length + 1))]); }, 5 * 1000);
524
    </script>
114 - 525
    <?php include_once ($_SERVER['DOCUMENT_ROOT'] . "/php/downloadAtOnload.php"); ?>
2 - 526
</body>
527
</html>
21 - 528
<?php MySessionHandler::commit(session_id()); ?>