-
Notifications
You must be signed in to change notification settings - Fork 11
/
itemDetails.php
212 lines (190 loc) · 6.8 KB
/
itemDetails.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
209
210
211
212
<!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">
<title>about products</title>
<!-- Bootstrap -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<!-- Font Awesome -->
<link href="css/font-awesome.min.css" rel="stylesheet">
<!-- custom css -->
<link rel="stylesheet" type="text/css" href="css/style.css">
</head>
<body>
<?php
include ("function/connection.php");
include ("include/header.php");
include ("function/function.php");
include ("include/bannar.php");
?>
<br>
<div id="detailp" class="container">
<div>
<ul class="breadcrumb">
<li>
<a href="allads.php">Allads</a>
</li>
<li>
<a href="#">item</a>
</li>
<li>
<a href="#">Detail</a>
</li>
</ul>
</div>
<div class="row">
<div class="col-md-7">
<?php
if(isset($_GET["details"])) {
$details = $_GET["details"];
$select = "select * from product where id='".$details."'";
$see_product=$con->query($select);
echo "<div id='dteailview'>";
while($row=$see_product->fetch_array()){
echo "<h3 style='color:blue;font-weight:bolder'>".$row['title']."</h3>
<div class='thumbnail'><img src=images/".$row['image']." alt='Image not found'></div>
<h4>".$row['price']."</h4>
<p>".$row['description']."</p>
<p><strong> Condition :".$row['condition']."</strong></p>
<p><strong> Adtype : ".$row['adtype']."</strong></p>
<p style='display:none'>".$row['user_id'];
$uid = $row['user_id'];
$usql = "SELECT * FROM users WHERE id = '$uid'";
$userinfo = $con->query($usql);
while($urec = $userinfo->fetch_array()){
?>
<div>
<?php echo "<h4 class='bg-success'>Post by : " . $urec['name']."</h4>"; ?>
</div>
<?php
}
;
}
echo "</div>";
}
?>
<div id="dtailright">
<h3 class='text-center bannar'><strong>CONTACT</strong></h3>
<hr>
<?php
if(isset($_GET["details"])) {
$details = $_GET["details"];
$select = "select * from product where id='".$details."'";
$see_product=$con->query($select);
while($row=$see_product->fetch_array()){
echo "<p style='display:none'>".$row['user_id']."</P>";
$uid = $row['user_id'];
$usql = "SELECT * FROM users WHERE id = '$uid'";
$userinfo = $con->query($usql);
while($urec = $userinfo->fetch_array()){
?>
<div class='text-center well'>
<?php echo "<h4 > Name :" . $urec['name']."</h4>
<h4> Email : " . $urec['email']."</h4>
<img src='images/tphone.png'><strong>" . $urec['phone']."</strong>" ?>
</div>
<?php
}
;
}
}
?>
<hr>
</div>
</div>
<div class="col-md-5">
<div id="dtailright">
<br>
<hr>
<?php
if(isset($_GET["details"])) {
$details = $_GET["details"];
$select = "select * from product where id='".$details."'";
$see_product=$con->query($select);
while($row=$see_product->fetch_array()){
echo "<p style='display:none'>".$row['user_id']."</P>";
$uid = $row['user_id'];
$usql = "SELECT * FROM users WHERE id = '$uid'";
$userinfo = $con->query($usql);
while($urec = $userinfo->fetch_array()){
echo "<img src='images/tphone.png'><strong>" . $urec['phone']."</strong>" ?>
<?php
}
;
}
}
?>
<hr>
<img class="img-responsive" src="images/sadd.gif">
<h4>Share this ad</h4>
<hr>
<ul class="social">
<li>
<a href="https://www.facebook.com/"> <i class=" fa fa-facebook"> </i> </a>
</li>
<li>
<a href="#"> <i class="fa fa-twitter"> </i> </a>
</li>
<li>
<a href="#"> <i class="fa fa-google-plus"> </i> </a>
</li>
<li>
<a href="#"> <i class="fa fa-pinterest"> </i> </a>
</li>
<li>
<a href="#"> <i class="fa fa-youtube"> </i> </a>
</li>
</ul>
<br>
</div>
</div>
</div>
</div>
<div class="container">
<div class="row">
<h3>USER COMMENT</h3>
<div class="well col-md-6" style="height:350px;">
<form class="form-group" method="post" action="<?php echo $_SERVER["PHP_SELF"]; ?>">
Name :<input class="form-control" type="text" name="name" id="name" required>
Connent :<textarea class="form-control" name="comment" id="comment" required></textarea><br>
<input class="well-sm" type="submit" value="Post Comment" name="submit">
</form>
</div>
<div class="col-md-6 well">
<div style=" width:100%; overflow:scroll; height:310px;">
<?php
$select = "SELECT * FROM comment order by date desc";
$select_query = $con->query($select);
while($rows = $select_query->fetch_array()) {
echo "<h3>".$rows['name']."</h3>";
echo "<h5>".$rows['comment']."</h5>";
echo "<h5 class='text-right'>".$rows['date']."</h5>";
echo"<hr class='h'>";
}
?>
</div>
</div>
</div>
</div>
<?php
if(isset($_POST['submit'])){
$db =$con;
$name =$_POST['name'];
$comment =$_POST['comment'];
$insertdata = "INSERT INTO `buynsell`.`comment` (`id`, `name`, `comment`) VALUES ('', '$name', '$comment')";
$result = $db->query($insertdata);
if($result){echo "Your Cmment Added!!";}
else echo "Error!!!";
$db->close();
}
include ("include/footer.php");
?>
<!--/Footer-->
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="js/jquery.min.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed By Imran-->
<script src="js/bootstrap.min.js"></script>
</body>
</html>