-
Notifications
You must be signed in to change notification settings - Fork 0
/
post.php
executable file
·193 lines (156 loc) · 6 KB
/
post.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
<?php
session_start();
require 'dbconfig.php';
if(isset($_GET['post'])){
//get posts from database
$posts = $database->getReference('Posts')->getValue();
//check data
foreach($posts as $key => $value)
{
if($key==$_GET['post']){
$available = $value['available'];
$description = $value['description'];
$pic = $value['pic'];
$pin = $value['pin'];
$price = $value['price'];
$title = $value['title'];
$type = $value['type'];
$user = $value['userkey'];
$time = $value['time'];
}
}
//get posts from database
$users = $database->getReference('Users')->getValue();
//check data
foreach($users as $key => $value)
{
if($key == $user){
$email=$value['email'];
$phone=$value['phone'];
$username= $value['username'];
$pp=$value['pp'];
}
}
$map="https://www.google.com/maps/place/".$pin;
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta content="width=device-width, initial-scale=1.0" name="viewport">
<title>Post</title>
<meta content="" name="description">
<meta content="" name="keywords">
<!-- Favicons -->
<link href="assets/img/finallogo.png" rel="icon">
<link href="assets/img/finallogo.png" rel="apple-touch-icon">
<!-- Google Fonts -->
<link href="https://fonts.googleapis.com/css?family=Open+Sans:300,300i,400,400i,600,600i,700,700i|Raleway:300,300i,400,400i,600,600i,700,700i" rel="stylesheet">
<!-- Vendor CSS Files -->
<link href="assets/vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<link href="assets/vendor/icofont/icofont.min.css" rel="stylesheet">
<link href="assets/vendor/boxicons/css/boxicons.min.css" rel="stylesheet">
<link href="assets/vendor/venobox/venobox.css" rel="stylesheet">
<link href="assets/vendor/owl.carousel/assets/owl.carousel.min.css" rel="stylesheet">
<link href="assets/vendor/aos/aos.css" rel="stylesheet">
<!-- Template Main CSS File -->
<link href="assets/css/style.css" rel="stylesheet">
</head>
<body>
<!-- ======= Header ======= -->
<header id="header" class="fixed-top">
<div class="container-fluid d-flex">
<div class="logo mr-auto">
<h1 class="text-light"><a href="index.php">
<span><img src="assets/img/finallogo.png" alt="Kerrili" class="img-fluid"> KERRILI</span>
</a></h1>
<!-- Uncomment below if you prefer to use an image logo -->
<!-- <a href="index.html"><img src="assets/img/logo.png" alt="" class="img-fluid"></a>-->
</div>
<?php
//loggedIn nav
if(isset($_SESSION['id'])){include("assets/navbars/hometestlog.php");}
//Not LoggedIn
else{
include("assets/navbars/hometest.php");
}
?><!-- .nav-menu -->
</div>
</header><!-- End Header -->
<main id="main">
<!-- ======= Breadcrumbs Section ======= -->
<section class="breadcrumbs">
<div class="container">
<div class="d-flex justify-content-between align-items-center">
<h2>Search</h2>
<ol>
<li><a href="hometest.php">Home</a></li>
<li>Search</li>
<li>Post</li>
</ol>
</div>
</div>
</section><!-- Breadcrumbs Section -->
<!-- ======= Portfolio Details Section ======= -->
<section class="portfolio-details">
<div class="container">
<div class="portfolio-details-container">
<!-- imgs container -->
<div class="owl-carousel portfolio-details-carousel">
<img src="<?= $pic ?>" class="img-fluid" alt="" style="max-height: 600px; ">
</div>
<style>
{
}</style>
<div class="portfolio-info">
<img src="<?= $pp ?>" style="border-radius: 50px;float: left;" alt="profile-picture" width="40px" height="40px">
<h3 style="margin-top: 6px;"> <?= $username ?></h3>
<ul>
<li><strong>Category</strong>: <?= $type ?></li>
<li><strong>Date</strong>: <?= $time ?></li>
<li><strong>Price</strong>: <?= $price ?> DA</li>
<li><strong>Email</strong>: <?= $email ?></li>
<li><strong>Phone</strong>: <?= $phone ?></li>
<?php
if($available=="yes"){
echo'<li style="color: green;float: right">Available</li>';
}
if($available=="no"){
echo'<li style="color: red;float: right">Not Available</li>';
}
?>
</ul>
</div>
</div>
<div class="portfolio-description">
<h2><?= $title ?></h2>
<p>
<?= $description ?>
</p>
</div>
<div class="map">
<h3>View In Map </h3>
<a href="<?= $map ?>" target="_blank"><img src="assets/img/map_image.png" class="img-fluid" alt="the map" width="100%" style="max-height: 350px;"></a>
</div>
</div>
</section><!-- End Portfolio Details Section -->
</main><!-- End #main -->
<!-- ======= Footer ======= -->
<?php
include("assets/navbars/footer.php");
?>
<a href="#" class="back-to-top"><i class="icofont-simple-up"></i></a>
<!-- Vendor JS Files -->
<script src="assets/vendor/jquery/jquery.min.js"></script>
<script src="assets/vendor/bootstrap/js/bootstrap.bundle.min.js"></script>
<script src="assets/vendor/jquery.easing/jquery.easing.min.js"></script>
<script src="assets/vendor/php-email-form/validate.js"></script>
<script src="assets/vendor/isotope-layout/isotope.pkgd.min.js"></script>
<script src="assets/vendor/venobox/venobox.min.js"></script>
<script src="assets/vendor/owl.carousel/owl.carousel.min.js"></script>
<script src="assets/vendor/aos/aos.js"></script>
<!-- Template Main JS File -->
<script src="assets/js/main.js"></script>
</body>
</html>