<?php
$admin = 2;
$file = __FILE__;
include ("../inc/inc_common.php");
include ("../inc/inc_connect.php");
include ("../inc/inc_admincheck.php");
include ("../inc/inc_getdate.php");
include ("../inc/inc_forumname.php");
$page = "Admin - Email Stats";
$pagelink = $file;
include("../inc/inc_setonline.php");
$title = "$name1 Admin - $gfcookie[1]";
include ("../inc/inc_head.php");
include ("../inc/inc_body.php");
$title = "Emails Sent";
include ("../inc/inc_title.php");

if ($action == "delete")
{
    $query = "DELETE FROM $emailtable WHERE intId != '0'";
    mysql_query( $query, $link ) or die ( "Error! : ".mysql_error() );
}

print "<font size=$fontsizeb><br><center>";

$result=mysql_query("SELECT * FROM $emailtable");
$num_rows = mysql_num_rows( $result );
print "<b>$num_rows Emails are held on the system.</b><br><br><font size=$fontsize><a href=\"admin_stats_email.php?action=delete\">Wipe Emails From The Database</a><br><br>";
while ( $a_row = mysql_fetch_object( $result ) )
{
    $postthis = $a_row->memMessage;
    $postthis = str_replace ( "<", "&lt;", $postthis);
    $postthis = str_replace ( ">", "&gt;", $postthis);
    $postthis = nl2br("$postthis");
    print "<table border=1 cellspacing=0 width=\"75%\" bordercolor=\"$bordercolor\" cellpadding=2><tr><td>
    <font size=\"$fontsize\" face=\"$font\" color=\"$fontcolor\"><b>To</b>: $a_row->strTo<br>
    <b>From</b>: $a_row->strFrom<br>
    <b>Datestamp</b>: $a_row->strDate<br>
    <b>Subject</b>: $a_row->strSubject<br>
    <b>Message</b>: $postthis</td></tr></table><br>";
}


include ("../inc/inc_footer.php");

?>