-
Notifications
You must be signed in to change notification settings - Fork 0
/
riwayat.php
160 lines (145 loc) · 6.33 KB
/
riwayat.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
<?php
require 'function.php';
if (!isset($_SESSION["login"])) {
header("Location: login_form.php");
}
$id_login = $_SESSION["login"];
$users = query("SELECT * FROM users WHERE Id_user='$id_login'");
$users_riwayat = query("SELECT * FROM riwayat_perjalanan WHERE id_user='$id_login' AND NOT checkout='-' ORDER BY riwayat_perjalanan.id DESC");
$Photo_profile = findRow("SELECT Photo_profile FROM users WHERE Id_user='$id_login'", "Photo_profile");
$data = query("SELECT * FROM checkin WHERE id_user='$id_login'");
$json = json_encode($users_riwayat);
echo "
<script>
var text = $json
</script>
";
?>
<!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.0">
<title>Riwayat Perjalanan</title>
<!-- <link rel="stylesheet" href="CSS/riwayat.css"> -->
<link rel="icon" href="img/logo.ico" type="image/icon type">
<link rel="stylesheet" href="CSS/riwayat.css">
</head>
<body>
<div class="container">
<div class="navbar">
<div class="logo">
<div class="icon">
</div>
<h3>PeduliLindungi</h3>
</div>
<div class="atasan">
<a class="active" href="index.php">Beranda</a>
<a href="index.php#tentang">Tentang</a>
<a href="index.php#statistik">Statistik</a>
<a href="index.php#Bahasa">Bahasa</a>
</div>
<?php if (isset($_SESSION["login"])) : ?>
<?php foreach ($users as $user) : ?>
<div class="account">
<div class="photo-profil">
<?php if (strlen($Photo_profile) > 1) : ?>
<div class="custom" style="background-image: url(img/user-pic/<?= $user["Photo_profile"] ?>);">
</div>
<?php else : ?>
<div class="default">
<h4><?= substr($user["Nama"], 0, 1) ?></h4>
</div>
<?php endif; ?>
</div>
<?php if (strlen($user["Nama"]) >= 11) : ?>
<h3><?= substr($user["Nama"], 0, 11) ?>..</h3>
<img src="img/sort-down.png" class="dropdown" alt="" srcset="">
<?php else : ?>
<h3><?= $user["Nama"] ?></h3>
<img src="img/sort-down.png" class="dropdown" alt="" srcset="">
<?php endif; ?>
<div class="dropbtn">
<div class="dropdown-content">
<a href="account.php">
<img src="img/login.png" alt="">
Profil
</a>
<a href="logout.php">
<img src="img/exit.png" alt="">
Keluar
</a>
</div>
</div>
<?php endforeach; ?>
<?php else : ?>
<div class="not_login">
<a href="login_form.php">Login</a>/
<a href="register_form.php">Register</a>
</div>
<?php endif; ?>
</div>
</div>
<div class="wrapper">
<div class="nav">
<div class="group-input">
<form action="" method="post">
<img src="img/search.webp" alt="" srcset="">
<input type="text" name="cari" id="filter-lokasi" placeholder="filter lokasi">
</form>
</div>
<h4>Riwayat Perjalanan</h4>
<select name="option" id="option">
<option value="hari ini">Hari ini</option>
<option value="kemarin">kemarin</option>
<option value="1 mgg lalu">1 mgg lalu</option>
</select>
</div>
<div class="menubar">
<div class="group-menubar">
<div class="list-perjalanan">
<p>List perjalanan</p>
<ul>
<?php foreach ($users_riwayat as $key) : ?>
<li id="list-perjalanan" data-id="<?= $key["id"] ?>">
<img src="img/map.png" alt="" srcset="">
<p><?= substr($key["lokasi"], 0, 55) ?></p>
</li>
<?php endforeach; ?>
</ul>
</div>
<div class="details">
<div class="header-details">
<img src="img/left.png" alt="" srcset="" id="back">
<p>Details perjalanan</p>
</div>
<ul>
<li id="nama-jalan">Nama jalan : <br>
<p id="namaJalan">Lorem ipsum dolor sit amet consectetur adipisicing elit. Modi, quidem?</p>
</li>
<li id="checkin">Checkin : <br>
<p id="waktuCheckin">10:10:10</p>
</li>
<li id="checkout">Checkout :<br>
<p id="waktuCheckout">10:10:10</p>
</li>
<li id="lama_perjalanan">lama Perjalanan :<br>
<p id="lamaPerjalanan">10:10:10</p>
</li>
</ul>
</div>
</div>
</div>
<div class="sidebar">
<iframe frameborder="0" id="map">
</iframe>
</div>
</div>
<div class="footer">
</div>
</div>
<script src="JS/jquery-3.6.1.min.js"></script>
<script src="JS/riwayat.js"></script>
</body>
</html>