Este es el error:
Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\newop\template\header.php:80) in C:\xampp\htdocs\newop\mainindex.php on line 16
La línea 80 del header es esta (es una sola línea, solo que descompactada):
<div class="col-md-2 col-xs-2 device-select">
<a href="budget.php?device=2">
<img class="full-width" src="res/images/device2.jpg">
</img>
</a>
<center class="popular-devices">
<?php echo $lang['header_dropdown_string_2'];?>
</center>
</div>
... y este el código:
<?php
session_start();
if (!isset($_SESSION['user'])){ header("Location: index.php"); }
?>
<html>
<body>
<?php
include("template/head.php");
include("template/header.php");
include ("db_files/db.php");
$usermail = mysqli_real_escape_string($db, $_SESSION['user']);
$strSQL = "SELECT nivel FROM usuarios where email ='$usermail'";
$query = mysqli_query($db, $strSQL);
while ($result = mysqli_fetch_array($query)){
if ($result['nivel'] == 1 || $result['nivel'] == 2){
header("location: userlist:php");
}
}
$state = array(
1 => $lang['state_name_string_1'],
2 => $lang['state_name_string_2'],
3 => $lang['state_name_string_3'],
4 => $lang['state_name_string_4'],
);
?>
<div class="content container">
<div class="row no-margin no-padding">
<div class="col-md-2 hidden-sm hidden-xs">
<div class="mainuserimage">
<img class="full-width" src="res/images/users/user1.png"/>
</div>
<div>
<?php
$strSQL = "SELECT nombre, email, telefono FROM usuarios where email ='$usermail'";
$query = mysqli_query($db, $strSQL);
while ($result = mysqli_fetch_array($query)){
echo "<i class='glyphicon glyphicon-user'></i> ".$result['nombre']."<br>";
echo "<i class='glyphicon glyphicon-envelope'></i> ".$result['email']."<br>";
echo "<i class='glyphicon glyphicon-earphone'></i> ".$result['telefono']."<br>";
}
?>
</div>
</div>
<div class="col-md-10 col-xs-12">
<h3 class="main-title"><?php echo $lang['mainindex_string_1']; ?></h3><br>
<div class="row">
<div class="col-md-2 col-xs-3">
<p><?php echo $lang['mainindex_string_2']; ?></p>
</div>
<div class="col-md-2 col-xs-3">
<p><?php echo $lang['mainindex_string_3']; ?></p>
</div>
<div class="col-md-2 col-xs-3">
<p><?php echo $lang['mainindex_string_4']; ?></p>
</div>
<div class="col-md-2 hidden-sm hidden-xs">
<p><?php echo $lang['mainindex_string_5']; ?></p>
</div>
<div class="col-md-2 col-xs-3">
<p><?php echo $lang['mainindex_string_6']; ?></p>
</div>
<div class="col-md-2 hidden-sm hidden-xs">
<p><?php echo $lang['mainindex_string_7']; ?></p>
</div>
<?php
$strSQL = "SELECT id, marca, modelo, imei, descripcion_problema, problem, problem2, problem2_namees, estado, fecha_creacion FROM tickets, problem2 WHERE tickets.email = '$usermail' AND tickets.problem2 = problem2.problem2_id";
$query = mysqli_query($db, $strSQL);
while($result = mysqli_fetch_array($query)){ ?>
<div class="col-md-2 col-xs-3">
<p><a href="repairdetail.php?id=<?php echo $result['id']; ?>"><i class="glyphicon glyphicon-list-alt"></i></a> <?php echo $result['marca']; ?></p>
</div>
<div class="col-md-2 col-xs-3">
<p><?php echo $result['modelo']; ?></p>
</div>
<div class="col-md-2 col-xs-3">
<p><?php echo $result['imei']; ?></p>
</div>
<div class="col-md-2 hidden-sm hidden-xs">
<p><?php echo $result['problem2_namees']; ?></p>
</div>
<div class="col-md-2 col-xs-3">
<p><?php echo $state[$result['estado']]; ?></p>
</div>
<div class="col-md-2 hidden-sm hidden-xs">
<p><?php echo $result['fecha_creacion']; ?></p>
</div>
<?php
}
?>
</div>
</div>
</div>
</div>
<?php
include("template/footer.php");
?>
</body>
</html>
include("template/head.php");
lo tienes en el body