Subversion Repositories cheapmusic

Rev

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

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