-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathviewAds.php
147 lines (136 loc) · 7.46 KB
/
viewAds.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
<?php
include ("config.php");
include ("bd.php");
if (isset($_SESSION['id']))
{
$id = $_SESSION['id'];
}
?>
<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="">
<meta name="author" content="">
<title>Просмотр объявления</title>
<link href="vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<link href="css/shop-homepage.css" rel="stylesheet">
<link href="vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<?php
include("navbar.php");
$id_ad=$_GET['id'];
$result = mysql_query("SELECT * FROM user WHERE block_user=0 ",$db);
$result2 = mysql_query("SELECT * FROM advert WHERE id_ad='$id_ad'",$db);
$myrow2 = mysql_fetch_array($result2);
?>
<br>
<br>
<br>
<br>
<div class="container">
<div class="row">
<div class="col-12">
<div class="card">
<div class="userData ml-3">
<br>
<h2 class="d-block" style="font-size: 1.5rem; font-weight: bold"><a href="javascript:void(0);"><?php echo $myrow2['name_ad']; ?></a></h2>
<br>
<?php
if($myrow2['advertAction_ad']=='1')
{
?>
<a class="btn btn-outline-danger" href="complain.php?id=<?php echo $myrow2['id_ad'];?>" role="button">Пожаловаться на объявление</a>
<?php
}
else
{
?>
<a href="#" class="btn btn-danger">Заблокировано</a>
<br>
<br>
<a href="unblocked_ad.php?id=<?php echo $myrow2['id_ad'];?>" class="btn btn-primary">Разблокировать объявление </a>
<?php
}
?>
</div>
<div class="card-body">
<div class="card-title mb-4">
<div class="d-flex justify-content-start">
<div class="image-container">
<?php echo '<img class="card-img-top" style="width: 350px; height: 350px" src="data:image/jpeg;base64,' . base64_encode( $myrow2['photo_ad'] ) . '" />' ?>
<!-- <img src="img/kek2.png" id="imgProfile" style="width: 400px; height: 400px" class="img-thumbnail" /> -->
</div>
<div class="container">
<div class="tab-content ml-1" id="myTabContent">
<div class="tab-pane fade show active" id="basicInfo" role="tabpanel" aria-labelledby="basicInfo-tab">
<div class="row">
<div class="col-sm-3 col-md-2 col-5">
<label style="font-weight:bold;">Описание товара</label>
</div>
<div class="col-md-8 col-6">
<?php echo $myrow2['description_ad']; ?>
</div>
</div>
<hr />
<div class="row">
<div class="col-sm-3 col-md-2 col-5">
<label style="font-weight:bold;">Предложение</label>
</div>
<div class="col-md-8 col-6">
<?php echo $myrow2['item_ad']; ?>
</div>
</div>
<hr />
<div class="row">
<div class="col-sm-3 col-md-2 col-5">
<label style="font-weight:bold;">E-mail</label>
</div>
<div class="col-md-8 col-6">
<?php if ($myrow2['email_ad'] == 1){ ?>
<p> <?php echo $myrow['email_user']?> </p>
<?php }else { echo "Не указан";} ?>
</div>
</div>
<hr />
<div class="row">
<div class="col-sm-3 col-md-2 col-5">
<label style="font-weight:bold;">Телефон</label>
</div>
<div class="col-md-8 col-6">
<?php if ($myrow2['phone_ad'] == 1){ ?>
<p> <?php echo $myrow['phone_user']?> </p>
<?php }else { echo "Не указан";} ?>
</div>
</div>
<hr />
<div class="row">
<div class="col-sm-3 col-md-2 col-5">
<label style="font-weight:bold;">Адрес</label>
</div>
<div class="col-md-8 col-6">
<?php if ($myrow2['address_ad'] == 1){ ?>
<p> <?php echo $myrow['address_user']?> </p>
<?php }else { echo "Не указан";} ?>
</div>
</div>
<hr />
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<?php
include("footer.php");
?>
<script src="vendor/jquery/jquery.min.js"></script>
<script src="vendor/bootstrap/js/bootstrap.bundle.min.js"></script>
</body>
</html>