cartesae.php 16.1 KB
Newer Older
Ayolo's avatar
Ayolo committed
1 2 3 4
<?php
/* Copyright 2006
 * - Julien Etelain < julien at pmad dot net >
 *
Feu's avatar
fixes  
Feu committed
5
 * Ce fichier fait partie du site de l'Association des Étudiants de
Ayolo's avatar
Ayolo committed
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
 * l'UTBM, http://ae.utbm.fr.
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as
 * published by the Free Software Foundation; either version 2 of the
 * License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 * 02111-1307, USA.
 */
$topdir = "../";
require_once($topdir. "include/site.inc.php");
require_once($topdir . "include/cts/sqltable.inc.php");
require_once($topdir . "include/entities/asso.inc.php");
require_once($topdir . "include/entities/carteae.inc.php");
require_once($topdir . "include/entities/cotisation.inc.php");
$site = new site ();

if (!$site->user->is_in_group ("gestion_ae"))
32
  $site->error_forbidden("accueil");
Ayolo's avatar
Ayolo committed
33 34 35

if ( $_REQUEST["action"] == "pdf" )
{
Ayolo's avatar
Ayolo committed
36
  require_once($topdir . "include/pdf/carteae.inc.php");
37

Ayolo's avatar
Ayolo committed
38
  $pdf = new pdfcarteae();
39

Ayolo's avatar
Ayolo committed
40 41 42
  $ids = explode(",",$_REQUEST["ids"]);
  foreach ( $ids as $key => $val )
    $ids[$key] = intval($val);
43 44

  $req = new requete($site->db,
Ayolo's avatar
Ayolo committed
45 46 47 48 49 50
      "SELECT " .
      "`utilisateurs`.`id_utilisateur`, " .
      "`utilisateurs`.`nom_utl`, " .
      "`utilisateurs`.`prenom_utl`, " .
      "`utl_etu_utbm`.`surnom_utbm`, " .
      "`ae_cotisations`.`date_fin_cotis`, " .
mbriand's avatar
mbriand committed
51
      "`ae_cotisations`.`type_cotis`, " .
Ayolo's avatar
Ayolo committed
52 53 54 55 56 57
      "`ae_carte`.`id_carte_ae` " .
      "FROM `ae_carte` " .
      "INNER JOIN `ae_cotisations` ON `ae_cotisations`.`id_cotisation`=`ae_carte`.`id_cotisation` " .
      "INNER JOIN `utilisateurs` ON `ae_cotisations`.`id_utilisateur`=`utilisateurs`.`id_utilisateur` ".
      "LEFT JOIN `utl_etu_utbm` ON `utl_etu_utbm`.`id_utilisateur`=`utilisateurs`.`id_utilisateur` ".
      "WHERE `utilisateurs`.`id_utilisateur` IN (".implode(",",$ids).") " .
58 59
      "ORDER BY `ae_carte`.`id_carte_ae`");

Ayolo's avatar
Ayolo committed
60 61 62
  $pdf->render($req);
  $pdf->Output();
  exit();
Ayolo's avatar
Ayolo committed
63 64 65
}


66
$site->start_page ("accueil", "Cartes AE");
Ayolo's avatar
Ayolo committed
67 68 69 70

$cts = new contents("Cartes AE");

$tabs = array(
Ayolo's avatar
Ayolo committed
71 72 73 74 75 76
      array("","ae/cartesae.php", "Impression"),
      array("print","ae/cartesae.php?view=print", "Test apr&egrave;s impression"),
      array("bureau","ae/cartesae.php?view=bureau", "Reception au bureau"),
      array("retrait","ae/cartesae.php?view=retrait", "Retrait carte AE"),
      array("cadeau","ae/cartesae.php?view=cadeau", "Retrait cadeau"),
      );
Ayolo's avatar
Ayolo committed
77
//array("photos","ae/cartesae.php?view=photos", "Photo manquante")
78

Ayolo's avatar
Ayolo committed
79 80 81 82
$cts->add(new tabshead($tabs,$_REQUEST["view"]));

