<?php

include ("config.php");

$highlight_menu = 2;

_request("id_user", "confirm");

if ($id_user == ADMIN_USER)
	header ("Location: utilisateur.php");

if ($info_util= $util->get_utilisateur($id_user))
{
	$id_zone = $info_util["id_zone"];
	$user_nom = $info_util["user_nom"];
	$user_prenom = $info_util["user_prenom"];
	$user_coords = $info_util["user_coords"];
	$user_tel1 = $info_util["user_tel1"];
	$user_tel2 = $info_util["user_tel2"];
	$user_login = $info_util["user_login"];
	$user_pass = $info_util["user_pass"];
	$user_cat = $info_util["user_cat"];
}
else
	header ("Location: utilisateur.php");

if ($confirm == 1)
{
	if ($util->del_utilisateur($id_user))
		header ("Location: utilisateur.php?action=suppression");
}

include ("header.php");

if (!empty($error))
{
	if (is_int($error))
		echo "<p class=\"center error\">" . $error_list[$error] . "</p>\n";
	else
		echo "<p class=\"center error\">" . $error . "</p>\n";
}

echo "<div id=\"form-utilisateur\">\n";
echo "<table class=\"center\">\n";

echo "<tr>\n";
echo "<th class=\"center\" colspan=\"2\">Informations concernant cet utilisateur</th>\n";
echo "</tr>\n";

echo "<tr>\n";
echo "<td class=\"r\"><label for=\"user_nom\">Nom</label></td>\n";
echo "<td><input type=\"text\" class=\"int\" name=\"user_nom\" id=\"user_nom\" value=\"" . $user_nom . "\" readonly=\"readonly\" /></td>\n";
echo "</tr>\n";

echo "<tr>\n";
echo "<td class=\"r\"><label for=\"user_prenom\">Pr&eacute;nom</label></td>\n";
echo "<td><input type=\"text\" class=\"int\" name=\"user_prenom\" id=\"user_prenom\" value=\"" . $user_prenom . "\" readonly=\"readonly\" /></td>\n";
echo "</tr>\n";

echo "<tr>\n";
echo "<td class=\"r\"><label for=\"user_coords\">Adresse</label></td>\n";
echo "<td><textarea name=\"user_coords\" id=\"user_coords\" readonly=\"readonly\">" . nobr($user_coords) . "</textarea></td>\n";
echo "</tr>\n";

echo "<tr>\n";
echo "<td class=\"r\"><label for=\"user_tel1\">T&eacute;l&eacute;phone</label></td>\n";
echo "<td><input type=\"text\" class=\"int\" name=\"user_tel1\" id=\"user_tel1\" value=\"" . $user_tel1 . "\" readonly=\"readonly\" /></td>\n";
echo "</tr>\n";

echo "<tr>\n";
echo "<td class=\"r\"><label for=\"user_tel2\">T&eacute;l&eacute;phone</label></td>\n";
echo "<td><input type=\"text\" class=\"int\" name=\"user_tel2\" id=\"user_tel2\" value=\"" . $user_tel2 . "\" readonly=\"readonly\" /></td>\n";
echo "</tr>\n";

$info_zone = $menu->get_zone_geo($id_zone);

echo "<tr>\n";
echo "<td class=\"r\"><label for=\"id_zone\">Zone g&eacute;ographique</label></td>\n";
echo "<td><input type=\"text\" class=\"int\" name=\"id_zone\" id=\"id_zone\" value=\"" . $info_zone["zone_nom"] . "\" readonly=\"readonly\" /></td>\n";
echo "</tr>\n";

echo "<tr>\n";
echo "<td class=\"r\"><label for=\"user_cat\">Cat&eacute;gorie</label></td>\n";
echo "<td><input type=\"text\" class=\"int\" name=\"user_cat\" id=\"user_cat\" value=\"" . (!empty($cat_tab[$user_cat]) ? $cat_tab[$user_cat] : "") . "\" readonly=\"readonly\" /></td>\n";
echo "</tr>\n";


echo "<tr>\n";
echo "<td class=\"center\" colspan=\"2\"><a class=\"sdel\" href=\"utilisateur_suppression.php?id_user=" . $id_user . "&amp;confirm=1\">Confirmer la suppression de cet utilisateur</a></td>\n";
echo "</tr>\n";

echo "</table>\n";
echo "</div>\n";

echo "<p><a class=\"slink\" href=\"utilisateur.php\">Retour &agrave; la liste des utilisateurs</a></p>\n";

include ("footer.php");

?>