-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhistory.php
More file actions
69 lines (63 loc) · 2.2 KB
/
history.php
File metadata and controls
69 lines (63 loc) · 2.2 KB
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
<?php
if (!isset($_SESSION['loggedin']) || $_SESSION['loggedin'] !== true) {
header("Location: login.php");
exit();
}
$servername = "localhost";
$username = "root";
$password = "";
$dbname = "demo";
$conn = new mysqli($servername, $username, $password, $dbname);
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
?>
<div class="tab-pane fade" id="History" role="tabpanel" aria-labelledby="history-tab">
<h3>Kayıtlar</h3>
<div class="table-responsive">
<table class="table table-striped table-bordered">
<thead class="table-dark">
<tr>
<th>ID</th>
<th>Müşteri</th>
<th>Sertifika</th>
<th>Şablon</th>
<th>Gönderim Tarihi</th>
<th>Konu</th>
<th>İçerik</th>
</tr>
</thead>
<tbody>
<?php
$sql = "SELECT mails.id, customers.f_ad, certificates.c_no, mails.m_sablon_ismi, mails.gonderim_tarihi, mails.m_konu, mails.m_icerik
FROM mails
JOIN customers ON mails.customer_id = customers.id
JOIN certificates ON mails.template_id = certificates.id
ORDER BY mails.gonderim_tarihi DESC";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
while ($row = $result->fetch_assoc()) {
echo "<tr>";
echo "<td>". $row["id"]. "</td>";
echo "<td>". $row["f_ad"]. "</td>";
echo "<td>". $row["c_no"]. "</td>";
echo "<td>". $row["m_sablon_ismi"]. "</td>";
echo "<td>". $row["gonderim_tarihi"]. "</td>";
echo "<td>". $row["m_konu"]. "</td>";
echo "<td>". $row["m_icerik"]. "</td>";
echo "</tr>";
}
} else {
echo "<tr><td colspan='7'>Kayıt bulunamadı</td></tr>";
}
?>
</tbody>
</table>
</div>
</div>
<?php
$conn->close();
?>
<script src="script.js"></script>
</body>
</html>