-
Notifications
You must be signed in to change notification settings - Fork 2
/
soonbook.php
178 lines (177 loc) · 8.13 KB
/
soonbook.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
<?php
session_start();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Sách sắp có</title>
<link rel="stylesheet" type="text/css" href="css/top_header.css"/>
<link rel="stylesheet" type="text/css" href="css/content.css"/>
<link rel="stylesheet" type="text/css" href="css/left_content.css"/>
<link rel="stylesheet" type="text/css" href="css/middle_content.css"/>
<link rel="stylesheet" type="text/css" href="css/footer.css"/>
<style type="text/css">
a:link{
text-decoration:none;
color:#05b2e9;
}
a:visited {
color: #05b2e9;
}
a:hover {
color: #3C3;
}
a:active {
color: #F00;
}
</style>
</head>
<body>
<div class="top">
<center><a href="index.php"><img src="images/File-1414989219.png" alt="" width="1140" height="65" /></a></center>
</div>
<!--------- START HEADER----------------->
<div class="header">
<div id="homepage_icon"><a href="index.php"><abbr title="Home Page"><img src="images/Homepage_icon.jpg" width="80" height="97"/></abbr></a></div>
<div class="search_area">
<form action="search_result.php" method="post">
<div class="search_div"><input type="text" name="search" placeholder="Tìm theo tên sách" class="search"/></div>
<input name="submit" type="submit" class="button" value="TÌM" />
</form>
<div class="title"><a href="search.php"><img src="images/title.png" width="261" height="35" alt="muasachonline.vn" /></a></div>
</div>
<div class="login_area">
<div class="login_icon"><img src="images/<?php if(isset($_SESSION['role'])){if($_SESSION['role']==1) echo "admin_icon.png"; else echo"login_icon.png";}else echo"login_icon.png";?>" width="45" height="41" align="middle" /></div>
<?php
if(isset($_SESSION['name']))
{
if($_SESSION['role']==1)
{
?>
<div class="login_text">Chào Admin</div>
<div class="login_text"><a href="ad_account.php">Trang quản lý</a> | <a href="logout.php">Đăng Xuất</a></div>
<?php
}
else
{
?>
<div class="login_text"> Chào <?php echo $_SESSION['name'];?> - <a href="logout.php">Log out</a></div>
<div class="login_text"><a href="cus_account.php">Trang cá nhân</a> | <a href="cus_cart.php">Giỏ hàng</a></div>
<?php
}
}
else
{
?>
<div class="login_text1"><a href="login.php">Đăng nhập</a> | <a href="registered.php">Đăng ký</a></div>
<?php
}
?>
<div class="hotline"><img src="images/phone_icon.jpg" width="15" height="15" /><span class="hotline_text">Hotline:</span> <span class="phone_number">1900-6035</span><span style="font-size:12px">(8-21h kể cả T7,CN)</span></div>
</div>
</div>
<br />
<hr />
<!--------- END HEADER ------------------>
<div class="main">
<!----- START CONTENT --------->
<div class="start">
<span><a href="index.php">Trang chủ</a></span> / <strong>Mua sách trực tuyến Giảm Giá Hơn 20% - Nhà Sách HEDSPI</strong>
</div>
<!----- START left_content ------->
<div class="left_content">
<div class="title_box1">DANH MỤC SÁCH</div>
<div class="left_menu1">
<ul class="left_menu_content1">
<li><a href="category.php?cate_ID=1">Sách Tiếng Anh</a></li>
<li><a href="category.php?cate_ID=2">Sách Văn Học - Tiểu Thuyết</a></li>
<li><a href="category.php?cate_ID=3">Sách Kinh Tế</a></li>
<li><a href="category.php?cate_ID=4">Sách Chuyên Ngành</a></li>
<li><a href="category.php?cate_ID=5">Sách Kỹ Năng Sống - Nghệ Thuật Sống</a></li>
<li><a href="category.php?cate_ID=6">Sách Giáo Khoa - Tham Khảo</a></li>
<li><a href="category.php?cate_ID=7">Sách Học Ngoại Ngữ - Từ Điển</a></li>
<li><a href="category.php?cate_ID=8">Sách Cho Tuổi Mới Lớn</a></li>
<li><a href="category.php?cate_ID=9">Sách Truyện Thiếu Nhi</a></li>
<li><a href="category.php?cate_ID=10">Sách Thường Thức - Đời Sống</a></li>
<li><a href="category.php?cate_ID=11">Truyện Tranh, Manga, Comic</a></li>
<li><a href="category.php?cate_ID=12">Sách Văn Hóa - Nghệ Thuật - Du Lịch</a></li>
<li style="border: none;"><a href="category.php?cate_ID=13">Sách Nuôi Dạy Con</a></li>
</ul>
</div>
<div class="title_box2">MUA THEO GIÁ</div>
<div class="left_menu2">
<ul class="left_menu_content2">
<li><a href="">0 ₫ - 100.000 ₫ </a></li>
<li><a href="">100.000 ₫ - 200.000 ₫ </a></li>
<li><a href="">200.000 ₫ - 300.000 ₫ </a></li>
<li><a href="">300.000 ₫ - 400.000 ₫ </a></li>
<li style="border: none;"><a href=""> 400.000₫ < </a></li>
</ul>
</div>
</div>
<!------- END left_content ------->
<!------- START Middle_content ------->
<div class="middle_content">
<div class="title" id="no_border">
<p class="font_title">Sách sắp có mặt trên HEDSPI Bookstore</p>
</div>
<div class="divider xam">
</div>
<?php
$conn=mysqli_connect("localhost","root","","bookstore");
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
mysqli_set_charset($conn,"utf8");
$sql="SELECT * FROM books WHERE DATEDIFF(publish_date,CURDATE())>0 ORDER BY publish_date LIMIT 0,15";
$query=mysqli_query($conn,$sql);
?>
<div class="list_book1">
<?php
$check=0;
while ($data = mysqli_fetch_assoc($query) )
{
$img=$data['image'];
$title=$data['title'];
$ID=$data['book_ID'];
$author=$data['author'];
$price=$data['price'];
$sale_off=$data['sale_off'];
?>
<div class="book">
<div class="book_icon"><a href="book_info.php?book_ID=<?php echo $ID;?>"><img src="images/<?php echo $img; ?>" width="130" height="182" /></a></div>
<div class="book_title"><a href="book_info.php?book_ID=<?php echo $ID;?>"><?php echo $title;?></a></div>
<div class="book_note"><?php echo $author; ?></div>
<div class="book_cost"><?php $gia_ban=(int)($price*(100-$sale_off)/100); echo $gia_ban;?>.000₫</div>
<div class="book_note">-<?php echo $sale_off;?>%</div>
</div>
<?php
$check++;
if(($check % 5)==0)
{
?><div class="clr"></div><?php
}
}
?>
</div>
<div class="clr"></div>
<!------- END Middle_content ------->
</div>
</div>
<div class="clr"></div>
<!--------------- FOOTER ------------------>
<div class="footer">
<div class="leter_icon"><img src="images/Homepage/icon_sign.png" width="25" height="25" /></div>
<span id="footer_title">Đăng Kí Nhận Bản Tin Hedspi - <span style="font-weight:normal">Nhiều Tiện Lợi và Ưu Đãi đang chờ bạn!</span></span>
<div class="hand_icon"><img src="images/Homepage/hand-right-128.png" width="40" height="40" /></div>
<form>
<div class="input"><input type="text" name="input" class="input_class"/></div>
<input name="button" type="button" class="button_class" value="Đăng Ký - Nhận Tiện Ích" />
</form>
<div class="clr"></div>
<p>© Đại Học Bách Khoa Hà Nội<br /><br />Lớp Thực Hành Cơ Sở Dữ Liệu - Việt Nhật B- K57<br />Thành viên: Ngô Văn Thịnh, Trần Bảo Huy, Đặng Mỹ Linh, Đồng Xuân Mạnh</p>
</div>
</body>
</html>