Beispiel #1
0
function getPercentOfSentRead($username)
{
    $sent = getNumMailSent($username);
    $read = mysql_num_rows(mysql_query("SELECT `id` FROM `mail` WHERE `from`='{$username}' AND `unread`='0'") or die(mysql_error()));
    if ($sent == 0) {
        return 100;
    }
    return round($read / $sent * 100);
}
Beispiel #2
0
					<li><a href='about.php'>About xMail</a></li>
				</ul>
			</div>
			<div class='body'>
				<?php 
$alerts->displayAllAlerts();
// Display alerts
?>
				<div class='post'>
					<span class='title'>Your account, <?php 
echo $_SESSION['username'];
?>
</span>
					<p class='content'>
						You have sent <?php 
echo getNumMailSent($_SESSION['username']);
?>
 mail messages, <?php 
echo getPercentOfSentRead($_SESSION['username']);
?>
% of which have been read.<br>
						<br>
						<b>Change your password:</b>
						<form action='account.php' method='post'>
							<table border=0>
								<tr><td>Current Password: </td><td><input type='password' name='cpwd'></td></tr>
								<tr><td>New Password: </td><td><input type='password' name='npwd'></td></tr>
								<tr><td>Repeat New Password: </td><td><input type='password' name='npwd2'></td></tr>
								<tr><td colspan=2><input type='submit' name='changepassword' value='Change Password'></td></tr>
							</table>
						</form>