<?php
//Load time function (in footer)
$time = microtime(true);
$time = explode(' ', $time);
$time = $time[1] + $time[0];
$start = $time;

$session_username = mysql_real_escape_string($_SESSION['username']);
$session_password = mysql_real_escape_string($_SESSION['password']);

if($_SESSION['acctype'] == '1')  {

$startq = mysql_query("SELECT * FROM advertisers WHERE username='$session_username' AND password='$session_password'");
$startf = mysql_num_rows($startq);
$see = mysql_fetch_array($startq);

if ($startf == '0') {
$aloggedin = 0;
}
else
{
$aloggedin = 1;
}



}
else
{
$startq = mysql_query("SELECT * FROM members WHERE username='$session_username' AND password='$session_password'");
$startf = mysql_num_rows($startq);
$see = mysql_fetch_array($startq);

if ($startf == '0') {
$loggedin = 0;
}
else
{
$loggedin = 1;
}
}
?>
<!DOCTYPE html>
<html lang="en"><head>
  <meta charset="utf-8">
  <title><?php echo"$title"?></title>
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta name="description" content="Plan flat skin for Bootstrap">
  <meta name="author" content="Jozef Vojtáš" >
  
  <!-- Google Web Font -->
  <link href="http://fonts.googleapis.com/css?family=Open+Sans:300,300italic,700&subset=latin,latin-ext" rel="stylesheet" type="text/css">
  
  <!-- Bootstrap 3 Plan styles -->
  <link id="plan-theme" href="data/templates/frontend/bootflot/assets/css/bootstrap.belizehole.min.css" rel="stylesheet">
  <link href="include/fontawesome/css/font-awesome.css" rel="stylesheet" type="text/css" />
  <!-- Bootstrap Select -->
  <link rel="stylesheet" href="data/templates/frontend/bootflot/assets/css/bootstrap-select.min.css">
  <!-- Plan UI -->
  <link id="plan-theme-extra" href="data/templates/frontend/bootflot/assets/css/plan.belizehole.min.css" rel="stylesheet">

  <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
  <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
    <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
  <![endif]-->

  <!-- Docs Custom styles -->
  <style>

    body {
      padding: 120px 0 0 0; 
    }
    footer {
      background-color: white;
      border-top: 1px solid #ddd;
      padding: 30px;
      margin-top: 50px;
    }  
    .row > [class*="col-"] {
      margin-bottom: 30px;
    }
    .navbar-container {
      position: relative;
      min-height: 100px;
    }
    .navbar-container .navbar.navbar-fixed-top,
    .navbar-container .navbar.navbar-fixed-bottom {
      position: absolute;
      top: 50px;
      z-index: 0;
    }
    .navbar-container .navbar.navbar-fixed-top .container,
    .navbar-container .navbar.navbar-fixed-bottom .container {
      max-width: 90%;
    }
    .btn-group {
      margin-bottom: 10px
    }
    .form-inline select, 
    .form-inline input[type="text"], 
    .form-inline input[type="password"] {
      width: 180px;
    }
    .input-group {
      margin-bottom: 10px;
    }
    .pagination { margin-top :0;}
    .navbar-inverse {margin: 110px 0} 
  </style>
  
</head>

<body>

  <nav class="navbar navbar-inverse navbar-fixed-top" role="navigation" style="margin: 0"><!-- WHITE navbar-bootflot -->
    <div class="container">
		<a class="navbar-brand" href="f.home"><?php echo"$title"?></a>
      <!-- Brand and toggle get grouped for better mobile display -->
      <div class="navbar-header navbar-right">
        <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#main-nav">
          <span class="sr-only">Toggle navigation</span>
          <span class="icon-bar"></span>
          <span class="icon-bar"></span>
          <span class="icon-bar"></span>
        </button>
      </div>

      <!-- Collect the nav links, forms, and other content for toggling -->
      <div class="collapse navbar-collapse" id="main-nav">
        <ul class="nav navbar-nav">
          <li>
            <a href="f.home"><?php echo $a026; ?></a>
          </li>
          <li class="dropdown">
            <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo $a010;?> <b class="caret"></b></a>
            <ul class="dropdown-menu">
              <li><a href="f.publisher_rates"><?php echo $a193;?></a></li>
              <li><a href="f.advertiser_rates_int"><?php echo $a192;?></a></li>
            </ul>
          </li> 
		   <li>
            <a href="f.abuse"><?php echo $a013;?></a>
          </li>
		  <li>
            <a href="f.contact"><?php echo $a033;?></a>
          </li>
        </ul>
		<ul class="nav navbar-nav navbar-right">
			<li class="dropdown">
				<a href="#" class="dropdown-toggle" data-toggle="dropdown"><i class="fa fa-language"></i> <b class="caret"></b></a>
				<ul class="dropdown-menu">
					<li><a href="?lang=english">English</a></li>
					<li><a href="?lang=slovak">Slovak</a></li>
					<li><a href="?lang=german">German</a></li>
					<li><a href="?lang=chinese">Chinese</a></li>
					<li><a href="?lang=portuguese">Portuguese</a></li>
					<li><a href="?lang=russian">Russian</a></li>
					<li><a href="?lang=czech">Czech</a></li>
					<li><a href="?lang=spanish">Spanish</a></li>
					<li><a href="?lang=french">French</a></li>
					<li><a href="?lang=arabic">Arabic</a></li>
					<li><a href="?lang=croatian">Croatian</a></li>
					<li><a href="?lang=danish">Danish</a></li>
					<li><a href="?lang=hungarian">Hungarian</a></li>
					<li><a href="?lang=italian">Italian</a></li>
					<li><a href="?lang=japanese">Japanese</a></li>
					<li><a href="?lang=polish">Polish</a></li>
					<li><a href="?lang=slovenian">Slovenian</a></li>
					<li><a href="?lang=swedish">Swedish</a></li>
				</ul>
			</li> 
			<?php 
// IF LOGGED IN SHOW USER PANEL
if($_SESSION['username']) {
?>
			<li>
				<a data-toggle="modal" href="f.panel"> <i class="fa fa-sign-in"></i> <?php echo $a037;?></a>
			</li>
			<li>
				<a data-toggle="modal" href="f.panel/pub/logout"> <i class="fa fa-plus"></i> <?php echo $a041;?></a>
			</li>
<?php
}
//IF LOGGED OUT SHOW LOGIN / JOIN NOW PANEL
else
{
?>
			<li>
				<a data-toggle="modal" href="#signin"> <i class="fa fa-sign-in"></i> <?php echo $a043;?></a>
			</li>
			<li>
				<a data-toggle="modal" href="#signup"> <i class="fa fa-plus"></i> <?php echo $a042;?></a>
			</li>
<?php
}
?>
		</ul>
      </div><!-- /.navbar-collapse -->
    </div>
  </nav>