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));
45if (is_numeric($entity)) {
46 define(
"DOLENTITY", $entity);
50require
'../../main.inc.php';
53if (!isModEnabled(
'member')) {
57$langs->loadLangs(array(
"main",
"members",
"companies",
"other"));
71function llxHeaderVierge($title, $head =
"", $disablejs = 0, $disablehead = 0, $arrayofjs = [], $arrayofcss = [])
75 print
'<body class="public_body">'.
"\n";
92$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
93$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
96if (empty($page) || $page == -1) {
99$offset = $limit * $page;
100$pageprev = $page - 1;
101$pagenext = $page + 1;
110 $sortfield =
"lastname";
122$form =
new Form($db);
126 $morehead =
'<link rel="stylesheet" type="text/css" href="' .
getDolGlobalString(
'MEMBER_PUBLIC_CSS').
'">';
128 $morehead =
'<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.
'/theme/eldy/style.css.php">';
131llxHeaderVierge($langs->trans(
"ListOfValidatedPublicMembers"), $morehead);
133$sql =
"SELECT rowid, firstname, lastname, societe, zip, town, email, birth, photo";
137$sql .=
" FROM ".MAIN_DB_PREFIX.
"adherent";
138$sql .=
" WHERE entity = ".((int) $entity);
139$sql .=
" AND statut = 1";
140$sql .=
" AND public = 1";
143$nbtotalofrecords =
'';
146 $sqlforcount = preg_replace(
'/^'.preg_quote($sqlfields,
'/').
'/',
'SELECT COUNT(*) as nbtotalofrecords', $sql);
147 $sqlforcount = preg_replace(
'/GROUP BY .*$/',
'', $sqlforcount);
149 $resql = $db->query($sqlforcount);
151 $objforcount = $db->fetch_object($resql);
152 $nbtotalofrecords = $objforcount->nbtotalofrecords;
157 if (($page * $limit) > $nbtotalofrecords) {
164$sql .= $db->order($sortfield, $sortorder);
165$sql .= $db->plimit(
$conf->liste_limit + 1, $offset);
172$result = $db->query($sql);
174 $num = $db->num_rows($result);
177 $param =
"&statut=$statut&sortorder=$sortorder&sortfield=$sortfield";
178 $title = $langs->trans(
"ListOfValidatedPublicMembers");
179 print_barre_liste($title, $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder,
'', $num, $nbtotalofrecords,
'');
180 print
'<table class="public_border centpercent">';
182 print
'<tr class="public_liste_titre">';
183 print
'<th class="left"><a href="'.$_SERVER[
"PHP_SELF"].
'?page='.$page.
'&sortorder=ASC&sortfield=firstname">'.
dolGetFirstLastname($langs->trans(
"Firstname"), $langs->trans(
"Lastname")).
'</a></th>';
184 print
'<th class="left"><a href="'.$_SERVER[
"PHP_SELF"].
'?page='.$page.
'&sortorder=ASC&sortfield=societe">'.$langs->trans(
"Company").
'</a></th>'.
"\n";
186 print_liste_field_titre(
"EMail", $_SERVER[
"PHP_SELF"],
"email",
'', $param,
'', $sortfield, $sortorder,
'left public_');
187 print_liste_field_titre(
"Zip", $_SERVER[
"PHP_SELF"],
"zip",
"", $param,
'', $sortfield, $sortorder,
'left public_');
188 print_liste_field_titre(
"Town", $_SERVER[
"PHP_SELF"],
"town",
"", $param,
'', $sortfield, $sortorder,
'left public_');
189 print_liste_field_titre(
"Photo", $_SERVER[
"PHP_SELF"],
"",
"", $param,
'', $sortfield, $sortorder,
'center public_');
192 while ($i < $num && $i < $conf->liste_limit) {
193 $objp = $db->fetch_object($result);
195 print
'<tr class="oddeven">';
196 print
'<td><a href="public_card.php?id='.$objp->rowid.
'">'.
dolGetFirstLastname($objp->firstname, $objp->lastname).
'</a></td>'.
"\n";
197 print
'<td>'.$objp->societe.
'</td>'.
"\n";
198 print
'<td>'.$objp->email.
'</td>'.
"\n";
199 print
'<td>'.$objp->zip.
'</td>'.
"\n";
200 print
'<td>'.$objp->town.
'</td>'.
"\n";
201 if (isset($objp->photo) && $objp->photo !=
'') {
202 print
'<td class="center">';
203 print $form->showphoto(
'memberphoto', $objp, 64);
206 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.