if ($_REQUEST["view"] == "cadeau")
{
Ayolo's avatar
Ayolo committed
83 84 85 86 87
  if ( isset($_REQUEST['code']))
  {
    $carte = new carteae($site->db);
    $cotiz = new cotisation($site->db, $site->dbrw);
    $user = new utilisateur($site->db);
Ayolo's avatar
Ayolo committed
88

Ayolo's avatar
Ayolo committed
89
    $lst = new itemlist("R&eacute;sultat");
Ayolo's avatar
Ayolo committed
90

Ayolo's avatar
Ayolo committed
91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114
    $carte->load_by_cbarre($_REQUEST['code']);
    if ( $carte->id > 1 )
    {
      $cotiz->load_by_id($carte->id_cotisation);
      $user->load_by_id($cotiz->id_utilisateur);
      if ( $cotiz->a_pris_cadeau )
        $lst->add("<b>ATTENTION : </b>Cadeau déjà pris pour " . $user->prenom. " ".$user->nom." !","ko");
      else
      {
        $cotiz->mark_cadeau();
        if ( !$cotiz->a_pris_carte )
        {
          $lst->add($user->prenom. " ".$user->nom." : OK","ok");
          $advert = 1;
        }
        else
          $lst->add($user->prenom. " ".$user->nom." : OK","ok");
      }
    }
    else
      $lst->add("Carte n°".$_REQUEST['code']." inconnue !","ko");
    $cts->add($lst,true);
    if ($advert)
    {
BenC's avatar
BenC committed
115
      $cts->puts("<br/><b style=\"red\">ATTENTION : </b>".$user->prenom." ".$user->nom." ne semble pas avoir déjà pris sa carte AE !<br/><br/>");
Ayolo's avatar
Ayolo committed
116 117 118 119 120 121 122 123 124 125 126
      $frm_retrait_cae = new form("gotoretraitcae","cartesae.php?view=retrait",false,"POST",null);
      $frm_retrait_cae->add_submit("go","Marquer sa carte AE comme retir&eacute;e");
      $frm_retrait_cae->add_hidden("code",$_REQUEST['code']);
      $cts->add($frm_retrait_cae);
    }
  }
  $frm = new form("retraitcadeau","cartesae.php?view=cadeau",false,"POST","Retrait cadeau");
  $frm->add_text_field("code","Carte AE : ");
  $frm->set_focus("code");
  $frm->add_submit("valid","Valider");
  $cts->add($frm,true);
Ayolo's avatar
Ayolo committed
127 128 129
}
elseif ( $_REQUEST["view"] == "retrait" )
{
Ayolo's avatar
Ayolo committed
130 131 132 133 134
  if ( isset($_REQUEST["code"]))
  {
    $carte = new carteae($site->db,$site->dbrw);
    $cotiz = new cotisation($site->db,$site->dbrw);
    $user = new utilisateur($site->db);
135

Ayolo's avatar
Ayolo committed
136
    $lst = new itemlist("R&eacute;sultats");
137

Ayolo's avatar
Ayolo committed
138 139 140 141 142
    $carte->load_by_cbarre($_REQUEST["code"]);
    if ( $carte->id > 1 )
    {
      $cotiz->load_by_id($carte->id_cotisation);
      $user->load_by_id($cotiz->id_utilisateur);
143 144

      if ( $_REQUEST["cadeau"] )
Ayolo's avatar
Ayolo committed
145
      {
146
        $lst->puts("<h3>Cadeau :</h3>");
Ayolo's avatar
Ayolo committed
147 148 149 150 151 152 153 154
        if ( $cotiz->a_pris_cadeau )
        {
          $lst->add("<b>ATTENTION : </b> ". $user->prenom . " " . $user->nom . " Cadeau déjà pris !","ko");
        }
        else
        {
          $cotiz->mark_cadeau();
          $lst->add($user->prenom." ".$user->nom." : OK","ok");
155
        }
Ayolo's avatar
Ayolo committed
156 157 158
      }
      elseif ( !$cotiz->a_pris_cadeau )
      {
159
        $lst->puts("<h3>Cadeau :</h3>");
Ayolo's avatar
Ayolo committed
160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187
        $distrib = new form("distrib","cartesae.php?view=cadeau",false,"POST","INFO : " .$user->prenom . " " . $user->nom . " n'a pas encore pris son cadeau !<br/><br/>");
        $distrib->add_hidden("code",$_REQUEST['code']);
        $distrib->add_submit("valid","Marquer son cadeau comme pris");
        $lst->add($distrib,"info");
      }
      $lst->puts("<h3>Carte AE :</h3>");
      if ( $cotiz->a_pris_carte )
      {
        $lst->add("<b>ATTENTION : </b> ". $user->prenom . " " . $user->nom . " Carte AE déjà prise !","ko");
      }
      else
      {
        $cotiz->mark_carte();
        $carte->set_state(CETAT_CIRCULATION);
        $lst->add($user->prenom." ".$user->nom." : OK","ok");
      }
    }
    else
      $lst->add("Carte n°".$_REQUEST['code']." inconnue !","ko");
    $cts->add($lst,true);
    if (!$cotiz->a_pris_cadeau)
    {
    $cts->puts("<br/>");
    $frm_suiv = new form("gotocadeau","cartesae.php?view=cadeau",false,"POST",null);
    $frm_suiv->add_submit("suiv","Etape Suivante");
    $cts->add($frm_suiv);
    }
  }
188

Ayolo's avatar
Ayolo committed
189 190 191 192 193 194
  $frm = new form("retraitcarte","cartesae.php?view=retrait",false,"POST","Retrait carte");
  $frm->add_checkbox("cadeau","Retrait du cadeau");
  $frm->add_text_field("code","Carte");
  $frm->set_focus("code");
  $frm->add_submit("valid","Valider");
  $cts->add($frm,true);
195 196

  $req = new requete($site->db,
Ayolo's avatar
Ayolo committed
197 198 199 200 201 202 203 204 205 206
      "SELECT " .
      "`utilisateurs`.`id_utilisateur`, " .
         "`utl_etu_utbm`.`departement_utbm`, ".
      "CONCAT(`utilisateurs`.`nom_utl`,' ',`utilisateurs`.`prenom_utl`) as `nom_utilisateur`, " .
      "`ae_cotisations`.`date_fin_cotis`, " .
      "`ae_carte`.`id_carte_ae` " .
      "FROM `ae_carte` " .
      "INNER JOIN `ae_cotisations` ON `ae_cotisations`.`id_cotisation`=`ae_carte`.`id_cotisation` " .
      "INNER JOIN `utilisateurs` ON `ae_cotisations`.`id_utilisateur`=`utilisateurs`.`id_utilisateur` ".
         "LEFT JOIN `utl_etu_utbm` ON `ae_cotisations`.`id_utilisateur` = `utl_etu_utbm`.`id_utilisateur` ".
mbriand's avatar
mbriand committed
207 208
      "WHERE `ae_carte`.`etat_vie_carte_ae` = '" . CETAT_AU_BUREAU_AE . "' " .
      "AND `ae_cotisations`.`date_fin_cotis` > '".date("Y-m-d")."' " .
209 210
      "ORDER BY `utilisateurs`.`nom_utl`,`utilisateurs`.`prenom_utl`");

Ayolo's avatar
Ayolo committed
211
  $cts->add(new sqltable(
212 213 214
    "listnonret",
    "Liste des utilisateurs qui ne sont pas venus retirer leur carte ae", $req, "cartesae.php",
    "id_utilisateur",
Ayolo's avatar
Ayolo committed
215 216 217 218
    array(
      "id_carte_ae"=>"N° carte",
      "nom_utilisateur"=> "Nom & Prénom",
      "departement_utbm" => "Département",
219 220
      "date_fin_cotis"=>"Cotisation jusqu'au"),
    array("email_retrait_carte"=>"Envoyer email de rappel"),
Ayolo's avatar
Ayolo committed
221 222 223
    array("email_retrait_carte"=>"Envoyer email de rappel"),
    array( )
    ),true);
Ayolo's avatar
Ayolo committed
224 225 226
}
elseif ( $_REQUEST["view"] == "bureau" )
{
Ayolo's avatar
Ayolo committed
227 228 229 230 231 232 233 234 235 236 237 238 239 240
  if ( isset($_REQUEST["codes"]))
  {
    $carte = new carteae($site->db,$site->dbrw);
    $user = new utilisateur($site->db);
    $codes = explode("\n",$_REQUEST["codes"]);
    $lst = new itemlist("R&eacute;sultats");
    foreach ( $codes as $num )
    {
      $carte->load_by_cbarre($num);
      if ( $carte->id > 0 )
      {
        $user->load_by_cotisation($carte->id_cotisation);
        if ($carte->set_state(CETAT_AU_BUREAU_AE))
        {
241
          $lst->add($user->prenom." ".$user->nom." : OK","ok");
Ayolo's avatar
Ayolo committed
242 243
        }
        else
BenC's avatar
BenC committed
244
          $lst->add($user->prenom." ".$user->nom." : Carte déjà réceptionnée","ko");
Ayolo's avatar
Ayolo committed
245 246 247 248 249 250 251 252 253 254
      }
      else
        $lst->add("Carte n°".$num." inconnue !","ko");
    }
    $cts->add($lst,true);
    $cts->puts("<br/>");
    $frm_suiv = new form("gotoretrait","cartesae.php?view=retrait",false,"POST",null);
    $frm_suiv->add_submit("suiv","Etape Suivante");
    $cts->add($frm_suiv);
  }
255

Ayolo's avatar
Ayolo committed
256 257 258 259 260 261
  $frm = new form("aubureau","cartesae.php?view=bureau",false,"POST","Cartes");
  $frm->add_info("Scanner les cartes à marquer comme receptionnés au bureau de l'ae");
  $frm->add_text_area("codes","Cartes");
  $frm->set_focus("codes");
  $frm->add_submit("valid","Valider");
  $cts->add($frm,true);
Ayolo's avatar
Ayolo committed
262 263 264
}
elseif ( $_REQUEST["view"] == "print" )
{
Ayolo's avatar
Ayolo committed
265 266 267 268 269 270 271 272 273 274 275 276 277
  if ( isset($_REQUEST["codes"]))
  {
    $carte = new carteae($site->db,$site->dbrw);
    $user = new utilisateur($site->db);
    $codes = explode("\n",$_REQUEST["codes"]);
    $lst = new itemlist("R&eacute;sultats");
    foreach ( $codes as $num )
    {
      $carte->load_by_cbarre($num);
      if ( $carte->id > 0 )
      {
        $carte->set_state(CETAT_IMPRIMEE);
        $user->load_by_cotisation($carte->id_cotisation);
278
        $lst->add($user->prenom." ".$user->nom." : OK","ok");
Ayolo's avatar
Ayolo committed
279 280 281 282
      }
      else
        $lst->add("Carte n°".$num." inconnue !","ko");
    }
Ayolo's avatar
Ayolo committed
283

Ayolo's avatar
Ayolo committed
284 285 286 287 288 289
    $cts->add($lst,true);
    $cts->puts("<br/>");
    $frm_suiv = new form("gotobureau","cartesae.php?view=bureau",false,"POST",null);
    $frm_suiv->add_submit("suiv","Etape Suivante");
    $cts->add($frm_suiv);
  }
290

Ayolo's avatar
Ayolo committed
291 292 293 294 295 296
  $frm = new form("printed","cartesae.php?view=print",false,"POST","Cartes");
  $frm->add_info("Scanner les cartes à marquer comme imprimées");
  $frm->add_text_area("codes","Cartes");
  $frm->set_focus("codes");
  $frm->add_submit("valid","Valider");
  $cts->add($frm,true);
Ayolo's avatar
Ayolo committed
297 298 299
}
else
{
Ayolo's avatar
Ayolo committed
300 301 302 303 304 305 306
  if ($_REQUEST['action']=="email_photo")
  {
    $lst = new itemlist("R&eacute;sultats :");
    if($_GET['id_utilisateur'])
      $ids[] = $_GET['id_utilisateur'];
    elseif($_POST['id_utilisateurs'])
    {
Ayolo's avatar
Ayolo committed
307

Ayolo's avatar
Ayolo committed
308 309 310
      foreach ($_POST['id_utilisateurs'] as $id_util)
        $ids[] = $id_util;
    }
Ayolo's avatar
Ayolo committed
311

Ayolo's avatar
Ayolo committed
312 313 314 315 316 317
    foreach ( $ids as $id )
    {
      $user = new utilisateur($site->db);
      $user->load_by_id($id);
      $user->load_all_extra();
      $body = "Bonjour,
Ayolo's avatar
Ayolo committed
318 319


Feu's avatar
fixes  
Feu committed
320
Votre carte AE est prête a être imprimée.
Ayolo's avatar
Ayolo committed
321

Feu's avatar
fixes  
Feu committed
322
Cependant vous ne disposez pas de photo d'identité sur votre profil pour figurer sur votre carte AE.
323

Feu's avatar
fixes  
Feu committed
324
Vous devez ajouter une photo d'identité à votre profil en vous rendant à l'adresse :
325
    http://ae.utbm.fr". $GLOBALS["wwwtopdir"]."user.php?id_utilisateur=".$user->id."&see=photos&page=edit
Feu's avatar
fixes  
Feu committed
326
Votre carte AE sera désormais transmise pour impression.
Ayolo's avatar
Ayolo committed
327 328


Feu's avatar
fixes  
Feu committed
329
Merci de votre compréhension
Ayolo's avatar
Ayolo committed
330

Feu's avatar
fixes  
Feu committed
331
L'équipe info AE";
Ayolo's avatar
Ayolo committed
332

Ayolo's avatar
Ayolo committed
333
      $ret = mail($user->email_utbm, "[AE] Problème lors de l'impression de votre carte AE - Photo manquante", $body,
Ayolo's avatar
Ayolo committed
334
                            "From: \"AE UTBM\" <ae@utbm.fr>\nReply-To: ae.info@utbm.fr");
Ayolo's avatar
Ayolo committed
335
      if ($ret)
336
        $lst->add("Mail de rappel &agrave; " .$user->prenom. " " .$user->nom. " : Envoy&eacute;","ok");
Ayolo's avatar
Ayolo committed
337 338 339 340
      else
        $lst->add("Erreur lors de l'envoi du mail de rappel pour " . $user->prenom . " " . $user->nom ." !","ko");
    }
    $cts->add($lst,true);
341 342
  }
  $req = new requete($site->db,
Ayolo's avatar
Ayolo committed
343 344 345 346
      "SELECT `ae_cotisations`.`id_utilisateur` FROM `ae_carte` " .
      "INNER JOIN `ae_cotisations` ON `ae_cotisations`.`id_cotisation`=`ae_carte`.`id_cotisation` " .
      "LEFT JOIN `utl_etu_utbm` ON `ae_cotisations`.`id_utilisateur`=`utl_etu_utbm`.`id_utilisateur` ".
      "WHERE `ae_carte`.`etat_vie_carte_ae`=".CETAT_ATTENTE." " .
mbriand's avatar
mbriand committed
347
      "AND departement_utbm IN ('tc','mc') " .
348
      "ORDER BY `ae_carte`.`id_carte_ae`");
Ayolo's avatar
Ayolo committed
349 350
  $printable['sev'] = array();
  while ( $row = $req->get_row() )
Antoine Tenart's avatar
kwain  
Antoine Tenart committed
351
    if ( file_exists("../data/matmatronch/" . $row['id_utilisateur'] .".identity.jpg"))
352 353 354
      $printable['sev'][]=$row['id_utilisateur'];

  $req = new requete($site->db,
Ayolo's avatar
Ayolo committed
355 356 357 358 359
      "SELECT `ae_cotisations`.`id_utilisateur` FROM `ae_carte` " .
      "INNER JOIN `ae_cotisations` ON `ae_cotisations`.`id_cotisation`=`ae_carte`.`id_cotisation` " .
      "LEFT JOIN `utl_etu_utbm` ON `ae_cotisations`.`id_utilisateur`=`utl_etu_utbm`.`id_utilisateur` ".
      "WHERE `ae_carte`.`etat_vie_carte_ae`=".CETAT_ATTENTE." " .
      "AND departement_utbm IN ('edim')  " .
360
      "ORDER BY `ae_carte`.`id_carte_ae`");
Ayolo's avatar
Ayolo committed
361 362
  $printable['mon'] = array();
  while ( $row = $req->get_row() )
Antoine Tenart's avatar
kwain  
Antoine Tenart committed
363
    if ( file_exists("../data/matmatronch/" . $row['id_utilisateur'] .".identity.jpg"))
Ayolo's avatar
Ayolo committed
364
      $printable['mon'][]=$row['id_utilisateur'];
Ayolo's avatar
Ayolo committed
365

Ayolo's avatar
Ayolo committed
366 367 368 369 370
  $req = new requete($site->db,
      "SELECT `ae_cotisations`.`id_utilisateur` FROM `ae_carte` " .
      "INNER JOIN `ae_cotisations` ON `ae_cotisations`.`id_cotisation`=`ae_carte`.`id_cotisation` " .
      "LEFT JOIN `utl_etu_utbm` ON `ae_cotisations`.`id_utilisateur`=`utl_etu_utbm`.`id_utilisateur` ".
      "WHERE `ae_carte`.`etat_vie_carte_ae`=".CETAT_ATTENTE." " .
mbriand's avatar
mbriand committed
371
      "AND ( departement_utbm NOT IN ('tc','mc','edim') OR departement_utbm IS NULL ) " .
Ayolo's avatar
Ayolo committed
372 373 374
      "ORDER BY `ae_carte`.`id_carte_ae`");
  $printable['bel'] = array();
  while ( $row = $req->get_row() )
Antoine Tenart's avatar
kwain  
Antoine Tenart committed
375
    if ( file_exists("../data/matmatronch/" . $row['id_utilisateur'] .".identity.jpg"))
Ayolo's avatar
Ayolo committed
376
      $printable['bel'][]=$row['id_utilisateur'];
Ayolo's avatar
Ayolo committed
377

Ayolo's avatar
Ayolo committed
378 379 380
  $print = new contents("PDFs &agrave; imprimer ");
  $print->add_paragraph(count($printable['sev'])." carte(s) imprimable(s) pour Sevenans : <a href=\"cartesae.php?action=pdf&ids=".implode(",",$printable['sev'])."\">Imprimer</a>");
  $print->add_paragraph(count($printable['bel'])." carte(s) imprimable(s) pour Belfort : <a href=\"cartesae.php?action=pdf&ids=".implode(",",$printable['bel'])."\">Imprimer</a>");
Ayolo's avatar
Ayolo committed
381
  $print->add_paragraph(count($printable['mon'])." carte(s) imprimable(s) pour Montbéliard : <a href=\"cartesae.php?action=pdf&ids=".implode(",",$printable['mon'])."\">Imprimer</a>");
Ayolo's avatar
Ayolo committed
382 383
  $cts->add($print,true);

384
  $req = new requete($site->db,
Ayolo's avatar
Ayolo committed
385 386 387 388
      "SELECT `ae_cotisations`.`id_utilisateur` FROM `ae_carte` " .
      "INNER JOIN `ae_cotisations` ON `ae_cotisations`.`id_cotisation`=`ae_carte`.`id_cotisation` " .
      "LEFT JOIN `utl_etu_utbm` ON `ae_cotisations`.`id_utilisateur`=`utl_etu_utbm`.`id_utilisateur` ".
      "WHERE `ae_carte`.`etat_vie_carte_ae`=".CETAT_ATTENTE." " .
389
      "ORDER BY `ae_carte`.`id_carte_ae`");
Ayolo's avatar
Ayolo committed
390 391
  $nprintable = array();
  while ( $row = $req->get_row() )
Antoine Tenart's avatar
kwain  
Antoine Tenart committed
392
    if ( !file_exists("../data/matmatronch/" . $row['id_utilisateur'] .".identity.jpg"))
393 394 395
      $nprintable[]=$row['id_utilisateur'];

  $req = new requete($site->db,
Ayolo's avatar
Ayolo committed
396 397 398 399 400 401 402 403 404
      "SELECT " .
      "`utilisateurs`.`id_utilisateur`, " .
      "CONCAT(`utilisateurs`.`nom_utl`,' ',`utilisateurs`.`prenom_utl`) as `nom_utilisateur`, " .
      "`ae_cotisations`.`date_fin_cotis`, " .
      "`ae_carte`.`id_carte_ae` " .
      "FROM `ae_carte` " .
      "INNER JOIN `ae_cotisations` ON `ae_cotisations`.`id_cotisation`=`ae_carte`.`id_cotisation` " .
      "INNER JOIN `utilisateurs` ON `ae_cotisations`.`id_utilisateur`=`utilisateurs`.`id_utilisateur` ".
      "WHERE `utilisateurs`.`id_utilisateur` IN (".implode(",",$nprintable).") " .
405
      "AND date_fin_cotis > NOW()" .
406 407
      "ORDER BY `utilisateurs`.`nom_utl`,`utilisateurs`.`prenom_utl`");

Ayolo's avatar
Ayolo committed
408
  $cts->add(new sqltable(
409 410 411
    "listphmanq",
    "Liste des utilisateurs dont les photos manquent sur les cartes AE", $req, "cartesae.php",
    "id_utilisateur",
Ayolo's avatar
Ayolo committed
412 413 414
    array(
      "id_carte_ae"=>"N° carte",
      "nom_utilisateur"=>"Nom",
415 416
      "date_fin_cotis"=>"Cotisation jusqu'au"),
    array("email_photo"=>"Envoyer email de rappel"),
Ayolo's avatar
Ayolo committed
417 418 419
    array("email_photo"=>"Envoyer email de rappel"),
    array( )
    ),true);
420

Ayolo's avatar
Ayolo committed
421 422 423 424 425 426 427
}

$site->add_contents($cts);

$site->end_page ();

?>