-
Notifications
You must be signed in to change notification settings - Fork 0
/
GLCodesInquiry.php
75 lines (61 loc) · 1.71 KB
/
GLCodesInquiry.php
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
<?php
/* $Revision: 1.8 $ */
$PageSecurity = 8;
include ('includes/session.inc');
$title = _('GL Codes Inquiry');
include('includes/header.inc');
$SQL = 'SELECT group_,
accountcode ,
accountname
FROM chartmaster INNER JOIN accountgroups ON chartmaster.group_ = accountgroups.groupname
ORDER BY sequenceintb,
accountcode';
$ErrMsg = _('No general ledger accounts were returned by the SQL because');
$AccountsResult = DB_query($SQL,$db,$ErrMsg);
/*show a table of the orders returned by the SQL */
echo "<CENTER><TABLE CELLPADDING=2 COLSPAN=2>
<TR>
<TH>"._('Group')."</FONT></TH>
<TH>"._('Code')."</FONT></TH>
<TH>"._('Account Name').'</FONT></TH>
</TR>';
$j = 1;
$k=0; //row colour counter
$ActGrp ='';
while ($myrow=DB_fetch_array($AccountsResult)) {
if ($k==1){
echo '<tr class="EvenTableRows">';
$k=0;
} else {
echo '<tr class="OddTableRows">';
$k++;
}
if ($myrow['group_']== $ActGrp){
printf("<td></td>
<td><FONT SIZE=2>%s</FONT></td>
<td><FONT SIZE=2>%s</FONT></td>
</tr>",
$myrow['accountcode'],
$myrow['accountname']);
} else {
$ActGrp = $myrow['group_'];
printf("<td><FONT SIZE=2>%s</FONT></td>
<td><FONT SIZE=2>%s</FONT></td>
<td><FONT SIZE=2>%s</FONT></td>
</tr>",
$myrow['group_'],
$myrow['accountcode'],
$myrow['accountname']);
}
$j++;
If ($j == 18){
$j=1;
echo "<TR><TH>"._('Group')."</FONT></TH>
<TH>"._('Code')."</FONT></TH>
<TH>"._('Account Name').'</FONT></TH></TR>';
}
}
//end of while loop
echo '</TABLE></CENTER>';
include('includes/footer.inc');
?>