-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathview_mail.php
More file actions
51 lines (50 loc) · 1.57 KB
/
view_mail.php
File metadata and controls
51 lines (50 loc) · 1.57 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
<?php
session_start();
require_once("require/secure.php");
require_once("require/basic.php");
Secure(true);
page_head();
?>
<h2>E-Mail Log</h2>
<p>This page records every e-mail sent by the website</p>
<a id="showall" href='#'>Show All Comments</a> <a id="hideall" href='#'>Hide All Comments</a>
<div class="row">
<div class="col-md-12">
<table class="mail table table-bordered table-condensed">
<tr><th>To</th><th>Time</th><th>Subject</th><th style="width: 120px;">Body</th></tr>
<?php
$result = $sql->query("SELECT `to`, `subject`, `body`, `date` FROM `hvz_mail` ORDER BY `date` ASC");
$num = 0;
while( $row = $result->fetch_assoc() )
{
$body = str_replace("\n", "<br/>", $row['body']);
//<p class='body'>{$body}</p>
echo "<tr><td>{$row['to']}</td><td>{$row['date']}</td><td>{$row['subject']}</td><td class='body'><a id='body$num' href='#'>Show/Hide</a></td></tr>";
echo "<tr><td style='padding: 0' colspan='4'>" ;
echo "<div style='margin: 5px' id='collapse$num' class='collapse'><div style='margin-bottom: 0' class='well'>{$body}</div></div>";
echo "</td></tr>";
$num = $num + 1;
}
?>
</table>
</div>
</div>
<script type="text/javascript">
$("td.body a").click( function() {
var idNum = $(this).attr('id').substr(4);
$("#collapse" + idNum).collapse("toggle");
return false;
});
//$("p.body").hide();
$("a#showall").click( function() {
$("div.collapse").collapse("show");
return false;
});
$("a#hideall").click( function() {
$("div.collapse").collapse("hide");
return false;
});
</script>
<?php
page_foot();
?>