<div class="logged">
<span style="color:white;"><?=$_SESSION['UserData']['first_name'].' '.$_SESSION['UserData']['last_name']?> <a href="?action=logout"><?=$this->Language('logout');?></a>
<?
if($_SESSION['UserData']['type'] == 'SUPERADMIN' || $_SESSION['UserData']['from_role_type'] == 'SUPERADMIN' || $_SESSION['UserData']['type'] == 'ADMIN' || $_SESSION['UserData']['from_role_type'] == 'ADMIN' || $_SESSION['UserData']['type'] == 'SELLER_MANAGER' || $_SESSION['UserData']['from_role_type'] == 'SELLER_MANAGER'){

	echo '<span style="color:white;">'.$this->Language('Login as:').'</span> ';
	echo '<select name="login_as_dif_user" style="max-width:100px;">';
	while($row = $this->users->Assoc()){

		echo '<option value="'.$row['name'].':'.$row['password'].'" '.($row['id'] == $_SESSION['UserData']['user_id'] ? 'selected="selected"' : '').'>'.$row['name'].'</option>';
	}
	echo '</select>';
}
?>
<a href="?action=reassign"><?=$this->Language('reassign');?></a>
<?
if($_SESSION['UserData']['type'] == 'SUPERADMIN'){

	echo '<a href="'.phpmyadmin.'" style="padding:0;" target="_blank">phpMyAdmin</a>';
}
?>
</span>

<?=$this->fwMessages;?>
</div>

<script type="text/javascript">
$('[name=login_as_dif_user]').change(function(){

	var login_as_dif_user = $(this).val().split(':');
	window.location.href = "/admin/?action=login&user="+login_as_dif_user[0]+"&password="+login_as_dif_user[1]+"&from_role_type=<?=$_SESSION['UserData']['type'];?>";
});
</script>