Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Modules
Author Message
Donovan
Client


Joined: Oct 07, 2003
Posts: 735
Location: Ohio

PostPosted: Wed Jul 16, 2008 1:12 pm Reply with quote

Initial design of a new module I'm making for my kids swim team. I wanted a tabbed menu to list Roster, Records, Coaches and the like across the top.

I have used this tabmenu() before and wanted to replicate it here but so far am getting a blank page. I turned error reporting on but still see nothing.

Maybe someone can see what is wrong with this index.php


Code:
<?php


/************************************************************************
* Idle Hour Swim Team Module
* By: Steve Donovan
* http://www.idlehourswimteam.org
* Copyright © 2007 by Idle Hour Swim Club
* License: GNU/GPL
************************************************************************/

if (!defined('MODULE_FILE')) {
    die ("You can't access this file directly...");
}

//error_reporting (E_ALL|E_STRICT);
error_reporting(E_ALL);

define('INDEX_FILE', TRUE);
$index = 1;

//Required Files
@include_once("header.php");
$module_name = basename(dirname(__FILE__));
@get_lang($module_name);
global $module_name, $db, $prefix, $bgcolor1, $bgcolor2;

switch($op) {
      
      case "roster":
         swim_menu('Roster');      
         break;      

      case "team_records":
         swim_menu('Team Records');
         break;   

      case "pool_records":
         swim_menu('Pool Records');      
         break;

      case "swim_meets":
         swim_menu('Swim Meets');
         break;

      case "coaches":
         swim_menu('Coaches');
         break;   

      case "board_members":
         swim_menu('Board Members');
         break;

      default:
      swim_menu('Information');
      break;
         
}

function tabmenu(){
    global $prefix, $db, $bgcolor2, $bgcolor3;
echo "
 <style type=\"text/css\">
     a.tab {
        border-collapse: collapse;
        border-style: solid solid none solid;
        border-color: $bgcolor2;
        border-width: 1px 1px 0px 1px;
        background-color: $bgcolor2;
        padding: 2px 0.5em 1px 0.5em;
        margin-top: 4px;
        font-family: arial;
        text-decoration: none;
      }
          a.tab2 {
        border-collapse: collapse;
        border-style: solid solid solid solid;
        border-color: $bgcolor2;
        border-width: 1px 1px 1px 1px;
        background-color: $bgcolor2;
        padding: 2px 0.5em 1px 0.5em;
        margin-top: 4px;
        font-family: arial;
        text-decoration: none;
      }
      a.tab:hover {
        border-color: $bgcolor2;
        background-color: $bgcolor3;
      text-decoration: none;
       text-decoration: bold;
      }
      a.tab2:hover {
        border-color: $bgcolor2;
        background-color: $bgcolor3;
      text-decoration: none;
       text-decoration: bold;
      }
      .panel { border: solid 1px $bgcolor2; background-color: $bgcolor1; padding: 5px; height: 300px; overflow: none;
     text-decoration: none;}
    </style>";
   ?>
    <script language="JavaScript" type="text/javascript">
      var panels = new Array('panel1', 'panel2', 'panel3', 'panel4', 'panel5', 'panel6', 'panel7', 'panel8','panel9');
      var selectedTab = null;
      function showPanel(tab, name)
      {
        if (selectedTab)
        {
          selectedTab.style.backgroundColor = '<? echo"$bgcolor2";?>';
          selectedTab.style.paddingTop = '';
          selectedTab.style.paddingBottom = '2px';
        }
        selectedTab = tab;
        selectedTab.style.backgroundColor = '<? echo"$bgcolor3";?>';
        selectedTab.style.paddingTop = '4px';
        for(i = 0; i < panels.length; i++)
        {
          document.getElementById(panels[i]).style.display = (name == panels[i]) ? 'block':'none';
        }
        return false;
      }
    </script>
<?php
}

/**********************************
*  Swim Team Menu
***********************************/

