-
Notifications
You must be signed in to change notification settings - Fork 0
/
view_content.php
237 lines (222 loc) · 7.82 KB
/
view_content.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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
<?php
define('myeshop', true);
include 'include/db_connect.php';
include 'functions/functions.php';
session_start();
include 'include/auth_cookie.php';
$id = clear_string($_GET["id"]);
$seoquery = mysql_query("SELECT seo_words,seo_description FROM table_products WHERE products_id='$id' AND visible='1'",$link);
If (mysql_num_rows($seoquery) > 0)
{
$resquery = mysql_fetch_array($seoquery);
}
If ($id != $_SESSION['countid'])
{
$querycount = mysql_query("SELECT count FROM table_products WHERE products_id='$id'",$link);
$resultcount = mysql_fetch_array($querycount);
$newcount = $resultcount["count"] + 1;
$update = mysql_query ("UPDATE table_products SET count='$newcount' WHERE products_id='$id'",$link);
}
$_SESSION['countid'] = $id;
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link rel="icon" type="image/png" href="favicon-96x96.png" sizes="96x96">
<meta name="Description" content="<? echo $resquery["seo_description"]; ?>">
<meta name="keywords" content="<? echo $resquery["seo_words"]; ?>">
<link rel="stylesheet" href="css/reset.css">
<link rel="stylesheet" href="css/style.css">
<link rel="stylesheet" href="trackbar/trackbar.css">
<script src="/js/jquery-1.8.2.min.js"></script>
<script src="/js/jquery.elevateZoom-3.0.8.min.js"></script>
<script src="/js/jcarousellite_1.0.1.js"></script>
<script src="/js/eshop-script.js"></script>
<script src="/js/jquery.cookie.min.js"></script>
<script src="/trackbar/jquery.trackbar.js"></script>
<script src="/js/TextChange.js"></script>
<link rel="stylesheet" href="fancybox/jquery.fancybox.css">
<script src="/fancybox/jquery.fancybox.js"></script>
<script src="/js/jTabs.js"></script>
<title>Интернет магазин Косметики</title>
<script>
$(document).ready(function(){
$("ul.tabs").jTabs({content: ".tabs_content", animate: true, effect:"fade"});
$(".image-modal").fancybox();
$(".send-review").fancybox();
});
</script>
</head>
<body>
<?php include_once 'include/google-analytics.php'; ?>
<div id="block-body">
<?php
include 'include/block-header.php';
?>
<div id="block-right">
<?php
include 'include/block-category.php';
include 'include/block-parfume.php';
include 'include/block-parameter.php';
include 'include/block-news.php';
?>
</div>
<div id="block-content">
<?php
$result1 = mysql_query("SELECT * FROM table_products WHERE products_id = '$id' AND visible = '1'",$link);
if (mysql_num_rows($result1) > 0)
{
$row1 = mysql_fetch_array($result1);
do
{
if (strlen($row1["image"]) > 0 && file_exists("./upload_images/".$row1["image"]))
{
$img_path = './upload_images/'.$row1["image"];
$max_width = 350;
$max_height = 350;
list($width, $height) = getimagesize($img_path);
$ratioh = $max_height/$height;
$ratiow = $max_width/$width;
$ratio = min($ratioh, $ratiow);
$width = intval($ratio*$width);
$height = intval($ratio*$height);
}else
{
$img_path = "/images/no-image.png";
$width = 110;
$height = 200;
}
if (strlen($row1["image_large"]) > 0 && file_exists("./upload_images/large/".$row1["image_large"]))
{
$img_path_large = './upload_images/large/'.$row1["image_large"];
}
// Количество отзывов
$query_reviews = mysql_query("SELECT * FROM table_reviews WHERE products_id = '$id' AND moderate='1'",$link);
$count_reviews = mysql_num_rows($query_reviews);
echo '
<div id="block-breadcrumbs-and-rating">
<p id="nav-breadcrumbs"><a href="view_cat.php?type=makeup">Макияж</a> \ <span>'.$row1["brand"].'</span></p>
<div id="block-like">
<p id="likegood" tid="'.$id.'">Нравиться</p>
<p id="likegoodcount">'.$row1["yes_like"].'</p>
</div>
</div>
<div id="block-content-info"><img id="zoom" src="'.$img_path.'" width="'.$width.'" height="'.$height.'" data-zoom-image="'.$img_path_large.'">
<div id="block-mini-description">
<p id="content-title">'.$row1["title"].'</p>
<ul class="reviews-and-counts-content">
<li><img src="/images/eye-icon.png"><p>'.$row1["count"].'</p></li>
<li><img src="/images/comment-icon.png"><p>'.$count_reviews.'</p></li>
</ul>
<p id="style-price">'.group_numerals($row1["price"]).' сом</p>
<a class="add-cart" id="add-cart-view" tid="'.$row1["products_id"].'"></a>
<p id="content-text">'.$row1["mini_description"].'</p>
</div>
</div>
';
}
while ($row1 = mysql_fetch_array($result1));
$result = mysql_query("SELECT * FROM upload_images WHERE products_id='$id'",$link);
If (mysql_num_rows($result) > 0)
{
$row = mysql_fetch_array($result);
echo '<div id="block-img-slide"><ul>';
do
{
$img_path = './upload_images/'.$row["image"];
$max_width = 70;
$max_height = 70;
list($width, $height) = getimagesize($img_path);
$ratioh = $max_height/$height;
$ratiow = $max_width/$width;
$ratio = min($ratioh, $ratiow);
$width = intval($ratio*$width);
$height = intval($ratio*$height);
// Комментарии отзывы итд
echo '
<li>
<a class="image-modal" href="#image'.$row["id"].'"><img src="'.$img_path.'" width="'.$width.'" height="'.$height.'"></a>
</li>
<a style="display:none;" class="image-modal" rel="group" id="image'.$row["id"].'" ><img src="./upload_images/'.$row["image"].'"></a>
';
}
while ($row = mysql_fetch_array($result));
echo '
</ul>
</div>
';
}
$result = mysql_query("SELECT * FROM table_products WHERE products_id='$id' AND visible='1'",$link);
$row = mysql_fetch_array($result);
echo '
<ul class="tabs">
<li><a class="active" href="#" >Описание</a></li>
<li><a href="#" >Как применять</a></li>
<li><a href="#" >Состав</a></li>
<li><a href="#" >Отзывы</a></li>
</ul>
<div class="tabs_content">
<div>'.$row["description"].'</div>
<div>'.$row["how_to_use"].'</div>
<div>'.$row["features"].'</div>
<div>
<p id="link-send-review" ><a class="send-review" href="#send-review">Написать отзыв</a></p>
';
$query_reviews = mysql_query("SELECT * FROM table_reviews WHERE products_id='$id' AND moderate='1' ORDER BY reviews_id DESC",$link);
If (mysql_num_rows($query_reviews) > 0)
{
$row_reviews = mysql_fetch_array($query_reviews);
do
{
echo '
<div class="block-reviews" >
<p class="author-date" ><strong>'.$row_reviews["name"].'</strong>, '.$row_reviews["date"].'</p>
<img src="/images/plus-reviews.png">
<p class="textrev" >'.$row_reviews["good_reviews"].'</p>
<img src="/images/minus-reviews.png">
<p class="textrev" >'.$row_reviews["bad_reviews"].'</p>
<p class="text-comment">'.$row_reviews["comment"].'</p>
</div>
';
}
while ($row_reviews = mysql_fetch_array($query_reviews));
}
else
{
echo '<p class="title-no-info" >Отзывов нет</p>';
}
echo '
</div>
</div>
<div id="send-review" >
<p align="right" id="title-review">Публикация отзыва производится после предварительной модерации.</p>
<ul>
<li><p align="right"><label id="label-name" >Имя<span>*</span></label><input maxlength="15" type="text" id="name_review"></p></li>
<li><p align="right"><label id="label-good" >Достоинства<span>*</span></label><textarea id="good_review"></textarea></p></li>
<li><p align="right"><label id="label-bad" >Недостатки<span>*</span></label><textarea id="bad_review" ></textarea></p></li>
<li><p align="right"><label id="label-comment" >Комментарий</label><textarea id="comment_review"></textarea></p></li>
</ul>
<p id="reload-img"><img src="/images/loading.gif"></p> <p id="button-send-review" iid="'.$id.'" ></p>
</div>
';
}
?>
</div>
<?php
include 'include/block-random.php';
include 'include/block-footer.php';
?>
</div>
<script>
$("#zoom").elevateZoom({
zoomWindowFadeIn: 500,
zoomWindowFadeOut: 500,
lensFadeIn: 500,
lensFadeOut: 500,
zoomType : "lens",
lensSize : 220
});
</script>
</body>
</html>