This repository has been archived by the owner on Apr 30, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlist_banchay.php
84 lines (69 loc) · 2.68 KB
/
list_banchay.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
<?php session_start(); ?>
<?php
$title = "Sách bán chạy";
require_once("./includes/connect.php");
include("./includes/function.php");
include("./includes/header.php");
include("./includes/sidebar-a.php");
?>
<div class="noidung">
<!-- SACH MOI PHAT HANH -->
<?php
// Phân trang
$tableName=" sach ORDER BY luot_mua DESC ";// Ten Table
$targetpage = "list_banchay.php"; // Ten trang dang dc dung phan trang
$limit = 20;// So hang hien thi cua du lieu
include("includes/phantrang1.php");
?>
<div class="sach_sap_phat_hanh" style="margin-top: 10px;background: url(./style/images/bg-listsp.png) no-repeat;width:740px;">
<div class="header_sach_sap_phat_hanh">
<li class="title_sach_sap_phat_hanh">
<h2>
<a href="" title="">Sản phẩm bán chạy</a>
</h2>
</li><!-- end title_sach_sap_phat_hanh -->
</div><!-- end header_sach_sap_phat_hanh -->
<div style="clear:both"></div>
<div class="sach_sap_phat_hanh_body">
<?php
//$s = "SELECT * FROM sach WHERE dmuc_id='$page'";
//$q = mysql_query($s) or die("Không thể hiện thị sách");
if (mysql_num_rows($result) > 0) {
while ($r = mysql_fetch_assoc($result)) {
//---- Tinh so tien ban ---//
$a = $r['dongia'];
$b = $r['giamgia'] * 0.01;
$c = $a * $b;
$ban = $a - $c;
//Hien thi san pham
echo "<div class='product'>
<div class='product_images'>
<a href='#' title=''><img src='./style/images/img_sach/$r[hinhanh]'></a>
</div> <!-- end product_images -->
<div class='product_tieu_de'>
<a href='#'>$r[sach_name]</a>
</div> <!-- end product_tieu_de -->
<div class='product_thong_tin'>
<li>Tác giả: $r[tacgia]</li>
<li>Giá bìa: <span class='gia_bia_index'>".number_format($r['dongia'],"0",",",".")."đ</span></li>
<li>Giá bán: <span class='gia_bia_ban'>".number_format($ban,"0",",",".")."đ</span></li>
<li>Giảm giá: <span class='tr_gia_giam'>$r[giamgia]%</span></li>
</div> <!-- end product_thong_tin -->
<div class='product_chitiet'>
<a href='chitiet.php?ct=$r[sach_id]'><img src='./style/images/chi_tiet.png'></a>
</div> <!-- end product_chitiet -->
</div> <!-- end product -->";
}// end while
} else {
echo "<p class='error'>Không có sản phẩm</p>";
}// end IF NUM_ROWS
?>
</div> <!-- end sach_sap_phat_hanh_body -->
<div class="sach_sap_phat_hanh_footer"></div>
</div> <!-- end sach_sap_phat_hanh -->
<!-- END SACH MOI PHAT HANH -->
<?php include("includes/phantrang2.php"); ?>
</div><!-- end noidung -->
<?php
include("./includes/footer.php");
?>