Subversion Repositories cheapmusic

Rev

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