<?php
    
/**
    * o------------------------------------------------------------------------------o
    * | This package is dual licensed as QPL (NOT GPL) and a commercial license.     |
    * | If you use the code commercially (or if you don't want to be restricted by   |
    * | the QPL license), you will need the commercial license. It's only £49 (GBP - |
    * | roughly $98 depending on the exchange rate) and helps me out a lot. Thanks.  |
    * o------------------------------------------------------------------------------o
    *
    * © Copyright Richard Heyes
    */

    /**
    * This class allows easy and attractive messages to be displayed to users
    */
    
class Messages2
    
{
        
/**
        * Shows a nicely formatted success message
        *
        * @param string $msg The success message
        */
        
function ShowSuccess($msg)
        {
    
?>
    <div style="background-color: #ECFFD5; border: 2px solid #BAE09B; margin: 5px">
        <table border="0">
            <tr>
                <td>
                    <img src="green_tick.png" style="float: left" />
                    <div style="color: #5BA600; margin-top: 3px; font-weight: bold; font-family: Arial, Sans-serif; font-size: 12pt">
                        <?=htmlspecialchars($msg)?>
                    </div>
                </td>
                <td></td>
            </tr>
        </table>
    </div>
<?php
        
}

        
/**
        * Shows a nicely formatted warning message
        *
        * @param string $msg The warning message
        */
        
function ShowWarning($msg)
        {
    
?>
    <div style="background-color: #FFFCF1; border: 2px solid #FFDB5F; margin: 5px">
        <table border="0">
            <tr>
                <td>
                    <img src="yellow_exclamation.png" style="float: left" />
                    <div style="color: #EEBE00; margin-top: 3px; font-weight: bold; font-family: Arial, Sans-serif; font-size: 12pt">
                        <?=htmlspecialchars($msg)?>
                    </div>
                </td>
                <td></td>
            </tr>
        </table>
    </div>
<?php
        
}
        
        
/**
        * Shows a nicely formatted error message
        *
        */
        
function ShowError($msg)
        {
?>
    <div style="background-color: #FFE3E3; border: 2px solid #FEC2C2; margin: 5px">
        <table border="0">
            <tr>
                <td>
                    <img src="red_cross.png" style="float: left" />
                    <div style="color: #E80000; margin-top: 3px; font-weight: bold; font-family: Arial, Sans-serif; font-size: 12pt">
                        <?=htmlspecialchars($msg)?>
                    </div>
                </td>
                <td></td>
            </tr>
        </table>
    </div>
<?php
        
}
    }
?>