Subversion Repositories cheapmusic

Rev

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

Rev Author Line No. Line
2 - 1
<?php
25 - 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");
35 - 6
include_once($_SERVER['DOCUMENT_ROOT'] . "/php/tools.php");
45 - 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';
25 - 13
$configFile = parse_ini_file($_SERVER['DOCUMENT_ROOT'] . "/../MyFiles/config/cheapmusic.ini", 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
57 - 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'])) {
46
        $_SESSION['sessData']['userLoggedIn'] = TRUE;
47
        $_SESSION['sessData']['userID'] = $_COOKIE['rememberUserId'];
36 - 48
        $userPicture = getUserImage($userData);
57 - 49
        $userTheme = $userData['theme'];
50
        if (empty($_SESSION["manualFilter"])) {
51
            $_SESSION['buyer']['Zip'] = $userData['zip'];
52
            $_SESSION['buyer']['Country'] = 'United States';
53
            $_SESSION['buyer']['Currency'] = 'USD';
54
    		$_SESSION["filterCondition"]["New"] = $userData['conditionNew'];
55
	    	$_SESSION["filterCondition"]["Used"] = $userData['conditionUsed'];
56
    		$_SESSION["filterMediaType"]["CD"] = $userData['mediaCD'];
57
	    	$_SESSION["filterMediaType"]["Record"] = $userData['mediaRecord'];
58
    		$_SESSION["filterMediaType"]["Digital"] = $userData['mediaDigital'];
59
	    	$_SESSION["filterMediaType"]["Book"] = $userData['mediaBook'];
60
	    }
35 - 61
    } else {
62
        unsetSessData();
63
    }
64
// or if the user has already logged in
65
} else if (isLoggedIn()) {
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'];
79
        if (empty($_SESSION["manualFilter"])) {
35 - 80
            $_SESSION['buyer']['Zip'] = $userData['zip'];
81
            $_SESSION['buyer']['Country'] = 'United States';
82
            $_SESSION['buyer']['Currency'] = 'USD';
57 - 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
        }
90
    } else {
91
        unsetSessData();
92
    }
93
// not logged in
94
} else {
95
    unsetSessData();
96
}
57 - 97
 
98
 
2 - 99
?>
100
<!DOCTYPE html>
101
<html lang="en-US">
102
<head>
103
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
57 - 104
    <title>Find Cheap Music... CDs, Records, Digital, Books and Sheets</title>
2 - 105
    <meta name="viewport" content="width=device-width, initial-scale=1">
57 - 106
    <meta name="description" content="Find Cheap Music searches dozens of trusted online stores for low-priced Compact Discs, Vinyl Records, Digital Downloads, Music Sheets and Music related books. Maintain a wishlist and get coupons / special offers with free registration.">
107
    <meta name="keywords" content="Cheap,Music,Album,Single,Promo,CD,Compact Disc,Vinyl,Record,Digital,Download,Sheet,Book">
2 - 108
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
109
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.0/jquery.min.js" integrity="sha384-JUMjoW8OzDJw4oFpWIB2Bu/c6768ObEthBMVSiIx4ruBIEdyNSUQAjJNFqT5pnJ6" crossorigin="anonymous"></script>
110
    <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
111
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
3 - 112
    <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.1/css/all.css" integrity="sha384-50oBUHEmvpQ+1lW4y57PTFmhCaXp0ML5d60M1M7uH2+nqUivzIebhndOJK28anvf" crossorigin="anonymous">
57 - 113
    <link rel="stylesheet" href="css/theme-<?php echo (!empty($userTheme) ? $userTheme : "default"); ?>.css">
114
    <link rel="stylesheet" href="css/style.min.css" integrity="sha384-h70/XsYIv8btoooNkZxWt/2VctdM5nVsUsbKkkPvA0bfH/bh06pnjaQbk/Ucmv9U" crossorigin="anonymous">
17 - 115
    <link rel="stylesheet" href="css/jquery.flexdatalist.min.css" integrity="sha384-IUkltzhO8hiEuEm0UJQvWrrtE1xqVHA0NbUeIY7a+zCokg7LqiDf5HSt69ru8a7R" crossorigin="anonymous">
116
    <script src="js/jquery.flexdatalist.min.js" integrity="sha384-JKZ5fd3wxuyCR/AhbpbYALE2xwlYMGYu0XpsXixX7YOni1G0is+vwTuSMuGGYhnl" crossorigin="anonymous"></script>
