Class for message

# comment ->filename ->class.messagepanel.php

<?php

class messagedisplay{

private $msg_type;
private $msg_color;
private $msg_content;
private $msg_url_redirection;
private $msg_redirection_time;
private $msg_heading;
private $msg_url_disp;

function __construct($msg_type,$msg_content,$msg_url_redirection,$msg_redirection_time,$msg_heading,$msg_url_disp){

$this->msg_type             = $msg_type;                   # Will allow different color scheme to be applied to our msg box
$this->msg_content             = $msg_content;             # Content that will be displayed in the box
$this->msg_url_redirection     = $msg_url_redirection;        # Will store url to which we will be redirected
$this->msg_redirection_time = $msg_redirection_time;     # will store number of seconds to wait for redirection
$this->msg_heading             = $msg_heading;                # Will display the heading of our message box
$this->msg_url_disp            = $msg_url_disp;            # Will display msg between url

}//constructor

function displayMsg(){

if ($this->msg_type == “ERROR”)
$this->msg_color = “red”;

elseif($this->msg_type == “NORMAL”)
$this->msg_color = “green”;

elseif($this->msg_type == “INFO”)
$this->msg_color = “white”;

echo ‘<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>’;
echo ‘<html xmlns=”http://www.w3.org/1999/xhtml”>’;
echo ‘<head>’;
echo ‘<META HTTP-EQUIV=”refresh” CONTENT=”‘.$this->msg_redirection_time.’;URL=’.$this->msg_url_redirection.’”>’;
echo ‘<title>Message Display Panel</title>’;

echo ‘<link href=”moos/inettuts.css” rel=”stylesheet” type=”text/css” />’;
echo’<link rel=”stylesheet” type=”text/css” href=”css/common.css” />’;
echo ‘<script type=”text/javascript” src=”moos/jquery-1.2.6.min.js”></script>’;
echo ‘<script type=”text/javascript” src=”moos/jquery-ui-personalized-1.6rc2.min.js”></script>’;
echo ‘<script type=”text/javascript” src=”moos/inettuts.js”></script></HEAD><BODY>’;

echo ‘</head>’;

echo ‘<body>’;

echo ‘</HEAD><BODY>’;

echo ‘<div align=”center”>’;

echo ‘<table width=”1028″ id=”t1″>’;
echo ‘<tr>’;

echo ‘<td width=”1020″ height=”300″ align=”center” valign=”top”>’;
echo ‘<div id=”top”>’;

echo ‘</div>’;

echo ‘</td>’;

echo ‘</tr>’;

echo ‘<tr>’;
echo ‘<td height=”40″ align=”center”></td>’;
echo ‘</tr>’;
echo ‘<tr>’;
echo ‘<td height=”505″ align=”center” valign=”top”>’;
echo ‘<div align=”center”>’;
echo ‘</div>’;

echo ‘<div id=”columns”>’;
echo ‘<ul id=”column1″>’;
echo ‘</ul>’;

echo ‘<ul id=”column2″>’;
echo ‘<li>’;
echo ‘<div>’;
echo ‘<h3>’.$this->msg_heading.’</h3>’;
echo ‘</div>’;
echo ‘<div>’;
echo ‘<p><h3><b>’.$this->msg_content.’</b></h3></p>’;
echo ‘<p>You Will be Automatically Redirected to Required Page in ‘. $this->msg_redirection_time .’ Seconds.</p>’;
echo ‘<p>If you aren\’t forwarded to the new page, <br/><a href=”‘.$this->msg_url_redirection.’”>’.$this->msg_url_disp.’</a>.</p>’;

echo ‘</div>’;
echo ‘</li>’;
echo ‘</ul>’;

echo ‘</div>’;

echo ‘<br/></td>’;
echo ‘</tr>’;
echo ‘<tr>’;

echo ‘<td id=”bottom”  valign=”top” align=”center”>’;
echo ‘<div style=”color:#FFF; font-size:11px; font-weight:600;”> <strong>Copyright &copy; 2009</strong></div>’;

echo ‘</td>’;

echo ‘</tr>’;

echo ‘</table>’;

echo’</div>’;

echo ‘</body>’;
echo ‘</html>’;

}//displayMSg

}//class message display

?>

Leave a Reply