-
Notifications
You must be signed in to change notification settings - Fork 8
/
mail_history.php
84 lines (83 loc) · 1.87 KB
/
mail_history.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
<?php
// To view the list of sent mails history
require_once("config.php");
session_start();
if (isset($_SESSION["type"])) {
if ($_SESSION["type"] != 'ML') {
exit("Please go back and try again!");
}
} else {
header("Location: $start_page");
exit();
}
$mysqli = new mysqli($host,$db_user,$db_password,$db_name);
if ($mysqli->connect_errno)
die("Connect failed: ".$mysqli->connect_error);
?>
<!DOCTYPE html>
<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>Mailer</title>
<style type="text/css">
body
{
background-color:#F8F8FC;
}
.overflow
{
height:80px;
width:200px;
overflow:auto;
resize: both;
background-color: #F8F8FC;
margin: 3px;
border: 1px solid #88B;
border-radius: 3px;
}
table {
border-spacing: 0;
border: 0;
background-color:#F4F4FF;
}
th {
padding: 5px 15px 5px 0px;
text-align: left;
border: 0;
border-bottom: 1px solid #889;
background-color: #E9E9FF;
}
td {
padding-right: 15px;
border: 0;
border-bottom: 1px solid #99A;
}
td:hover {
background-color: #EFEFFF;
}
</style>
</head>
<body>
<h1>mailer</h1>
<a href="mail.php">Group mail</a>
<a href="mails_add.php">Add new eMails</a>
Mail history
<a href="logout.php">Log out</a><br/><br/>
<table>
<tr>
<th>id</th><th>replyto</th><th>wtag</th><th>stag</th>
<th>to_ids</th><th>subject</th><th>body</th><th>timestamp</th>
<?php
$result = $mysqli->query("SELECT id,replyto,wtag,stag,to_ids,subject,body,timestamp FROM mail_history");
while($r = $result->fetch_assoc()) {
$body = str_replace("\n",'<br/>',$r['body']);
echo "<tr><td>$r[id]</td><td>$r[replyto]</td><td>$r[wtag]</td><td>$r[stag]</td><td>$r[to_ids]</td>".
"<td>$r[subject]</td><td>$body</td><td>$r[timestamp]</td></tr>";
}
$result->free();
$mysqli->close();
?>
</tr>
</table>
</body>
</html>