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)
16 $bt = $go_debug>1 ? ('<hr>'.get_backtrace(true)) : '';
17 trigger_error($msg.$bt, E_USER_ERROR);
20 function display_notification($msg, $center=true)
22 trigger_error($msg, E_USER_NOTICE);
25 function display_warning($msg, $center=true)
27 trigger_error($msg, E_USER_WARNING);
30 function display_notification_centered($msg)
32 display_notification($msg, true);
35 function display_heading($msg)
37 echo "<center><span class='headingtext'>$msg</span></center>\n";
40 function display_heading2($msg)
42 echo "<center><span class='headingtext2'>$msg</span></center>\n";
45 function display_note($msg, $br=0, $br2=0, $extra="")
47 for ($i = 0; $i < $br; $i++)
50 echo "<center><span $extra>$msg</span></center>\n";
52 echo "<center><span>$msg</span></center>\n";
53 for ($i = 0; $i < $br2; $i++)
57 function stock_item_heading($stock_id)
61 $result = db_query("SELECT description, units FROM ".TB_PREF."stock_master WHERE stock_id=".db_escape($stock_id));
62 $myrow = db_fetch_row($result);
64 display_heading("$stock_id - $myrow[0]");
66 display_heading2(_("in units of : ") . $units);