-
Notifications
You must be signed in to change notification settings - Fork 2
/
wishpage.php
124 lines (98 loc) · 3.94 KB
/
wishpage.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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
<?php
session_start();
include('header_menuleft.php');
include('config.php');
$user_id = $_SESSION['user_id'];
?>
<div class="wishlist_box_body">
<h2>Wishlist</h2>
<?php
$query2 = mysql_query("SELECT * FROM wishlist WHERE user_id = '$user_id' ");
while ($row = mysql_fetch_array($query2))
{
$item_id = $row['item_id'];
$item_found;
$query3 = mysql_query("SELECT * FROM items WHERE item_id = '$item_id' ");
$endline_count=0;
while ($row = mysql_fetch_array($query3))
{
$item_found = 1;
$item_name_wish = $row['name'];
$owner_id = $row['user_id'];
$item_id = $row['item_id'];
$user_id = $row['user_id'];
$creation_date = $row['creation_date'];
$expiration_date = $row['expiration_date'];
$status = $row['status'];
$type = $row['type'];
$name = $row['name'];
$category_id = $row['category_id'];
$views = $row['views'];
$category_name = mysql_fetch_array(mysql_query("SELECT * FROM categories WHERE category_id = '$category_id' "));
$category_name = $category_name['category_name'];
$picture = $row['picture'];
if($picture == NULL)
$picture='images/no_image.jpg';
else
$picture="uploads/".$picture;
$query4 = mysql_query("SELECT * FROM users WHERE user_id = '$owner_id' ");
while (($row = mysql_fetch_array($query4)) && $endline_count < 10)
{
$owner_name = $row['name'];
$owner_last_name = $row['last_name'];
$endline_count++;
echo "
<div class='prod_box'>
<div class='top_prod_box'></div>
<div class='center_prod_box blocks'>
<div class='product_title'><a href='item_page.php?id=".$item_id."'>".$name."</a></div>
<div class='product_img'><a href='item_page.php?id=".$item_id."'><img border='0' height='94' width='94' src='".$picture."'></a></div>
<div class='creation_date'>Created: <span class='creation'>".$creation_date ."</span></div>
<div class='expiration_date'>Expires: <span class='expiration'>".$expiration_date ."</span></div>
<div class='created_by'>By: <span class='user'>".$owner_name." ".$owner_last_name."</span></div>
<div class='views_product'>Views: <span class='views'>".$views ."</span></div>
<div class='category_name'>Category: <span class='category'>".$category_name ."</span></div>
</div>
<div class='bottom_prod_box'></div>
</div>
";
}
}
}
if ($item_found != 1)
echo "Sorry, there are no items in your wishlist!";
?>
</div>
<script>
var currentTallest = 0,
currentRowStart = 0,
rowDivs = new Array(),
$el,
topPosition = 0;
$('.blocks').each(function() {
$el = $(this);
topPostion = $el.position().top;
if (currentRowStart != topPostion) {
// we just came to a new row. Set all the heights on the completed row
for (currentDiv = 0 ; currentDiv < rowDivs.length ; currentDiv++) {
rowDivs[currentDiv].height(currentTallest);
}
// set the variables for the new row
rowDivs.length = 0; // empty the array
currentRowStart = topPostion;
currentTallest = $el.height();
rowDivs.push($el);
} else {
// another div on the current row. Add it to the list and check if it's taller
rowDivs.push($el);
currentTallest = (currentTallest < $el.height()) ? ($el.height()) : (currentTallest);
}
// do the last row
for (currentDiv = 0 ; currentDiv < rowDivs.length ; currentDiv++) {
rowDivs[currentDiv].height(currentTallest);
}
})
</script>
<?php
include('footer.php');
?>