<?php
require_once("include/connect.inc");
include("include/setsession.php");
mysqli_query($link, "SET character_set_results=utf8");

$lastid=0;
$txt='<div id="btnAdd" title="aggiungi un record" onclick="javascript:showDetAnag(0)"></div><table class="tree" width="100%">';
$i=1;
$query = "SELECT * FROM ".$s_prefix."_tb_users ORDER BY lastname";
$values = mysqli_query($link, $query) or die('Query failed: ' . mysqli_error($link));
while($result = mysqli_fetch_array($values, MYSQLI_ASSOC)) {
	$status='';
	//if($result['enabled']==0) $status=' style="color:#CC0000;"';;
	$border = 'style="border-top:solid 1px #414141"';
	if($i==1) $border='';
	$txt.= '<tr class="treegrid-'.$i.'"><td '.$border.'><tree_a><a href="#" onclick="javascript:showDetAnag('.$result['id'].')" '.$status.'>'.$result['lastname'].' '.$result['name'].'</a></tree_a><br>
				<tree_p>'.$result['lastname'] /*email*/.'</tree_p>
			</td></tr>';
	$a=$i;
	$i++;
}
unset($result);
mysqli_free_result($values);

$txt.= '</table>';

echo $txt
?>


