28if (!defined(
'NOLOGIN')) {
31if (!defined(
'NOCSRFCHECK')) {
32 define(
"NOCSRFCHECK", 1);
34if (!defined(
'NOIPCHECK')) {
35 define(
'NOIPCHECK',
'1');
37if (!defined(
'NOBROWSERNOTIF')) {
38 define(
'NOBROWSERNOTIF',
'1');
44$entity = (!empty($_GET[
'entity']) ? (int) $_GET[
'entity'] : (!empty($_POST[
'entity']) ? (int) $_POST[
'entity'] : 1));
46define(
"DOLENTITY", $entity);
50require
'../../main.inc.php';
58if (!isModEnabled(
'member')) {
62$langs->loadLangs(array(
"main",
"members",
"companies",
"other"));
76function llxHeaderVierge($title, $head =
"", $disablejs = 0, $disablehead = 0, $arrayofjs = [], $arrayofcss = [])
80 print
'<body class="public_body">'.
"\n";
97$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
98$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
101if (empty($page) || $page == -1) {
104$offset = $limit * $page;
105$pageprev = $page - 1;
106$pagenext = $page + 1;
115 $sortfield =
"lastname";
127$form =
new Form($db);
131 $morehead =
'<link rel="stylesheet" type="text/css" href="' .
getDolGlobalString(
'MEMBER_PUBLIC_CSS').
'">';
133 $morehead =
'<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.
'/theme/eldy/style.css.php">';
136llxHeaderVierge($langs->trans(
"ListOfValidatedPublicMembers"), $morehead);
138$sql =
"SELECT rowid, firstname, lastname, societe, zip, town, email, birth, photo";
142$sql .=
" FROM ".MAIN_DB_PREFIX.
"adherent";
143$sql .=
" WHERE entity = ".((int) $entity);
144$sql .=
" AND statut = 1";
145$sql .=
" AND public = 1";
148$nbtotalofrecords =
'';
151 $sqlforcount = preg_replace(
'/^'.preg_quote($sqlfields,
'/').
'/',
'SELECT COUNT(*) as nbtotalofrecords', $sql);
152 $sqlforcount = preg_replace(
'/GROUP BY .*$/',
'', $sqlforcount);
154 $resql = $db->query($sqlforcount);
156 $objforcount = $db->fetch_object($resql);
157 $nbtotalofrecords = $objforcount->nbtotalofrecords;
162 if (($page * $limit) > $nbtotalofrecords) {
169$sql .= $db->order($sortfield, $sortorder);
170$sql .= $db->plimit(
$conf->liste_limit + 1, $offset);
173$result = $db->query($sql);
175 $num = $db->num_rows($result);
178 $param =
"&statut=$statut&sortorder=$sortorder&sortfield=$sortfield";
179 $title = $langs->trans(
"ListOfValidatedPublicMembers");
180 print_barre_liste($title, $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder,
'', $num, $nbtotalofrecords,
'');
181 print
'<table class="public_border centpercent">';
183 print
'<tr class="public_liste_titre">';
184 print
'<th class="left"><a href="'.$_SERVER[
"PHP_SELF"].
'?page='.$page.
'&sortorder=ASC&sortfield=firstname">'.
dolGetFirstLastname($langs->trans(
"Firstname"), $langs->trans(
"Lastname")).
'</a></th>';
185 print
'<th class="left"><a href="'.$_SERVER[
"PHP_SELF"].
'?page='.$page.
'&sortorder=ASC&sortfield=societe">'.$langs->trans(
"Company").
'</a></th>'.
"\n";
187 print_liste_field_titre(
"EMail", $_SERVER[
"PHP_SELF"],
"email",
'', $param,
'', $sortfield, $sortorder,
'left public_');
188 print_liste_field_titre(
"Zip", $_SERVER[
"PHP_SELF"],
"zip",
"", $param,
'', $sortfield, $sortorder,
'left public_');
189 print_liste_field_titre(
"Town", $_SERVER[
"PHP_SELF"],
"town",
"", $param,
'', $sortfield, $sortorder,
'left public_');
190 print_liste_field_titre(
"Photo", $_SERVER[
"PHP_SELF"],
"",
"", $param,
'', $sortfield, $sortorder,
'center public_');
193 while ($i < $num && $i < $conf->liste_limit) {
194 $objp = $db->fetch_object($result);
196 print
'<tr class="oddeven">';
197 print
'<td><a href="public_card.php?id='.$objp->rowid.
'">'.
dolGetFirstLastname($objp->firstname, $objp->lastname).
'</a></td>'.
"\n";
198 print
'<td>'.$objp->societe.
'</td>'.
"\n";
199 print
'<td>'.$objp->email.
'</td>'.
"\n";
200 print
'<td>'.$objp->zip.
'</td>'.
"\n";
201 print
'<td>'.$objp->town.
'</td>'.
"\n";
202 if (isset($objp->photo) && $objp->photo !=
'') {
203 print
'<td class="center">';
204 print $form->showphoto(
'memberphoto', $objp, 64);
207 print
"<td> </td>\n";
print_barre_liste($title, $page, $file, $options='', $sortfield='', $sortorder='', $morehtmlcenter='', $num=-1, $totalnboflines='', $picto='generic', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limit=-1, $selectlimitsuffix=0, $hidenavigation=0, $pagenavastextinput=0, $morehtmlrightbeforearrow='')
Print a title with navigation controls for pagination.
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
printCommonFooter($zone='private')
Print common footer : conf->global->MAIN_HTML_FOOTER js for switch of menu hider js for conf->global-...
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
dolGetFirstLastname($firstname, $lastname, $nameorder=-1)
Return firstname and lastname in correct order.
print_liste_field_titre($name, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $tooltip="", $forcenowrapcolumntitle=0)
Show title line of an array.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs=array(), $arrayofcss=array(), $disableforlogin=0, $disablenofollow=0, $disablenoindex=0)
Output html header of a page.
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...
llxHeaderVierge($title, $head="", $disablejs=0, $disablehead=0, $arrayofjs=[], $arrayofcss=[])
Show header for member list.
llxFooterVierge()
Show footer for member list.
httponly_accessforbidden($message='1', $http_response_code=403, $stringalreadysanitized=0)
Show a message to say access is forbidden and stop program.