Location: PHPKode > projects > Shift Log > shiftlog_stable_1.9.4/shiftlog/index.php
<?php
#########################################################################
#	Shift Log - A simple pass down log program 			                #
#	Written By Brandon Crabtree							                #
#	Copyright (C) 2006 Brandon Crabtree 				                #
#	         															#
# This program is free software: you can redistribute it and/or modify	#
# it under the terms of the GNU General Public License as published by	#
# the Free Software Foundation, either version 3 of the License, or		#
# (at your option) any later version.									#
# This program is distributed in the hope that it will be useful,		#
# but WITHOUT ANY WARRANTY; without even the implied warranty of		#
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the			#
# GNU General Public License for more details.							#
#																		#
# You should have received a copy of the GNU General Public License		#
# along with this program.  If not, see http://www.gnu.org/licenses .	#
#																		#			
#########################################################################

session_start();
	include('common/output_fns.php');
	include('common/config.php');
	include("common/login.php");
####################################################### Security Checking Do Not Remove ########################################################
	//convert your log in data to a variable
	$username = $_SESSION['username'];
	//check if your loged in if not get ya back to the login page.
	if($logged_in)
		{
	//connect to the database and check current users group membership
		$conn;
		
		$user_query="SELECT group_id FROM users WHERE username='$username'";
		$result=mysql_query($user_query);
		$line=mysql_fetch_array($result);

	//If a member of staff
				if ($log_status == 2)
					{
	//Check if the log is online if not post down for maintenance
					if ($gman == 1)
						{
						header( 'Location: common/help.php' ) ;
						}
	//If a member of management				
					elseif ($gman >=2)
						{
						header( 'Location: common/high5.php' ) ;						
						}
					else
						{
						displayLogin();
						}
					}
				else
					{
					header( 'Location: common/index.php');	
					}
					
	//If your not loged in, Display login page
	}
	else
	{
	displayLogin();
  	}
	//Display log status
	echo "<div id=\"staus\" align=\"center\">Log Status:";
	if($log_status == 1)
		{
		echo "<font color=\"green\"> Online</font>";
		}
		else
		{
		echo "<font color=\"red\"> Offline</font></div>";
		}
											
	 //Call the config file to connect to the db.

		
	

?>
Return current item: Shift Log