[ Index ]

PHP Cross Reference of IEUF

title

Body

[close]

/gestion/ -> adherents.php (source)

   1  <?php
   2  //Vérification accès
   3  require  'inc/autorisation.inc.php';
   4  if (NonCA()) include  'inc/404.php';
   5  ?>
   6  
   7  <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   8  "http://www.w3.org/TR/html4/loose.dtd">
   9  <html>
  10    <head>
  11      <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type">
  12      <meta http-equiv="Pragma" content="no-cache">
  13      <meta http-equiv="Cache-Control" content="no-cache, must-revalidate">
  14      <meta http-equiv="expires" content="0">
  15      <title>
  16        Paiements
  17      </title>
  18      <style type="text/css">
  19  body {
  20      font-family: Arial,Helvetica,sans-serif;
  21      font-size: 10pt;
  22      }
  23      .parametres {
  24      width: 200px;
  25      height: 500px;
  26      position: fixed;
  27      min-height: 500px;
  28      background-color: #666666;
  29      color: white;
  30      }
  31      .tableau {
  32      margin-left: 205px;
  33      }
  34      #lst_rec {
  35      position: relative;
  36      background-color: #cccccc;
  37      color: black;
  38      font-style: italic;
  39      height: 100pt;
  40      max-height: 100pt;
  41      overflow: auto;
  42      }
  43  
  44      </style>
  45      <script language="JavaScript" type="text/JavaScript">
  46  <!--
  47      tab_pers = new Array();
  48      <?php
  49      include  "../inclus/connect_bd.inc.php";
  50  
  51      $an_adh = date("n")<9 ? date("Y")-1 : date("Y");
  52      $date_deb = $an_adh."-09-01";
  53  
  54      $liste_choix=array(
  55          "N" => array("Adhérents à vérifier","FROM personne, adhesion WHERE id_perso = personne.id AND date_adhesion>'$date_deb' AND mod_du GROUP BY personne.id "),
  56          "J" => array("Adhérents à jour","FROM personne, adhesion WHERE id_perso = personne.id AND date_adhesion>'$date_deb' AND NOT mod_du GROUP BY personne.id "),
  57          "A" => array("Adhérents de la saison","FROM personne, adhesion WHERE id_perso = personne.id AND date_adhesion>'$date_deb'")
  58     );
  59  
  60  
  61      function NormNom($n) {
  62        $org= "ÂÄÀÇÉÊËÈÎÏÔÖÛÜÙ?'";
  63        $dst= "AAACEEEEIIOOUUUY_";
  64        return strtr(strtoupper($n), $org, $dst);
  65      }
  66      $ind_selection= "N";
  67      if (isset ($_POST['choix'])) {
  68          $ind_selection= $_POST['choix'];
  69      }
  70      $compl_req= $liste_choix[$ind_selection][1];
  71      $requete= "SELECT adhesion.id, personne.civilite, personne.Nom, personne.Prenom
  72                                                      $compl_req ORDER BY personne.nom, personne.prenom";
  73      $recherche=mysql_query($requete);
  74      if ($recherche === false) die( mysql_error());
  75      $id= 0;
  76      while ($col= mysql_fetch_assoc($recherche)) {
  77        $nom= NormNom($col['Nom']);
  78        echo "tab_pers[$id]= '$nom'; \r\n";
  79        $id++;
  80      }
  81      $rech="";
  82      if (isset ($_POST['recherche']))
  83          $rech=$_POST['recherche'];
  84      ?>
  85  
  86      function Recherche(v) {
  87        var org= "ÂÄÀÇÉÊËÈÎÏÔÖÛÜÙ?'";
  88        var dst= "AAACEEEEIIOOUUUY_";
  89        var val= "";
  90        var scroll= true;
  91        if (v.length == 0) val='###';
  92        else {
  93            v= v.toUpperCase();
  94            for (var i= 0; i < v.length; i++) {
  95              j= org.indexOf(v.charAt(i))
  96              if (j >= 0)
  97                val+= dst.charAt(j);
  98              else
  99                val+= v.charAt(i);
 100          }
 101        }
 102        for (var i= 0; i < tab_pers.length; i++) {
 103          var elt= document.getElementById('idp_'+i);
 104          if (tab_pers[i].indexOf(val) == 0) {
 105             elt.style.backgroundColor='#FFFF88';
 106             if (scroll) {
 107               elt.scrollIntoView();
 108               scroll= false;
 109             }
 110          }
 111          else
 112            elt.style.backgroundColor='';
 113        }
 114      }
 115  
 116      function Ouvrefiche(id,type) {
 117          open("paiement.php?idb="+id,"_blank","width=1000,height=700,left=320,top=0,resizable=yes,scrollbars=yes").focus();
 118      }
 119  
 120      //-->
 121      </script>
 122    </head>
 123    <body onload="document.parametres.recherche.focus()">
 124      <div class="parametres" style="height: 21px;">
 125        <form method="post" action="<?php echo $_SERVER['PHP_SELF'] ?>" name="parametres" id="parametres">
 126          Sélection :<br>
 127          <select name="choix" onchange="document.parametres.submit()">
 128              <?php
 129                  foreach ($liste_choix as $idx=>$lc) {
 130                      $sel= $ind_selection == $idx ? " selected='selected'" : '';
 131                      echo "
 132                      <option value='$idx' $sel>
 133                          $lc[0]
 134                       </option>";
 135                  }
 136              ?>
 137          </select>
 138          <br>
 139          <br>
 140          <div>
 141            Rechercher :<br>
 142            <input size="25" name="recherche" autocomplete="off" onkeyup="Recherche(this.value)" value="<?php echo $rech; ?>">
 143            <br>
 144          </div><br>
 145          <input name="Creation" value="Ajout d'un payeur" type="button" onclick="Ouvreform(0,'i')">
 146        </form>
 147      </div>
 148      <table id="liste" class="tableau" border="1" cellpadding="2" cellspacing="2" width="800">
 149        <tbody>
 150          <tr>
 151            <td align="left" width="46">
 152              Civilité
 153            </td>
 154            <td width="120">
 155              Nom
 156            </td>
 157            <td width="90">
 158              Prénom
 159            </td>
 160          </tr>
 161            <?php $id= 0;
 162                  if (mysql_num_rows($recherche)>0) {
 163                   mysql_data_seek($recherche, 0);
 164                   while ($col= mysql_fetch_assoc($recherche)) {
 165                      echo "
 166                      <tr id='idp_$id'>
 167                              <td>{$col['civilite']}</td>       
 168                              <td><a href='javascript:Ouvrefiche({$col['id']},\"i\")'>{$col['Nom']}</a></td>
 169                              <td>{$col['Prenom']}</td>
 170                       </tr>
 171                      ";
 172                      $id++;
 173                    }
 174                  }
 175            ?>
 176        </tbody>
 177      </table>
 178      <script type="text/JavaScript">
 179          Recherche("<?php echo $rech; ?>");
 180      </script>
 181  
 182    </body>
 183  </html>


Generated: Fri Jan 31 19:59:00 2014 Cross-referenced by PHPXref 0.7.1