/usr/local/miolo2/classes/ui/controls/merror.class

Go to the documentation of this file.
00001 <?php
00006 class MError extends MControl
00007 {
00011     var $msg;
00012 
00016     var $info;
00017 
00021     var $href;
00022 
00034     function __construct($msg = null, $info = null, $href = null)
00035     {
00036         $this->msg = $msg;
00037         $this->info = $info;
00038         $this->href = $href;
00039 
00040         if (!$this->msg)
00041             $this->msg = "Erro";
00042 
00043         //        if ( ! $this->info )
00044         //            $this->info = "Causa desconhecida";
00045 
00046         if (!$this->href)
00047         {
00048             $this->href = getenv("HTTP_REFERER");
00049 
00050             if (!$this->href)
00051                 $this->href = "/index.php";
00052         }
00053     }
00054 
00062     function Generate()
00063     {
00064         echo "<html>";
00065         echo "<body>";
00066         echo "<form action=\"{$this->href}\">";
00067         echo "<table width=\"50%\" border=\"0\" cellspacing=\"0\" cellpadding=\"3\" align=\"center\">\n";
00068         echo "  <tr>\n";
00069         echo "    <td class=\"boxTitle\" bgcolor=\"#990000\" colspan=\"2\"><font color=\"#FFFFFF\"><b>Fatal Error</b></font></td>\n";
00070         echo "  </tr>\n";
00071         echo "  <tr>\n";
00072         echo "    <td valign=\"top\" width=\"60\"><img src=\"/images/error.gif\" hspace=\"20\"></td>\n";
00073         echo "    <td class=\"errorText\">";
00074 
00075         echo $this->msg;
00076 
00077         if (is_array($this->info))
00078         {
00079             echo "<ul>\n";
00080 
00081             foreach ($this->info as $i)
00082                 echo "<li>$i</li>";
00083 
00084             echo "</ul>\n";
00085         }
00086         else
00087             echo $this->info;
00088 
00089         echo "</td>\n";
00090         echo "  </tr>\n";
00091         echo "  <tr>\n";
00092         echo "    <td colspan=\"2\" bgcolor=\"#AAAAAA\" align=\"center\">\n";
00093         echo "       <input type=\"button\" value=\"Voltar\">\n";
00094         echo "    </td>\n";
00095         echo "  </tr>\n";
00096         echo "</table>\n";
00097         echo "</form>";
00098         echo "</body></html>";
00099     }
00100 }
00101 ?>
CopyLeft (L) 2001-2006 - [MIOLO Development Team] SOLIS - Cooperativa de Soluções Livres - Lajeado/RS - Brasil