<?php
require_once ("../classes/settings.class.php");
require_once ("../classes/license.class.php");
$objST	= new settings($objDB);
$objLicense	= new License($objDB);
$siteTitle=$objST->select();

define('CURRENCY_CODE',$siteTitle['currency']);
define('PAYMENT_CURRENCY_CODE',$siteTitle['currencycode']);

$PG_TITLE=$objST->ClientFilePathName($_SERVER['PHP_SELF']);


//if logo empty shows site title in the logo place
if(trim($siteTitle['sitelogo'])!='')
{
	//checking logo default or not
	switch($siteTitle['sitelogo'])
	{
		case "logo_default.gif":
			$showLogoTop='12';
		break;

		default:
			$showLogoTop='12';
		break;
	}//end swich

	//checking image size
	@list($width,$height)=@getimagesize('../images/'.$siteTitle['sitelogo']);
	if($width>175)
	{
		$width='175';
	}//end if
	else
	{
		$width=$width;
	}//end else

	if($height>75)
	{
		$height='75';
	}//end if
	else
	{
		$height=$height;
	}//end else

	//$showLogoImgTtl='<img src="../images/'.$siteTitle['sitelogo'].'" width="'.$width.'" height="'.$height.'" alt="'.$siteTitle['sitename'].'" title="'.$siteTitle['sitename'].'" border="0">';
        $showLogoImgTtl='<img src="../images/'.$siteTitle['sitelogo'].'" alt="'.$siteTitle['sitename'].'" title="'.$siteTitle['sitename'].'" border="0" style="max-height:92px;">';
}//end if
else
{
	$showLogoTop='12';
	$showLogoImgTtl=$siteTitle['sitename'];
}//end else

$ShowContent    = isset($_POST['ddlContent']) && $_POST['ddlContent'] != '' ? $_POST['ddlContent'] : 'index.php';
$ddlContent     = isset($_POST['ddlContent']) && $_POST['ddlContent'] != '' ? $_POST['ddlContent'] : 'index.php';

if($PG_TITLE=='settings.php')
{
	$onBodyLd='onLoad="showHint(\'index.php\');"';
}//end if
if($PG_TITLE=='metatags.php')
{
	$onBodyLd='onLoad="ShowTitle(\''.$ShowContent.'\');"';
}//end if

//checking user login status
if (isset($_SESSION['adminlogged']) && $_SESSION['adminlogged']=="YES") 
{
	$shwLink='settings.php';
}//end if
else
{
	$shwLink='index.php';
}//end else


// Checking license validation
$table=TABLEPREFIX."lookup";
$var_domain	= strtoupper(trim($_SERVER['HTTP_HOST']));
if($var_domain == '192.168.0.11' || $var_domain == 'LOCALHOST' || $var_domain == '127.0.0.1' || ISCRIPTSCLOUD || $var_domain='ISCRIPTS.COM') {
    ;
}else if(!$objLicense->FCE74825B5A01C99B06AF231DE0BD667D($var_domain,$table)) {
    header("Location:invalidlicense.php");
    exit;
}
// Checking license validation
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title><?php echo $siteTitle['sitename'];?></title>
<meta name="keywords" content="<?php echo $siteTitle['metatagKey'];?>">
<meta name="description" content="<?php echo $siteTitle['metatagDes'];?>">
<meta name="copyright" content="Copyright (C) www.iScripts.com, 2007. All rights reserved.">
<meta name="author" content="www.armia.com">
<!--<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="PRAGMA" content="no-cache">
<meta http-equiv="Expires" content="Mon, 04 Dec 1999 21:29:02 GMT">-->
<link href="../favicon.ico" type="image/x-icon" rel="icon">
<link href="../favicon.ico" type="image/x-icon" rel="shortcut icon">
<link href="../styles/<?php echo $siteTitle['styles'];?>" rel="stylesheet" type="text/css">
<link href="../styles/CommonStyle.css" rel="stylesheet" type="text/css">
<link href="../styles/adminStyle.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.style1 {color: #FFFFFF}
-->
</style>

<script type="text/javascript" src="../js/jquery-1.8.3.min.js"></script>
</head>
<body <?php echo $onBodyLd;?>>

<div class="admin_main_outer">

<div class="admin_header">
<div id="Layer1" style="position:absolute; left:0; top:<?php echo $showLogoTop;?>px; width:auto; height:75px; z-index:1">
  <table width="100%"  border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td class=""><a href="<?php echo $shwLink;?>"><?php echo $showLogoImgTtl;?></a></td>
    </tr>
  </table>
</div>
<table width="100%"  border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td valign="middle" class="logo">
    <table width="100%"  border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="73%" align="right">&nbsp;</td>
        <td width="27%" align="right" class="admin_toprightlinks">
			<?php
			if(isset($_SESSION['adminlogged']) && $_SESSION['adminlogged']=="YES")
			{
				switch($PG_TITLE)
				{
					case "help_list.php":
						$hlpTxt='<font>Admin Help</font>';
					break;

					case "help_details.php":
						$hlpTxt='<font>Admin Help</font>';
					break;

					default:
						$hlpTxt='Admin Help';
					break;
				}//end switch

				echo '
				<a class="admin_logout" href="logout.php"><span>Logout</span></a>
				<a class="admin_hlp" href="help_list.php"><span>'.$hlpTxt.'</span></a>';
			}//end if
			?></td>
      </tr>
    </table>
    </td>
  </tr>
</table>
</div>