20 - 117
    <script src="js/input-clearer.min.js" integrity="sha384-PPIpFAWvzKO0l06o6zNV8tPFHNistosIDKHylKx5kJIM9zceSlJxAScUWQpt02xy" crossorigin="anonymous"></script>
43 - 118
    <script src="js/paginate.min.js" integrity="sha384-sN78hrw/H8RzeS4ete92bJj3Y0lEBeiryHisgrRm/pvsPyGLf0M14Vnm+cRxVchm" crossorigin="anonymous"></script>
57 - 119
    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">
120
    <link rel="icon" href="/favicon.ico" type="image/x-icon">
2 - 121
</head>
122
<body>
123
 
124
<?php
5 - 125
initSessionVariables();
2 - 126
 
127
if ($_SERVER["REQUEST_METHOD"] == "POST") {
5 - 128
	if ($_POST["submit"] == "Search") {
35 - 129
        if (empty($_SESSION['buyer']['Zip'])) {
130
    		$zip = (empty($_POST['buyerZip']) ? "" : sanitizeInput($_POST['buyerZip']));
131
        	if (strlen($zip) == 5 && preg_match("/^[0-9 ]*$/", $zip)) {
57 - 132
                if ($_SESSION["buyer"]["Zip"] != $zip) {
133
            	    $_SESSION["manualFilter"] = true;
134
	            	$_SESSION["buyer"]["Zip"] = $zip;
135
    	        }
35 - 136
   		    } else if (strlen($zip) == 0) {
137
        		$_SESSION["buyer"]["Zip"] = "";
138
	        }
139
	    }
2 - 140
 
46 - 141
        $_SESSION["discogsTitle"] = "";
142
        $_SESSION["discogsArtist"] = "";
35 - 143
		$searchTerm = (empty($_POST['searchTerm']) ? "" : searchFriendlyString($_POST['searchTerm']));
9 - 144
		if (empty($searchTerm)) {
145
			resetSessionVars();
5 - 146
		} else {
9 - 147
			$_SESSION["searchTerm"] = $searchTerm;
2 - 148
 
5 - 149
            if (checkSearchFilters()) {
150
    			performSearch();
151
    		}
152
		}
153
	} else if ($_POST["submit"] == "Save") {
57 - 154
	    $_SESSION["manualFilter"] = true;
5 - 155
		$_SESSION["filterCondition"]["New"] = checkPV("filterConditionNew");
156
		$_SESSION["filterCondition"]["Used"] = checkPV("filterConditionUsed");
157
		$_SESSION["filterMediaType"]["CD"] = checkPV("filterMediaTypeCD");
158
		$_SESSION["filterMediaType"]["Record"] = checkPV("filterMediaTypeRecord");
159
		$_SESSION["filterMediaType"]["Digital"] = checkPV("filterMediaTypeDigital");
20 - 160
		$_SESSION["filterMediaType"]["Book"] = checkPV("filterMediaTypeBook");
2 - 161
 
46 - 162
        $_SESSION["discogsTitle"] = "";
163
        $_SESSION["discogsArtist"] = "";
27 - 164
		$searchTerm = searchFriendlyString($_POST['searchTerm']);
165
		if (empty($searchTerm)) {
166
			resetSessionVars();
167
		} else {
168
			$_SESSION["searchTerm"] = $searchTerm;
169
 
170
            if (checkSearchFilters()) {
171
    			performSearch();
172
    		}
5 - 173
		}
14 - 174
	} else if ($_POST["submit"] == "discogsSearch") {
50 - 175
        $searchTerm = "";
176
        if (!empty($_POST['discogsBarcode'])) {
177
    		$searchTerm = searchFriendlyString($_POST['discogsBarcode']);
178
        } else {
179
            if (!empty($_POST['discogsTitle'])) {
180
                $searchTerm = $_POST['discogsTitle'];
181
            }
58 - 182
 
50 - 183
            if (!empty($_POST['discogsArtist'])) {
184
                $searchTerm .= " " . $_POST['discogsArtist'];
185
            }
58 - 186
 
50 - 187
            $searchTerm = trim($searchTerm);
188
        }
189
 
14 - 190
		if (empty($searchTerm)) {
191
			resetSessionVars();
192
		} else {
193
			$_SESSION["searchTerm"] = $searchTerm;
46 - 194
            if (isset($_POST['discogsTitle'])) {
195
                $_SESSION["discogsTitle"] = searchFriendlyString($_POST['discogsTitle']);
196
            }
197
            if (isset($_POST['discogsArtist'])) {
198
                $_SESSION["discogsArtist"] = searchFriendlyString($_POST['discogsArtist']);
199
            }
14 - 200
 
201
            if (checkSearchFilters()) {
202
    			performSearch();
203
    		}
204
		}
5 - 205
	} else if (in_array($_POST["submit"], $buttonArr)) {
206
		$_SESSION["currentView"] = $_POST["submit"];
207
		filterResults();
208
	}
209
} else if ($_SERVER["REQUEST_METHOD"] == "GET") {
210
	if (isset($_GET['z'])) {
9 - 211
    	$_SESSION["buyer"]["Zip"] = "";
5 - 212
		$zip = sanitizeInput($_GET['z']);
213
		if (strlen($zip) == 5 && preg_match("/^[0-9 ]*$/", $zip)) {
214
			$_SESSION["buyer"]["Zip"] = $zip;
215
		}
216
	}
2 - 217
 
9 - 218
    $_SESSION["searchTerm"] = "";
5 - 219
	if (isset($_GET['q'])) {
14 - 220
		$_SESSION["searchTerm"] = searchFriendlyString($_GET["q"]);
5 - 221
        if (checkSearchFilters()) {
222
    		performSearch();
223
    	}
224
	}
2 - 225
}
226
?>
227
 
