-
Notifications
You must be signed in to change notification settings - Fork 0
/
booksspecification.php
208 lines (201 loc) · 6.68 KB
/
booksspecification.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
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
<head>
<meta charset="utf-8">
<title></title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">
<style>
nav {
float: left;
max-width: 220px;
margin: 0;
padding: 1em;
}
nav ul {
list-style-type: none;
padding: 0;
color:#0066ff;
}
nav ul a {
text-decoration: none;
padding-left:20px;
font-size:20px;
font-style:oblique;
}
article {
margin-left: 680px;
border-left: 1px solid gray;
padding: 1em;
overflow: hidden;
}
table th{
padding-right: 120px;
padding-bottom:6px;
}
table td{
padding-right: 120px;
padding-bottom:8px;
font-size:14px;
font-style:arial;
}
table td button
{
padding-left:20px;
font-size:30px;
background-color:#006600;
color:#ffffff;
}
hr
{
border: 2px solid lightgray;
}
p
{
font-size:16px;
font-weight:700;
color:#527a7a;
}
blink {
color:red;
font-size:24px;
-webkit-animation: blink 1s step-end infinite;
animation: blink 1s step-end infinite
}
@-webkit-keyframes blink {
67% { opacity: 0 }
}
@keyframes blink {
67% { opacity: 0 }
}
#result
{
position:absolute;
top:50px;
}
#result :hover
{
font-size:22px;
}
</style>
<script>
function fx(str)
{
if (str.length == 0)
{
document.getElementById("Result").innerHTML = "";
return;
}
else
{
var xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function()
{
if (xmlhttp.readyState == 4 && xmlhttp.status == 200)
{
document.getElementById("Result").innerHTML = xmlhttp.responseText;
}
}
xmlhttp.open("GET", "search.php?q=" + str, true);
xmlhttp.send();
}
}
</script>
</head>
<body>
<header style="background-color:#555;height:70px">
<div style="padding-top:10px;font-color:#000000">
<a href="index.php"><i class="glyphicon glyphicon-home" style="font-size:30px;color:#ffffff;padding-left:30px">HOME</i></a>
<?php
session_start();
$cookie=0;
if(isset($_COOKIE['user']))
{
$cookie=$_COOKIE['user'];
}
if(isset($_SESSION['id']))
{
$id=$_SESSION['id'];
$con=new MySQLi("localhost","root","","project");
$sql="select * from registration where cid=$id";
$res=$con->query($sql);
$row=$res->fetch_array();
echo "<span style='padding-left:160px'><input type='text' name='n1' style='width:300px;height:30px;font-size:16px' placeholder=' What are you looking for?' onKeyUp='fx(this.value)'></span><button type='submit' style='background-color:#ffffff;height:30px;width:30px' ><i class='fa fa-search'></i></button><span style='padding-left:120px;color:#ffffff'>Welcome,".$row[1]."</span><span style='padding-left:15px;color:#ffffff'><a href='track.php'><button type='submit' style='background-color:#555;color:#ffffff'>Track Orders</button></a></span><span style='padding-left:15px'><a href='log out.php'><button type='submit' style='background-color:#555;color:#ffffff'>LOG OUT </button></a></span><a href='cartdetails.php'><i class='fa fa-shopping-cart' style='padding-left:18px;font-size:28px;color:white'> Cart(".$cookie.")</i></a>";
}
else
{
echo "<span style='padding-left:160px'><input type='text' name='n1' style='width:300px;height:30px;font-size:16px' placeholder=' What are you looking for?' onKeyUp='fx(this.value)'></span><button type='submit' style='background-color:#ffffff;height:30px;width:30px' ><i class='fa fa-search'></i></button><span style='padding-left:350px;color:#ffffff'><a href='login.php'><button type='submit' style='background-color:#555;color:#ffffff'>LOG IN </button></a></span><span style='padding-left:50px'><a href='sign up.php'><button type ='submit' style='background-color:#555;color:#ffffff'> SIGN UP </button></a></span><a href='cartdetails.php'><i class='fa fa-shopping-cart' style='padding-left:18px;font-size:28px;color:white'> Cart(".$cookie.")</i></a>";
}
?>
</div>
</header><div style='padding-left:312px' id='Result'></div><br>
<?php
$id=$_GET['id'];
$con=new MySQLi("localhost","root","","project");
$sql="select * from books where id=$id";
$res=$con->query($sql);
$row=$res->fetch_array();
if(isset($_SESSION['id']))
{
$mid=$row[0];
$cid=$_SESSION['id'];
$modelname=$row[1];
$price=$row[8];
$images=$row[6];
$con=new MySQLi("localhost","root","","project");
$sql1="insert into history values(null,$mid,$cid,'null','$modelname',$price,'$images')";
$res=$con->query($sql1);
}
?>
<nav>
<img style="margin:35px;padding-left:90px;padding-top:15px;padding-right:150px;padding-bottom:15px;height:500px" src="<?php echo $row[6] ?>">
<?php
if($row[9]>0)
{
if(isset($_COOKIE['user']))
{
$b=$_COOKIE['browser'];
$modelname=$row[1];
$con=new MySQLi("localhost","root","","project");
$sql1="select * from cart1 where bid=$b and modelname='$modelname'";
$res1=$con->query($sql1);
$c1=$res1->num_rows;
if($c1>=1)
{
echo "<table><tr><td><a href='cartdetails.php'><button style='background-color:#006600;color:#ffffff;width:260px;height:80px' name='btn1'>Go To Cart</button></a></td>";
}
else
{
echo "<table><tr><td><a href='addcart.php?model=$row[1]'><button style='background-color:#006600;color:#ffffff;width:260px;height:80px' name='btn1'>Add To Cart</button></a></td>";
}
}
else
{
echo "<table><tr><td><a href='addcart.php?model=$row[1]'><button style='background-color:#006600;color:#ffffff;width:260px;height:80px' name='btn1'>Add To Cart</button></a></td>";
}
echo "<td><a href='booksbuynow.php?model=$row[1]'><button style='background-color:#006600;color:#ffffff;width:260px;height:80px'> BUY NOW </button></a></td></tr></table>";
}
else
{
echo "<p style='color:#003366;font-size:24px'> OUT OF STOCK <p>";
}
?>
</nav>
<article>
<p style="color:#000000;font-size:26px"><?php echo $row[1] ?></p>
<p style="color:#00cc00;font-size:20px;padding-left:423px"> PRICE </p>
<p style="color:#000033;font-size:28px;padding-left:423px"><strike>₹<?php echo $row[7] ?></strike></p>
<blink style="padding-left:423px"> OFFER PRICE </blink>
<p style="color:#000033;font-size:28px;padding-left:423px">₹<?php echo $row[8] ?> </p>
<br>
<p style="color:#000000;font-size:22px">SPECIFICATION </p><hr>
<?php
echo "<table>";
echo "<tr><td>Books Name </td><td>" .$row[1]. "</td></tr>";
echo "<tr><td>Author </td><td>" .$row[2]. "</td></tr>";
echo "<tr><td>Publisher </td><td>" .$row[3]. "</td></tr>";
echo "<tr><td>Edition </td><td>" .$row[4]. "</td></tr>";
echo "<tr><td>Language </td><td>" .$row[5]. "</td></tr></table>";
?>
</article>
</body>
</html>