[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

/se3master/var/www/se3/annu/ -> listing.php (source)

   1  <?php
   2  
   3  
   4     /**
   5     
   6     * @Version $Id: listing.php 8600 2015-03-16 20:12:30Z plouf $ 
   7     
   8    
   9     * @Projet LCS / SambaEdu 
  10     
  11     * @auteurs  
  12     
  13     * @Licence Distribue selon les termes de la licence GPL
  14     
  15     * @note 
  16     
  17     */
  18  
  19     /**
  20  
  21     * @Repertoire: annu
  22     * file: listing.php
  23  
  24    */    
  25  
  26  session_start();
  27  set_time_limit (300);
  28  
  29      require "config.inc.php";
  30      require "functions.inc.php";
  31      require  "ihm.inc.php";
  32  
  33  
  34          // HTMLPurifier
  35          require_once  ("traitement_data.inc.php");
  36          
  37      $login=isauth();
  38  
  39      if (!is_admin("Annu_is_admin",$login)=="Y") {
  40          // dégage crétin
  41          echo "dégage...";
  42      } else {
  43          $listing = unserialize(rawurldecode($_POST['hiddeninput']));
  44  
  45  // Tri du listing par classe/nom/prénom
  46  function trieleve($a,$b)
  47  {
  48      //tri par classe
  49      $res=strcmp($a["cla"], $b["cla"]);
  50      
  51      if ($res == 0) {
  52          $res=strcmp($a["nom"], $b["nom"]);
  53          if ($res == 0) {
  54              $res=strcmp($a["pre"], $b["pre"]);
  55          }
  56      }
  57  
  58      return $res;
  59  }
  60  
  61  usort($listing, "trieleve");
  62  
  63  
  64  
  65      
  66      $content = "<page backtop='15mm' backbottom='15mm' >";
  67  
  68  
  69      foreach ($listing as $nkey => $user)
  70          {
  71              if (!isset($classe_preced)) { $classe_preced = $user['cla']; }
  72              if ($user['cla']!=$classe_preced) {
  73                  $classe_preced = $user['cla'];
  74                  $content .="</page><page backtop='15mm' backbottom='15mm' >";
  75              }
  76  
  77              $content .="<div style='margin-bottom:3mm; border: solid 1px black; padding:3mm; width: 80%; margin: auto'>";
  78      
  79              $content .="<table style='width:100%'><tr><td style='width:50%'>";
  80              $content .=$user['nom']." ";
  81              $content .=$user['pre']."<br>";
  82              $content .=$user['cla']."</td>";
  83          
  84              $content .="<td style='width:35%'>";
  85              $content .="identifiant  : <span style='font-family:courier'>".$user['uid']."</span><br>";
  86              $content .="mot de passe : <span style='font-family:courier'>".$user['pwd']."</span>";
  87              $content .="</td>";
  88              $content .="</tr></table>";
  89  
  90              $content .="<span style='font-size:70%'>Le mot de passe est strictement personnel et doit &#234;tre prot&#233;g&#233;. L'utilisateur est responsable de l'usage qui est fait de son identifiant.</span>";    
  91              $content .="</div>";
  92          }
  93  
  94      $content .="</page>";
  95  
  96  
  97      require_once(dirname(__FILE__).'/../html2pdf/html2pdf.class.php');
  98      $html2pdf = new HTML2PDF('P','A4','fr', false, 'ISO-8859-15');
  99      $html2pdf->WriteHTML($content);
 100      $html2pdf->Output('liste.pdf');
 101  
 102          $pdf = new HTML2PDF('P','A4','fr'); 
 103  
 104      if((isset($_POST['purge_session_data']))&&($_POST['purge_session_data']=='y')) {
 105          unset($_SESSION['comptes_crees']) ;    
 106      }
 107      if((isset($_POST['purge_csv_data']))&&($_POST['purge_csv_data']=='y')) {
 108          if (file_exists("/tmp/changement_mdp.csv")) {
 109              unlink("/tmp/changement_mdp.csv"); 
 110          }    
 111      }
 112  }
 113  ?>


Generated: Tue Mar 17 22:47:18 2015 Cross-referenced by PHPXref 0.7.1