1<?php
2
3
4include ('includes/session.php');
5
6$Title = _('Periods Inquiry');
7
8include('includes/header.php');
9
10$SQL = "SELECT periodno ,
11		lastdate_in_period
12		FROM periods
13		ORDER BY periodno";
14
15$ErrMsg =  _('No periods were returned by the SQL because');
16$PeriodsResult = DB_query($SQL,$ErrMsg);
17
18echo '<p class="page_title_text"><img src="'.$RootPath.'/css/'.$Theme.'/images/transactions.png" title="' . $Title . '" alt="" />' . ' '
19		. $Title . '</p>';
20
21/*show a table of the orders returned by the SQL */
22
23$NumberOfPeriods = DB_num_rows($PeriodsResult);
24$PeriodsInTable = round($NumberOfPeriods/3,0);
25
26$TableHeader = '<tr><th>' . _('Period Number') . '</th>
27					<th>' . _('Date of Last Day') . '</th>
28				</tr>';
29
30echo '<table><tr>';
31
32for ($i=0;$i<3;$i++) {
33	echo '<td valign="top">';
34	echo '<table cellpadding="2" class="selection">';
35	echo $TableHeader;
36	$j=0;
37
38	while ($myrow=DB_fetch_array($PeriodsResult)){
39		echo '<tr class="striped_row">
40				<td>' . $myrow['periodno'] . '</td>
41			  <td>' . ConvertSQLDate($myrow['lastdate_in_period']) . '</td>
42			</tr>';
43		$j++;
44		if ($j==$PeriodsInTable){
45			break;
46		}
47	}
48	echo '</table>';
49	echo '</td>';
50}
51
52echo '</tr></table>';
53//end of while loop
54
55include('includes/footer.php');
56?>
57