1<?php
2/**
3* This file provides output functions for summary.php
4* No data manipulation is done in this file
5* @author Samuel Tran
6* @author Jeremy Fowler <jfowler06@users.sourceforge.net>
7* @version 04-03-2007
8* @package Templates
9*
10* Copyright (C) 2005 - 2007 MailZu
11* License: GPL, see LICENSE
12*/
13
14
15/**
16* Print table listing messages in quarantine :
17*	- spam (content type = 'S')
18*	- attachment (content type = 'B')
19*	- viruses (content type = 'V')
20*	- bad headers (content type = H)
21*	- pending requests ( RS = 'P')
22* @param array $res containing spam and attachments of logged in user
23*/
24function showSummary($count_array) {
25	global $link;
26
27?>
28	<table width="100%" border="0" cellspacing="0" cellpadding="1" align="center">
29  		<tr>
30    		<td class="tableBorder">
31
32					<!-- Draw Summary table -->
33      		<table width="100%" border="0" cellspacing="1" cellpadding="0">
34        		<tr>
35			<td colspan="5" class="tableTitle">
36			<?php echo translate($_SESSION['sessionNav']); ?>
37			</td>
38
39        		<td class="tableTitle">
40            		<div align="right">
41              			<?php $link->doLink('javascript: help(\'msg_summary\');', '?', '', 'color: #FFFFFF;',
42					translate('Help') . ' - ' . translate($_SESSION['sessionNav'])) ?>
43            		</div>
44        		</td>
45        		</tr>
46      		</table>
47
48
49		<!-- Print summary table -->
50    <table class="stdFont" width="100%" height="100%" border="0" cellspacing="1" cellpadding="0">
51
52				<!-- Print table's headers -->
53        <tr class="rowHeaders">
54					<td width="15%">
55						<?php echo translate('Date'); ?>
56					</td>
57					<td width="14%">
58						<?php echo translate('Spam'); ?>
59					</td>
60       		<td width="14%">
61						<?php echo translate('Banned'); ?>
62					</td>
63       		<td width="14%">
64 						<?php echo translate('Viruses'); ?>
65					</td>
66       		<td width="14%">
67 						<?php echo translate('Bad Headers'); ?>
68					</td>
69       		<td width="14%">
70 						<?php echo translate('Pending Requests'); ?>
71					</td>
72       		<td width="15%">
73 						<?php echo translate('Total'); ?>
74					</td>
75   			</tr>
76
77			<?php  $i = 0;
78					foreach ($count_array as $key => $val) {
79						echo '<tr class="' . 'cellColor' . ($i++%2) . ' align="center">';
80						echo ($key == 'Total' ? '<td class="rowTotals">' : '<td class="rowNumValues">') . "$key</td> \n";
81						foreach ($val as $subkey => $subval) {
82	 						echo ( $key == 'Total' ? '<td class="rowTotals">' : '<td class="rowNumValues">') . "$subval</td> \n";
83						}
84					echo '</tr>';
85					}
86			?>
87			</tr>
88		</table>
89		</td>
90		</tr>
91	</table>
92<?php
93}
94
95?>
96