Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class page{
- public $content;
- public $title = "TLA consultanting Agency";
- public $keywords = "TLA, consultanting, etc";
- public $buttons = array(
- "Home" => "home.php",
- "Contact" => "contact.php",
- "Services" => "services.php",
- "Site Map" => "map.php"
- );
- public function __set($name, $value){
- $this -> $name = $value;
- }
- public function display(){
- echo"<html>\n<head>\n";
- $this -> DisplayTitle();
- $this -> DisplayKeywords();
- $this -> DisplayStyles();
- echo "</head>\n<body>\n";
- //$this -> DisplayHeader();
- $this -> DisplayMenu($this->$buttons);
- echo $this->content;
- //$this -> DisplayFooter();
- echo "</body>\n</html>\n";
- }
- public function DisplayTitle(){
- echo"<title>". $this->title."</title>";
- }
- public function DisplayKeywords(){
- echo "<meta name=\"Keywords\"
- content=\"".$this->keywords."\"/>";
- }
- public function DisplayStyles()
- {
- ?>
- <style>
- h1 {
- color:white; font-size:24pt; text-align:center; text-align:center;
- font-family:arial, san-serif
- }
- .menu{
- color:white; font-size:12pt; text-align:justify;
- font-family:arial, san-serif; font-weight:bold
- }
- td{
- background:black
- }
- p{
- color:black; font-size:12pt; text-align:justify;
- font-family:arial, san-serif
- }
- p.foot{
- color:white; font-size:9pt; text-align:center;
- font-family:arial, san-serif; font-weight: bold
- }
- a:link, a:visited, a:active{
- color:white
- }
- </style>
- <?php}
- public function DisplayHeader(){?>
- <table width="100%" cellpadding="12"
- cellspacing="0" border="0">
- <tr bgcolor="black">
- <td align="left"><img src="logo.png"/></td>
- <td>
- <h1>TLA Consultanting Pty LTD</h1>
- </td>
- <td align="right"><img src="logo.png"/></td>
- </tr>
- </table>
- <?php
- }
- public function DisplayMenu($buttons){
- echo"<table width=\"100%\" bgcolor=\"white\" cellpadding=\"4\" cellspacing=\"4\">\n";
- echo"</tr>\n";
- $width = 100/count($buttons);
- while(list($name,$url) = each($buttons)){
- $this -> DisplayButton($width, $name, $url,!$this->IsUrlCurrentPage($url));
- }
- echo"</tr>\n";
- echo"</table>\n";
- }
- public function IsUrlCurrentPage($url){
- if(strpos($_SERVER['PHP_SELF'],$url) == false){
- return false;
- }
- else{
- return true;
- }
- }
- public function DisplayButton($width, $name, $url, $active = true){
- if ($active){
- echo "<td width= \"". $width . "%\">
- <a href=\"". $url ."\">
- <img src=\"s-logo.png\" alt=\"".$name."\" border=\"0\"/></a>
- <a href=\"".$url."\"><span class=\"menu\">".$name."</span></a></td>";
- }
- else{
- echo "<td width= \"". $width . "%\">
- <img src=\"s-logo.png\">
- <span class=\"menu\">".$name."</span></td>";
- }
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement