-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsanpham_chitiet.php
88 lines (77 loc) · 3.25 KB
/
sanpham_chitiet.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
<?php
$sanpham = $sp->laysptheoid($_GET['idSP']);
if($sanpham == false) return false;
?>
<h1 style="margin-top:0;"><b><?php echo $sanpham['TenSP'] ?></b></h1><hr/>
<div class="row chitietsp">
<div class="col-xs-6 col-sm-6 col-md-3">
<?php require_once("sanpham_hinhanh.php");?>
</div>
<div class="col-xs-6 col-sm-6 col-md-4">
<div style="padding: 0 20px;">
<h2 class="text-danger"><b><?php echo number_format($sanpham['Gia'], 0, ',', '.'); ?></b><small class="text-danger">đ</small></h2>
<p><?php echo nl2br($sanpham['MoTa']);?></p>
<p>Còn <b><?php echo $sanpham['SoLuongTonKho'];?></b> sản phẩm</p>
<a idsp="<?php echo $_GET['idSP'];?>" class="btn btn-success btn-lg btn-block" id="themvaogiohang">Thêm vào giỏ hàng <i class="glyphicon glyphicon-ok" id="plus"></i></a>
<a href="index.php?action=xemdonhang" id="xemgiohang" class="btn btn-default btn-lg btn-block" style="margin-top:10px;" <?php if(count($_SESSION['sanpham'])==0) echo "disabled";?>>Kiểm tra giỏ hàng</a>
</div>
</div>
<div class="col-sm-12 col-md-5 text-muted">
<h2 class="">Chức năng nổi bật</h2>
<?php
if($sp->laythuoctinhsp($_GET['idSP']) == '') echo "Đang cập nhật";
echo $sp->laythuoctinhsp($_GET['idSP']);
if($sanpham['baiviet'] != null) echo "<ul><li><a class='text-muted text-primary' href='#'>Xem thêm bài đánh giá</a></li></ul>";
?>
</div>
</div>
<hr/>
<div class="row">
<div class="col-md-7"><?php require_once("sanpham_binhluan.php");?></div>
<div class="col-md-5">
<?php $video = $sp->layvideo($_GET['idSP']); if($video != ''){?>
<h3>Video sản phẩm</h3>
<iframe width="480" height="320" src="https://www.youtube.com/embed/<?php echo $video;?>">
</iframe>
<?php }?>
</div>
</div>
<hr/>
<?php
$listsptuongduong = $sp->laysptuongduong($idCL, $sanpham['idSP'], 10, 12);
if(count($listsptuongduong)>0){
?>
<div class="row">
<h4>Các sản phẩm tương đương:</h4>
<?php
foreach($listsptuongduong as $sanpham){
if($sanpham['idSP'] == $_GET['idSP']) continue;
?>
<a href="index.php?idSP=<?php echo $sanpham['idSP']?>"><div class="col-md-2 text-center">
<center>
<img class="tomtatsp-hinh img-responsive" src="<?php echo BASE_URL;?>upload/sanpham/hinhchinh/<?php echo $sanpham['urlHinh'];?>">
<b style="font-size: 12px;"><?php echo ucwords(strtolower($sanpham['TenSP'])); ?></b>
<p class="text-danger" ><strong><?php echo number_format($sanpham['Gia'],0,',','.');?><small>đ</small></strong></p>
</center>
</div></a>
<?php
}
?>
</div>
<hr/>
<?php }//if count listsptuongduong?>
<script>
$(document).ready(function(){
$("#themvaogiohang").click(function(){
themvaogiohang();
$("#plus").css('opacity', '1');
$("#cart").css({'font-size': '30px', 'color':'green'});
setTimeout(function(){
$("#plus").css('opacity', '0');
$("#cart").css({'font-size': '25px', 'color':'#140044'});
$("#xemgiohang").removeAttr('disabled');
giohangtomtat();
}, 1000);
});
});
</script>