function ligneEtatListeLog($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 LOG_DATE DESC"); //Nombre d'éléments $nbre = nombreLog($where); if ($nbre > 0) { //Calcule des limites $sql = "SELECT * FROM logs {$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)) { $d1 = frFormat($row['LOG_DATE']); //Return $ret = array(); // DFR, TFR $returnHTML .= ' <tr align="left" valign="middle"> <td class="botBorderTdall" align="center">' . $i . '</td> <td class="botBorderTdall">' . stripslashes($row['LOGIN']) . ' </td> <td class="botBorderTdall">' . stripslashes(getPersonnelName($row['MLLE'])) . ' </td> <td class="botBorderTdall">' . stripslashes($d1['DFR']) . ' </td> <td class="botBorderTdall">' . stripslashes($d1['TFR']) . ' </td> <td class="botBorderTdall">' . stripslashes($row['LOG_DESCRIP']) . ' </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; }
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)) { $i % 2 == 0 ? $col = "tableOddRow" : ($col = "tableEvenRow"); $row['ACTIVATED'] == 1 ? $etat = 'Activé' : ($etat = 'Déactivé'); $returnHTML .= ' <tr align="left" valign="middle" class="' . $col . '"> <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; }