2 |
- |
1 |
<?php
|
|
|
2 |
if ($_SERVER["SERVER_NAME"] == "www.findcheapmusic.com") {
|
|
|
3 |
header("Strict-Transport-Security: max-age=31536000; includeSubDomains; preload");
|
|
|
4 |
header("X-Content-Type-Options: nosniff");
|
|
|
5 |
header("X-XSS-Protection: 1; mode=block");
|
|
|
6 |
header("Access-Control-Allow-Origin: *");
|
|
|
7 |
header("Referrer-Policy: no-referrer");
|
|
|
8 |
header("X-Frame-Options: SAMEORIGIN");
|
|
|
9 |
header("Set-Cookie: ^(.*)$ $1;HttpOnly;Secure");
|
3 |
- |
10 |
header("Content-Security-Policy: default-src 'none';font-src https://use.fontawesome.com/releases/v5.8.1/webfonts/; frame-src https://googleads.g.doubleclick.net; img-src 'self' https://rover.ebay.com https://thumbs1.ebaystatic.com https://thumbs2.ebaystatic.com https://thumbs3.ebaystatic.com https://thumbs4.ebaystatic.com; script-src 'self' 'unsafe-inline' https://epnt.ebay.com/static/epn-smart-tools.js https://adservice.google.com/adsid/integrator.js 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 https://pagead2.googlesyndication.com/pagead/js/r20190415/r20190131/show_ads_impl.js https://pagead2.googlesyndication.com/pub-config/r20160913/ca-pub-8487504570542589.js https://www.findcheapmusic.com/js/adsbygoogle.js https://www.findcheapmusic.com/js/googleads.js https://www.googletagmanager.com/gtag/js https://www.findcheapmusic.com/js/tooltip.js https://www.findcheapmusic.com/js/disableSubmit.js https://www.googletagservices.com/activeview/js/current/osd.js; style-src 'unsafe-inline' https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/ https://www.findcheapmusic.com/css/ https://use.fontawesome.com/releases/v5.8.1/css/;frame-ancestors 'self'");
|
2 |
- |
11 |
}
|
|
|
12 |
|
|
|
13 |
ini_set("session.cookie_httponly", 1);
|
|
|
14 |
ini_set("session.cookie_secure", 1);
|
|
|
15 |
session_start();
|
|
|
16 |
?>
|
|
|
17 |
<!DOCTYPE html>
|
|
|
18 |
<html lang="en-US">
|
|
|
19 |
<head>
|
|
|
20 |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
|
|
21 |
<title>Find Cheap Music...</title>
|
|
|
22 |
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
|
23 |
<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">
|
|
|
24 |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.0/jquery.min.js" integrity="sha384-JUMjoW8OzDJw4oFpWIB2Bu/c6768ObEthBMVSiIx4ruBIEdyNSUQAjJNFqT5pnJ6" crossorigin="anonymous"></script>
|
|
|
25 |
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
|
|
|
26 |
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
|
3 |
- |
27 |
<link rel="stylesheet" href="css/style.css" integrity="sha384-NRDSk3fYlDJJckInLsqRrYM9x0GE9dRVOk9FYV9/Z0xi48M56JicV8X2XpnkIPrE" crossorigin="anonymous">
|
|
|
28 |
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.1/css/all.css" integrity="sha384-50oBUHEmvpQ+1lW4y57PTFmhCaXp0ML5d60M1M7uH2+nqUivzIebhndOJK28anvf" crossorigin="anonymous">
|
2 |
- |
29 |
<!-- Global site tag (gtag.js) - Google Analytics -->
|
|
|
30 |
<!--script async src="https://www.googletagmanager.com/gtag/js?id=UA-138428761-2"></script-->
|
|
|
31 |
<!--script src="/js/gtag.js" integrity="sha384-ZoAmOe9K3AXr6ONEK6njtE/HMsMvyjck9EfsgXdZLG7rEiz5GqXEk3RQc2cFIRNY" crossorigin="anonymous"></script-->
|
|
|
32 |
</head>
|
|
|
33 |
<body>
|
|
|
34 |
|
|
|
35 |
<?php
|
|
|
36 |
include_once('php/clsLibGTIN.php');
|
|
|
37 |
include_once('php/tools.php');
|
|
|
38 |
|
|
|
39 |
$filterWarnings = '';
|
|
|
40 |
|
|
|
41 |
initSV("buyerCountry", "United States");
|
|
|
42 |
initSV("buyerCurrency", "USD");
|
|
|
43 |
initSV("filterConditionNew", true);
|
|
|
44 |
initSV("filterConditionUsed", true);
|
|
|
45 |
initSV("filterMediaTypeCD", true);
|
|
|
46 |
initSV("filterMediaTypeRecord", false);
|
|
|
47 |
initSV("filterMediaTypeDigital", false);
|
|
|
48 |
|
|
|
49 |
if ($_SERVER["REQUEST_METHOD"] == "POST") {
|
|
|
50 |
////echo "<pre>"; print_r($_POST); print_r($_SESSION); echo "</pre>";
|
|
|
51 |
if ($_POST["submit"] == "Search") {
|
|
|
52 |
$zip = test_input($_POST['buyerZip']);
|
|
|
53 |
if (strlen($zip) == 5 && preg_match("/^[0-9 ]*$/",$zip)) {
|
|
|
54 |
$_SESSION["buyerZip"] = $zip;
|
|
|
55 |
} else if (strlen($zip) == 0) {
|
|
|
56 |
unset($_SESSION["buyerZip"]);
|
|
|
57 |
}
|
|
|
58 |
|
|
|
59 |
if (empty($_POST["upc"])) {
|
|
|
60 |
// ???
|
|
|
61 |
} else {
|
|
|
62 |
$_SESSION["searchTerm"] = test_input($_POST["upc"]);
|
|
|
63 |
|
|
|
64 |
$barcodeType = clsLibGTIN::GTINCheck($_SESSION["searchTerm"], false, 1);
|
|
|
65 |
$barcodeValue = clsLibGTIN::GTINCheck($_SESSION["searchTerm"]);
|
|
|
66 |
|
|
|
67 |
$arr = [];
|
|
|
68 |
$arr = searchAll($_SESSION["searchTerm"]);
|
|
|
69 |
|
|
|
70 |
// $arr2 = filterTable($arr);
|
|
|
71 |
$_SESSION["lowUsed"] = findLowest($arr, "Used");
|
|
|
72 |
$_SESSION["lowNew"] = findLowest($arr, "New");
|
|
|
73 |
$_SESSION["lowDigital"] = findLowest($arr, "Digital");
|
|
|
74 |
$_SESSION["itemTable"] = buildTable($arr);
|
|
|
75 |
}
|
|
|
76 |
} else if ($_POST["submit"] == "Save") {
|
|
|
77 |
$_SESSION["filterConditionNew"] = checkPV("filterConditionNew");
|
|
|
78 |
$_SESSION["filterConditionUsed"] = checkPV("filterConditionUsed");
|
|
|
79 |
$_SESSION["filterMediaTypeCD"] = checkPV("filterMediaTypeCD");
|
|
|
80 |
$_SESSION["filterMediaTypeRecord"] = checkPV("filterMediaTypeRecord");
|
|
|
81 |
$_SESSION["filterMediaTypeDigital"] = checkPV("filterMediaTypeDigital");
|
|
|
82 |
|
|
|
83 |
$filterError = false;
|
|
|
84 |
if (!$_SESSION["filterConditionNew"] && !$_SESSION["filterConditionUsed"]) {
|
|
|
85 |
$filterWarnings .= '<div class="alert alert-danger">Please select at least one Condition (New or Used)</div>';
|
|
|
86 |
$filterError = true;
|
|
|
87 |
}
|
|
|
88 |
|
|
|
89 |
if (!$_SESSION["filterMediaTypeCD"] && !$_SESSION["filterMediaTypeRecord"] && !$_SESSION["filterMediaTypeDigital"]) {
|
|
|
90 |
$filterWarnings .= '<div class="alert alert-danger">Please select at least one Media Type (CD, Record or Digital)</div>';
|
|
|
91 |
$filterError = true;
|
|
|
92 |
}
|
|
|
93 |
|
|
|
94 |
if (!$filterError) {
|
|
|
95 |
// BUGBUG avoid re-search
|
|
|
96 |
$arr = [];
|
|
|
97 |
$arr = searchAll($_SESSION["searchTerm"]);
|
|
|
98 |
$_SESSION["lowUsed"] = findLowest($arr, "Used");
|
|
|
99 |
$_SESSION["lowNew"] = findLowest($arr, "New");
|
|
|
100 |
$_SESSION["lowDigital"] = findLowest($arr, "Digital");
|
|
|
101 |
$_SESSION["itemTable"] = buildTable($arr);
|
|
|
102 |
|
|
|
103 |
// $arr2 = filterTable($arr);
|
|
|
104 |
// $_SESSION["lowUsed"] = findLowest($arr2, "Used");
|
|
|
105 |
// $_SESSION["lowNew"] = findLowest($arr2, "New");
|
|
|
106 |
// $_SESSION["lowDigital"] = findLowest($arr2, "Digital");
|
|
|
107 |
// $_SESSION["itemTable"] = buildTable($arr2);
|
|
|
108 |
}
|
|
|
109 |
}
|
3 |
- |
110 |
} else if ($_SERVER["REQUEST_METHOD"] == "GET") {
|
|
|
111 |
//echo '<pre>'; print_r($_GET); echo '</pre>';
|
2 |
- |
112 |
}
|
|
|
113 |
?>
|
|
|
114 |
|
|
|
115 |
<nav class="navbar navbar-expand-sm bg-dark navbar-dark">
|
|
|
116 |
<a class="navbar-brand" href="#">Home</a>
|
|
|
117 |
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#collapsibleNavbar">
|
|
|
118 |
<span class="navbar-toggler-icon"></span>
|
|
|
119 |
</button>
|
|
|
120 |
<div class="collapse navbar-collapse" id="collapsibleNavbar">
|
|
|
121 |
<ul class="navbar-nav">
|
|
|
122 |
<li class="nav-item">
|
|
|
123 |
<a class="nav-link" href="terms.html">Terms of Service</a>
|
|
|
124 |
</li>
|
|
|
125 |
<li class="nav-item">
|
|
|
126 |
<a class="nav-link" href="privacy.html">Privacy Policy</a>
|
|
|
127 |
</li>
|
|
|
128 |
</ul>
|
|
|
129 |
</div>
|
|
|
130 |
</nav>
|
|
|
131 |
|
3 |
- |
132 |
<div class="page-header bg-primary">
|
|
|
133 |
<div class="container text-center py-3">
|
2 |
- |
134 |
<h1>Find Cheap Music...</h1>
|
|
|
135 |
<p class="hide-small">Find the cheapest music online. Advertisement free website.</p>
|
|
|
136 |
</div>
|
|
|
137 |
</div>
|
|
|
138 |
|
3 |
- |
139 |
<div class="container-fluid bg-primary py-3">
|
2 |
- |
140 |
<?php echo $filterWarnings; ?>
|
|
|
141 |
<form method="post" action="/index.php"
|
|
|
142 |
onsubmit="document.getElementById('search').innerHTML = '<span class=\'spinner-border spinner-border-sm\'></span> Searching, please wait...';">
|
|
|
143 |
<div class="input-group mb-3">
|
|
|
144 |
<div class="input-group-prepend">
|
3 |
- |
145 |
<span title="Search Tips" data-toggle="tooltip" data-placement="top"><a class="input-group-text" data-toggle="modal" href="#searchInfoModal"><i class="fas fa-info-circle" style="font-size:25px"></i></a></span>
|
|
|
146 |
<span title="Search Filter" data-toggle="tooltip" data-placement="top"><a class="input-group-text" data-toggle="modal" href="#filterModal" data-keyboard="false"><i class="fas fa-filter" style='font-size:25px'></i></a></span>
|
2 |
- |
147 |
</div>
|
|
|
148 |
<input name="upc" type="text" class="form-control" placeholder="Search by Barcode, Label, Artist, Title, ..." value="<?php echo getSV("searchTerm") ?>">
|
|
|
149 |
<div class="input-group-append">
|
|
|
150 |
<button id="search" type="submit" class="btn btn-success" name="submit" value="Search">Go</button>
|
|
|
151 |
</div>
|
|
|
152 |
</div>
|
|
|
153 |
<div class="input-group input-group-sm mb-3">
|
|
|
154 |
<div class="input-group-prepend input-group-sm">
|
|
|
155 |
<input type="text" class="form-control border-0" maxlength="12" size="12" placeholder="Shipping to:">
|
|
|
156 |
<input type="text" class="form-control" maxlength="20" size="20" id="buyerCountry" name="buyerCountry" value="United States" readonly>
|
|
|
157 |
<input type="text" class="form-control" maxlength="3" size="3" id="buyerCurrency" name="buyerCurrency" value="USD" readonly>
|
|
|
158 |
<input type="text" class="form-control" maxlength="5" size="5" id="buyerZip" name="buyerZip" placeholder="Zip Code" value="<?php echo getSV('buyerZip'); ?>">
|
|
|
159 |
</div>
|
|
|
160 |
<?php
|
|
|
161 |
if (getSV('buyerZip') == '') {
|
|
|
162 |
echo '<div class="input-group-append input-group-sm">';
|
3 |
- |
163 |
echo ' <i class="fas fa-exclamation-triangle input-group-text img-fluid" 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>';
|
2 |
- |
164 |
echo '</div>'; }
|
|
|
165 |
?>
|
|
|
166 |
</div>
|
|
|
167 |
<div class="input-group mb-3">
|
|
|
168 |
</div>
|
|
|
169 |
</form>
|
|
|
170 |
</div>
|
|
|
171 |
|
|
|
172 |
<?php
|
|
|
173 |
|
|
|
174 |
echo printTableHeader();
|
|
|
175 |
echo getSV("itemTable");
|
|
|
176 |
echo printSearchFilterModal();
|
3 |
- |
177 |
echo printSearchInfoModal();
|
2 |
- |
178 |
?>
|
|
|
179 |
|
|
|
180 |
<footer class="container-fluid text-center">
|
|
|
181 |
<p>Disclaimer: As an Associate we earn from qualifying purchases.</p>
|
|
|
182 |
<p>Copyright © 2019 FindCheapMusic.com. All rights reserved.</p>
|
|
|
183 |
</footer>
|
|
|
184 |
|
|
|
185 |
<script src="/js/tooltip.js" integrity="sha384-RySBj8L2blcDPtmumEPwxSRsRne8Rb6+H1mTTeCZ6/Zo3VJR1FRHn3XG1NgYqYx+" crossorigin="anonymous"></script>
|
|
|
186 |
<script src="/js/disableSubmit.js" integrity="sha384-bWbxxiPngRC4S0dntyF76TZxF3MQ9rc7ebUKhHzn7UnyTpED8UmWRMpDPwceXtWV" crossorigin="anonymous"></script>
|
|
|
187 |
</body>
|
|
|
188 |
</html>
|