2004-10-19 20:58:50 +02:00
< ? php
2003-01-15 00:29:24 +01:00
/* Copyright ( C ) 2001 - 2003 Rodolphe Quiedeville < rodolphe @ quiedeville . org >
2004-07-14 21:46:34 +02:00
* Copyright ( C ) 2002 - 2003 Jean - Louis Bergamo < jlb @ j1b . org >
2014-07-26 17:18:19 +02:00
* Copyright ( C ) 2004 - 2014 Laurent Destailleur < eldy @ users . sourceforge . net >
2013-03-15 15:48:03 +01:00
* Copyright ( C ) 2013 Raphaël Doursenaud < rdoursenaud @ gpcsolutions . fr >
2003-01-15 00:29:24 +01:00
*
2002-12-30 16:13:28 +01:00
* 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
2013-01-16 15:36:08 +01:00
* the Free Software Foundation ; either version 3 of the License , or
2002-12-30 16:13:28 +01:00
* ( 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
2011-08-01 00:21:57 +02:00
* along with this program . If not , see < http :// www . gnu . org / licenses />.
2002-12-30 16:13:28 +01:00
*/
2004-08-14 14:37:59 +02:00
2009-02-01 14:47:37 +01:00
/**
2014-09-18 20:33:37 +02:00
* \file htdocs / adherents / list . php
2009-10-10 18:00:35 +02:00
* \ingroup member
2009-05-24 20:36:34 +02:00
* \brief Page to list all members of foundation
2008-11-15 01:10:42 +01:00
*/
2004-08-14 14:37:59 +02:00
2012-08-22 23:24:21 +02:00
require '../main.inc.php' ;
2012-08-22 23:11:24 +02:00
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php' ;
require_once DOL_DOCUMENT_ROOT . '/adherents/class/adherent.class.php' ;
require_once DOL_DOCUMENT_ROOT . '/adherents/class/adherent_type.class.php' ;
2004-07-17 01:35:53 +02:00
2010-05-02 19:05:07 +02:00
$langs -> load ( " members " );
2006-07-02 16:33:13 +02:00
$langs -> load ( " companies " );
2006-04-01 04:07:58 +02:00
2013-01-10 08:27:12 +01:00
// Security check
$result = restrictedArea ( $user , 'adherent' );
2013-01-02 18:43:59 +01:00
2012-04-02 10:26:06 +02:00
$action = GETPOST ( " action " );
$filter = GETPOST ( " filter " );
$statut = GETPOST ( " statut " );
$search = GETPOST ( " search " );
$search_ref = GETPOST ( " search_ref " );
2013-02-23 11:11:33 +01:00
$search_lastname = GETPOST ( " search_lastname " );
2013-02-23 15:26:39 +01:00
$search_firstname = GETPOST ( " search_firstname " );
2012-04-02 10:26:06 +02:00
$search_login = GETPOST ( " search_login " );
$type = GETPOST ( " type " );
$search_email = GETPOST ( " search_email " );
2012-07-28 00:53:51 +02:00
$search_categ = GETPOST ( " search_categ " , 'int' );
$catid = GETPOST ( " catid " , 'int' );
2012-04-29 21:40:13 +02:00
$sall = GETPOST ( " sall " );
2012-04-02 10:26:06 +02:00
2012-05-09 16:03:15 +02:00
$sortfield = GETPOST ( " sortfield " , 'alpha' );
$sortorder = GETPOST ( " sortorder " , 'alpha' );
$page = GETPOST ( " page " , 'int' );
if ( $page == - 1 ) { $page = 0 ; }
$offset = $conf -> liste_limit * $page ;
$pageprev = $page - 1 ;
$pagenext = $page + 1 ;
if ( ! $sortorder ) { $sortorder = ( $filter == 'outofdate' ? " ASC " : " DESC " ); }
2013-02-23 11:11:33 +01:00
if ( ! $sortfield ) { $sortfield = ( $filter == 'outofdate' ? " d.datefin " : " d.lastname " ); }
2012-05-09 16:03:15 +02:00
2014-11-23 09:46:24 +01:00
if ( GETPOST ( " button_removefilter_x " ) || GETPOST ( " button_removefilter " )) // Both test are required to be compatible with all browsers
2008-12-08 16:07:11 +01:00
{
2012-04-02 10:26:06 +02:00
$search = " " ;
$search_ref = " " ;
2013-02-23 11:11:33 +01:00
$search_lastname = " " ;
2013-02-23 15:26:39 +01:00
$search_firstname = " " ;
2012-04-02 10:26:06 +02:00
$search_login = " " ;
$type = " " ;
$search_email = " " ;
$search_categ = " " ;
2012-07-28 00:53:51 +02:00
$catid = " " ;
2010-07-10 18:42:12 +02:00
$sall = " " ;
2008-12-08 16:07:11 +01:00
}
2010-07-10 18:42:12 +02:00
2008-12-08 16:07:11 +01:00
/*
* View
*/
2011-12-03 16:14:36 +01:00
$form = new Form ( $db );
$formother = new FormOther ( $db );
2011-12-03 15:44:34 +01:00
$membertypestatic = new AdherentType ( $db );
$memberstatic = new Adherent ( $db );
2009-08-12 14:59:14 +02:00
llxHeader ( '' , $langs -> trans ( " Member " ), 'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros' );
2008-12-08 16:07:11 +01:00
2010-07-10 18:42:12 +02:00
$now = dol_now ();
2008-12-08 16:07:11 +01:00
2013-02-23 15:26:39 +01:00
$sql = " SELECT d.rowid, d.login, d.lastname, d.firstname, d.societe as company, d.fk_soc, " ;
2010-04-20 21:00:17 +02:00
$sql .= " d.datefin, " ;
2006-11-26 19:24:53 +01:00
$sql .= " d.email, d.fk_adherent_type as type_id, d.morphy, d.statut, " ;
$sql .= " t.libelle as type, t.cotisation " ;
2012-07-28 00:53:51 +02:00
$sql .= " FROM " . MAIN_DB_PREFIX . " adherent as d " ;
2012-07-28 22:07:27 +02:00
if ( ! empty ( $search_categ ) || ! empty ( $catid )) $sql .= ' LEFT JOIN ' . MAIN_DB_PREFIX . " categorie_member as cm ON d.rowid = cm.fk_member " ; // We need this table joined to the select in order to filter by categ
2012-07-28 00:53:51 +02:00
$sql .= " , " . MAIN_DB_PREFIX . " adherent_type as t " ;
2005-08-25 21:38:34 +02:00
$sql .= " WHERE d.fk_adherent_type = t.rowid " ;
2014-07-18 18:21:09 +02:00
if ( $catid > 0 ) $sql .= " AND cm.fk_categorie = " . $db -> escape ( $catid );
2012-07-28 22:07:27 +02:00
if ( $catid == - 2 ) $sql .= " AND cm.fk_categorie IS NULL " ;
2014-07-18 18:21:09 +02:00
if ( $search_categ > 0 ) $sql .= " AND cm.fk_categorie = " . $db -> escape ( $search_categ );
2012-07-28 22:07:27 +02:00
if ( $search_categ == - 2 ) $sql .= " AND cm.fk_categorie IS NULL " ;
2009-11-07 11:49:52 +01:00
$sql .= " AND d.entity = " . $conf -> entity ;
2009-02-01 14:47:37 +01:00
if ( $sall )
2005-08-25 21:38:34 +02:00
{
2013-03-15 15:48:03 +01:00
// For natural search
$scrit = explode ( ' ' , $sall );
2014-07-18 18:21:09 +02:00
foreach ( $scrit as $crit )
{
2013-03-15 15:48:03 +01:00
$sql .= " AND ( " ;
if ( is_numeric ( $sall )) $sql .= " d.rowid = " . $sall . " OR " ;
2014-07-18 18:21:09 +02:00
$sql .= " d.firstname LIKE '% " . $db -> escape ( $sall ) . " %' OR d.lastname LIKE '% " . $db -> escape ( $sall ) . " %' OR d.societe LIKE '% " . $db -> escape ( $sall ) . " %' " ;
$sql .= " OR d.email LIKE '% " . $db -> escape ( $sall ) . " %' OR d.login LIKE '% " . $db -> escape ( $sall ) . " %' OR d.address LIKE '% " . $db -> escape ( $sall ) . " %' " ;
2015-04-14 19:46:49 +02:00
$sql .= " OR d.town LIKE '% " . $db -> escape ( $sall ) . " %' OR d.note_public LIKE '% " . $db -> escape ( $sall ) . " %' OR d.note_private LIKE '% " . $db -> escape ( $sall ) . " %') " ;
2013-03-15 15:48:03 +01:00
}
2004-07-17 14:41:15 +02:00
}
2012-04-02 10:26:06 +02:00
if ( $type > 0 )
2009-02-01 14:47:37 +01:00
{
2012-04-02 10:26:06 +02:00
$sql .= " AND t.rowid= " . $type ;
2004-07-17 14:41:15 +02:00
}
2012-04-02 10:26:06 +02:00
if ( isset ( $_GET [ " statut " ]) || isset ( $_POST [ " statut " ]))
2003-02-23 19:16:12 +01:00
{
2014-07-18 18:21:09 +02:00
$sql .= " AND d.statut in ( " . $db -> escape ( $statut ) . " ) " ; // Peut valoir un nombre ou liste de nombre separes par virgules
2003-02-23 19:16:12 +01:00
}
2012-04-02 10:43:19 +02:00
if ( $search_ref )
{
2014-07-18 18:21:09 +02:00
if ( is_numeric ( $search_ref )) $sql .= " AND (d.rowid = " . $db -> escape ( $search_ref ) . " ) " ;
2012-04-02 10:43:19 +02:00
else $sql .= " AND 1 = 2 " ; // Always wrong
}
2013-02-23 11:11:33 +01:00
if ( $search_lastname )
2007-05-02 00:35:14 +02:00
{
2014-07-18 18:21:09 +02:00
$sql .= " AND (d.firstname LIKE '% " . $db -> escape ( $search_lastname ) . " %' OR d.lastname LIKE '% " . $db -> escape ( $search_lastname ) . " %' OR d.societe LIKE '% " . $db -> escape ( $search_lastname ) . " %') " ;
2007-05-02 00:35:14 +02:00
}
2012-04-02 10:26:06 +02:00
if ( $search_login )
2008-08-17 23:50:27 +02:00
{
2014-07-18 18:21:09 +02:00
$sql .= " AND d.login LIKE '% " . $db -> escape ( $search_login ) . " %' " ;
2008-08-17 23:50:27 +02:00
}
2012-04-02 10:26:06 +02:00
if ( $search_email )
2007-09-28 16:01:44 +02:00
{
2014-07-18 18:21:09 +02:00
$sql .= " AND (d.email LIKE '% " . $db -> escape ( $search_email ) . " %') " ;
2007-09-28 16:01:44 +02:00
}
2006-04-01 04:07:58 +02:00
if ( $filter == 'uptodate' )
{
2012-04-02 10:26:06 +02:00
$sql .= " AND datefin >= ' " . $db -> idate ( $now ) . " ' " ;
2005-08-11 20:24:58 +02:00
}
2006-04-01 04:07:58 +02:00
if ( $filter == 'outofdate' )
{
2012-10-16 18:33:49 +02:00
$sql .= " AND (datefin IS NULL OR datefin < ' " . $db -> idate ( $now ) . " ') " ;
2006-04-01 04:07:58 +02:00
}
2010-07-10 18:42:12 +02:00
// Count total nb of records with no order and no limits
2009-02-01 14:47:37 +01:00
$nbtotalofrecords = 0 ;
if ( empty ( $conf -> global -> MAIN_DISABLE_FULL_SCANLIST ))
{
2009-11-07 11:49:52 +01:00
$resql = $db -> query ( $sql );
2015-02-10 10:45:48 +01:00
if ( $resql ) $nbtotalofrecords = $db -> num_rows ( $resql );
2010-07-10 18:42:12 +02:00
else dol_print_error ( $db );
2009-02-01 14:47:37 +01:00
}
2008-03-20 23:12:56 +01:00
// Add order and limit
2010-07-10 18:42:12 +02:00
$sql .= $db -> order ( $sortfield , $sortorder );
$sql .= $db -> plimit ( $conf -> liste_limit + 1 , $offset );
2002-12-30 16:13:28 +01:00
2014-06-12 11:31:53 +02:00
dol_syslog ( " get list " , LOG_DEBUG );
2008-11-15 01:10:42 +01:00
$resql = $db -> query ( $sql );
2009-02-01 14:47:37 +01:00
if ( $resql )
2002-12-30 16:13:28 +01:00
{
2010-07-10 18:42:12 +02:00
$num = $db -> num_rows ( $resql );
$i = 0 ;
$titre = $langs -> trans ( " MembersList " );
if ( isset ( $_GET [ " statut " ]))
{
if ( $statut == '-1,1' ) { $titre = $langs -> trans ( " MembersListQualified " ); }
if ( $statut == '-1' ) { $titre = $langs -> trans ( " MembersListToValid " ); }
if ( $statut == '1' && ! $filter ) { $titre = $langs -> trans ( " MembersListValid " ); }
if ( $statut == '1' && $filter == 'uptodate' ) { $titre = $langs -> trans ( " MembersListUpToDate " ); }
if ( $statut == '1' && $filter == 'outofdate' ) { $titre = $langs -> trans ( " MembersListNotUpToDate " ); }
if ( $statut == '0' ) { $titre = $langs -> trans ( " MembersListResiliated " ); }
}
2012-04-02 10:26:06 +02:00
elseif ( $action == 'search' )
2010-07-10 18:42:12 +02:00
{
$titre = $langs -> trans ( " MembersListQualified " );
}
2012-04-02 10:26:06 +02:00
if ( $type > 0 )
2010-07-10 18:42:12 +02:00
{
2008-11-15 01:10:42 +01:00
$membertype = new AdherentType ( $db );
2014-04-09 00:12:07 +02:00
$result = $membertype -> fetch ( GETPOST ( " type " ));
2008-11-15 01:10:42 +01:00
$titre .= " ( " . $membertype -> libelle . " ) " ;
2010-07-10 18:42:12 +02:00
}
$param = " " ;
2014-07-26 17:18:19 +02:00
if ( $statut != " " ) $param .= " &statut= " . $statut ;
2012-04-02 10:26:06 +02:00
if ( $search_nom ) $param .= " &search_nom= " . $search_nom ;
if ( $search_login ) $param .= " &search_login= " . $search_login ;
if ( $search_email ) $param .= " &search_email= " . $search_email ;
if ( $filter ) $param .= " &filter= " . $filter ;
2014-04-09 00:12:07 +02:00
if ( $type > 0 ) $param .= " &type= " . $type ;
2010-07-10 18:42:12 +02:00
print_barre_liste ( $titre , $page , $_SERVER [ " PHP_SELF " ], $param , $sortfield , $sortorder , '' , $num , $nbtotalofrecords );
if ( $sall )
{
2012-04-02 10:26:06 +02:00
print $langs -> trans ( " Filter " ) . " ( " . $langs -> trans ( " Ref " ) . " , " . $langs -> trans ( " Lastname " ) . " , " . $langs -> trans ( " Firstname " ) . " , " . $langs -> trans ( " EMail " ) . " , " . $langs -> trans ( " Address " ) . " " . $langs -> trans ( " or " ) . " " . $langs -> trans ( " Town " ) . " ): " . $sall ;
2010-07-10 18:42:12 +02:00
}
2005-08-11 20:24:58 +02:00
2014-07-26 17:18:19 +02:00
print '<form method="POST" action="' . $_SERVER [ " PHP_SELF " ] . ( $param ? '?' . $param : '' ) . '">' ;
2010-07-10 18:42:12 +02:00
print " <table class= \" noborder \" width= \" 100% \" > " ;
// Filter on categories
$moreforfilter = '' ;
2012-09-15 10:01:35 +02:00
if ( ! empty ( $conf -> categorie -> enabled ))
2010-07-10 18:42:12 +02:00
{
$moreforfilter .= $langs -> trans ( 'Categories' ) . ': ' ;
2012-07-28 00:53:51 +02:00
$moreforfilter .= $formother -> select_categories ( 3 , $search_categ , 'search_categ' , 1 );
2010-07-10 18:42:12 +02:00
$moreforfilter .= ' ' ;
}
if ( $moreforfilter )
{
print '<tr class="liste_titre">' ;
2012-04-02 10:26:06 +02:00
print '<td class="liste_titre" colspan="9">' ;
2010-07-10 18:42:12 +02:00
print $moreforfilter ;
print '</td></tr>' ;
}
print '<tr class="liste_titre">' ;
2012-04-02 10:26:06 +02:00
print_liste_field_titre ( $langs -> trans ( " Ref " ), $_SERVER [ " PHP_SELF " ], " d.rowid " , $param , " " , " " , $sortfield , $sortorder );
2013-02-23 11:11:33 +01:00
print_liste_field_titre ( $langs -> trans ( " Name " ) . " / " . $langs -> trans ( " Company " ), $_SERVER [ " PHP_SELF " ], " d.lastname " , $param , " " , " " , $sortfield , $sortorder );
2012-04-02 10:26:06 +02:00
print_liste_field_titre ( $langs -> trans ( " Login " ), $_SERVER [ " PHP_SELF " ], " d.login " , $param , " " , " " , $sortfield , $sortorder );
print_liste_field_titre ( $langs -> trans ( " Type " ), $_SERVER [ " PHP_SELF " ], " t.libelle " , $param , " " , " " , $sortfield , $sortorder );
print_liste_field_titre ( $langs -> trans ( " Person " ), $_SERVER [ " PHP_SELF " ], " d.morphy " , $param , " " , " " , $sortfield , $sortorder );
print_liste_field_titre ( $langs -> trans ( " EMail " ), $_SERVER [ " PHP_SELF " ], " d.email " , $param , " " , " " , $sortfield , $sortorder );
print_liste_field_titre ( $langs -> trans ( " Status " ), $_SERVER [ " PHP_SELF " ], " d.statut,d.datefin " , $param , " " , " " , $sortfield , $sortorder );
print_liste_field_titre ( $langs -> trans ( " EndSubscription " ), $_SERVER [ " PHP_SELF " ], " d.datefin " , $param , " " , 'align="center"' , $sortfield , $sortorder );
print_liste_field_titre ( $langs -> trans ( " Action " ), $_SERVER [ " PHP_SELF " ], " " , $param , " " , 'width="60" align="center"' , $sortfield , $sortorder );
2010-07-10 18:42:12 +02:00
print " </tr> \n " ;
2015-02-14 19:10:40 +01:00
// Line for filters fields
2007-05-02 00:35:14 +02:00
print '<tr class="liste_titre">' ;
2009-07-15 17:04:58 +02:00
print '<td class="liste_titre" align="left">' ;
2012-04-02 10:26:06 +02:00
print '<input class="flat" type="text" name="search_ref" value="' . $search_ref . '" size="4"></td>' ;
2007-05-02 00:35:14 +02:00
2009-07-15 17:04:58 +02:00
print '<td class="liste_titre" align="left">' ;
2013-02-23 11:11:33 +01:00
print '<input class="flat" type="text" name="search_lastname" value="' . $search_lastname . '" size="12"></td>' ;
2012-04-02 10:26:06 +02:00
print '<td class="liste_titre" align="left">' ;
print '<input class="flat" type="text" name="search_login" value="' . $search_login . '" size="7"></td>' ;
2009-02-01 14:47:37 +01:00
2008-11-15 01:10:42 +01:00
print '<td class="liste_titre">' ;
2010-07-10 18:42:12 +02:00
$listetype = $membertypestatic -> liste_array ();
2012-09-24 12:12:37 +02:00
print $form -> selectarray ( " type " , $listetype , $type , 1 , 0 , 0 , '' , 0 , 32 );
2010-07-10 18:42:12 +02:00
print '</td>' ;
2007-05-02 00:35:14 +02:00
print '<td class="liste_titre"> </td>' ;
2009-07-15 17:04:58 +02:00
print '<td class="liste_titre" align="left">' ;
2012-04-02 10:26:06 +02:00
print '<input class="flat" type="text" name="search_email" value="' . $search_email . '" size="12"></td>' ;
2007-05-02 00:35:14 +02:00
print '<td class="liste_titre"> </td>' ;
print '<td align="right" colspan="2" class="liste_titre">' ;
2014-01-13 09:43:21 +01:00
print '<input type="image" class="liste_titre" src="' . img_picto ( $langs -> trans ( " Search " ), 'search.png' , '' , '' , 1 ) . '" name="button_search" value="' . dol_escape_htmltag ( $langs -> trans ( " Search " )) . '" title="' . dol_escape_htmltag ( $langs -> trans ( " Search " )) . '">' ;
2011-02-18 11:45:38 +01:00
print ' ' ;
2014-01-13 09:43:21 +01:00
print '<input type="image" class="liste_titre" src="' . img_picto ( $langs -> trans ( " Search " ), 'searchclear.png' , '' , '' , 1 ) . '" name="button_removefilter" value="' . dol_escape_htmltag ( $langs -> trans ( " RemoveFilter " )) . '" title="' . dol_escape_htmltag ( $langs -> trans ( " RemoveFilter " )) . '">' ;
2007-05-02 00:35:14 +02:00
print '</td>' ;
2015-02-14 19:10:40 +01:00
print " </tr> \n " ;
2007-05-02 00:35:14 +02:00
2010-07-10 18:42:12 +02:00
$var = True ;
while ( $i < $num && $i < $conf -> liste_limit )
{
$objp = $db -> fetch_object ( $resql );
$datefin = $db -> jdate ( $objp -> datefin );
2012-04-02 10:43:19 +02:00
$memberstatic -> id = $objp -> rowid ;
$memberstatic -> ref = $objp -> rowid ;
$memberstatic -> lastname = $objp -> lastname ;
$memberstatic -> firstname = $objp -> firstname ;
2010-07-10 18:42:12 +02:00
2012-09-30 21:26:58 +02:00
if ( ! empty ( $objp -> fk_soc )) {
$memberstatic -> socid = $objp -> fk_soc ;
$memberstatic -> fetch_thirdparty ();
$companyname = $memberstatic -> thirdparty -> name ;
} else {
$companyname = $objp -> company ;
2012-09-24 12:12:37 +02:00
}
2010-07-10 18:42:12 +02:00
$var =! $var ;
2011-12-03 15:44:34 +01:00
print " <tr " . $bc [ $var ] . " > " ;
2012-04-02 10:26:06 +02:00
// Ref
2012-04-02 10:43:19 +02:00
print " <td> " ;
print $memberstatic -> getNomUrl ( 1 );
print " </td> \n " ;
2012-04-02 10:26:06 +02:00
// Lastname
2014-09-18 21:18:25 +02:00
print " <td><a href= \" card.php?rowid= $objp->rowid\ " > " ;
2012-09-24 12:12:37 +02:00
print (( ! empty ( $objp -> lastname ) || ! empty ( $objp -> firstname )) ? dol_trunc ( $memberstatic -> getFullName ( $langs )) : '' );
print ((( ! empty ( $objp -> lastname ) || ! empty ( $objp -> firstname )) && ! empty ( $companyname )) ? ' / ' : '' );
print ( ! empty ( $companyname ) ? dol_trunc ( $companyname , 32 ) : '' );
print " </a></td> \n " ;
2010-07-10 18:42:12 +02:00
// Login
print " <td> " . $objp -> login . " </td> \n " ;
// Type
$membertypestatic -> id = $objp -> type_id ;
$membertypestatic -> libelle = $objp -> type ;
2013-04-25 01:13:13 +02:00
print '<td class="nowrap">' ;
2012-09-24 12:12:37 +02:00
print $membertypestatic -> getNomUrl ( 1 , 32 );
2010-07-10 18:42:12 +02:00
print '</td>' ;
// Moral/Physique
2011-12-03 15:44:34 +01:00
print " <td> " . $memberstatic -> getmorphylib ( $objp -> morphy ) . " </td> \n " ;
2010-07-10 18:42:12 +02:00
// EMail
print " <td> " . dol_print_email ( $objp -> email , 0 , 0 , 1 ) . " </td> \n " ;
// Statut
2013-04-25 01:13:13 +02:00
print '<td class="nowrap">' ;
2011-12-03 15:44:34 +01:00
print $memberstatic -> LibStatut ( $objp -> statut , $objp -> cotisation , $datefin , 2 );
2010-07-10 18:42:12 +02:00
print " </td> " ;
2011-01-15 03:39:31 +01:00
// End of subscription date
2010-07-10 18:42:12 +02:00
if ( $datefin )
{
2013-04-25 01:13:13 +02:00
print '<td align="center" class="nowrap">' ;
2011-01-15 03:39:31 +01:00
print dol_print_date ( $datefin , 'day' );
if ( $datefin < ( $now - $conf -> adherent -> cotisation -> warning_delay ) && $objp -> statut > 0 ) print " " . img_warning ( $langs -> trans ( " SubscriptionLate " ));
2010-07-10 18:42:12 +02:00
print '</td>' ;
}
else
{
2013-04-25 01:13:13 +02:00
print '<td align="left" class="nowrap">' ;
2010-07-10 18:42:12 +02:00
if ( $objp -> cotisation == 'yes' )
{
print $langs -> trans ( " SubscriptionNotReceived " );
if ( $objp -> statut > 0 ) print " " . img_warning ();
}
else
{
print ' ' ;
}
print '</td>' ;
}
// Actions
print '<td align="center">' ;
2007-05-26 17:36:46 +02:00
if ( $user -> rights -> adherent -> creer )
{
2014-09-18 21:18:25 +02:00
print " <a href= \" card.php?rowid= " . $objp -> rowid . " &action=edit&backtopage=1 \" > " . img_edit () . " </a> " ;
2007-05-26 17:36:46 +02:00
}
print ' ' ;
2012-05-09 16:03:15 +02:00
if ( $user -> rights -> adherent -> supprimer && $objp -> statut == - 1 )
{
2014-09-18 21:18:25 +02:00
print " <a href= \" card.php?rowid= " . $objp -> rowid . " &action=delete&backtopage=1 \" > " . img_picto ( $langs -> trans ( " Delete " ), 'disable.png' ) . " </a> " ;
2012-05-09 16:03:15 +02:00
}
if ( $user -> rights -> adherent -> supprimer && $objp -> statut == 1 )
2007-05-26 17:36:46 +02:00
{
2014-09-18 21:18:25 +02:00
print " <a href= \" card.php?rowid= " . $objp -> rowid . " &action=resign&backtopage=1 \" > " . img_picto ( $langs -> trans ( " Resiliate " ), 'disable.png' ) . " </a> " ;
2010-07-10 18:42:12 +02:00
}
2007-05-26 17:36:46 +02:00
print " </td> " ;
2005-08-11 20:24:58 +02:00
2010-07-10 18:42:12 +02:00
print " </tr> \n " ;
$i ++ ;
}
2007-05-02 00:35:14 +02:00
2010-07-10 18:42:12 +02:00
print " </table> \n " ;
2014-12-15 19:15:26 +01:00
print '</form>' ;
2006-11-26 08:10:57 +01:00
2006-11-26 08:12:17 +01:00
if ( $num > $conf -> liste_limit )
2006-11-26 08:10:57 +01:00
{
2010-07-10 18:42:12 +02:00
print_barre_liste ( '' , $page , $_SERVER [ " PHP_SELF " ], $param , $sortfield , $sortorder , '' , $num , $nbtotalofrecords , '' );
2006-11-26 08:10:57 +01:00
}
2006-03-23 17:31:41 +01:00
}
2002-12-30 16:13:28 +01:00
else
{
2010-07-10 18:42:12 +02:00
dol_print_error ( $db );
2002-12-30 16:13:28 +01:00
}
2011-08-27 16:24:16 +02:00
llxFooter ();
2012-04-02 10:26:06 +02:00
$db -> close ();