14 - 228
    <form method="post" action="/index.php">
20 - 229
        <input type="hidden" name="sessionTab" value="<?php echo MySessionHandler::getSessionTab(); ?>">
14 - 230
       	<input type="hidden" name="searchTerm" value="<?php echo getSV("searchTerm") ?>">
231
       	<input type="hidden" name="buyerZip" value="<?php echo $_SESSION["buyer"]["Zip"];?>">
57 - 232
        <nav class="navbar navbar-expand-sm bg-dark text-light navbar-dark">
35 - 233
            <div class="navbar-header">
57 - 234
                <span class="navbar-brand"><button type="submit" name="submit" value="Search" class="nav-item btn text-light">Find Cheap Music</button></span>
35 - 235
            </div>
14 - 236
            <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#collapsibleNavbar">
237
                <span class="navbar-toggler-icon"></span>
238
            </button>
239
            <div class="collapse navbar-collapse" id="collapsibleNavbar">
35 - 240
                <ul class="navbar-nav mr-auto">
14 - 241
                    <li class="nav-item">
47 - 242
                        <button type="submit" name="submit" value="Search" class="nav-link btn"><i class="fas fa-home"></i></button>
35 - 243
                    </li>
244
                    <?php if (isLoggedIn()) { ?>
245
                        <li class="nav-item">
246
                            <button type="submit" name="submit" value="coupons" class="nav-link btn">Coupons</button>
247
                        </li>
45 - 248
                        <li class="nav-item">
249
                            <button type="submit" name="submit" value="wishlist" class="nav-link btn">Wishlist</button>
250
                        </li>
35 - 251
                    <?php } ?>
252
                    <li class="nav-item">
15 - 253
                        <button type="submit" name="submit" value="terms" class="nav-link btn">Terms of Service</button>
14 - 254
                    </li>
255
                    <li class="nav-item">
15 - 256
                        <button type="submit" name="submit" value="privacy" class="nav-link btn">Privacy Policy</button>
14 - 257
                    </li>
57 - 258
                    <li class="nav-item">
259
                        <button type="submit" name="submit" value="help" class="nav-link btn"><i class="far fa-question-circle"></i></button>
260
                    </li>
14 - 261
                </ul>
35 - 262
                <ul class="navbar-nav">
263
                    <?php if (!isLoggedIn()) { ?>
264
                    <li class="nav-item">
47 - 265
                        <a href="/login/index.php" class="nav-link btn"><i class='fas fa-sign-in-alt'></i> Login</a>
35 - 266
                    </li>
267
                    <?php } else { ?>
36 - 268
                        <li class="nav-item">
47 - 269
                            <img class="img-fluid hide-extra-small hide-small user-img" src="<?php echo $userPicture ?>" alt="User Image">
36 - 270
                        </li>
35 - 271
                        <li class="nav-item dropdown">
47 - 272
                          <a class="nav-link dropdown-toggle" href="#" id="navbardrop" data-toggle="dropdown"><i class="fas fa-user-cog"></i> Account</a>
35 - 273
                          <div class="dropdown-menu dropdown-menu-right">
47 - 274
                              <button formaction="/login/account.php" type="submit" name="submit" value="account" class="dropdown-item btn"><i class="fas fa-info-circle"></i> Information</button>
275
                              <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 - 276
                              <?php if (empty($_SESSION['sessData']['loginType']) || $_SESSION['sessData']['loginType'] != 'social') { ?>
47 - 277
                                  <button formaction="/login/changePassword.php" type="submit" name="submit" value="changePassword" class="dropdown-item btn"><i class="fas fa-key"></i> Change Password</button>
36 - 278
                              <?php } ?>
47 - 279
                              <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 - 280
                          </div>
281
                        </li>
282
                    <?php } ?>
