//All commun functions require_once 'menus.php'; require_once 'funcuser.php'; //Top Menu $selectedTab = $_GET['selectedTab']; $menu = topMenus($selectedTab, $_SESSION['GL_USER']['DROIT']); //Left Menu $leftMenu = parametersMenus($selectedTab, $_SESSION['GL_USER']['DROIT']); //DOIT MAJ $droitMAJ = $_SESSION['GL_USER']['DROIT']['par_uti']; isset($_SESSION['DATA_LO']['LOGIN']) ? $login = $_SESSION['DATA_LO']['LOGIN'] : ($login = ''); isset($_SESSION['DATA_LO']['NUM_MLLE']) ? $nummlle = $_SESSION['DATA_LO']['NUM_MLLE'] : ($nummlle = ''); isset($_SESSION['DATA_LO']['IDPROFIL']) ? $groupe = $_SESSION['DATA_LO']['IDPROFIL'] : ($groupe = ''); isset($_SESSION['DATA_LO']['ACTIVATED']) ? $active = $_SESSION['DATA_LO']['ACTIVATED'] : ($active = ''); isset($_SESSION['DATA_LO']['idlangue']) ? $idlangue = $_SESSION['DATA_LO']['idlangue'] : ($idlangue = ''); $mag = getUsermagasin($login); $mg = preg_split('/ /', $mag); isset($mg[0]) ? $mag1 = $mg[0] : ($mag1 = ''); isset($mg[1]) ? $mag2 = $mg[1] : ($mag2 = ''); isset($mg[2]) ? $mag3 = $mg[2] : ($mag3 = ''); isset($mg[3]) ? $mag4 = $mg[3] : ($mag4 = ''); isset($mg[4]) ? $mag5 = $mg[4] : ($mag5 = ''); isset($mg[5]) ? $mag6 = $mg[5] : ($mag6 = ''); isset($mg[6]) ? $mag7 = $mg[6] : ($mag7 = ''); isset($mg[7]) ? $mag8 = $mg[7] : ($mag8 = ''); isset($active) && $active == 1 ? $check = 'checked="checked"' : ($check = ''); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="fr" xml:lang="fr"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
function ligneEtatListeUtilisateur($wh = '') { $userName = getField('LOGIN', $_SESSION['GL_USER']['LOGIN'], 'LOGIN', 'compte'); $ilang = getCodelangue($userName); $returnHTML = ''; //Where clause $where = ''; isset($wh) and $wh != '' ? $where = " WHERE {$wh} " : ($where = ""); //Oerder condition $order = ''; isset($ord) and $ord != '' ? $order = " ORDER BY {$ord} {$sens}" : ($order = " ORDER BY LOGIN ASC"); //Nombre d'éléments $nbre = nombreUser($where); if ($nbre > 0) { //Calcule des limites $sql = "SELECT * FROM compte INNER JOIN profil ON (compte.IDPROFIL=profil.IDPROFIL) {$where} {$order};"; //Exécution try { $cnx = new PDO(DBD, DBUSER, DBPWD, array(PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES utf8")); //Connexion to database } catch (PDOException $error) { //Treat error //("Erreur de connexion : " . $error->getMessage() ); header('location:errorPage.php'); } $query = $cnx->prepare($sql); //Prepare the SQL $query->execute(); //Execute prepared SQL => $query $i = 1; while ($row = $query->fetch(PDO::FETCH_ASSOC)) { $row['ACTIVATED'] == 1 ? $etat = 'Activé' : ($etat = 'Déactivé'); $returnHTML .= ' <tr align="left" valign="middle"> <td class="botBorderTdall" align="center">' . $i . '</td> <td class="botBorderTdall">' . stripslashes($row['LOGIN']) . ' </td> <td class="botBorderTdall">' . stripslashes($row['LIBPROFIL']) . ' </td> <td class="botBorderTdall">' . stripslashes($row['NUM_MLLE']) . ' </td> <td class="botBorderTdall">' . stripslashes(getPersonnelName($row['NUM_MLLE'])) . ' </td> <td class="botBorderTdall">' . stripslashes($etat) . '</td> <td class="botBorderTdall">' . stripslashes(getUsermagasin($row['LOGIN'])) . ' </td> </tr>'; $i++; } } else { if ($ilang == '1' && $ilang != '') { $returnHTML .= '<tr><td colspan="4" class="text">Aucune donnée...</td></tr>'; } if ($ilang == '2' && $ilang != '') { $returnHTML .= '<tr><td colspan="4" class="text">No data...</td></tr>'; } if ($ilang == '3' && $ilang != '') { $returnHTML .= '<tr><td colspan="4" class="text">Nenhum dado...</td></tr>'; } } return $returnHTML; }