Location: PHPKode > projects > PHP OpenTailorShop > phpopentailorshop/webkasse/header.php
<?
session_start();
require("database.php");

// put full path to Smarty.class.php
require('/usr/local/lib/php/Smarty/Smarty.class.php');
require('/usr/local/lib/php/Smarty/SmartyPaginate.class.php');

$smarty = new Smarty();
$smarty->template_dir = '/home/elena/kasse/html/smarty/templates';
$smarty->compile_dir = '/home/elena/kasse/html/smarty/templates_c';
$smarty->cache_dir = '/home/elena/kasse/html/smarty/cache';
$smarty->config_dir = '/home/elena/kasse/html/smarty/configs';

$javascript = '
init() {
       
	if (document.all&&document.getElementById) {
		navRoot = document.getElementById("nav");
		for (i=0; i<navRoot.childNodes.length; i++) {
			node = navRoot.childNodes[i];
			if (node.nodeName=="LI") {
				node.onmouseover=function() {
					this.className+=" over";
				}
				node.onmouseout=function() {
					this.className=this.className.replace(" over", "");
				}
			}
		}
	}
}
   if (document.addEventListener) {
       document.addEventListener("DOMContentLoaded", init, false);
   }

   /* for Internet Explorer */
   /*@cc_on @*/
   /*@if (@_win32)
       document.write("<script defer src=ie_onload.js><"+"/script>");
   /*@end @*/
   
window.onload=init;

';

$pagetitle="Schneideratelier Kreativ Kasse";

$smarty->assign("pagetitle", $pagetitle);
$smarty->assign("javascript", $javascript);


function logged_in() 
{
	$ip=$_SERVER['REMOTE_ADDR'];
	$session = session_id();
	if ( $_SESSION['key'] == '' ) return FALSE ;
	$sql = "SELECT `username` FROM `account` WHERE `last_ip` = '".$ip."' AND `sessionkey`='".$_SESSION['key']."' LIMIT 1";
	$result = mysql_query($sql) or die( mysql_error() );
	if (mysql_num_rows($result) > 0)
	{
		if ( $row = mysql_fetch_array($result) )
		{
			return TRUE;
		}
		else return FALSE;
	}
	else return FALSE;	
}

if( logged_in() )       $bLogin = 1;
else                    $bLogin = 0;

$smarty->assign( "UserLogin", $bLogin );

$ip=$_SERVER['REMOTE_ADDR'];
$gmlevel = 0 ;
$sql = "SELECT `gmlevel` FROM `account` WHERE `last_ip` = '".$ip."' AND `sessionkey`='".$_SESSION['key']."' LIMIT 1";
$result = mysql_query($sql) or die( mysql_error() );
if (mysql_num_rows($result) > 0)
{
	if ( $row = mysql_fetch_array($result) )
	{
		$gmlevel = $row['gmlevel'];
	}
}

$smarty->assign( "GMLevel", $gmlevel );
?>
Return current item: PHP OpenTailorShop