function swim_menu($panel) {
    global $prefix, $db, $bgcolor2, $bgcolor3;
   tabmenu();
    include("header.php");   
    OpenTable();
    echo "<center><strong>Idle Hour Swim Team</strong></center><br>";
   echo "<a href=\"#\" class=\"tab\" onclick=\"return showPanel(this, 'panel1');\" STYLE=\"text-decoration:none\"><img src=\"modules/Swim_Team/images/folder.gif\" width=\"10\" height=\"10\" border=\"0\">Information</a>";
    echo "<a href=\"#\" class=\"tab\" onclick=\"return showPanel(this, 'panel2');\" STYLE=\"text-decoration:none\"><img src=\"modules/Swim_Team/images/folder.gif\" width=\"10\" height=\"10\" border=\"0\"> Team Roster</a>";
    echo "<a href=\"#\" class=\"tab\" onclick=\"return showPanel(this, 'panel3');\" STYLE=\"text-decoration:none\"><img src=\"modules/Swim_Team/images/folder.gif\" width=\"10\" height=\"10\" border=\"0\"> Team Records</a>";
   echo "<a href=\"#\" class=\"tab\" onclick=\"return showPanel(this, 'panel4');\" STYLE=\"text-decoration:none\"><img src=\"modules/Swim_Team/images/folder.gif\" width=\"10\" height=\"10\" border=\"0\"> Pool Records</a>";
   echo "<a href=\"#\" class=\"tab\" onclick=\"return showPanel(this, 'panel5');\" STYLE=\"text-decoration:none\"><img src=\"modules/Swim_Team/images/folder.gif\" width=\"10\" height=\"10\" border=\"0\"> Swim Meets</a>";
    echo "<a href=\"#\" class=\"tab\" onclick=\"return showPanel(this, 'panel6');\" STYLE=\"text-decoration:none\"><img src=\"modules/Swim_Team/images/folder.gif\" width=\"10\" height=\"10\" border=\"0\"> Coaches</a>";
    echo "<a href=\"#\" class=\"tab\" onclick=\"return showPanel(this, 'panel7');\" STYLE=\"text-decoration:none\"><img src=\"modules/Swim_Team/images/folder.gif\" width=\"10\" height=\"10\" border=\"0\"> Board Members</a>";
   echo "<a href=\"#\" class=\"tab\" onclick=\"return showPanel(this, 'panel8');\" STYLE=\"text-decoration:none\"><img src=\"modules/Swim_Team/images/folder.gif\" width=\"10\" height=\"10\" border=\"0\"> Join the Team</a>";   
   
   if ($panel=="Information"){$panstyle="";}else{$panstyle="style=\"display: none\"";}
   echo "<div class=\"panel\" id=\"panel1\" $panstyle>";
   information();
   echo "</div>";
   if ($panel=="Roster"){$panstyle="";}else{$panstyle="style=\"display: none\"";}
   echo "<div class=\"panel\" id=\"panel2\" $panstyle>";   
   roster();
   echo "</div>";
   if ($panel=="Team Records"){$panstyle="";}else{$panstyle="style=\"display: none\"";}
   echo "<div class=\"panel\" id=\"panel3\" $panstyle>";   
   team_records();
   echo "</div>";
   if ($panel=="Pool Records"){$panstyle="";}else{$panstyle="style=\"display: none\"";}
   echo "<div class=\"panel\" id=\"panel4\" $panstyle>";   
   pool_records();
   echo "</div>";
   if ($panel=="Swim Meets"){$panstyle="";}else{$panstyle="style=\"display: none\"";}
   echo "<div class=\"panel\" id=\"panel5\" $panstyle>";   
   swim_meets();
   echo "</div>";
   if ($panel=="Coaches"){$panstyle="";}else{$panstyle="style=\"display: none\"";}
   echo "<div class=\"panel\" id=\"panel6\" $panstyle>";   
   coaches();
   echo "</div>";
   if ($panel=="Board Members"){$panstyle="";}else{$panstyle="style=\"display: none\"";}
   echo "<div class=\"panel\" id=\"panel7\" $panstyle>";   
   board_members();
   echo "</div>";
   CloseTable();
   echo "<br>";   
   echo "<br>";   
    include("footer.php");
}

