-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdescription.php
More file actions
216 lines (185 loc) · 8.97 KB
/
description.php
File metadata and controls
216 lines (185 loc) · 8.97 KB
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
<?php
session_start();
if(!isset($_SESSION['user']))
header("location: index.php?Message=Login To Continue");
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="Books">
<meta name="author" content="40_Riya and 44_Mahek ">
<title> Online Bookstore</title>
<!-- Bootstrap -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/my.css" rel="stylesheet">
<style>
@media only screen and (width: 768px) { body{margin-top:150px;}}
@media only screen and (max-width: 760px) { #books .row{margin-top:10px;}}
.tag {display:inline;float:left;padding:2px 5px;width:auto;background:#F5A623;color:#fff;height:23px;}
.tag-side{display:inline;float:left;}
#books {border:1px solid #DEEAEE; margin-bottom:20px;padding-top:30px;padding-bottom:20px;background:#fff; margin-left:10%;margin-right:10%;}
#description {border:1px solid #DEEAEE; margin-bottom:20px;padding:20px 50px;background:#fff;margin-left:10%;margin-right:10%;}
#description hr{margin:auto;}
#service{background:#fff;padding:20px 10px;width:112%;margin-left:-6%;margin-right:-6%;}
.glyphicon {color:#D67B22;}
</style>
</head>
<body>
<nav class="navbar navbar-default navbar-fixed-top navbar-inverse">
<div class="container-fluid">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="index.php" style="margin: -7px 0px -22px -35px;"><img alt="Brand" src="img/logo.png" style="width: 127px;margin: -13px;"></a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav navbar-right">
<?php
if(isset($_SESSION['user']))
{
echo'
<li><a href="index.php" class="btn btn-lg">Home</a></li>
<li><a href="cart.php" class="btn btn-lg">Cart</a></li>
<li> <a href="history.php" class="btn btn-lg"> Order history </a> </li>;
<li> <a href="destroy.php" class="btn btn-lg"> LogOut </a> </li>';
}
?>
</ul>
</div><!-- /.navbar-collapse -->
</div><!-- /.container-fluid -->
</nav>
<div id="top" >
<div id="searchbox" class="container-fluid" style="width:112%;margin-left:-6%;margin-right:-6%;">
<div>
<form role="search" action="Result.php" method="post">
<input type="text" name="keyword" class="form-control" placeholder="Search for a Book , Author Or Category" style="width:80%;margin:20px 10% 20px 10%;">
</form>
</div>
</div>
</div>
<?php
include "dbconnect.php";
$PID=$_GET['ID'];
$query = "SELECT * FROM products WHERE PID='$PID'";
$result = mysqli_query ($con,$query)or die(mysql_error());
if(mysqli_num_rows($result) > 0)
{
while($row = mysqli_fetch_assoc($result))
{
$path="img/books/".$row['PID'].".jpg";
$target="cart.php?ID=".$PID."&";
echo '
<div class="container-fluid" id="books">
<div class="row">
<div class="col-sm-10 col-md-6">
<img class="center-block img-responsive" src="'.$path.'" height="550px" style="padding:20px;">
</div>
<div class="col-sm-10 col-md-4 col-md-offset-1">
<h2> '. $row["Title"] . '</h2>
<hr>
<div style = "font-family: serif; font-size: 18px; font-weight: 600;">
AUTHOR : '.$row["Author"].' <br>
PAGES : '.$row["page"].' <br>
WEIGHT : '.$row["weight"].' <br>
PRICE : '.$row["Price"].' <br><br>';
if($row["Available"]<5)
{
echo ' <p style="color:red;"> Hurry!! Only '. $row["Available"] .' left in stock.</p>';
}
echo '
</div>
<span style="font-weight:bold; font-size: 18px;"> Quantity : </span>';
echo'<select id="quantity">';
for($i=1;$i<=$row['Available'];$i++)
echo '<option value="'.$i.'">'.$i.'</option>';
echo ' </select>';
echo' <br><br><br>
<a id="buyLink" href="'.$target.'" class="btn btn-lg btn-primary" style="padding:15px;color:white;text-decoration:none;">
ADD TO CART <br>
</a>
</div>
</div>
</div>
';
echo '
<div class="container-fluid" id="description">
<div class="row">
<h2> Description </h2>
<p style = "font-size: 18px; font-family: sans-serif;">'.$row['Description'] .'</p><br>
<pre style="background:inherit;border:none;font-family: sans-serif; font-size: 15px;">
PRODUCT CODE '.$row["PID"].' <hr>
TITLE '.$row["Title"].' <hr>
AUTHOR '.$row["Author"].' <hr>
AVAILABLE '.$row["Available"].' <hr>
PUBLISHER '.$row["Publisher"].' <hr>
PAGES '.$row["page"].' <hr>
WEIGHT '.$row["weight"].' <hr>
</pre>
</div>
</div>
';
}
}
echo '</div>';
?>
<footer style=" background:#9794af;bottom:0px;clear: both;position: relative; height: 300px;margin-top: -80px;">
<div class="container-fluid">
<div class="row">
<div class="col-sm-1 col-md-1 col-lg-1">
</div>
<div class="col-sm-7 col-md-5 col-lg-5">
<div class="row text-center">
<h2>Get In Touch!</h2>
<hr class="primary">
<p>Still Confused? Give us a call or send us an email and we will get back to you as soon as possible!</p>
</div>
<div class="row">
<div class="col-md-6 text-center">
<span class="glyphicon glyphicon-earphone"></span>
<p>123-456-6789</p>
</div>
<div class="col-md-6 text-center">
<span class="glyphicon glyphicon-envelope"></span>
<p>[email protected]</p>
</div>
</div>
</div>
<div class="hidden-sm-down col-md-2 col-lg-2">
</div>
<div class="col-sm-4 col-md-3 col-lg-3 text-center">
<h2 style="color:#390858;">Follow Us At</h2>
<div>
<img title="Twitter" alt="Twitter" src="img/social/twitter.png" width="35" height="35" />
<img title="LinkedIn" alt="LinkedIn" src="img/social/linkedin.png" width="35" height="35" />
<img title="Facebook" alt="Facebook" src="img/social/facebook.png" width="35" height="35" />
<img title="google+" alt="google+" src="img/social/google.jpg" width="35" height="35" />
<img title="Pinterest" alt="Pinterest" src="img/social/pinterest.jpg" width="35" height="35" />
</div>
</div>
</div>
</div>
</footer>
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="js/bootstrap.min.js"></script>
<script>
$(function () {
var link = $('#buyLink').attr('href');
$('#buyLink').attr('href', link + 'quantity=' + $('#quantity option:selected').val());
$('#quantity').on('change', function () {
$('#buyLink').attr('href', link + 'quantity=' + $('#quantity option:selected').val());
});
});
</script>
</body>
</html>