-
Notifications
You must be signed in to change notification settings - Fork 0
/
priceHistory.php
executable file
·95 lines (70 loc) · 2.59 KB
/
priceHistory.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
<?php
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
include "funcLib.php";
$iid = $_REQUEST["iid"];
$query = "SELECT title,price FROM items WHERE iid=$iid";
$rs2 = mysql_query($query) or die("Could not query: " . mysql_error());
$row2 = mysql_fetch_assoc($rs2);
$result = "<table style=\"border-collapse: collapse;\" border=\"1\" bordercolor=\"#111111\" cellpadding=\"4\" cellspacing=\"0\" bgcolor=lightYellow>";
$result .= "<tr><td colspan=2 align=center bgcolor=\"#6702cc\">";
$result .= "<font size=3 color=white>";
$result .= "<b>Amazon price history for<br><i>" . $row2["title"] . "</i></b></font></td></tr>";
if($iid){
$query = "SELECT * FROM itemPriceHistory WHERE iid=$iid ORDER BY dateChanged";
$rs2 = mysql_query($query) or die("Could not query: " . mysql_error());
$i = 1;
while($row3 = mysql_fetch_assoc($rs2)){
if($i % 2 == 0){
$bgcolor="lightYellow";
}
else{
$bgcolor="white";
}
$result .= "<tr><td bgcolor=\"$bgcolor\">" . parseDate($row3["dateChanged"]) . "</td><td bgcolor=\"$bgcolor\">$" . $row3["price"] . "</td></tr>";
$i++;
}
}
if($bgcolor == "lightYellow"){
$bgcolor="white";
}
else{
$bgcolor="lightYellow";
}
$result .= "<tr><td bgcolor=\"$bgcolor\">Current price</td><td bgcolor=$bgcolor>$" . $row2["price"] . "</td></tr>";
$result .= "</table>";
if($_REQUEST["js"]){
print $result;
return;
}
?>
<HTML>
<link rel=stylesheet href=style.css type=text/css>
<title>WishList Home Page</title>
<BODY>
<table cellspacing="0" cellpadding="5" width="100%" height="100%" bgcolor="#FFFFFF" nosave border="0" style="border: 1px solid rgb(128,255,128)">
<tr>
<td valign="top">
<?php
createNavBar("../index.php:Home|:Price History");
?>
<center>
<h3>On this page you can see the historical prices Amazon has charged for an item since it was added to a WishList</h3>
<?php
print $result;
?>
</center>
</td>
</tr>
</table>
</body>
</html>