283
                </ul>
14 - 284
            </div>
285
        </nav>
286
    </form>
2 - 287
 
3 - 288
    <div class="page-header bg-primary">
289
        <div class="container text-center py-3">
14 - 290
        <?php
20 - 291
            if (getPGV('submit') == "terms") {
14 - 292
                echo file_get_contents('snippets/headerTerms.txt');
20 - 293
            } else if (getPGV('submit') == "privacy") {
14 - 294
                echo file_get_contents('snippets/headerPrivacy.txt');
46 - 295
            } else if (getPGV('submit') == "coupons") {
296
                echo file_get_contents('snippets/headerCoupons.txt');
297
            } else if (getPGV('submit') == "wishlist") {
298
                echo file_get_contents('snippets/headerWishlist.txt');
57 - 299
            } else if (getPGV('submit') == "help") {
300
                echo file_get_contents('snippets/headerHelp.txt');
14 - 301
            } else {
36 - 302
                echo '<p id="textslide" class="d-none d-sm-block">FindCheapMusic.com</p>';
14 - 303
            }
304
        ?>
2 - 305
        </div>
306
    </div>
307
 
3 - 308
	<div class="container-fluid bg-primary py-3">
5 - 309
        <?php
57 - 310
        if (!in_array(getPGV('submit'), array("terms", "privacy", "coupons", "wishlist", "help"))) {
5 - 311
            echo $_SESSION["filterWarnings"];
14 - 312
        }
5 - 313
        ?>
57 - 314
        <form <?php if (in_array(getPGV('submit'), array("terms", "privacy", "coupons", "wishlist", "help"))) {echo "hidden";} ?> method="post" action="/index.php" class="form-inline"
58 - 315
            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 - 316
            <input id="sessionId" type="hidden" name="sessionId" value="<?php echo session_id(); ?>">
20 - 317
            <input id="sessionTab" type="hidden" name="sessionTab" value="<?php echo MySessionHandler::getSessionTab(); ?>">
17 - 318
        	<div class="form-group">
319
                <div class="btn-group">
47 - 320
                    <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>
321
                    <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 - 322
                    <div class="btn-group">
47 - 323
                        <button class="btn dropdown-toggle <?php echo ($_SESSION["buyer"]["Zip"] == '' ? "bg-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 - 324
                        <div class="dropdown-menu">
325
                            <div class="form-inline">
326
                                <label class="m-2">Shipping to:</label>
327
                                <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>
328
                                <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>
329
                                <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"];?>">
330
                            </div>
331
                        </div>
332
                    </div>
2 - 333
                </div>
334
        	</div>
20 - 335
        	<div class="form-group mx-1">
336
        	    <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 - 337
        	    <datalist id="searchHistory">
338
            	    <?php echo getSearchHistory(); ?>
339
            	</datalist>
340
            </div>
341
        	<div class="form-group">
342
                <button id="searchBtn" type="submit" class="btn btn-success mx-1 rounded" name="submit" value="Search">Go</button>
343
            </div>
2 - 344
        </form>
345
    </div>
346
 
5 - 347
    <?php
