Login   Register  
PHP Classes
elePHPant
Icontem

File: errOut.inc

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Srinivasan Ramakrishnan  >  csvtohtml  >  errOut.inc  >  Download  
File: errOut.inc
Role: ???
Content type: text/plain
Description: Error handler that can be changed to say log to a file or DB as needed. Outputs to screen by default. This file must be included for CSV2HTML to function.
Class: csvtohtml
Converts a CSV file into a HTML table
Author: By
Last change:
Date: 13 years ago
Size: 1,492 bytes
 

Contents

Class file image Download
<?php
/****************************************************************************************
*       CSV2HTML - PHP code by Srinivasan Ramakrishnan, cheeni@bigfoot.com              *
*       http://www.sriniram.com, 03/FEB/2001                                            *
*       Free for non-commercial use. For commercial use please contact author.          *
*       No warranties of correctness are extended for non-commercial usage.             *
****************************************************************************************/
/*  This is the error output function of CSV2HTML
    Change this as desired to manipulate output errors.
*/ 
function errOut($errMsg,$priority){
    switch($priority){
    case 0: $start = "<h1>";
            $end = "</h1>";
            $errLevel = "FATAL ERROR: (0)";
            $color = "#FF0000";
            break;
    case 1: $start = "<h2>";
            $end = "</h2>";
            $errLevel = "ERROR: (1)";
            $color = "#cc3300";
            break;
    case 2: $start = "<h3>";
            $end = "</h3>";
            $errLevel = "WARNING: (2)";         
            $color = "#ff9900";
            break;
    case 3: $start = "<h4>";
            $end = "</h4>";
            $errLevel = "NOTE: (3)";            
            $color = "Yellow";
            break;
    }
    
    echo $start . '<font color="' . $color .'">' . "<b>" . $errLevel ."</b><br><i>". $errMsg ."</i></font>". $end;
}
?>