2 |
- |
1 |
<?php
|
7 |
- |
2 |
include_once('php/sessions_db.php');
|
|
|
3 |
include_once('php/cryptor.php');
|
|
|
4 |
|
2 |
- |
5 |
if ($_SERVER["SERVER_NAME"] == "www.findcheapmusic.com") {
|
5 |
- |
6 |
header("Strict-Transport-Security: max-age=31536000; includeSubDomains; preload");
|
|
|
7 |
header("X-Content-Type-Options: nosniff");
|
|
|
8 |
header("X-XSS-Protection: 1; mode=block");
|
|
|
9 |
header("Access-Control-Allow-Origin: *");
|
|
|
10 |
header("Referrer-Policy: no-referrer");
|
|
|
11 |
header("X-Frame-Options: SAMEORIGIN");
|
|
|
12 |
header("Set-Cookie: ^(.*)$ $1;HttpOnly;Secure");
|
|
|
13 |
header("Content-Security-Policy: default-src 'none'; font-src https://use.fontawesome.com; form-action 'self'; img-src 'self' data: https://thumbs1.ebaystatic.com https://thumbs2.ebaystatic.com https://thumbs3.ebaystatic.com https://thumbs4.ebaystatic.com; script-src 'self' 'unsafe-inline' https://ajax.googleapis.com/ajax/libs/jquery/3.4.0/jquery.min.js https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js; style-src 'self' 'unsafe-inline' https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/ https://use.fontawesome.com/releases/v5.8.1/css/;frame-ancestors 'self'");
|
2 |
- |
14 |
}
|
|
|
15 |
|
7 |
- |
16 |
$configFile = parse_ini_file("../MyFiles/config/cheapmusic.ini",true);
|
|
|
17 |
$crypt = Cryptor::getInstance($configFile['cryptor']);
|
|
|
18 |
$tmpSessionTab = (isset($_POST["sessionTab"]) && $_POST["sessionTab"] > 0 ? $_POST["sessionTab"] : null);
|
|
|
19 |
$handler = MySessionHandler::getInstance($tmpSessionTab, $configFile['mysqli']);
|
|
|
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);
|
2 |
- |
25 |
session_start();
|
|
|
26 |
?>
|
|
|
27 |
<!DOCTYPE html>
|
|
|
28 |
<html lang="en-US">
|
|
|
29 |
<head>
|
|
|
30 |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
|
|
31 |
<title>Find Cheap Music...</title>
|
|
|
32 |
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
|
33 |
<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">
|
|
|
34 |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.0/jquery.min.js" integrity="sha384-JUMjoW8OzDJw4oFpWIB2Bu/c6768ObEthBMVSiIx4ruBIEdyNSUQAjJNFqT5pnJ6" crossorigin="anonymous"></script>
|
|
|
35 |
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
|
|
|
36 |
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
|
6 |
- |
37 |
<link rel="stylesheet" href="css/style.min.css" integrity="sha384-zfDdfwK/GMKsN/HIVw5QfYNpAuPYAhtEwYs/IFiDiboUBjXRjHpjPt1gdNtJgAWA" crossorigin="anonymous">
|
3 |
- |
38 |
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.1/css/all.css" integrity="sha384-50oBUHEmvpQ+1lW4y57PTFmhCaXp0ML5d60M1M7uH2+nqUivzIebhndOJK28anvf" crossorigin="anonymous">
|
2 |
- |
39 |
<!-- Global site tag (gtag.js) - Google Analytics -->
|
|
|
40 |
<!--script async src="https://www.googletagmanager.com/gtag/js?id=UA-138428761-2"></script-->
|
|
|
41 |
<!--script src="/js/gtag.js" integrity="sha384-ZoAmOe9K3AXr6ONEK6njtE/HMsMvyjck9EfsgXdZLG7rEiz5GqXEk3RQc2cFIRNY" crossorigin="anonymous"></script-->
|
|
|
42 |
</head>
|
|
|
43 |
<body>
|
|
|
44 |
|
|
|
45 |
<?php
|
|
|
46 |
include_once('php/clsLibGTIN.php');
|
|
|
47 |
include_once('php/tools.php');
|
|
|
48 |
|
5 |
- |
49 |
initSessionVariables();
|
2 |
- |
50 |
|
|
|
51 |
if ($_SERVER["REQUEST_METHOD"] == "POST") {
|
5 |
- |
52 |
if ($_POST["submit"] == "Search") {
|
|
|
53 |
$zip = sanitizeInput($_POST['buyerZip']);
|
|
|
54 |
if (strlen($zip) == 5 && preg_match("/^[0-9 ]*$/", $zip)) {
|
|
|
55 |
$_SESSION["buyer"]["Zip"] = $zip;
|
|
|
56 |
} else if (strlen($zip) == 0) {
|
|
|
57 |
$_SESSION["buyer"]["Zip"] = "";
|
|
|
58 |
}
|
2 |
- |
59 |
|
5 |
- |
60 |
if (empty($_POST["searchTerm"])) {
|
|
|
61 |
$_SESSION["searchTerm"] = "";
|
|
|
62 |
$_SESSION["resultArr"] = [];
|
|
|
63 |
} else {
|
|
|
64 |
$_SESSION["searchTerm"] = sanitizeInput($_POST["searchTerm"]);
|
2 |
- |
65 |
|
5 |
- |
66 |
if (checkSearchFilters()) {
|
|
|
67 |
performSearch();
|
|
|
68 |
}
|
|
|
69 |
}
|
|
|
70 |
} else if ($_POST["submit"] == "Save") {
|
|
|
71 |
$_SESSION["filterCondition"]["New"] = checkPV("filterConditionNew");
|
|
|
72 |
$_SESSION["filterCondition"]["Used"] = checkPV("filterConditionUsed");
|
|
|
73 |
$_SESSION["filterMediaType"]["CD"] = checkPV("filterMediaTypeCD");
|
|
|
74 |
$_SESSION["filterMediaType"]["Record"] = checkPV("filterMediaTypeRecord");
|
|
|
75 |
$_SESSION["filterMediaType"]["Digital"] = checkPV("filterMediaTypeDigital");
|
2 |
- |
76 |
|
5 |
- |
77 |
if (checkSearchFilters()) {
|
|
|
78 |
performSearch();
|
|
|
79 |
}
|
|
|
80 |
} else if (in_array($_POST["submit"], $buttonArr)) {
|
|
|
81 |
$_SESSION["currentView"] = $_POST["submit"];
|
|
|
82 |
filterResults();
|
|
|
83 |
}
|
|
|
84 |
} else if ($_SERVER["REQUEST_METHOD"] == "GET") {
|
|
|
85 |
$_SESSION["buyer"]["Zip"] = "";
|
|
|
86 |
if (isset($_GET['z'])) {
|
|
|
87 |
$zip = sanitizeInput($_GET['z']);
|
|
|
88 |
if (strlen($zip) == 5 && preg_match("/^[0-9 ]*$/", $zip)) {
|
|
|
89 |
$_SESSION["buyer"]["Zip"] = $zip;
|
|
|
90 |
}
|
|
|
91 |
}
|
2 |
- |
92 |
|
5 |
- |
93 |
if (isset($_GET['q'])) {
|
|
|
94 |
$_SESSION["searchTerm"] = sanitizeInput($_GET["q"]);
|
|
|
95 |
if (checkSearchFilters()) {
|
|
|
96 |
performSearch();
|
|
|
97 |
}
|
|
|
98 |
} else {
|
|
|
99 |
$_SESSION["searchTerm"] = "";
|
|
|
100 |
}
|
2 |
- |
101 |
}
|
|
|
102 |
?>
|
|
|
103 |
|
|
|
104 |
<nav class="navbar navbar-expand-sm bg-dark navbar-dark">
|
|
|
105 |
<a class="navbar-brand" href="#">Home</a>
|
|
|
106 |
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#collapsibleNavbar">
|
|
|
107 |
<span class="navbar-toggler-icon"></span>
|
|
|
108 |
</button>
|
|
|
109 |
<div class="collapse navbar-collapse" id="collapsibleNavbar">
|
|
|
110 |
<ul class="navbar-nav">
|
|
|
111 |
<li class="nav-item">
|
|
|
112 |
<a class="nav-link" href="terms.html">Terms of Service</a>
|
|
|
113 |
</li>
|
|
|
114 |
<li class="nav-item">
|
|
|
115 |
<a class="nav-link" href="privacy.html">Privacy Policy</a>
|
|
|
116 |
</li>
|
|
|
117 |
</ul>
|
|
|
118 |
</div>
|
|
|
119 |
</nav>
|
|
|
120 |
|
3 |
- |
121 |
<div class="page-header bg-primary">
|
|
|
122 |
<div class="container text-center py-3">
|
2 |
- |
123 |
<h1>Find Cheap Music...</h1>
|
4 |
- |
124 |
<p class="d-none d-sm-block">Find the cheapest music online. Advertisement free website.</p>
|
2 |
- |
125 |
</div>
|
|
|
126 |
</div>
|
|
|
127 |
|
3 |
- |
128 |
<div class="container-fluid bg-primary py-3">
|
5 |
- |
129 |
<?php
|
|
|
130 |
echo $_SESSION["filterWarnings"];
|
|
|
131 |
?>
|
2 |
- |
132 |
<form method="post" action="/index.php"
|
|
|
133 |
onsubmit="document.getElementById('search').innerHTML = '<span class=\'spinner-border spinner-border-sm\'></span> Searching, please wait...';">
|
7 |
- |
134 |
<input type="hidden" name="sessionTab" value="<?php echo $handler->getSessionTab(); ?>">
|
2 |
- |
135 |
<div class="input-group mb-3">
|
|
|
136 |
<div class="input-group-prepend">
|
4 |
- |
137 |
<div class="d-none d-sm-block">
|
|
|
138 |
<button class="btn input-group-text mx-1 rounded" type="button" data-toggle="modal" data-target="#searchInfoModal"><i class="fas fa-info-circle" style="font-size:25px"></i></button>
|
|
|
139 |
</div>
|
|
|
140 |
<button class="btn input-group-text mx-1 rounded" type="button" data-toggle="modal" data-target="#filterModal" data-keyboard="false"><i class="fas fa-filter" style='font-size:25px'></i></button>
|
2 |
- |
141 |
</div>
|
5 |
- |
142 |
<input id="searchTerm" name="searchTerm" type="text" class="form-control ml-1" placeholder="Search by Barcode, Label, Artist, Title, ..." value="<?php echo getSV("searchTerm") ?>">
|
2 |
- |
143 |
<div class="input-group-append">
|
|
|
144 |
<button id="search" type="submit" class="btn btn-success" name="submit" value="Search">Go</button>
|
|
|
145 |
</div>
|
|
|
146 |
</div>
|
4 |
- |
147 |
<div class="input-group input-group-sm mb-3 col-xl-5 col-lg-7 col-md-12 col-sm-12 col-12">
|
2 |
- |
148 |
<div class="input-group-prepend input-group-sm">
|
4 |
- |
149 |
<!--span class="input-group-text mx-1">Shipping to:</span-->
|
|
|
150 |
<label class="mr-2">Shipping to:</label>
|
2 |
- |
151 |
</div>
|
4 |
- |
152 |
<div class="d-none d-sm-inline-flex">
|
|
|
153 |
<input type="text" class="form-control form-control-sm mx-1" maxlength="20" style="width:12em!important" id="buyerCountry" name="buyerCountry" value="United States" readonly>
|
|
|
154 |
<input type="text" class="form-control form-control-sm mx-1" maxlength="3" style="width:3.5em!important" id="buyerCurrency" name="buyerCurrency" value="USD" readonly>
|
|
|
155 |
</div>
|
5 |
- |
156 |
<input type="text" class="form-control form-control-sm mx-1" maxlength="5" style="width:2.5em!important" id="buyerZip" name="buyerZip" placeholder="Zip Code" value="<?php echo $_SESSION["buyer"]["Zip"];?>">
|
2 |
- |
157 |
<?php
|
5 |
- |
158 |
if ($_SESSION["buyer"]["Zip"] == '') {
|
4 |
- |
159 |
echo '<div class="input-group-append input-group-sm mx-1 rounded">';
|
5 |
- |
160 |
echo ' <i class="fas fa-exclamation-triangle input-group-text img-fluid rounded" style="font-size:14px;color:orange;" title="Please enter your postal code to get the accurate shipping cost for items listed using a shipping rate table." data-toggle="tooltip" data-placement="auto" data-delay="100"></i>';
|
|
|
161 |
echo '</div>';
|
|
|
162 |
}
|
2 |
- |
163 |
?>
|
|
|
164 |
</div>
|
|
|
165 |
</form>
|
|
|
166 |
</div>
|
|
|
167 |
|
5 |
- |
168 |
<?php
|
|
|
169 |
echo printTableHeader();
|
|
|
170 |
echo buildTable();
|
|
|
171 |
echo printSearchFilterModal();
|
|
|
172 |
echo printSearchInfoModal();
|
|
|
173 |
?>
|
2 |
- |
174 |
|
|
|
175 |
<footer class="container-fluid text-center">
|
|
|
176 |
<p>Disclaimer: As an Associate we earn from qualifying purchases.</p>
|
|
|
177 |
<p>Copyright © 2019 FindCheapMusic.com. All rights reserved.</p>
|
|
|
178 |
</footer>
|
|
|
179 |
|
6 |
- |
180 |
<script src="/js/dr.min.js" integrity="sha384-EtIwzuKAwnONywwaqKOYs3eD2KXe6HrxJ1Ako6N6cR5LHyrLhKsaxBuSbkJhhtEH" crossorigin="anonymous"></script>
|
2 |
- |
181 |
</body>
|
|
|
182 |
</html>
|