20 - 348
    if (getPGV('submit') == "terms") {
14 - 349
        echo file_get_contents('snippets/terms.txt');
20 - 350
    } else if (getPGV('submit') == "privacy") {
14 - 351
        echo file_get_contents('snippets/privacy.txt');
57 - 352
    } else if (getPGV('submit') == "help") {
353
        echo file_get_contents('snippets/help.txt');
35 - 354
    } else if (getPGV('submit') == "coupons") {
41 - 355
        //get_linkshareCoupons(); // bugbug
356
        echo getCouponCodes();
46 - 357
    } else if (getPGV('submit') == "wishlist") {
358
        echo getWishlist();
38 - 359
    } else if (getPGV('submit') == "random") {
360
        findDiscogsMaster("***RANDOM***");
361
        echo $_SESSION["discogs"];
14 - 362
    } else {
9 - 363
        if ($_SESSION["lowestPrice"]["All"] > 0.00 || !empty($_SESSION["searchTerm"])) {
12 - 364
            echo $_SESSION["discogs"];
58 - 365
	        echo "<div id=\"productTable\" class=\"container\">";
9 - 366
            echo printTableHeader();
367
            echo buildTable();
11 - 368
            echo "</div>";
46 - 369
        } else if (!empty($_SESSION["discogs"])) {
370
            echo $_SESSION["discogs"];
371
        } else {
372
             ?>
38 - 373
    <div class="container-fluid text-center">
374
    <form method="post" action="/index.php">
375
        <input type="hidden" name="sessionTab" value="<?php echo MySessionHandler::getSessionTab(); ?>">
376
       	<input type="hidden" name="searchTerm" value="<?php echo getSV("searchTerm") ?>">
377
       	<input type="hidden" name="buyerZip" value="<?php echo $_SESSION["buyer"]["Zip"];?>">
43 - 378
        <button id="randomBtn" type="submit" class="btn btn-success mt-5 rounded" name="submit" value="random">Random Album Suggestions</button>
38 - 379
    </form>
380
    </div>
381
        <?php }
5 - 382
        echo printSearchFilterModal();
383
        echo printSearchInfoModal();
14 - 384
    }
5 - 385
    ?>
2 - 386
 
14 - 387
    <div class="modal" id="progressBarDiv">
17 - 388
        <div class="modal-dialog modal-dialog-centered">
14 - 389
            <div class="modal-content">
390
                <div class="modal-header">
15 - 391
                    <h4 id="progressBarHeader">Searching</h4>
14 - 392
                </div>
393
                <div class="modal-body">
394
                    <div class="progress">
395
                        <div id="progressBar" class="progress-bar" style="width:0%">0%</div>
396
                    </div>
397
                </div>
15 - 398
                <div class="modal-footer">
399
                    <span id="progressBarMessage"></span>
400
                </div>
14 - 401
            </div>
402
        </div>
403
    </div>
404
 
43 - 405
    <footer class="container-fluid text-center bg-primary py-5 mt-5">
20 - 406
        <?php if (!empty($_SESSION["searchTerm"])) {
407
            echo "<p>Disclaimer: As an Associate we earn from qualifying purchases.</p>";
408
        }
409
        ?>
410
        <form method="post" action="/index.php">
411
            <input type="hidden" name="sessionTab" value="<?php echo MySessionHandler::getSessionTab(); ?>">
412
       	    <input type="hidden" name="searchTerm" value="<?php echo getSV("searchTerm") ?>">
413
           	<input type="hidden" name="buyerZip" value="<?php echo $_SESSION["buyer"]["Zip"];?>">
414
            <ul class="list-inline text-center">
415
                <li class="list-inline-item">
57 - 416
                    <button class="btn btn-sm bg-light text-dark" type="submit" name="submit" value="terms">Terms of Service</button>
20 - 417
                </li>
418
                <li class="list-inline-item">
57 - 419
                    <button class="btn btn-sm bg-light text-dark" type="submit" name="submit" value="privacy">Privacy Policy</button>
20 - 420
                </li>
421
            </ul>
422
        </form>
17 - 423
        <p>Copyright &#169; <?php echo @date("Y"); ?> FindCheapMusic.com. All rights reserved.</p>
2 - 424
    </footer>
425
 
58 - 426
    <script src="js/dr.min.js" integrity="sha384-421ncZqHyymCRwArqnvtPcoMUxlEwu7EsJmWksrTkHsRXQYy9UYHUc9w9fWxCMPC" crossorigin="anonymous"></script>
36 - 427
    <script>var quotes = [
38 - 428
    <?php
36 - 429
        if ($file = fopen("snippets/header.txt", "r")) {
430
            while (($line = fgets($file)) !== false) {
431
                echo "\"" . trim($line) . "\",";
432
            }
433
            fclose($file);
434
        }
435
     ?>
436
    ]; var i = 0; setInterval(function() { $("#textslide").html(quotes[i]); if (i == quotes.length) i=0; else i++; }, 5 * 1000);</script>
2 - 437
</body>
438
</html>
21 - 439
<?php MySessionHandler::commit(session_id()); ?>