/**********************************
*  Information
***********************************/

function information() {
    global $prefix, $db, $bgcolor2, $bgcolor3;
   tabmenu();
   echo"<table border=\"1\" width=\"100%\" cellpadding=\"3\">";
   echo"<tr>"
   ."<td>Information Under Construction</td>"
   ."</tr>"
   ."</table>";

  include("footer.php");   
}


/**********************************
*  Team Roster
***********************************/

function roster() {
   global $prefix, $db, $bgcolor2, $bgcolor3;
   tabmenu();   
   echo"<table border=\"1\" width=\"100%\" cellpadding=\"3\">";
   echo"<tr>"
   ."<td>Roster Under Construction</td>"
   ."</tr>"
   ."</table>";

 include("footer.php");
}

/**********************************
*  Team Records
***********************************/

function team_records() {
   global $prefix, $db, $bgcolor2, $bgcolor3;
   tabmenu();
   echo"<table border=\"1\" width=\"100%\" cellpadding=\"3\">";
   echo"<tr>"
   ."<td>Team Records Under Construction</td>"
   ."</tr>"
   ."</table>";
  include("footer.php");   
}
   
/**********************************
*  Pool Records
***********************************/

function pool_records() {
    global $prefix, $db, $bgcolor2, $bgcolor3;
   tabmenu();
   echo"<table border=\"1\" width=\"100%\" cellpadding=\"3\">";
   echo"<tr>"
   ."<td>Pool Records Under Construction</td>"
   ."</tr>"
   ."</table>";
  include("footer.php");   
}

/**********************************
*  Swim Meets
***********************************/

function swim_meets() {
    global $prefix, $db, $bgcolor2, $bgcolor3;
   tabmenu();
   echo"<table border=\"1\" width=\"100%\" cellpadding=\"3\">";
   echo"<tr>"
   ."<td>Swim Meets Under Construction</td>"
   ."</tr>"
   ."</table>";
  include("footer.php");   
}

/**********************************
*  Coaches
***********************************/

function coaches() {
    global $prefix, $db, $bgcolor2, $bgcolor3;
   tabmenu();
   echo"<table border=\"1\" width=\"100%\" cellpadding=\"3\">";
   echo"<tr>"
   ."<td>Coaches Under Construction</td>"
   ."</tr>"
   ."</table>";
  include("footer.php");   
}

/**********************************
*  Board Members
***********************************/

function board_members() {
    global $prefix, $db, $bgcolor2, $bgcolor3;
   tabmenu();
   echo"<table border=\"1\" width=\"100%\" cellpadding=\"3\">";
   echo"<tr>"
   ."<td>Board Members Under Construction</td>"
   ."</tr>"
   ."</table>";
  include("footer.php");   
}

?>
 
View user's profile Send private message Visit poster's website ICQ Number
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 17086

PostPosted: Mon Jul 21, 2008 6:42 am Reply with quote

Remove all @ signs from the beginning of those statements. They suppress the error messages and make debugging impossible.
 
View user's profile Send private message
Donovan
PostPosted: Mon Jul 21, 2008 2:54 pm Reply with quote

Changed here but still nothing displayed.

Code:
if (!defined('MODULE_FILE')) { 

    die ("You can't access this file directly...");
}
require_once('mainfile.php');
//error_reporting (E_ALL|E_STRICT);
error_reporting(E_ALL);

define('INDEX_FILE', TRUE);
$index = 1;

//Required Files
include_once("header.php");
$module_name = basename(dirname(__FILE__));
get_lang($module_name);
global $module_name, $db, $prefix, $bgcolor1, $bgcolor2;
 
Raven
PostPosted: Mon Jul 21, 2008 4:06 pm Reply with quote

Have you checked your server error log?
 
Donovan
PostPosted: Mon Jul 21, 2008 5:09 pm Reply with quote

The only thing in my error logs are I'm missing an image in my theme.

public_html/themes/images/PH2BLUE/pixel.gif

I just now fixed the path.
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Modules

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©