Ajout filtre categ sur adherent
This commit is contained in:
parent
6c6e98f8bb
commit
b9f28cca65
@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2002-2003 Jean-Louis Bergamo <jlb@j1b.org>
|
* Copyright (C) 2002-2003 Jean-Louis Bergamo <jlb@j1b.org>
|
||||||
* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -26,6 +26,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
require("../main.inc.php");
|
require("../main.inc.php");
|
||||||
|
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.class.php");
|
||||||
require_once(DOL_DOCUMENT_ROOT."/adherents/class/adherent_type.class.php");
|
require_once(DOL_DOCUMENT_ROOT."/adherents/class/adherent_type.class.php");
|
||||||
|
|
||||||
@ -49,17 +50,22 @@ $pagenext = $page + 1;
|
|||||||
|
|
||||||
if ($_REQUEST["button_removefilter"])
|
if ($_REQUEST["button_removefilter"])
|
||||||
{
|
{
|
||||||
$_GET["search_nom"]="";
|
$_GET["search_nom"]="";
|
||||||
$_REQUEST["search_nom"]="";
|
$_REQUEST["search_nom"]="";
|
||||||
$_GET["search_prenom"]="";
|
$_GET["search_prenom"]="";
|
||||||
$_REQUEST["search_prenom"]="";
|
$_REQUEST["search_prenom"]="";
|
||||||
$_GET["type"]="";
|
$_GET["type"]="";
|
||||||
$_REQUEST["type"]="";
|
$_REQUEST["type"]="";
|
||||||
$_GET["search_email"]="";
|
$_GET["search_email"]="";
|
||||||
$_REQUEST["search_email"]="";
|
$_REQUEST["search_email"]="";
|
||||||
$sall="";
|
$_GET["search_categ"]="";
|
||||||
|
$_REQUEST["search_categ"]="";
|
||||||
|
$sall="";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Load categ filters
|
||||||
|
$search_categ = isset($_GET["search_categ"])?$_GET["search_categ"]:$_POST["search_categ"];
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* View
|
* View
|
||||||
@ -68,6 +74,9 @@ if ($_REQUEST["button_removefilter"])
|
|||||||
llxHeader('',$langs->trans("Member"),'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros');
|
llxHeader('',$langs->trans("Member"),'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros');
|
||||||
|
|
||||||
$form=new Form($db);
|
$form=new Form($db);
|
||||||
|
$htmlother=new FormOther($db);
|
||||||
|
|
||||||
|
$now=dol_now();
|
||||||
|
|
||||||
$membertypestatic=new AdherentType($db);
|
$membertypestatic=new AdherentType($db);
|
||||||
|
|
||||||
@ -76,115 +85,141 @@ $sql.= " d.datefin,";
|
|||||||
$sql.= " d.email, d.fk_adherent_type as type_id, d.morphy, d.statut,";
|
$sql.= " d.email, d.fk_adherent_type as type_id, d.morphy, d.statut,";
|
||||||
$sql.= " t.libelle as type, t.cotisation";
|
$sql.= " t.libelle as type, t.cotisation";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."adherent as d, ".MAIN_DB_PREFIX."adherent_type as t";
|
$sql.= " FROM ".MAIN_DB_PREFIX."adherent as d, ".MAIN_DB_PREFIX."adherent_type as t";
|
||||||
|
if ($search_categ) $sql.= ", ".MAIN_DB_PREFIX."categorie_member as cf";
|
||||||
$sql.= " WHERE d.fk_adherent_type = t.rowid ";
|
$sql.= " WHERE d.fk_adherent_type = t.rowid ";
|
||||||
|
if ($search_categ) $sql.= " AND d.rowid = cf.fk_member"; // Join for the needed table to filter by categ
|
||||||
$sql.= " AND d.entity = ".$conf->entity;
|
$sql.= " AND d.entity = ".$conf->entity;
|
||||||
if ($sall)
|
if ($sall)
|
||||||
{
|
{
|
||||||
$sql.=" AND (d.prenom like '%".$sall."%' OR d.nom like '%".$sall."%' OR d.societe like '%".$sall."%'";
|
$sql.=" AND (d.prenom like '%".$sall."%' OR d.nom like '%".$sall."%' OR d.societe like '%".$sall."%'";
|
||||||
$sql.=" OR d.email like '%".$sall."%' OR d.login like '%".$sall."%' OR d.adresse like '%".$sall."%'";
|
$sql.=" OR d.email like '%".$sall."%' OR d.login like '%".$sall."%' OR d.adresse like '%".$sall."%'";
|
||||||
$sql.=" OR d.ville like '%".$sall."%' OR d.note like '%".$sall."%')";
|
$sql.=" OR d.ville like '%".$sall."%' OR d.note like '%".$sall."%')";
|
||||||
}
|
}
|
||||||
if ($_REQUEST["type"] > 0)
|
if ($_REQUEST["type"] > 0)
|
||||||
{
|
{
|
||||||
$sql.=" AND t.rowid=".$_REQUEST["type"];
|
$sql.=" AND t.rowid=".$_REQUEST["type"];
|
||||||
}
|
}
|
||||||
if (isset($_GET["statut"]))
|
if (isset($_GET["statut"]))
|
||||||
{
|
{
|
||||||
$sql.=" AND d.statut in ($statut)"; // Peut valoir un nombre ou liste de nombre separes par virgules
|
$sql.=" AND d.statut in ($statut)"; // Peut valoir un nombre ou liste de nombre separes par virgules
|
||||||
}
|
}
|
||||||
if ( $_POST["action"] == 'search')
|
if ( $_POST["action"] == 'search')
|
||||||
{
|
{
|
||||||
if (isset($_POST['search']) && $_POST['search'] != ''){
|
if (isset($_POST['search']) && $_POST['search'] != '')
|
||||||
$sql.= " AND (d.prenom LIKE '%".$_POST['search']."%' OR d.nom LIKE '%".$_POST['search']."%')";
|
{
|
||||||
}
|
$sql.= " AND (d.prenom LIKE '%".$_POST['search']."%' OR d.nom LIKE '%".$_POST['search']."%')";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if ($_GET["search_nom"])
|
if ($_GET["search_nom"])
|
||||||
{
|
{
|
||||||
$sql.= " AND (d.prenom LIKE '%".$_GET["search_nom"]."%' OR d.nom LIKE '%".$_GET["search_nom"]."%')";
|
$sql.= " AND (d.prenom LIKE '%".$_GET["search_nom"]."%' OR d.nom LIKE '%".$_GET["search_nom"]."%')";
|
||||||
}
|
}
|
||||||
if ($_GET["search_login"])
|
if ($_GET["search_login"])
|
||||||
{
|
{
|
||||||
$sql.= " AND d.login LIKE '%".$_GET["search_login"]."%'";
|
$sql.= " AND d.login LIKE '%".$_GET["search_login"]."%'";
|
||||||
}
|
}
|
||||||
if ($_GET["search_email"])
|
if ($_GET["search_email"])
|
||||||
{
|
{
|
||||||
$sql.= " AND (d.email LIKE '%".$_GET["search_email"]."%')";
|
$sql.= " AND (d.email LIKE '%".$_GET["search_email"]."%')";
|
||||||
}
|
}
|
||||||
if ($filter == 'uptodate')
|
if ($filter == 'uptodate')
|
||||||
{
|
{
|
||||||
$sql.=" AND datefin >= ".$db->idate(mktime());
|
$sql.=" AND datefin >= ".$db->idate($now);
|
||||||
}
|
}
|
||||||
if ($filter == 'outofdate')
|
if ($filter == 'outofdate')
|
||||||
{
|
{
|
||||||
$sql.=" AND datefin < ".$db->idate(mktime());
|
$sql.=" AND datefin < ".$db->idate($now);
|
||||||
}
|
}
|
||||||
// Count total nb of records
|
// Insert categ filter
|
||||||
|
if ($search_categ)
|
||||||
|
{
|
||||||
|
$sql.= " AND cf.fk_categorie = ".addslashes($search_categ);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Count total nb of records with no order and no limits
|
||||||
$nbtotalofrecords = 0;
|
$nbtotalofrecords = 0;
|
||||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||||
{
|
{
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
if ($resql) $nbtotalofrecords = $db->num_rows($result);
|
if ($resql) $nbtotalofrecords = $db->num_rows($result);
|
||||||
else dol_print_error($db);
|
else dol_print_error($db);
|
||||||
}
|
}
|
||||||
// Add order and limit
|
// Add order and limit
|
||||||
$sql.= " ".$db->order($sortfield,$sortorder);
|
$sql.= $db->order($sortfield,$sortorder);
|
||||||
$sql.= " ".$db->plimit($conf->liste_limit+1, $offset);
|
$sql.= $db->plimit($conf->liste_limit+1, $offset);
|
||||||
|
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
$num = $db->num_rows($resql);
|
$num = $db->num_rows($resql);
|
||||||
$i = 0;
|
$i = 0;
|
||||||
|
|
||||||
$titre=$langs->trans("MembersList");
|
$titre=$langs->trans("MembersList");
|
||||||
if (isset($_GET["statut"]))
|
if (isset($_GET["statut"]))
|
||||||
{
|
{
|
||||||
if ($statut == '-1,1') { $titre=$langs->trans("MembersListQualified"); }
|
if ($statut == '-1,1') { $titre=$langs->trans("MembersListQualified"); }
|
||||||
if ($statut == '-1') { $titre=$langs->trans("MembersListToValid"); }
|
if ($statut == '-1') { $titre=$langs->trans("MembersListToValid"); }
|
||||||
if ($statut == '1' && ! $filter) { $titre=$langs->trans("MembersListValid"); }
|
if ($statut == '1' && ! $filter) { $titre=$langs->trans("MembersListValid"); }
|
||||||
if ($statut == '1' && $filter=='uptodate') { $titre=$langs->trans("MembersListUpToDate"); }
|
if ($statut == '1' && $filter=='uptodate') { $titre=$langs->trans("MembersListUpToDate"); }
|
||||||
if ($statut == '1' && $filter=='outofdate') { $titre=$langs->trans("MembersListNotUpToDate"); }
|
if ($statut == '1' && $filter=='outofdate') { $titre=$langs->trans("MembersListNotUpToDate"); }
|
||||||
if ($statut == '0') { $titre=$langs->trans("MembersListResiliated"); }
|
if ($statut == '0') { $titre=$langs->trans("MembersListResiliated"); }
|
||||||
}
|
}
|
||||||
elseif ($_POST["action"] == 'search') {
|
elseif ($_POST["action"] == 'search')
|
||||||
$titre=$langs->trans("MembersListQualified");
|
{
|
||||||
}
|
$titre=$langs->trans("MembersListQualified");
|
||||||
|
}
|
||||||
|
|
||||||
if ($_REQUEST["type"] > 0)
|
if ($_REQUEST["type"] > 0)
|
||||||
{
|
{
|
||||||
$membertype=new AdherentType($db);
|
$membertype=new AdherentType($db);
|
||||||
$result=$membertype->fetch($_REQUEST["type"]);
|
$result=$membertype->fetch($_REQUEST["type"]);
|
||||||
$titre.=" (".$membertype->libelle.")";
|
$titre.=" (".$membertype->libelle.")";
|
||||||
}
|
}
|
||||||
|
|
||||||
$param="";
|
$param="";
|
||||||
if (isset($_GET["statut"])) $param.="&statut=".$_GET["statut"];
|
if (isset($_GET["statut"])) $param.="&statut=".$_GET["statut"];
|
||||||
if (isset($_GET["search_nom"])) $param.="&search_nom=".$_GET["search_nom"];
|
if (isset($_GET["search_nom"])) $param.="&search_nom=".$_GET["search_nom"];
|
||||||
if (isset($_GET["search_login"])) $param.="&search_login=".$_GET["search_login"];
|
if (isset($_GET["search_login"])) $param.="&search_login=".$_GET["search_login"];
|
||||||
if (isset($_GET["search_email"])) $param.="&search_email=".$_GET["search_email"];
|
if (isset($_GET["search_email"])) $param.="&search_email=".$_GET["search_email"];
|
||||||
if (isset($_GET["filter"])) $param.="&filter=".$_GET["filter"];
|
if (isset($_GET["filter"])) $param.="&filter=".$_GET["filter"];
|
||||||
print_barre_liste($titre,$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$nbtotalofrecords);
|
print_barre_liste($titre,$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$nbtotalofrecords);
|
||||||
|
|
||||||
if ($sall)
|
if ($sall)
|
||||||
{
|
{
|
||||||
print $langs->trans("Filter")." (".$langs->trans("Lastname").", ".$langs->trans("Firstname").", ".$langs->trans("EMail").", ".$langs->trans("Address")." ".$langs->trans("or")." ".$langs->trans("Town")."): ".$sall;
|
print $langs->trans("Filter")." (".$langs->trans("Lastname").", ".$langs->trans("Firstname").", ".$langs->trans("EMail").", ".$langs->trans("Address")." ".$langs->trans("or")." ".$langs->trans("Town")."): ".$sall;
|
||||||
}
|
}
|
||||||
|
|
||||||
print "<table class=\"noborder\" width=\"100%\">";
|
print '<form method="GET" action="'.$_SERVER["PHP_SELF"].'">';
|
||||||
|
print "<table class=\"noborder\" width=\"100%\">";
|
||||||
|
|
||||||
print '<tr class="liste_titre">';
|
// Filter on categories
|
||||||
print_liste_field_titre($langs->trans("Name")." / ".$langs->trans("Company"),"liste.php","d.nom",$param,"","",$sortfield,$sortorder);
|
$moreforfilter='';
|
||||||
print_liste_field_titre($langs->trans("Login"),"liste.php","d.login",$param,"","",$sortfield,$sortorder);
|
if ($conf->categorie->enabled)
|
||||||
print_liste_field_titre($langs->trans("Type"),"liste.php","t.libelle",$param,"","",$sortfield,$sortorder);
|
{
|
||||||
print_liste_field_titre($langs->trans("Person"),"liste.php","d.morphy",$param,"","",$sortfield,$sortorder);
|
$moreforfilter.=$langs->trans('Categories'). ': ';
|
||||||
print_liste_field_titre($langs->trans("EMail"),"liste.php","d.email",$param,"","",$sortfield,$sortorder);
|
$moreforfilter.=$htmlother->select_categories(3,$search_categ,'search_categ');
|
||||||
print_liste_field_titre($langs->trans("Status"),"liste.php","d.statut,d.datefin",$param,"","",$sortfield,$sortorder);
|
$moreforfilter.=' ';
|
||||||
print_liste_field_titre($langs->trans("EndSubscription"),"liste.php","d.datefin",$param,"",'align="center"',$sortfield,$sortorder);
|
}
|
||||||
print_liste_field_titre($langs->trans("Action"),"liste.php","",$param,"",'width="60" align="center"',$sortfield,$sortorder);
|
if ($moreforfilter)
|
||||||
print "</tr>\n";
|
{
|
||||||
|
print '<tr class="liste_titre">';
|
||||||
|
print '<td class="liste_titre" colspan="8">';
|
||||||
|
print $moreforfilter;
|
||||||
|
print '</td></tr>';
|
||||||
|
}
|
||||||
|
|
||||||
|
print '<tr class="liste_titre">';
|
||||||
|
print_liste_field_titre($langs->trans("Name")." / ".$langs->trans("Company"),"liste.php","d.nom",$param,"","",$sortfield,$sortorder);
|
||||||
|
print_liste_field_titre($langs->trans("Login"),"liste.php","d.login",$param,"","",$sortfield,$sortorder);
|
||||||
|
print_liste_field_titre($langs->trans("Type"),"liste.php","t.libelle",$param,"","",$sortfield,$sortorder);
|
||||||
|
print_liste_field_titre($langs->trans("Person"),"liste.php","d.morphy",$param,"","",$sortfield,$sortorder);
|
||||||
|
print_liste_field_titre($langs->trans("EMail"),"liste.php","d.email",$param,"","",$sortfield,$sortorder);
|
||||||
|
print_liste_field_titre($langs->trans("Status"),"liste.php","d.statut,d.datefin",$param,"","",$sortfield,$sortorder);
|
||||||
|
print_liste_field_titre($langs->trans("EndSubscription"),"liste.php","d.datefin",$param,"",'align="center"',$sortfield,$sortorder);
|
||||||
|
print_liste_field_titre($langs->trans("Action"),"liste.php","",$param,"",'width="60" align="center"',$sortfield,$sortorder);
|
||||||
|
print "</tr>\n";
|
||||||
|
|
||||||
// Lignes des champs de filtre
|
// Lignes des champs de filtre
|
||||||
print '<form method="GET" action="'.$_SERVER["PHP_SELF"].'">';
|
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
|
|
||||||
print '<td class="liste_titre" align="left">';
|
print '<td class="liste_titre" align="left">';
|
||||||
@ -194,9 +229,9 @@ if ($resql)
|
|||||||
print '<input class="flat" type="text" name="search_login" value="'.$_REQUEST["search_login"].'" size="7"></td>';
|
print '<input class="flat" type="text" name="search_login" value="'.$_REQUEST["search_login"].'" size="7"></td>';
|
||||||
|
|
||||||
print '<td class="liste_titre">';
|
print '<td class="liste_titre">';
|
||||||
$listetype=$membertypestatic->liste_array();
|
$listetype=$membertypestatic->liste_array();
|
||||||
$form->select_array("type", $listetype, $_REQUEST["type"], 1, 0, 0, 0, '', 0, 12);
|
$form->select_array("type", $listetype, $_REQUEST["type"], 1, 0, 0, 0, '', 0, 12);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
print '<td class="liste_titre"> </td>';
|
print '<td class="liste_titre"> </td>';
|
||||||
|
|
||||||
@ -207,85 +242,85 @@ if ($resql)
|
|||||||
|
|
||||||
print '<td align="right" colspan="2" class="liste_titre">';
|
print '<td align="right" colspan="2" class="liste_titre">';
|
||||||
print '<input type="image" class="liste_titre" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/search.png" name="button_search" alt="'.$langs->trans("Search").'">';
|
print '<input type="image" class="liste_titre" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/search.png" name="button_search" alt="'.$langs->trans("Search").'">';
|
||||||
print ' <input type="image" value="button_removefilter" class="liste_titre" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/searchclear.png" name="button_removefilter" alt="'.$langs->trans("RemoveFilter").'">';
|
print ' <input type="image" value="button_removefilter" class="liste_titre" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/searchclear.png" name="button_removefilter" alt="'.$langs->trans("RemoveFilter").'">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
print '</form>';
|
print '</form>';
|
||||||
|
|
||||||
$var=True;
|
$var=True;
|
||||||
while ($i < $num && $i < $conf->liste_limit)
|
while ($i < $num && $i < $conf->liste_limit)
|
||||||
{
|
{
|
||||||
$objp = $db->fetch_object($resql);
|
$objp = $db->fetch_object($resql);
|
||||||
|
|
||||||
$datefin=$db->jdate($objp->datefin);
|
$datefin=$db->jdate($objp->datefin);
|
||||||
|
|
||||||
$adh=new Adherent($db);
|
$adh=new Adherent($db);
|
||||||
|
|
||||||
// Nom
|
// Nom
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
print "<tr $bc[$var]>";
|
print "<tr $bc[$var]>";
|
||||||
if ($objp->societe != '')
|
if ($objp->societe != '')
|
||||||
{
|
{
|
||||||
print "<td><a href=\"fiche.php?rowid=$objp->rowid\">".img_object($langs->trans("ShowMember"),"user").' '.$objp->prenom." ".dol_trunc($objp->nom,12)." / ".dol_trunc($objp->societe,12)."</a></td>\n";
|
print "<td><a href=\"fiche.php?rowid=$objp->rowid\">".img_object($langs->trans("ShowMember"),"user").' '.$objp->prenom." ".dol_trunc($objp->nom,12)." / ".dol_trunc($objp->societe,12)."</a></td>\n";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print "<td><a href=\"fiche.php?rowid=$objp->rowid\">".img_object($langs->trans("ShowMember"),"user").' '.$objp->prenom." ".dol_trunc($objp->nom)."</a></td>\n";
|
print "<td><a href=\"fiche.php?rowid=$objp->rowid\">".img_object($langs->trans("ShowMember"),"user").' '.$objp->prenom." ".dol_trunc($objp->nom)."</a></td>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Login
|
// Login
|
||||||
print "<td>".$objp->login."</td>\n";
|
print "<td>".$objp->login."</td>\n";
|
||||||
|
|
||||||
// Type
|
// Type
|
||||||
print '<td nowrap="nowrap">';
|
print '<td nowrap="nowrap">';
|
||||||
$membertypestatic->id=$objp->type_id;
|
$membertypestatic->id=$objp->type_id;
|
||||||
$membertypestatic->libelle=$objp->type;
|
$membertypestatic->libelle=$objp->type;
|
||||||
print $membertypestatic->getNomUrl(1,12);
|
print $membertypestatic->getNomUrl(1,12);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
// Moral/Physique
|
// Moral/Physique
|
||||||
print "<td>".$adh->getmorphylib($objp->morphy)."</td>\n";
|
print "<td>".$adh->getmorphylib($objp->morphy)."</td>\n";
|
||||||
|
|
||||||
// EMail
|
// EMail
|
||||||
print "<td>".dol_print_email($objp->email,0,0,1)."</td>\n";
|
print "<td>".dol_print_email($objp->email,0,0,1)."</td>\n";
|
||||||
|
|
||||||
// Statut
|
// Statut
|
||||||
print '<td nowrap="nowrap">';
|
print '<td nowrap="nowrap">';
|
||||||
print $adh->LibStatut($objp->statut,$objp->cotisation,$datefin,2);
|
print $adh->LibStatut($objp->statut,$objp->cotisation,$datefin,2);
|
||||||
print "</td>";
|
print "</td>";
|
||||||
|
|
||||||
// Date fin cotisation
|
// Date fin cotisation
|
||||||
if ($datefin)
|
if ($datefin)
|
||||||
{
|
{
|
||||||
print '<td align="center" nowrap="nowrap">';
|
print '<td align="center" nowrap="nowrap">';
|
||||||
if ($datefin < time() && $objp->statut > 0)
|
if ($datefin < time() && $objp->statut > 0)
|
||||||
{
|
{
|
||||||
print dol_print_date($datefin,'day')." ".img_warning($langs->trans("SubscriptionLate"));
|
print dol_print_date($datefin,'day')." ".img_warning($langs->trans("SubscriptionLate"));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print dol_print_date($datefin,'day');
|
print dol_print_date($datefin,'day');
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<td align="left" nowrap="nowrap">';
|
print '<td align="left" nowrap="nowrap">';
|
||||||
if ($objp->cotisation == 'yes')
|
if ($objp->cotisation == 'yes')
|
||||||
{
|
{
|
||||||
print $langs->trans("SubscriptionNotReceived");
|
print $langs->trans("SubscriptionNotReceived");
|
||||||
if ($objp->statut > 0) print " ".img_warning();
|
if ($objp->statut > 0) print " ".img_warning();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print ' ';
|
print ' ';
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Actions
|
// Actions
|
||||||
print '<td align="center">';
|
print '<td align="center">';
|
||||||
if ($user->rights->adherent->creer)
|
if ($user->rights->adherent->creer)
|
||||||
{
|
{
|
||||||
print "<a href=\"fiche.php?rowid=$objp->rowid&action=edit&return=liste.php\">".img_edit()."</a>";
|
print "<a href=\"fiche.php?rowid=$objp->rowid&action=edit&return=liste.php\">".img_edit()."</a>";
|
||||||
@ -294,23 +329,23 @@ if ($resql)
|
|||||||
if ($user->rights->adherent->supprimer)
|
if ($user->rights->adherent->supprimer)
|
||||||
{
|
{
|
||||||
print "<a href=\"fiche.php?rowid=$objp->rowid&action=resign&return=liste.php\">".img_picto($langs->trans("Resiliate"),'disable.png')."</a>";
|
print "<a href=\"fiche.php?rowid=$objp->rowid&action=resign&return=liste.php\">".img_picto($langs->trans("Resiliate"),'disable.png')."</a>";
|
||||||
}
|
}
|
||||||
print "</td>";
|
print "</td>";
|
||||||
|
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
print "</table>\n";
|
print "</table>\n";
|
||||||
|
|
||||||
if ($num > $conf->liste_limit)
|
if ($num > $conf->liste_limit)
|
||||||
{
|
{
|
||||||
print_barre_liste('',$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$nbtotalofrecords,'');
|
print_barre_liste('',$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$nbtotalofrecords,'');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -21,7 +21,7 @@
|
|||||||
/**
|
/**
|
||||||
* \file htdocs/fourn/liste.php
|
* \file htdocs/fourn/liste.php
|
||||||
* \ingroup fournisseur
|
* \ingroup fournisseur
|
||||||
* \brief Page accueil de la zone fournisseurs
|
* \brief Home page of supplier area
|
||||||
* \version $Id$
|
* \version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -95,7 +95,6 @@ if ($search_categ)
|
|||||||
{
|
{
|
||||||
$sql .= " AND cf.fk_categorie = ".addslashes($search_categ);
|
$sql .= " AND cf.fk_categorie = ".addslashes($search_categ);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Count total nb of records
|
// Count total nb of records
|
||||||
$nbtotalofrecords = 0;
|
$nbtotalofrecords = 0;
|
||||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||||
@ -103,7 +102,6 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
|||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
$nbtotalofrecords = $db->num_rows($result);
|
$nbtotalofrecords = $db->num_rows($result);
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql.= $db->order($sortfield,$sortorder);
|
$sql.= $db->order($sortfield,$sortorder);
|
||||||
$sql.= $db->plimit($conf->liste_limit+1, $offset);
|
$sql.= $db->plimit($conf->liste_limit+1, $offset);
|
||||||
|
|
||||||
@ -118,7 +116,7 @@ if ($resql)
|
|||||||
|
|
||||||
print_barre_liste($langs->trans("ListOfSuppliers"), $page, "liste.php", $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords);
|
print_barre_liste($langs->trans("ListOfSuppliers"), $page, "liste.php", $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords);
|
||||||
|
|
||||||
print '<form action="liste.php?cat='.$_GET["cat"].'" method="GET">';
|
print '<form action="liste.php" method="GET">';
|
||||||
print '<table class="liste" width="100%">';
|
print '<table class="liste" width="100%">';
|
||||||
|
|
||||||
// Filter on categories
|
// Filter on categories
|
||||||
@ -132,7 +130,7 @@ if ($resql)
|
|||||||
if ($moreforfilter)
|
if ($moreforfilter)
|
||||||
{
|
{
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td class="liste_titre" colspan="9">';
|
print '<td class="liste_titre" colspan="6">';
|
||||||
print $moreforfilter;
|
print $moreforfilter;
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
@ -159,7 +157,6 @@ if ($resql)
|
|||||||
print '<input class="flat" type="text" size="10" name="search_compta" value="'.$_GET["search_compta"].'">';
|
print '<input class="flat" type="text" size="10" name="search_compta" value="'.$_GET["search_compta"].'">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
|
|
||||||
print '<td class="liste_titre" colspan="2" align="right"><input class="liste_titre" type="image" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/search.png" alt="'.$langs->trans("Search").'"></td>';
|
print '<td class="liste_titre" colspan="2" align="right"><input class="liste_titre" type="image" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/search.png" alt="'.$langs->trans("Search").'"></td>';
|
||||||
|
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user