1319f362014590d1713c84f338b166d2d9be03d5
[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_heading($msg)
33 {
34         echo "<center><span class='headingtext'>$msg</span></center>\n";        
35 }
36
37 function display_heading2($msg)
38 {
39         echo "<center><span class='headingtext2'>$msg</span></center>\n";       
40 }
41
42 function display_note($msg, $br=0, $br2=0, $extra="")
43 {
44         for ($i = 0; $i < $br; $i++)
45                 echo "<br>";
46         if ($extra != "")       
47                 echo "<center><span $extra>$msg</span></center>\n";     
48         else    
49                 echo "<center><span>$msg</span></center>\n";    
50         for ($i = 0; $i < $br2; $i++)
51                 echo "<br>";
52 }
53
54 function stock_item_heading($stock_id)
55 {
56         if ($stock_id != "") 
57         {
58                 $result = db_query("SELECT description, units FROM ".TB_PREF."stock_master WHERE stock_id=".db_escape($stock_id));
59         $myrow = db_fetch_row($result);
60         
61         display_heading("$stock_id - $myrow[0]"); 
62         $units = $myrow[1];
63         display_heading2(_("in units of : ") . $units);         
64         }
65 }
66
67 ?>