Fixed many issues in output HTML code according to HTML 4.01 Transitional format.
[fa-stable.git] / includes / ui / ui_msgs.inc
1 <?php
2 /**********************************************************************
3     Copyright (C) FrontAccounting, LLC.
4         Released under the terms of the GNU General Public License, GPL, 
5         as published by the Free Software Foundation, either version 3 
6         of the License, or (at your option) any later version.
7     This program is distributed in the hope that it will be useful,
8     but WITHOUT ANY WARRANTY; without even the implied warranty of
9     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
10     See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
11 ***********************************************************************/
12 function display_error($msg, $center=true)
13 {
14         trigger_error($msg, E_USER_ERROR);
15 }
16
17 function display_notification($msg, $center=true)
18 {
19         trigger_error($msg, E_USER_NOTICE);
20 }
21
22 function display_warning($msg, $center=true)
23 {
24         trigger_error($msg, E_USER_WARNING);
25 }
26
27 function display_notification_centered($msg)
28 {
29         display_notification($msg, true);
30 }
31
32 function display_caption($msg)
33 {
34         echo "<caption>$msg</caption>\n";
35 }
36
37 function display_heading($msg)
38 {
39         echo "<center><span class='headingtext'>$msg</span></center>\n";        
40 }
41
42 function display_heading2($msg)
43 {
44         echo "<center><span class='headingtext2'>$msg</span></center>\n";       
45 }
46
47 function display_note($msg, $br=0, $br2=0, $extra="")
48 {
49         for ($i = 0; $i < $br; $i++)
50                 echo "<br>";
51         if ($extra != "")       
52                 echo "<center><span $extra>$msg</span></center>\n";     
53         else    
54                 echo "<center><span>$msg</span></center>\n";    
55         for ($i = 0; $i < $br2; $i++)
56                 echo "<br>";
57 }
58
59 function stock_item_heading($stock_id)
60 {
61         if ($stock_id != "") 
62         {
63                 $result = db_query("SELECT description, units FROM ".TB_PREF."stock_master WHERE stock_id=".db_escape($stock_id));
64         $myrow = db_fetch_row($result);
65         
66         display_heading("$stock_id - $myrow[0]"); 
67         $units = $myrow[1];
68         display_heading2(_("in units of : ") . $units);         
69         }
70 }
71
72 ?>