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)
14 trigger_error($msg, E_USER_ERROR);
17 function display_notification($msg, $center=true)
19 trigger_error($msg, E_USER_NOTICE);
22 function display_warning($msg, $center=true)
24 trigger_error($msg, E_USER_WARNING);
27 function display_notification_centered($msg)
29 display_notification($msg, true);
32 function display_caption($msg)
34 echo "<caption>$msg</caption>\n";
37 function display_heading($msg)
39 echo "<center><span class='headingtext'>$msg</span></center>\n";
42 function display_heading2($msg)
44 echo "<center><span class='headingtext2'>$msg</span></center>\n";
47 function display_note($msg, $br=0, $br2=0, $extra="")
49 for ($i = 0; $i < $br; $i++)
52 echo "<center><span $extra>$msg</span></center>\n";
54 echo "<center><span>$msg</span></center>\n";
55 for ($i = 0; $i < $br2; $i++)
59 function stock_item_heading($stock_id)
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);
66 display_heading("$stock_id - $myrow[0]");
68 display_heading2(_("in units of : ") . $units);