<?php
/**
* MiniClick
* Gestionnaire de tableau collaboratif
* Copyright (C) 2006 Guillaume Monet <gm@ibreizh.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 
*
* @package miniclick
* @version 5.0.0
*/
//Test d'appel direct 
if($GLOBALS['main'] != 1){
	die("Cannot acces directly to this page");
}

if($_POST['nom'] != "" || $_POST['prenom'] != ""){
	$nom = $_POST['nom'];
	$prenom = $_POST['prenom'];
	$mail = $_POST['mail'];
  $req="UPDATE ".DB_NAME
  .".USER SET Nom='$nom',Prenom='$prenom',Mail='$mail' WHERE User_Id='"
	.$_SESSION['user_id']."'";
  // print $req;
	mysql_query($req);
}

$users = mysql_query("SELECT Nom,Prenom,Login,Mail FROM ".DB_NAME.".USER WHERE User_Id='".$_SESSION['user_id']."'");
$user = mysql_fetch_object($users);

?>
<form action="<?php echo $_SERVER["REQUEST_URI"]; ?>" method="POST">
<table class="formOuterBorder" border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
	<th class="formSecHeader" colspan="4" align="left">Informations de connection</th>
	</tr>
<tr>
<td>
	<table border="0" cellpadding="0" cellspacing="1" width="100%">
	<tbody><tr>
	<td class="dataLabel" width="20%">Nom:</td>
	<td width="30%"><input name="nom" tabindex="1" size="25" maxlength="25" value="<?php echo $user->Nom;?>" type="text"></td>
	<td class="dataLabel" width="20%"></font>Login:</td>
	<td width="30%"><input name="login" readonly="readonly" tabindex="2" size="15" maxlength="25" value="<?php echo $user->Login;?>" type="text"></td>
	</tr><tr>
	<td class="dataLabel" width="20%">Prenom:</td>
	<td width="30%"><input name="prenom" tabindex="1" size="25" maxlength="25" value="<?php echo $user->Prenom;?>"></td>
	</tr>
	</tbody></table>
</td></tr></tbody></table>
<br />
<table class="formOuterBorder" border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody><tr><td>
	<table border="0" cellpadding="0" cellspacing="1" width="100%">
	<tbody><tr>
	<th class="formSecHeader" colspan="4" align="left">Autres informations</th>
	</tr><tr>
	<td class="dataLabel" width="20%">Mail</td>
	<td width="30%"><input name="mail" tabindex="5" size="15" maxlength="25" value="<?php echo $user->Mail;?>" type="text"></td>
	<td class="dataLabel" width="20%">T&eacute;l&eacute;phone:</td>
	<td width="30%"><input name="phone" tabindex="6" size="20" maxlength="25" value="" type="text"></td>
	</tr></tbody></table>
</td></tr></tbody></table>
<input type="submit" />
</table>
