-
Notifications
You must be signed in to change notification settings - Fork 1
/
best_arrival.php
94 lines (70 loc) · 3.96 KB
/
best_arrival.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
<?php
session_start();
$text_show=$_SESSION["text_show"] ;
$subcat=$_SESSION["subcat"] ;
include('pager.php');
$id=$_GET['goods_Id'];
require_once('wp-admin/include/connectdb.php');
$value = $_POST['param7'];
$productnum=$_POST['productnum'];
$count_value =count($value);
//echo $count_value;
if($subcat == '')
{
$a= "SELECT * FROM `product` where category = '$text_show' ORDER BY `product`.`wholesale_price` DESC";
//echo "SELECT * FROM `product` where category = '$text_show' ORDER BY `product`.`wholesale_price` ASC";
}
else
{
$a= "SELECT * FROM `product` where category = '$text_show' and subcategory='$subcat' ORDER BY id DESC";
}
//for($i=1; $i < $count_value; $i++)
//{
//$a.=" or ORDER BY `product`.`wholesale_price` ASC";
//echo $a;
//}
//$a.=")";
$product_query= mysql_query(dopaging($a,$productnum));
$j=0;
$robin=mysql_query("SELECT * FROM rating where goods_id=$id ORDER BY id DESC LIMIT 3;");
//echo $product_query;
?>
<?php $c=0;
while($product_row=mysql_fetch_assoc($product_query)){
$c++;
if (strpos($product_row['images'],',') !== false) {
$product_img=explode(',',$product_row['images']);
$product_img=$product_img[0];
}
else{
$product_img=$product_row['images'];
}
$producturl1=preg_replace('/[^A-Za-z0-9\-]/', '-', $product_row['product_name']);
$producturl1=str_replace('--', '-', $producturl1);
$producturl1=strtolower(rtrim($producturl1, "-"));
?>
<div class="col-lg-4 col-md-6 col-sm-6 col-xs-12">
<div class="single-product">
<div class="product-photo" style="min-height:360px;">
<a href="/<?=$producturl1?>-<?=$product_row['id']?>.html">
<img class="primary-photo" src="/product_img/<?=$product_img?>" alt="" />
<img class="secondary-photo" src="/product_img/<?=$product_img?>" alt="" />
</a>
<div class="pro-action">
<a href="/<?=$producturl1?>-<?=$product_row['id']?>.html" class="action-btn"><i class="sp-shopping-cart"></i><span>Add to cart</span></a>
</div>
</div>
<div class="product-brief" style="min-height:130px; padding-left:2px; padding-right:0px;">
<h2><a href="/<?=$producturl1?>-<?=$product_row['id']?>.html"><?=$producturl1;?></a></h2>
<?php if(($_SESSION['i_am']=='Wholesaler' and $_SESSION['verify_status']==1) or ($_SESSION['i_am']=='ISR' and $_SESSION['verify_status']==1)) {?>
<h3 style="font-size:12px">Msrp<strike>$<?=number_format((float)$product_row['regular_price'], 2, '.', '')?></strike> <span style="font-size:14px; color:#F00;">wholesale $<?=number_format((float)$product_row['manufacture_price'], 2, '.', '')?></span> </h3>
<? }else if(($_SESSION['i_am']=='Salon' and $_SESSION['verify_status']==1)){?>
<h3 style="font-size:11px">Regular Price:<strike>$<?=number_format((float)$product_row['regular_price'], 2, '.', '')?></strike> <span style="font-size:12px; color:#F00;">Salon Price: $<?=number_format((float)$product_row['msrp_price'], 2, '.', '')?></span> </h3>
<? }else{ ?>
<h3 style="font-size:11px">Regular Price:<strike>$<?=number_format((float)$product_row['regular_price'], 2, '.', '')?></strike> <span style="font-size:14px; color:#F00;">MSRP $<?=number_format((float)$product_row['wholesale_price'], 2, '.', '')?></span> </h3>
<? }?>
</div>
</div>
</div>
<!-- Single-product end -->
<? } ?>