0120b7f88f8ee7880f774ee5861eef3825b55152
[fa-stable.git] / includes / ui / ui_msgs.inc
1 <?php
2
3 function display_error($msg, $center=true)
4 {
5     echo "<center><table border='1' cellpadding='3' cellspacing='0' style='border-collapse: collapse' bordercolor='#CC3300' width='98%'>
6       <tr>
7         <td  " . ($center?"align='center' ":"") . " width='100%' bgcolor='#ffcccc'><font color='#dd2200'>$msg</font></td>
8       </tr>
9     </table></center><br>\n";   
10         
11         //echo "<span class='errortext'><B>" . _("ERROR :") . "</B> $msg</span><BR>";
12 }
13
14 function display_notification($msg, $center=true)
15 {
16     echo "<center><table border='1' cellpadding='3' cellspacing='0' style='border-collapse: collapse' bordercolor='#33cc00' width='98%'>
17       <tr>
18         <td " . ($center?"align='center' ":"") . " width='100%' bgcolor='#ccffcc'><font color='#007700'>$msg</font></td>
19       </tr>
20     </table></center><br>\n";   
21 }
22
23 function display_notification_centered($msg)
24 {
25         display_notification($msg, true);
26 }
27
28 function display_heading($msg)
29 {
30         echo "<center><span class='headingtext'>$msg</span></center>\n";        
31 }
32
33 function display_heading2($msg)
34 {
35         echo "<center><span class='headingtext2'>$msg</span></center>\n";       
36 }
37
38 function display_note($msg, $br=0, $br2=0, $extra="")
39 {
40         for ($i = 0; $i < $br; $i++)
41                 echo "<br>";
42         if ($extra != "")       
43                 echo "<center><span $extra>$msg</span></center>\n";     
44         else    
45                 echo "<center><span>$msg</span></center>\n";    
46         for ($i = 0; $i < $br2; $i++)
47                 echo "<br>";
48 }
49
50 function stock_item_heading($stock_id)
51 {
52         if ($stock_id != "") 
53         {
54                 $result = db_query("SELECT description, units FROM ".TB_PREF."stock_master WHERE stock_id='$stock_id'");                
55         $myrow = db_fetch_row($result);
56         
57         display_heading("$stock_id - $myrow[0]"); 
58         $units = $myrow[1];
59         display_heading2(_("in units of : ") . $units);         
60         }
61 }
62
63 ?>