Layout adjustments
[fa-stable.git] / dimensions / includes / dimensions_ui.inc
1 <?php
2
3 include_once($path_to_root . "/includes/ui.inc");
4
5 //--------------------------------------------------------------------------------------
6
7 function display_dimension_payments($id)
8 {
9         global $path_to_root, $table_style;
10
11         $sql = "SELECT * FROM ".TB_PREF."gl_trans WHERE dimension_id = $id OR dimension2_id = $id
12                 ORDER BY account,tran_date";
13         $result = db_query($sql, "Transactions could not be calculated");
14
15     echo "<br>";
16
17     if (db_num_rows($result) == 0)
18     {
19         display_note(_("There are no transactions for this dimension."));
20     }
21     else
22     {
23                 display_heading2(_("Transactions for this Dimension"));
24                 start_table($table_style);
25                 $th = array(_("Type"), _("#"), _("Account"),
26                         _("Date"), _("Debit"), _("Credit"));
27                 table_header($th);
28
29         $total = $k = 0;
30
31         while ($myrow = db_fetch($result))
32         {
33
34                         alt_table_row_color($k);
35
36                 label_cell(systypes::name($myrow["type"]));
37                         label_cell(get_gl_view_str($myrow["type"], $myrow["type_no"], $myrow["type_no"], true));
38                         label_cell($myrow["account"]);
39                         label_cell(sql2date($myrow["tran_date"]));
40                         display_debit_or_credit_cells($myrow["amount"]);
41
42                         $total += $myrow["amount"];
43
44                         end_row();
45                 }
46
47                 start_row();
48                 label_cell(_("Total"), "colspan=4");
49                 display_debit_or_credit_cells($total);
50                 end_row();
51
52                 end_table();
53     }
54 }
55
56 //--------------------------------------------------------------------------------------
57
58 ?>