<?php
session_start();
include('../connexion.php');
if (!isset($_SESSION['celest']))
{
	header ('Location: index.php');
}
$active='parametre';
if (isset($_GET['W9mvyDvFWE5']))
{
	$chaiz=addslashes($_GET['W9mvyDvFWE5']);
	$id=addslashes($_GET['QYtgoGbhhd']);
	
	$sql= 'SELECT * FROM '.$chaiz.' WHERE id_'.$chaiz.'='.$id;
	$reponse=$bdd->query($sql) or die('Erreur SQL !<br />'.$sql.'<br />'.mysql_error());
	$data=$reponse->fetch();
	require_once('active.php');
	if($data[0]==NULL)
	{
		header('Location: index.php');
	}
	?>
	<?php include('tete.php'); ?>
    <link rel="stylesheet" type="text/css" href="style/style_admin.css" />
</head>
<body>
    <div id="wrapper">
    	<?php include('menu_admin.php'); ?>
        <div id="page-wrapper">
            <div class="row">
                <div class="col-lg-1 col-md-1"></div>
                <div class="col-lg-10 col-md-10 col-sm-11 col-xs-12" id="administration">
                    <div id="titro_admin">Détails</div>
                    <table width="100%" class="table table-hover" id="tableau">
						<?php
                        switch($chaiz)
                        {
                            case 'type':
							?>
							<div id="afficher_admin">
								<a class="btn btn-primary" href="ajouter-info.php?W9mvyDvFWE5=<?php echo $chaiz ?>">
									<i class="fa fa-pencil"></i> Ajouter
								</a>
							</div>
							<?php
                            $sql= 'SELECT * FROM '.$chaiz.' WHERE id_'.$chaiz.'="'.$id.'"';
                            $reponse=$bdd->query($sql) or die('Erreur SQL !<br />'.$sql.'<br />'.mysql_error());
                            $data=$reponse->fetch();
                            ?>
                            <tr>
                                <td id="td_right">Titre:</td>
                                <td>
									<?php echo stripslashes($data['lib_'.$chaiz.'']) ?>
                                    <div style="float:right;">
                                        <a href="modifier-info.php?W9mvyDvFWE5=<?php echo $chaiz ?>&QYtgoGbhhd=<?php echo $id ?>">
                                            <i class="fa fa-edit fa-2x"></i>
                                        </a>
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td id="td_right">Champs utilisés:</td>
                                <td>
                                	<?php
                                    $sql3= 'SELECT * FROM selection_type, selection WHERE selection.id_selection=selection_type.id_selection AND id_type="'.$id.'"';
                                    $reponse3=$bdd->query($sql3) or die('Erreur SQL !<br />'.$sql3.'<br />'.mysql_error());
                                    while($data3=$reponse3->fetch())
                                    {
                                        echo '<div id="box-price">'.$data3['lib_selection'].' <span id="span">('.$data3['obligation_type'].')</span></div> ';
                                    }
                                    ?>
                                </td>
                            </tr>
                            <tr>
                                <td id="td_right">Nombre d'image:</td>
                                <td>
									<?php echo stripslashes($data['nnombre_'.$chaiz.'']) ?>
                                </td>
                            </tr>
                            <tr>
                                <td id="td_right">Nombre de fichier:</td>
                                <td>
									<?php echo stripslashes($data['nfichier_'.$chaiz.'']) ?>
                                </td>
                            </tr>
                            <tr>
                                <td id="td_right">Nombre de vidéo:</td>
                                <td>
									<?php echo stripslashes($data['nvideo_'.$chaiz.'']) ?>
                                </td>
                            </tr>
                            <tr>
                                <td id="td_right">Date de création</td>
                                <td>
                                	<?php 
									echo date("d M Y H:i", strtotime($data['creation_'.$chaiz.'']));
                                    $sql3= 'SELECT * FROM '.$chaiz.', user WHERE '.$chaiz.'.id_creation_user=user.id_user AND id_'.$chaiz.'="'.$id.'"';
                                    $reponse3=$bdd->query($sql3) or die('Erreur SQL !<br />'.$sql3.'<br />'.mysql_error());
                                    $data3=$reponse3->fetch();
                                    echo ' Par <a href="afficher-info.php?W9mvyDvFWE5=user&QYtgoGbhhd='.$data3[0].'"><span id="span_user">'.$data3['lib_user'].'</span></a>';
                                    ?>
                                </td>
                            </tr>
                            <tr>
                                <td id="td_right">
                                	Dates de modification
                                    <?php
                                    $sql3='SELECT COUNT(*) FROM modificateur WHERE id_'.$chaiz.'='.$id;
                                    $reponse3=$bdd->query($sql3) or die('Erreur SQL !<br />'.$sql3.'<br />'.mysql_error());
                                    $data3=$reponse3->fetch();
									echo '('.$data3[0].')';
									?>
                                </td>
                                <td>
                                	<table class="table table-bordered">
                                	<?php
									$sql3='SELECT * FROM user, modificateur, '.$chaiz.' WHERE '.$chaiz.'.id_'.$chaiz.'=modificateur.id_'.$chaiz.' AND user.id_user=modificateur.id_modif_user AND '.$chaiz.'.id_'.$chaiz.'='.$id;
                                    $reponse3=$bdd->query($sql3) or die('Erreur SQL !<br />'.$sql3.'<br />'.mysql_error());
                                    while($data3=$reponse3->fetch())
									{
                                    	echo '<tr><td id="span_user"><a href="afficher-info.php?W9mvyDvFWE5=user&QYtgoGbhhd='.$data3[0].'">'.$data3['lib_user'].'</a></td><td>'.date("d M Y H:i:s", strtotime($data3['date_modificateur'])).'</td></tr>';
									}
									?>
                                    </table>
                                </td>
                            </tr>
                            <tr><td colspan="2" align="center">
                            	<a class="btn btn-default" href="gestionnaire-info.php?W9mvyDvFWE5=<?php echo $chaiz ?>"><i class="fa fa-reply"></i> Retour</a>
                            </td></tr>
                            <?php
                            break;
							
                            case 'user':
							?>
							<div id="afficher_admin">
								<a class="btn btn-primary" href="ajouter-info.php?W9mvyDvFWE5=<?php echo $chaiz ?>">
									<i class="fa fa-pencil"></i> Ajouter
								</a>
							</div>
							<?php
                            $sql= 'SELECT * FROM '.$chaiz.', type_user WHERE type_user.id_type_user=user.id_type_user AND id_'.$chaiz.'="'.$id.'"';
                            $reponse=$bdd->query($sql) or die('Erreur SQL !<br />'.$sql.'<br />'.mysql_error());
                            $data=$reponse->fetch();
							if($data['id_type_user']==1 and $developpeur!=1)
							{
								//header('Location: gestionnaire-info.php?W9mvyDvFWE5='.$chaiz);
								?>
								<script type="text/javascript">document.location.href="gestionnaire-info.php?W9mvyDvFWE5=<?php echo $chaiz;?>"</script>
                                <?php
							}
                            ?>
                            <tr>
                                <td id="td_right">Login:</td>
                                <td>
									<?php echo stripslashes($data['lib_'.$chaiz.'']) ?>
                                    <div style="float:right;">
                                        <a href="modifier-info.php?W9mvyDvFWE5=<?php echo $chaiz ?>&QYtgoGbhhd=<?php echo $id ?>">
                                            <i class="fa fa-edit fa-2x"></i>
                                        </a>
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td id="td_right">Type d'utilisateur:</td>
                                <td>
									<?php
                                    echo stripslashes($data['lib_type_user']);
									if($data['id_type_user']==4)
									{
										$sql3= 'SELECT * FROM agences WHERE id_agences='.$data['id_agences'];
										$reponse3=$bdd->query($sql3) or die('Erreur SQL !<br />'.$sql3.'<br />'.mysql_error());
										$data3=$reponse3->fetch();
										echo ' de l\'agence <span>'.stripslashes($data3['lib_agences']).'</span>';
									}
									?>
                                </td>
                            </tr>
                            <tr>
                                <td id="td_right">Email:</td>
                                <td>
									<?php echo stripslashes($data['mail_'.$chaiz.'']) ?>
                                </td>
                            </tr>
                            <tr>
                                <td id="td_right">Nombre de connexion:</td>
                                <td>
									<?php echo stripslashes($data['connexion_'.$chaiz.'']) ?>
                                </td>
                            </tr>
                            <tr>
                                <td id="td_right">Dernière connexion:</td>
                                <td>
									<?php echo date("d M Y H:i", strtotime($data['last_'.$chaiz.''])) ?>
                                </td>
                            </tr>
                            <tr>
                                <td id="td_right">Bloquer:</td>
                                <td>
									<?php echo stripslashes($data['bloquer_'.$chaiz.'']) ?>
                                </td>
                            </tr>
                            <tr>
                                <td id="td_right">Champs utilisés:</td>
                                <td>
                                	<?php
                                    $sql3= 'SELECT * FROM user_privilege, privilege WHERE privilege.id_privilege=user_privilege.id_privilege AND id_user="'.$id.'"';
                                    $reponse3=$bdd->query($sql3) or die('Erreur SQL !<br />'.$sql3.'<br />'.mysql_error());
                                    while($data3=$reponse3->fetch())
                                    {
                                        echo $data3['lib_privilege'].' - ';
                                    }
                                    ?>
                                </td>
                            </tr>
                            <tr>
                                <td id="td_right">Date de création</td>
                                <td>
                                	<?php
									echo date("d M Y H:i:s", strtotime($data['creation_'.$chaiz.'']));
                                    $sql3='SELECT * FROM user WHERE id_'.$chaiz.'='.$data['id_creation_user'];
                                    $reponse3=$bdd->query($sql3) or die('Erreur SQL !<br />'.$sql3.'<br />'.mysql_error());
                                    $data3=$reponse3->fetch();
                                    echo ' Par <a href="afficher-info.php?W9mvyDvFWE5=user&QYtgoGbhhd='.$data3[0].'"><span id="span_user">'.$data3['lib_user'].'</span></a>';
                                    ?>
                                </td>
                            </tr>
                            <tr>
                                <td id="td_right">
                                	Dates de modification
                                    <?php
                                    $sql3='SELECT COUNT(*) FROM modificateur WHERE id_'.$chaiz.'='.$id;
                                    $reponse3=$bdd->query($sql3) or die('Erreur SQL !<br />'.$sql3.'<br />'.mysql_error());
                                    $data3=$reponse3->fetch();
									echo '('.$data3[0].')';
									?>
                                </td>
                                <td>
                                	<table class="table table-bordered">
                                	<?php
									$sql3='SELECT * FROM user, modificateur WHERE user.id_user=modificateur.id_modif_user AND '.$chaiz.'.id_'.$chaiz.'='.$id;
                                    $reponse3=$bdd->query($sql3) or die('Erreur SQL !<br />'.$sql3.'<br />'.mysql_error());
                                    while($data3=$reponse3->fetch())
									{
                                    	echo '<tr><td id="span_user"><a href="afficher-info.php?W9mvyDvFWE5=user&QYtgoGbhhd='.$data3[0].'">'.$data3['lib_user'].'</a></td><td>'.date("d M Y H:i:s", strtotime($data3['date_modificateur'])).'</td></tr>';
									}
									?>
                                    </table>
                                </td>
                            </tr>
                            <tr><td colspan="2" align="center">
                            	<a class="btn btn-default" href="gestionnaire-info.php?W9mvyDvFWE5=<?php echo $chaiz ?>"><i class="fa fa-reply"></i> Retour</a>
                            </td></tr>
                            <?php
                            break;

                            case 'agence':
							if($developpeur==1)
							{
								?>
								<div id="afficher_admin">
									<a class="btn btn-primary" href="ajouter-info.php?W9mvyDvFWE5=<?php echo $chaiz ?>">
										<i class="fa fa-pencil"></i> Ajouter
									</a>
								</div>
								<?php
							}						
                            $sql= 'SELECT * FROM '.$chaiz.' WHERE id_'.$chaiz.'="'.$id.'"';
                            $reponse=$bdd->query($sql) or die('Erreur SQL !<br />'.$sql.'<br />'.mysql_error());
                            $data=$reponse->fetch();
                            ?>
                            <tr>
                                <td id="td_right">Titre:</td>
                                <td>
									<?php echo stripslashes($data['lib_'.$chaiz.'']) ?>
                                    <div style="float:right;">
                                        <a href="modifier-info.php?W9mvyDvFWE5=<?php echo $chaiz ?>&QYtgoGbhhd=<?php echo $id ?>">
                                            <i class="fa fa-edit fa-2x"></i>
                                        </a>
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td id="td_right">Image</td>
                                <td>
                                	<?php
                                    if($data['img_'.$chaiz.'']!='')
									{
										?>
										<img src="../upload/<?php echo stripslashes($data['img_'.$chaiz.'']) ?>" class="img-responsive" width="450">
										<?php
									}
									else
									{
										?>
										<img src="img/noimage.png" class="img-responsive" width="150">
										<?php
									}
									?>
                                </td>
                            </tr>
                            <tr>
                                <td id="td_right">Description</td>
                                <td>
                                	<?php echo stripslashes($data['descrip_'.$chaiz.'']) ?>
                                </td>
                            </tr>
                            <tr>
                                <td id="td_right">Date de création</td>
                                <td>
                                	<?php 
									echo date("d M Y H:i", strtotime($data['creation_'.$chaiz.'']));
                                    $sql3= 'SELECT * FROM '.$chaiz.', user WHERE '.$chaiz.'.id_creation_user=user.id_user AND id_'.$chaiz.'='.$id;
                                    $reponse3=$bdd->query($sql3) or die('Erreur SQL !<br />'.$sql3.'<br />'.mysql_error());
                                    $data3=$reponse3->fetch();
                                    echo ' Par <a href="afficher-info.php?W9mvyDvFWE5=user&QYtgoGbhhd='.$data3[0].'"><span id="span_user">'.$data3['lib_user'].'</span></a>';
                                    ?>
                                </td>
                            </tr>
                            <tr>
                                <td id="td_right">
                                	Dates de modification
                                    <?php
                                    $sql3='SELECT COUNT(*) FROM modificateur WHERE id_'.$chaiz.'='.$id;
                                    $reponse3=$bdd->query($sql3) or die('Erreur SQL !<br />'.$sql3.'<br />'.mysql_error());
                                    $data3=$reponse3->fetch();
									echo '('.$data3[0].')';
									?>
                                </td>
                                <td>
                                	<table class="table table-bordered">
                                	<?php
									$sql3='SELECT * FROM user, modificateur, '.$chaiz.' WHERE '.$chaiz.'.id_'.$chaiz.'=modificateur.id_'.$chaiz.' AND user.id_user=modificateur.id_modif_user AND '.$chaiz.'.id_'.$chaiz.'='.$id;
                                    $reponse3=$bdd->query($sql3) or die('Erreur SQL !<br />'.$sql3.'<br />'.mysql_error());
                                    while($data3=$reponse3->fetch())
									{
                                    	echo '<tr><td id="span_user"><a href="afficher-info.php?W9mvyDvFWE5=user&QYtgoGbhhd='.$data3[0].'">'.$data3['lib_user'].'</a></td><td>'.date("d M Y H:i:s", strtotime($data3['date_modificateur'])).'</td></tr>';
									}
									?>
                                    </table>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="2" align="center">
                                    <a class="btn btn-default" href="gestionnaire-info.php?W9mvyDvFWE5=<?php echo $chaiz ?>"><i class="fa fa-reply"></i> Retour</a>
                                </td>
                            </tr>
                            <?php
                            break;

                            case 'grande_categorie':
                            case 'type_forum':
							?>
							<div id="afficher_admin">
								<a class="btn btn-primary" href="ajouter-info.php?W9mvyDvFWE5=<?php echo $chaiz ?>">
									<i class="fa fa-pencil"></i> Ajouter
								</a>
							</div>
							<?php
                            $sql= 'SELECT * FROM '.$chaiz.' WHERE id_'.$chaiz.'="'.$id.'"';
                            $reponse=$bdd->query($sql) or die('Erreur SQL !<br />'.$sql.'<br />'.mysql_error());
                            $data=$reponse->fetch();
                            ?>
                            <tr>
                                <td id="td_right">Titre:</td>
                                <td>
									<?php echo stripslashes($data['lib_'.$chaiz.'']) ?>
                                    <div style="float:right;">
                                        <a href="modifier-info.php?W9mvyDvFWE5=<?php echo $chaiz ?>&QYtgoGbhhd=<?php echo $id ?>">
                                            <i class="fa fa-edit fa-2x"></i>
                                        </a>
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td id="td_right">url:</td>
                                <td>
									<?php echo stripslashes($data['url_'.$chaiz.'']) ?>
                                </td>
                            </tr>
                            <tr>
                                <td id="td_right">Image</td>
                                <td>
                                	<?php
                                    if($data['img_'.$chaiz.'']!='')
									{
										?>
										<img src="../upload/<?php echo stripslashes($data['img_'.$chaiz.'']) ?>" class="img-responsive" width="450">
										<?php
									}
									else
									{
										?>
										<img src="img/noimage.png" class="img-responsive" width="150">
										<?php
									}
									?>
                                </td>
                            </tr>
                            <tr>
                                <td id="td_right">Description</td>
                                <td>
                                	<?php echo stripslashes($data['descrip_'.$chaiz.'']) ?>
                                </td>
                            </tr>
                            <tr>
                                <td id="td_right">Date de création</td>
                                <td>
                                	<?php 
									echo date("d M Y H:i", strtotime($data['creation_'.$chaiz.'']));
                                    $sql3= 'SELECT * FROM '.$chaiz.', user WHERE '.$chaiz.'.id_creation_user=user.id_user AND id_'.$chaiz.'="'.$id.'"';
                                    $reponse3=$bdd->query($sql3) or die('Erreur SQL !<br />'.$sql3.'<br />'.mysql_error());
                                    $data3=$reponse3->fetch();
                                    echo ' Par <a href="afficher-info.php?W9mvyDvFWE5=user&QYtgoGbhhd='.$data3[0].'"><span id="span_user">'.$data3['lib_user'].'</span></a>';
                                    ?>
                                </td>
                            </tr>
                            <tr>
                                <td id="td_right">
                                	Dates de modification
                                    <?php
                                    $sql3='SELECT COUNT(*) FROM modificateur WHERE id_'.$chaiz.'='.$id;
                                    $reponse3=$bdd->query($sql3) or die('Erreur SQL !<br />'.$sql3.'<br />'.mysql_error());
                                    $data3=$reponse3->fetch();
									echo '('.$data3[0].')';
									?>
                                </td>
                                <td>
                                	<table class="table table-bordered">
                                	<?php
									$sql3='SELECT * FROM user, modificateur, '.$chaiz.' WHERE '.$chaiz.'.id_'.$chaiz.'=modificateur.id_'.$chaiz.' AND user.id_user=modificateur.id_modif_user AND '.$chaiz.'.id_'.$chaiz.'='.$id;
                                    $reponse3=$bdd->query($sql3) or die('Erreur SQL !<br />'.$sql3.'<br />'.mysql_error());
                                    while($data3=$reponse3->fetch())
									{
                                    	echo '<tr><td id="span_user"><a href="afficher-info.php?W9mvyDvFWE5=user&QYtgoGbhhd='.$data3[0].'">'.$data3['lib_user'].'</a></td><td>'.date("d M Y H:i:s", strtotime($data3['date_modificateur'])).'</td></tr>';
									}
									?>
                                    </table>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="2" align="center">
                                    <a class="btn btn-default" href="gestionnaire-info.php?W9mvyDvFWE5=<?php echo $chaiz ?>"><i class="fa fa-reply"></i> Retour</a>
                                </td>
                            </tr>
                            <?php
                            break;

                            case 'slider':
							?>
							<div id="afficher_admin">
								<a class="btn btn-primary" href="ajouter-info.php?W9mvyDvFWE5=<?php echo $chaiz ?>">
									<i class="fa fa-pencil"></i> Ajouter
								</a>
							</div>
							<?php
                            $sql= 'SELECT * FROM '.$chaiz.' WHERE id_'.$chaiz.'="'.$id.'"';
                            $reponse=$bdd->query($sql) or die('Erreur SQL !<br />'.$sql.'<br />'.mysql_error());
                            $data=$reponse->fetch();
                            ?>
                            <tr>
                                <td id="td_right">Lien:</td>
                                <td>
									<?php echo stripslashes($data['lien_'.$chaiz.'']) ?>
                                    <div style="float:right;">
                                        <a href="modifier-info.php?W9mvyDvFWE5=<?php echo $chaiz ?>&QYtgoGbhhd=<?php echo $id ?>">
                                            <i class="fa fa-edit fa-2x"></i>
                                        </a>
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td id="td_right">Image</td>
                                <td>
                                	<img src="../upload/<?php echo stripslashes($data['img_'.$chaiz.'']) ?>" class="img-responsive" width="450">
                                </td>
                            </tr>
                            <tr>
                                <td id="td_right">Date de création</td>
                                <td>
                                	<?php 
									echo date("d M Y H:i", strtotime($data['creation_'.$chaiz.'']));
                                    $sql3= 'SELECT * FROM '.$chaiz.', user WHERE '.$chaiz.'.id_creation_user=user.id_user AND id_'.$chaiz.'="'.$id.'"';
                                    $reponse3=$bdd->query($sql3) or die('Erreur SQL !<br />'.$sql3.'<br />'.mysql_error());
                                    $data3=$reponse3->fetch();
                                    echo ' Par <a href="afficher-info.php?W9mvyDvFWE5=user&QYtgoGbhhd='.$data3[0].'"><span id="span_user">'.$data3['lib_user'].'</span></a>';
                                    ?>
                                </td>
                            </tr>
                            <tr>
                                <td id="td_right">
                                	Dates de modification
                                    <?php
                                    $sql3='SELECT COUNT(*) FROM modificateur WHERE id_'.$chaiz.'='.$id;
                                    $reponse3=$bdd->query($sql3) or die('Erreur SQL !<br />'.$sql3.'<br />'.mysql_error());
                                    $data3=$reponse3->fetch();
									echo '('.$data3[0].')';
									?>
                                </td>
                                <td>
                                	<table class="table table-bordered">
                                	<?php
									$sql3='SELECT * FROM user, modificateur, '.$chaiz.' WHERE '.$chaiz.'.id_'.$chaiz.'=modificateur.id_'.$chaiz.' AND user.id_user=modificateur.id_modif_user AND '.$chaiz.'.id_'.$chaiz.'='.$id;
                                    $reponse3=$bdd->query($sql3) or die('Erreur SQL !<br />'.$sql3.'<br />'.mysql_error());
                                    while($data3=$reponse3->fetch())
									{
                                    	echo '<tr><td id="span_user"><a href="afficher-info.php?W9mvyDvFWE5=user&QYtgoGbhhd='.$data3[0].'">'.$data3['lib_user'].'</a></td><td>'.date("d M Y H:i:s", strtotime($data3['date_modificateur'])).'</td></tr>';
									}
									?>
                                    </table>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="2" align="center">
                                    <a class="btn btn-default" href="gestionnaire-info.php?W9mvyDvFWE5=<?php echo $chaiz ?>"><i class="fa fa-reply"></i> Retour</a>
                                </td>
                            </tr>
                            <?php
                            break;

							case 'type_user':
							case 'champ':
							case 'contrat':
							case 'type_conditionnement':
							case 'commune':
							case 'disponibilite':
							?>
							<div id="afficher_admin">
								<a class="btn btn-primary" href="ajouter-info.php?W9mvyDvFWE5=<?php echo $chaiz ?>">
									<i class="fa fa-pencil"></i> Ajouter
								</a>
							</div>
							<?php
                            $sql= 'SELECT * FROM '.$chaiz.' WHERE id_'.$chaiz.'="'.$id.'"';
                            $reponse=$bdd->query($sql) or die('Erreur SQL !<br />'.$sql.'<br />'.mysql_error());
                            $data=$reponse->fetch();
                            ?>
                            <tr>
                                <td id="td_right">Titre:</td>
                                <td>
									<?php echo stripslashes($data['lib_'.$chaiz.'']) ?>
                                    <div style="float:right;">
                                        <a href="modifier-info.php?W9mvyDvFWE5=<?php echo $chaiz ?>&QYtgoGbhhd=<?php echo $id ?>">
                                            <i class="fa fa-edit fa-2x"></i>
                                        </a>
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td id="td_right">Date de création</td>
                                <td>
                                	<?php 
									echo date("d M Y H:i", strtotime($data['creation_'.$chaiz.'']));
                                    $sql3= 'SELECT * FROM '.$chaiz.', user WHERE '.$chaiz.'.id_creation_user=user.id_user AND id_'.$chaiz.'="'.$id.'"';
                                    $reponse3=$bdd->query($sql3) or die('Erreur SQL !<br />'.$sql3.'<br />'.mysql_error());
                                    $data3=$reponse3->fetch();
                                    echo ' Par <a href="afficher-info.php?W9mvyDvFWE5=user&QYtgoGbhhd='.$data3[0].'"><span id="span_user">'.$data3['lib_user'].'</span></a>';
                                    ?>
                                </td>
                            </tr>
                            <tr>
                                <td id="td_right">
                                	Dates de modification
                                    <?php
                                    $sql3='SELECT COUNT(*) FROM modificateur WHERE id_'.$chaiz.'='.$id;
                                    $reponse3=$bdd->query($sql3) or die('Erreur SQL !<br />'.$sql3.'<br />'.mysql_error());
                                    $data3=$reponse3->fetch();
									echo '('.$data3[0].')';
									?>
                                </td>
                                <td>
                                	<table class="table table-bordered">
                                	<?php
									$sql3='SELECT * FROM user, modificateur, '.$chaiz.' WHERE '.$chaiz.'.id_'.$chaiz.'=modificateur.id_'.$chaiz.' AND user.id_user=modificateur.id_modif_user AND '.$chaiz.'.id_'.$chaiz.'='.$id;
                                    $reponse3=$bdd->query($sql3) or die('Erreur SQL !<br />'.$sql3.'<br />'.mysql_error());
                                    while($data3=$reponse3->fetch())
									{
                                    	echo '<tr><td id="span_user"><a href="afficher-info.php?W9mvyDvFWE5=user&QYtgoGbhhd='.$data3[0].'">'.$data3['lib_user'].'</a></td><td>'.date("d M Y H:i:s", strtotime($data3['date_modificateur'])).'</td></tr>';
									}
									?>
                                    </table>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="2" align="center">
                                    <a class="btn btn-default" href="gestionnaire-info.php?W9mvyDvFWE5=<?php echo $chaiz ?>"><i class="fa fa-reply"></i> Retour</a>
                                </td>
                            </tr>
                            <?php
                            break;

							case 'coordonnee':
							?>
							<div id="afficher_admin">
								<a class="btn btn-primary" href="ajouter-info.php?W9mvyDvFWE5=<?php echo $chaiz ?>">
									<i class="fa fa-pencil"></i> Ajouter
								</a>
							</div>
							<?php
                            $sql= 'SELECT * FROM '.$chaiz.' WHERE id_'.$chaiz.'="'.$id.'"';
                            $reponse=$bdd->query($sql) or die('Erreur SQL !<br />'.$sql.'<br />'.mysql_error());
                            $data=$reponse->fetch();
                            ?>
                            <tr>
                                <td id="td_right"><?php echo stripslashes($data['lib_'.$chaiz.'']) ?>:</td>
                                <td>
									<?php echo stripslashes($data['valeur_'.$chaiz.'']) ?>
                                    <div style="float:right;">
                                        <a href="modifier-info.php?W9mvyDvFWE5=<?php echo $chaiz ?>&QYtgoGbhhd=<?php echo $id ?>">
                                            <i class="fa fa-edit fa-2x"></i>
                                        </a>
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td id="td_right">Date de création</td>
                                <td>
                                	<?php 
									echo date("d M Y H:i", strtotime($data['creation_'.$chaiz.'']));
                                    $sql3= 'SELECT * FROM '.$chaiz.', user WHERE '.$chaiz.'.id_creation_user=user.id_user AND id_'.$chaiz.'="'.$id.'"';
                                    $reponse3=$bdd->query($sql3) or die('Erreur SQL !<br />'.$sql3.'<br />'.mysql_error());
                                    $data3=$reponse3->fetch();
                                    echo ' Par <a href="afficher-info.php?W9mvyDvFWE5=user&QYtgoGbhhd='.$data3[0].'"><span id="span_user">'.$data3['lib_user'].'</span></a>';
                                    ?>
                                </td>
                            </tr>
                            <tr>
                                <td id="td_right">
                                	Dates de modification
                                    <?php
                                    $sql3='SELECT COUNT(*) FROM modificateur WHERE id_'.$chaiz.'='.$id;
                                    $reponse3=$bdd->query($sql3) or die('Erreur SQL !<br />'.$sql3.'<br />'.mysql_error());
                                    $data3=$reponse3->fetch();
									echo '('.$data3[0].')';
									?>
                                </td>
                                <td>
                                	<table class="table table-bordered">
                                	<?php
									$sql3='SELECT * FROM user, modificateur, '.$chaiz.' WHERE '.$chaiz.'.id_'.$chaiz.'=modificateur.id_'.$chaiz.' AND user.id_user=modificateur.id_modif_user AND '.$chaiz.'.id_'.$chaiz.'='.$id;
                                    $reponse3=$bdd->query($sql3) or die('Erreur SQL !<br />'.$sql3.'<br />'.mysql_error());
                                    while($data3=$reponse3->fetch())
									{
                                    	echo '<tr><td id="span_user"><a href="afficher-info.php?W9mvyDvFWE5=user&QYtgoGbhhd='.$data3[0].'">'.$data3['lib_user'].'</a></td><td>'.date("d M Y H:i:s", strtotime($data3['date_modificateur'])).'</td></tr>';
									}
									?>
                                    </table>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="2" align="center">
                                    <a class="btn btn-default" href="gestionnaire-info.php?W9mvyDvFWE5=<?php echo $chaiz ?>"><i class="fa fa-reply"></i> Retour</a>
                                </td>
                            </tr>
                            <?php
                            break;

							case 'typeinfo':
							?>
							<div id="afficher_admin">
								<a class="btn btn-primary" href="ajouter-info.php?W9mvyDvFWE5=<?php echo $chaiz ?>">
									<i class="fa fa-pencil"></i> Ajouter
								</a>
							</div>
							<?php
                            $sql= 'SELECT * FROM '.$chaiz.', type WHERE type.id_type='.$chaiz.'.id_type AND id_'.$chaiz.'="'.$id.'"';
                            $reponse=$bdd->query($sql) or die('Erreur SQL !<br />'.$sql.'<br />'.mysql_error());
                            $data=$reponse->fetch();
                            ?>
                            <tr>
                                <td id="td_right">Titre:</td>
                                <td>
									<?php echo stripslashes($data['lib_'.$chaiz.'']) ?>
                                    <div style="float:right;">
                                        <a href="modifier-info.php?W9mvyDvFWE5=<?php echo $chaiz ?>&QYtgoGbhhd=<?php echo $id ?>">
                                            <i class="fa fa-edit fa-2x"></i>
                                        </a>
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td id="td_right">Type table:</td>
                                <td>
									<?php echo stripslashes($data['lib_type']) ?>
                                </td>
                            </tr>
                            <tr>
                                <td id="td_right">Date de création</td>
                                <td>
                                	<?php 
									echo date("d M Y H:i", strtotime($data['creation_'.$chaiz.'']));
                                    $sql3= 'SELECT * FROM '.$chaiz.', user WHERE '.$chaiz.'.id_creation_user=user.id_user AND id_'.$chaiz.'="'.$id.'"';
                                    $reponse3=$bdd->query($sql3) or die('Erreur SQL !<br />'.$sql3.'<br />'.mysql_error());
                                    $data3=$reponse3->fetch();
                                    echo ' Par <a href="afficher-info.php?W9mvyDvFWE5=user&QYtgoGbhhd='.$data3[0].'"><span id="span_user">'.$data3['lib_user'].'</span></a>';
                                    ?>
                                </td>
                            </tr>
                            <tr>
                                <td id="td_right">
                                	Dates de modification
                                    <?php
                                    $sql3='SELECT COUNT(*) FROM modificateur WHERE id_'.$chaiz.'='.$id;
                                    $reponse3=$bdd->query($sql3) or die('Erreur SQL !<br />'.$sql3.'<br />'.mysql_error());
                                    $data3=$reponse3->fetch();
									echo '('.$data3[0].')';
									?>
                                </td>
                                <td>
                                	<table class="table table-bordered">
                                	<?php
									$sql3='SELECT * FROM user, modificateur, '.$chaiz.' WHERE '.$chaiz.'.id_'.$chaiz.'=modificateur.id_'.$chaiz.' AND user.id_user=modificateur.id_modif_user AND '.$chaiz.'.id_'.$chaiz.'='.$id;
                                    $reponse3=$bdd->query($sql3) or die('Erreur SQL !<br />'.$sql3.'<br />'.mysql_error());
                                    while($data3=$reponse3->fetch())
									{
                                    	echo '<tr><td id="span_user"><a href="afficher-info.php?W9mvyDvFWE5=user&QYtgoGbhhd='.$data3[0].'">'.$data3['lib_user'].'</a></td><td>'.date("d M Y H:i:s", strtotime($data3['date_modificateur'])).'</td></tr>';
									}
									?>
                                    </table>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="2" align="center">
                                    <a class="btn btn-default" href="gestionnaire-info.php?W9mvyDvFWE5=<?php echo $chaiz ?>"><i class="fa fa-reply"></i> Retour</a>
                                </td>
                            </tr>
                            <?php
                            break;

							case 'categorie':
							?>
							<div id="afficher_admin">
								<a class="btn btn-primary" href="ajouter-info.php?W9mvyDvFWE5=<?php echo $chaiz ?>">
									<i class="fa fa-pencil"></i> Ajouter
								</a>
							</div>
							<?php
                            $sql= 'SELECT * FROM '.$chaiz.', type, typeinfo WHERE typeinfo.id_typeinfo='.$chaiz.'.id_typeinfo AND type.id_type='.$chaiz.'.id_type AND id_'.$chaiz.'="'.$id.'"';
                            $reponse=$bdd->query($sql) or die('Erreur SQL !<br />'.$sql.'<br />'.mysql_error());
                            $data=$reponse->fetch();
                            ?>
                            <tr>
                                <td id="td_right">Titre:</td>
                                <td>
									<?php echo stripslashes($data['lib_'.$chaiz.'']) ?>
                                    <div style="float:right;">
                                        <a href="modifier-info.php?W9mvyDvFWE5=<?php echo $chaiz ?>&QYtgoGbhhd=<?php echo $id ?>">
                                            <i class="fa fa-edit fa-2x"></i>
                                        </a>
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td id="td_right">Type table:</td>
                                <td>
									<?php echo stripslashes($data['lib_type']) ?>
                                </td>
                            </tr>
                            <tr>
                                <td id="td_right">Type d'information:</td>
                                <td>
									<?php echo stripslashes($data['lib_typeinfo']) ?>
                                </td>
                            </tr>
                            <tr>
                                <td id="td_right">Date de création</td>
                                <td>
                                	<?php 
									echo date("d M Y H:i", strtotime($data['creation_'.$chaiz.'']));
                                    $sql3= 'SELECT * FROM '.$chaiz.', user WHERE '.$chaiz.'.id_creation_user=user.id_user AND id_'.$chaiz.'="'.$id.'"';
                                    $reponse3=$bdd->query($sql3) or die('Erreur SQL !<br />'.$sql3.'<br />'.mysql_error());
                                    $data3=$reponse3->fetch();
                                    echo ' Par <a href="afficher-info.php?W9mvyDvFWE5=user&QYtgoGbhhd='.$data3[0].'"><span id="span_user">'.$data3['lib_user'].'</span></a>';
                                    ?>
                                </td>
                            </tr>
                            <tr>
                                <td id="td_right">
                                	Dates de modification
                                    <?php
                                    $sql3='SELECT COUNT(*) FROM modificateur WHERE id_'.$chaiz.'='.$id;
                                    $reponse3=$bdd->query($sql3) or die('Erreur SQL !<br />'.$sql3.'<br />'.mysql_error());
                                    $data3=$reponse3->fetch();
									echo '('.$data3[0].')';
									?>
                                </td>
                                <td>
                                	<table class="table table-bordered">
                                	<?php
									$sql3='SELECT * FROM user, modificateur, '.$chaiz.' WHERE '.$chaiz.'.id_'.$chaiz.'=modificateur.id_'.$chaiz.' AND user.id_user=modificateur.id_modif_user AND '.$chaiz.'.id_'.$chaiz.'='.$id;
                                    $reponse3=$bdd->query($sql3) or die('Erreur SQL !<br />'.$sql3.'<br />'.mysql_error());
                                    while($data3=$reponse3->fetch())
									{
                                    	echo '<tr><td id="span_user"><a href="afficher-info.php?W9mvyDvFWE5=user&QYtgoGbhhd='.$data3[0].'">'.$data3['lib_user'].'</a></td><td>'.date("d M Y H:i:s", strtotime($data3['date_modificateur'])).'</td></tr>';
									}
									?>
                                    </table>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="2" align="center">
                                    <a class="btn btn-default" href="gestionnaire-info.php?W9mvyDvFWE5=<?php echo $chaiz ?>"><i class="fa fa-reply"></i> Retour</a>
                                </td>
                            </tr>
                            <?php
                            break;

							case 'selection':
							?>
							<div id="afficher_admin">
								<a class="btn btn-primary" href="ajouter-info.php?W9mvyDvFWE5=<?php echo $chaiz ?>">
									<i class="fa fa-pencil"></i> Ajouter
								</a>
							</div>
							<?php
                            $sql= 'SELECT * FROM '.$chaiz.' WHERE id_'.$chaiz.'="'.$id.'"';
                            $reponse=$bdd->query($sql) or die('Erreur SQL !<br />'.$sql.'<br />'.mysql_error());
                            $data=$reponse->fetch();
                            ?>
                            <tr>
                                <td id="td_right">Titre:</td>
                                <td>
									<?php echo stripslashes($data['lib_'.$chaiz.'']) ?>
                                    <div style="float:right;">
                                        <a href="modifier-info.php?W9mvyDvFWE5=<?php echo $chaiz ?>&QYtgoGbhhd=<?php echo $id ?>">
                                            <i class="fa fa-edit fa-2x"></i>
                                        </a>
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td id="td_right">Afficher dans l'administration:</td>
                                <td>
									<?php echo stripslashes($data['afficher_'.$chaiz]) ?>
                                </td>
                            </tr>
                             <tr>
                                <td id="td_right">Type de select:</td>
                                <td>
									<?php echo stripslashes($data['select_'.$chaiz]) ?>
                                </td>
                            </tr>
                            <tr>
                                <td id="td_right">Privilege:</td>
                                <td>
                                	<?php
									$sql2= 'SELECT * FROM '.$chaiz.', privilege WHERE privilege.id_privilege=selection.id_privilege AND id_'.$chaiz.'="'.$id.'"';
									$reponse2=$bdd->query($sql2) or die('Erreur SQL !<br />'.$sql2.'<br />'.mysql_error());
									$data2=$reponse2->fetch();
									echo stripslashes($data2['lib_privilege']) ?>
                                </td>
                            </tr>
                            <tr>
                                <td id="td_right">Date de création</td>
                                <td>
                                	<?php 
									echo date("d M Y H:i", strtotime($data['creation_'.$chaiz.'']));
                                    $sql3= 'SELECT * FROM '.$chaiz.', user WHERE '.$chaiz.'.id_creation_user=user.id_user AND id_'.$chaiz.'="'.$id.'"';
                                    $reponse3=$bdd->query($sql3) or die('Erreur SQL !<br />'.$sql3.'<br />'.mysql_error());
                                    $data3=$reponse3->fetch();
                                    echo ' Par <a href="afficher-info.php?W9mvyDvFWE5=user&QYtgoGbhhd='.$data3[0].'"><span id="span_user">'.$data3['lib_user'].'</span></a>';
                                    ?>
                                </td>
                            </tr>
                            <tr>
                                <td id="td_right">
                                	Dates de modification
                                    <?php
                                    $sql3='SELECT COUNT(*) FROM modificateur WHERE id_'.$chaiz.'='.$id;
                                    $reponse3=$bdd->query($sql3) or die('Erreur SQL !<br />'.$sql3.'<br />'.mysql_error());
                                    $data3=$reponse3->fetch();
									echo '('.$data3[0].')';
									?>
                                </td>
                                <td>
                                	<table class="table table-bordered">
                                	<?php
									$sql3='SELECT * FROM user, modificateur, '.$chaiz.' WHERE '.$chaiz.'.id_'.$chaiz.'=modificateur.id_'.$chaiz.' AND user.id_user=modificateur.id_modif_user AND '.$chaiz.'.id_'.$chaiz.'='.$id;
                                    $reponse3=$bdd->query($sql3) or die('Erreur SQL !<br />'.$sql3.'<br />'.mysql_error());
                                    while($data3=$reponse3->fetch())
									{
                                    	echo '<tr><td id="span_user"><a href="afficher-info.php?W9mvyDvFWE5=user&QYtgoGbhhd='.$data3[0].'">'.$data3['lib_user'].'</a></td><td>'.date("d M Y H:i:s", strtotime($data3['date_modificateur'])).'</td></tr>';
									}
									?>
                                    </table>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="2" align="center">
                                    <a class="btn btn-default" href="gestionnaire-info.php?W9mvyDvFWE5=<?php echo $chaiz ?>"><i class="fa fa-reply"></i> Retour</a>
                                </td>
                            </tr>
                            <?php
                            break;

                            case 'contact':
                            $sql= 'SELECT * FROM '.$chaiz.' WHERE id_'.$chaiz.'="'.$id.'"';
                            $reponse=$bdd->query($sql) or die('Erreur SQL !<br />'.$sql.'<br />'.mysql_error());
                            $data=$reponse->fetch();
                            ?>
                            <tr>
                                <td id="td_right">Nom:</td>
                                <td>
									<?php echo stripslashes($data['lib_'.$chaiz.'']) ?>
                                </td>
                            </tr>
                            <tr>
                                <td id="td_right">Email</td>
                                <td>
                                	<?php echo stripslashes($data['mail_'.$chaiz.'']) ?>
                                </td>
                            </tr>
                            <tr>
                                <td id="td_right">N°Téléphone</td>
                                <td>
                                	<?php echo stripslashes($data['tel_'.$chaiz.'']) ?>
                                </td>
                            </tr>
                            <tr>
                                <td id="td_right">Sujet</td>
                                <td>
                                	<?php echo stripslashes($data['sujet_'.$chaiz.'']) ?>
                                </td>
                            </tr>
                            <tr>
                                <td id="td_right">Message</td>
                                <td>
                                	<?php echo stripslashes($data['msg_'.$chaiz.'']) ?>
                                </td>
                            </tr>
                            <tr>
                                <td id="td_right">Date de création</td>
                                <td>
                                	<?php echo date("d M Y H:i", strtotime($data['creation_'.$chaiz.'']));?>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="2" align="center">
                                    <a class="btn btn-default" href="gestionnaire-info.php?W9mvyDvFWE5=<?php echo $chaiz ?>"><i class="fa fa-reply"></i> Retour</a>
                                </td>
                            </tr>
                            <?php
                            break;

                            case 'agences':
                            $sql= 'SELECT * FROM '.$chaiz.' WHERE id_'.$chaiz.'="'.$id.'"';
                            $reponse=$bdd->query($sql) or die('Erreur SQL !<br />'.$sql.'<br />'.mysql_error());
                            $data=$reponse->fetch();
                            ?>
                            <tr>
                                <td id="td_right">Titre:</td>
                                <td>
									<?php echo stripslashes($data['lib_'.$chaiz.'']) ?>
                                    <div style="float:right;">
                                        <a href="modifier-info.php?W9mvyDvFWE5=<?php echo $chaiz ?>&QYtgoGbhhd=<?php echo $id ?>">
                                            <i class="fa fa-edit fa-2x"></i>
                                        </a>
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td id="td_right">Ville</td>
                                <td>
                                	<?php echo stripslashes($data['ville_'.$chaiz.'']) ?>
                                </td>
                            </tr>
                            <tr>
                                <td id="td_right">Latitude</td>
                                <td>
                                	<?php echo stripslashes($data['latitude_'.$chaiz.'']) ?>
                                </td>
                            </tr>
                            <tr>
                                <td id="td_right">Longitude</td>
                                <td>
                                	<?php echo stripslashes($data['longitude_'.$chaiz.'']) ?>
                                </td>
                            </tr>
                            <tr>
                                <td id="td_right">Pays</td>
                                <td>
                                	<?php
									$sql2= 'SELECT * FROM pays WHERE id_pays='.$data['id_pays'];
									$reponse2=$bdd-> query($sql2) or die('Erreur SQL !<br />'.$sql2.'<br />'.mysql_error());
									$data2=$reponse2->fetch();
									echo stripslashes($data2['nom_fr_fr']);
									?>
                                </td>
                            </tr>
                            <tr>
                                <td id="td_right">Date de création</td>
                                <td>
                                	<?php 
									echo date("d M Y H:i", strtotime($data['creation_'.$chaiz.'']));
                                    $sql3= 'SELECT * FROM '.$chaiz.', user WHERE '.$chaiz.'.id_creation_user=user.id_user AND agences.id_'.$chaiz.'="'.$id.'"';
                                    $reponse3=$bdd->query($sql3) or die('Erreur SQL !<br />'.$sql3.'<br />'.mysql_error());
                                    $data3=$reponse3->fetch();
                                    echo ' par <span id="span_user">'.$data3['lib_user'].'</span>';
                                    ?>
                                </td>
                            </tr>
                            <tr>
                                <td id="td_right">Date de dernière modification</td>
                                <td>
                                	<?php
                                    echo date("d M Y H:i", strtotime($data['modif_'.$chaiz.'']));
									$sql3= 'SELECT * FROM '.$chaiz.', user WHERE '.$chaiz.'.id_modif_user=user.id_user AND agences.id_'.$chaiz.'="'.$id.'"';
                                    $reponse3=$bdd->query($sql3) or die('Erreur SQL !<br />'.$sql3.'<br />'.mysql_error());
                                    $data3=$reponse3->fetch();
                                    echo ' par <span id="span_user">'.$data3['lib_user'].'</span>';
									?>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="2" align="center">
                                    <a class="btn btn-default" href="gestionnaire-info.php?W9mvyDvFWE5=<?php echo $chaiz ?>"><i class="fa fa-reply"></i> Retour</a>
                                </td>
                            </tr>
                            <?php
                            break;

                            case 'membre':
                            $sql= 'SELECT * FROM '.$chaiz.' WHERE id_'.$chaiz.'="'.$id.'"';
                            $reponse=$bdd->query($sql) or die('Erreur SQL !<br />'.$sql.'<br />'.mysql_error());
                            $data=$reponse->fetch();
                            ?>
							<div id="afficher_admin">
								<a class="btn btn-primary" href="inscriptionby.php">
									<i class="fa fa-pencil"></i> Ajouter
								</a>
							</div>
                            <tr>
                                <td id="td_right">Type d'inscription:</td>
                                <td>
									<?php
                                    if($data['inscription_'.$chaiz.'']=='agent')
									{
										$sql2 = 'SELECT * FROM user WHERE id_user='.$data['id_user'].'';
										$reponse2=$bdd->query($sql2) or die('Erreur SQL !<br />'.$sql2.'<br />'.mysql_error());
										$data2 =$reponse2->fetch();
										echo 'Inscrit par l\'agent <span id="lib-inscription"><a href="afficher-info.php?W9mvyDvFWE5=user&QYtgoGbhhd='.$data['id_user'].'">'.$data2['nom_user'].' '.$data2['prenom_user'].'</a></span>';
									}
									elseif($data['inscription_'.$chaiz.'']=='ligne')
									{
										echo 'Inscrit en ligne via CinetPay';
									}
									?>
                                </td>
                            </tr>
                            <tr>
                                <td id="td_right">Coût inscription:</td>
                                <td>
									<?php echo stripslashes($data['cout_'.$chaiz.'']) ?> Fcfa
                                </td>
                            </tr>
                            <tr>
                                <td id="td_right">Matricule:</td>
                                <td>
									<?php echo stripslashes($data['matricule_'.$chaiz.'']) ?>
                                    <div style="float:right;">
                                        <a href="modifier-info.php?W9mvyDvFWE5=<?php echo $chaiz ?>&QYtgoGbhhd=<?php echo $id ?>">
                                            <i class="fa fa-edit fa-2x"></i>
                                        </a>
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td id="td_right">Pseudo:</td>
                                <td>
									<?php echo stripslashes($data['pseudo_'.$chaiz.'']) ?>
                                </td>
                            </tr>
                            <tr>
                                <td id="td_right">Nom:</td>
                                <td>
									<?php echo stripslashes($data['nom_'.$chaiz.'']) ?>
                                </td>
                            </tr>
                            <tr>
                                <td id="td_right">Prenoms:</td>
                                <td>
									<?php echo stripslashes($data['prenom_'.$chaiz.'']) ?>
                                </td>
                            </tr>
                            <!--<tr>
                                <td id="td_right">Image:</td>
                                <td>
									<?php
                                    if($data['img_'.$chaiz.'']!='')
									{
										?>
										<img src="../upload/<?php echo stripslashes($data['img_'.$chaiz.'']) ?>" class="img-responsive" width="250">
										<?php
									}
									else
									{
										?>
										<img src="img/noimage.png" class="img-responsive" width="150">
										<?php
									}
									?>
                                </td>
                            </tr>-->
                            <tr>
                                <td id="td_right">Pays:</td>
                                <td>
									<?php
									$sql2 = 'SELECT * FROM pays WHERE id_pays='.$data['id_pays'].'';
									$reponse2=$bdd->query($sql2) or die('Erreur SQL !<br />'.$sql2.'<br />'.mysql_error());
									$data2 =$reponse2->fetch();
									echo stripslashes($data2['nom_fr_fr']);
									?>
                                </td>
                            </tr>
                            <tr>
                                <td id="td_right">Ville:</td>
                                <td>
									<?php echo stripslashes($data['ville_'.$chaiz.'']) ?>
                                </td>
                            </tr>
                            <tr>
                                <td id="td_right">Sexe:</td>
                                <td>
									<?php echo stripslashes($data['sexe_'.$chaiz.'']) ?>
                                </td>
                            </tr>
                            <tr>
                                <td id="td_right">Email:</td>
                                <td>
									<?php echo stripslashes($data['mail_'.$chaiz.'']) ?>
                                </td>
                            </tr>
                            <tr>
                                <td id="td_right">N°Téléphone:</td>
                                <td>
									<?php echo stripslashes($data['tel_'.$chaiz.'']) ?>
                                </td>
                            </tr>
                            <tr>
                                <td id="td_right">Bloquer:</td>
                                <td>
									<?php echo stripslashes($data['bloquer_'.$chaiz.'']); ?>
                                </td>
                            </tr>
                            <tr>
                                <td id="td_right">Parrain:</td>
                                <td>
                                	<?php
									if($data['id_parain']!=NULL)
									{
										$sql2='SELECT * FROM membre WHERE id_membre='.$data['id_parain'];
										$reponse2=$bdd->query($sql2) or die('Erreur SQL !<br />'.$sql2.'<br />'.mysql_error());
										$data2=$reponse2->fetch();
										?>
										<table width="100%" class="table table-bordered" style="margin-bottom:0; background:none;">
											<tr align="center"><td>Matricule</td><td>Pseudo</td><td>Téléphone</td><td>Date</td></tr>
											<tr id="lib-inscription" align="center">
												<td><a href="afficher-info.php?W9mvyDvFWE5=membre&QYtgoGbhhd=<?php echo $data2[0]; ?>"><?php echo stripslashes($data2['matricule_'.$chaiz.'']); ?></a></td>
												<td><?php echo stripslashes($data2['pseudo_'.$chaiz.'']); ?></td>
												<td><?php echo stripslashes($data2['tel_'.$chaiz.'']); ?></td>
                                                <td><?php echo date("d M Y H:i:s", strtotime($data2['creation_'.$chaiz.''])); ?></td>
											</tr>
										</table>
                                        <?php
									}
									else
									{
										echo '<div class="alert alert-danger">Pas de parrain</div>';
									}
									?>
                                </td>
                            </tr>
                            <tr>
                            	<td id="td_right">Filleul:
									<?php
                                    $sql2='SELECT COUNT(*) FROM membre WHERE id_parain='.$data[0];
                                    $reponse2=$bdd-> query($sql2) or die('Erreur SQL !<br />'.$sql2.'<br />'.mysql_error());
                                    $data2=$reponse2->fetch();
                                    echo '('.$data2[0].')';
                                    ?>
                                </td>
                            	<td>
                                    <table width="100%" class="table table-bordered" style="margin-bottom:0; background:none;">
                                    <tr align="center">
                                        <td></td>
                                        <td>Matricule</td>
                                        <td>Pseudo</td>
                                        <td>Téléphone</td>
                                        <td>Date</td>
                                    </tr>
                                    <?php
                                    $i=0;
                                    $sql2= 'SELECT * FROM membre WHERE id_parain='.$data[0];
                                    $reponse2=$bdd-> query($sql2) or die('Erreur SQL !<br />'.$sql2.'<br />'.mysql_error());
                                    while($data2=$reponse2->fetch())
                                    {
                                        $i++;
                                        ?>
                                        <tr id="lib-inscription" align="center">
                                            <td><?php echo $i; ?></td>
                                            <td>
                                                <a href="afficher-info.php?W9mvyDvFWE5=membre&QYtgoGbhhd=<?php echo $data2[0]; ?>"><?php echo stripslashes($data2['matricule_'.$chaiz.'']); ?></a>
                                            </td>
                                            <td>
                                                <?php echo stripslashes($data2['pseudo_'.$chaiz.'']); ?>
                                            </td>
                                            <td>
                                                <?php echo stripslashes($data2['tel_'.$chaiz.'']); ?>
                                            </td>
                                            <td>
                                                <?php echo date("d M Y H:i:s", strtotime($data2['creation_'.$chaiz.''])); ?>
                                            </td>
                                        </tr>
                                        <?php
										/*if($i==5)
										{
											$date_dernier_filleul=date("d M Y H:i:s", strtotime($data2['creation_'.$chaiz.'']));
										}*/
                                    }
                                    ?>
                                    </table>
                            	</td>
                            </tr>
                            
                            <tr>
                                <td id="td_right">Bonus de niveau:</td>
                                <td id="lib-inscription" style="font-size:18px;">
									<?php
                                    $sql2='SELECT COUNT(*) FROM membre WHERE id_membre>'.$id;
									$reponse2=$bdd->query($sql2) or die('Erreur SQL !<br />'.$sql2.'<br />'.mysql_error());
									$data2=$reponse2->fetch();
									if($data2[0]>=3125)
									{
										echo '5';
									}
									elseif($data2[0]>=625)
									{
										echo '4';
									}
									elseif($data2[0]>=125)
									{
										echo '3';
									}
									elseif($data2[0]>=25)
									{
										echo '2';
									}
									elseif($data2[0]>=5)
									{
										echo '1';
									}
									else
									{
										echo '0';
									}
									?>
                                </td>
                            </tr>
                            <tr>
                                <td id="td_right">Inscription 5e filleul:</td>
                                <td>
									<?php
                                    if($data['date_filleul']!=NULL)
									{
										echo date("d M Y H:i:s", strtotime($data['date_filleul']));
									}
									else
									{
										echo '<div class="alert alert-danger">Pas encore 5 filleuls</div>';
									}
									?>
                                </td>
                            </tr>
                            <tr>
                                <td id="td_right">Position dans la matrice:</td>
                                <td>
									<?php
                                    $sql2='SELECT COUNT(*) FROM membre WHERE id_membre<='.$id;
									$reponse2=$bdd->query($sql2) or die('Erreur SQL !<br />'.$sql2.'<br />'.mysql_error());
									$data2=$reponse2->fetch();
									echo stripslashes($data2[0]);
									?>
                                </td>
                            </tr>
                            <tr>
                                <td id="td_right">Personne inscrit après:</td>
                                <td>
									<?php
                                    $sql2='SELECT COUNT(*) FROM membre WHERE id_membre>'.$id;
									$reponse2=$bdd->query($sql2) or die('Erreur SQL !<br />'.$sql2.'<br />'.mysql_error());
									$data2=$reponse2->fetch();
									echo stripslashes($data2[0]);
									?>
                                </td>
                            </tr>
                            <tr>
                                <td id="td_right">Total des pernonnes inscrites:</td>
                                <td>
									<?php
                                    $sql2='SELECT COUNT(*) FROM membre';
									$reponse2=$bdd->query($sql2) or die('Erreur SQL !<br />'.$sql2.'<br />'.mysql_error());
									$data2=$reponse2->fetch();
									echo stripslashes($data2[0]);
									?>
                                </td>
                            </tr>
                            <tr>
                                <td id="td_right">Nombre de connexion:</td>
                                <td>
									<?php echo stripslashes($data['connexion_'.$chaiz.'']) ?>
                                </td>
                            </tr>
                            <tr>
                                <td id="td_right">Date d'inscription</td>
                                <td>
                                	<?php echo date("d M Y H:i:s", strtotime($data['creation_'.$chaiz.''])); ?>
                                </td>
                            </tr>
                            <tr>
                                <td id="td_right">Date de dernière connexion:</td>
                                <td>
                                    <?php
                                    if($data['last_connexion']==NULL)
									{
										echo '<div class="alert alert-danger">Jamais connecté</div>';
									}
									else
									{
										echo date("d M Y H:i:s", strtotime($data['last_connexion']));
									}
									?>
                                </td>
                            </tr>
                            <tr>
                                <td id="td_right">Date de dernière déconnexion:</td>
                                <td>
                                    <?php
                                    if($data['last_connexion']==NULL)
									{
										echo '<div class="alert alert-danger">Jamais déconnecté</div>';
									}
									else
									{
										echo date("d M Y H:i:s", strtotime($data['last_deconnexion']));
									}
									?>
                                </td>
                            </tr>
                            <tr>
                                <td id="td_right">Date de dernière modification</td>
                                <td>
                                	<?php
                                    if($data['last_connexion']==NULL)
									{
										echo '<div class="alert alert-danger">Jamais modifié</div>';
									}
									else
									{
										echo date("d M Y H:i:s", strtotime($data['modif_'.$chaiz.'']));
									}
									?>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="2" align="center">
                                    <a class="btn btn-default" href="gestionnaire-info.php?W9mvyDvFWE5=<?php echo $chaiz ?>"><i class="fa fa-reply"></i> Retour</a>
                                </td>
                            </tr>
                            <?php
                            break;
							
							case 'privilege':
							?>
							<div id="afficher_admin">
								<a class="btn btn-primary" href="ajouter-info.php?W9mvyDvFWE5=<?php echo $chaiz ?>">
									<i class="fa fa-pencil"></i> Ajouter
								</a>
							</div>
							<?php
                            $sql= 'SELECT * FROM '.$chaiz.' WHERE id_'.$chaiz.'="'.$id.'"';
                            $reponse=$bdd->query($sql) or die('Erreur SQL !<br />'.$sql.'<br />'.mysql_error());
                            $data=$reponse->fetch();
                            ?>
                            <tr>
                                <td id="td_right">Titre:</td>
                                <td>
									<?php echo stripslashes($data['lib_'.$chaiz.'']) ?>
                                    <div style="float:right;">
                                        <a href="modifier-info.php?W9mvyDvFWE5=<?php echo $chaiz ?>&QYtgoGbhhd=<?php echo $id ?>">
                                            <i class="fa fa-edit fa-2x"></i>
                                        </a>
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td id="td_right">Affichage dans l'administration:</td>
                                <td>
									<?php echo stripslashes($data['afficher_'.$chaiz.'']) ?>
                                </td>
                            </tr>
                            <tr>
                                <td id="td_right">Visible dans l'ajout d'utilisateur:</td>
                                <td>
									<?php echo stripslashes($data['visible_'.$chaiz.'']) ?>
                                </td>
                            </tr>
                            <tr>
                                <td id="td_right">Date de création</td>
                                <td>
                                	<?php 
									echo date("d M Y H:i", strtotime($data['creation_'.$chaiz.'']));
                                    $sql3= 'SELECT * FROM '.$chaiz.', user WHERE '.$chaiz.'.id_creation_user=user.id_user AND id_'.$chaiz.'="'.$id.'"';
                                    $reponse3=$bdd->query($sql3) or die('Erreur SQL !<br />'.$sql3.'<br />'.mysql_error());
                                    $data3=$reponse3->fetch();
                                    echo ' Par <a href="afficher-info.php?W9mvyDvFWE5=user&QYtgoGbhhd='.$data3[0].'"><span id="span_user">'.$data3['lib_user'].'</span></a>';
                                    ?>
                                </td>
                            </tr>
                            <tr>
                                <td id="td_right">
                                	Dates de modification
                                    <?php
                                    $sql3='SELECT COUNT(*) FROM modificateur WHERE id_'.$chaiz.'='.$id;
                                    $reponse3=$bdd->query($sql3) or die('Erreur SQL !<br />'.$sql3.'<br />'.mysql_error());
                                    $data3=$reponse3->fetch();
									echo '('.$data3[0].')';
									?>
                                </td>
                                <td>
                                	<table class="table table-bordered">
                                	<?php
									$sql3='SELECT * FROM user, modificateur, '.$chaiz.' WHERE '.$chaiz.'.id_'.$chaiz.'=modificateur.id_'.$chaiz.' AND user.id_user=modificateur.id_modif_user AND '.$chaiz.'.id_'.$chaiz.'='.$id;
                                    $reponse3=$bdd->query($sql3) or die('Erreur SQL !<br />'.$sql3.'<br />'.mysql_error());
                                    while($data3=$reponse3->fetch())
									{
                                    	echo '<tr><td id="span_user"><a href="afficher-info.php?W9mvyDvFWE5=user&QYtgoGbhhd='.$data3[0].'">'.$data3['lib_user'].'</a></td><td>'.date("d M Y H:i:s", strtotime($data3['date_modificateur'])).'</td></tr>';
									}
									?>
                                    </table>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="2" align="center">
                                    <a class="btn btn-default" href="gestionnaire-info.php?W9mvyDvFWE5=<?php echo $chaiz ?>"><i class="fa fa-reply"></i> Retour</a>
                                </td>
                            </tr>
                            <?php
                            break;

							default: header('administration.php');
                        }
                        ?>
                    </table>
                </div>
            </div>
        </div>
    </div>
</body>
</html>

<?php 
}
else
{
	header('Location: index.php');
}
?>