166 global $conf, $langs;
172 if (!empty($conf->use_javascript_ajax)) {
173 print
"\n".
'<!-- Includes JS Footer of Dolibarr -->'.
"\n";
174 print
'<script src="'.DOL_URL_ROOT.
'/core/js/lib_foot.js.php?lang='.$langs->defaultlang.
'"></script>'.
"\n";
187$parameters = array();
189$reshook = $hookmanager->executeHooks(
'doActions', $parameters,
$object, $action);
195if (empty($reshook) && $action ==
'add') {
205 $errmsg .= $langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Login")).
"<br>\n";
207 $sql =
"SELECT login FROM ".MAIN_DB_PREFIX.
"adherent WHERE login = '".$db->escape(
GETPOST(
'login')).
"'";
208 $result = $db->query($sql);
210 $num = $db->num_rows($result);
214 $langs->load(
"errors");
215 $errmsg .= $langs->trans(
"ErrorLoginAlreadyExists").
"<br>\n";
217 if (!GETPOSTISSET(
"pass1") || !GETPOSTISSET(
"pass2") ||
GETPOST(
"pass1",
'none') ==
'' ||
GETPOST(
"pass2",
'none') ==
'' ||
GETPOST(
"pass1",
'none') !=
GETPOST(
"pass2",
'none')) {
219 $langs->load(
"errors");
220 $errmsg .= $langs->trans(
"ErrorPasswordsMustMatch").
"<br>\n";
224 $errmsg .= $langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"EMail")).
"<br>\n";
229 $errmsg .= $langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Type")).
"<br>\n";
231 if (!in_array(
GETPOST(
'morphy'), array(
'mor',
'phy'))) {
233 $errmsg .= $langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
'Nature')).
"<br>\n";
237 $errmsg .= $langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Lastname")).
"<br>\n";
241 $errmsg .= $langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Firstname")).
"<br>\n";
245 $errmsg .= $langs->trans(
'ErrorFieldRequired', $langs->transnoentitiesnoconv(
'Email')).
"<br>\n";
247 $langs->load(
'errors');
249 $errmsg .= $langs->trans(
"ErrorBadEMail",
GETPOST(
"email",
"aZ09arobase")).
"<br>\n";
252 if (
GETPOST(
"birthmonth") && empty($birthday)) {
254 $langs->load(
"errors");
255 $errmsg .= $langs->trans(
"ErrorBadDateFormat").
"<br>\n";
260 $errmsg .= $langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"TurnoverOrBudget")).
"<br>\n";
266 $sessionkey =
'dol_antispam_value';
267 $ok = (array_key_exists($sessionkey, $_SESSION) && (strtolower($_SESSION[$sessionkey]) == strtolower(
GETPOST(
'code'))));
270 $errmsg .= $langs->trans(
"ErrorBadValueForCode").
"<br>\n";
275 $public = GETPOSTISSET(
'public') ? 1 : 0;
282 $adh->public = $public;
283 $adh->firstname =
GETPOST(
'firstname');
284 $adh->lastname =
GETPOST(
'lastname');
285 $adh->gender =
GETPOST(
'gender');
286 $adh->civility_id =
GETPOST(
'civility_id');
287 $adh->company =
GETPOST(
'societe');
288 $adh->societe = $adh->company;
289 $adh->address =
GETPOST(
'address');
290 $adh->zip =
GETPOST(
'zipcode');
292 $adh->email =
GETPOST(
'email',
'aZ09arobase');
294 $adh->login =
GETPOST(
'login');
295 $adh->pass =
GETPOST(
'pass1',
'password');
297 $adh->photo =
GETPOST(
'photo');
301 $adh->note_private =
GETPOST(
'note_private');
303 $adh->birth = $birthday;
307 $nb_post_max =
getDolGlobalInt(
"MAIN_SECURITY_MAX_POST_ON_PUBLIC_PAGES_BY_IP_ADDRESS", 200);
312 if ($nb_post_max > 0) {
313 $sql =
"SELECT COUNT(ref) as nb_adh";
314 $sql .=
" FROM ".MAIN_DB_PREFIX.
"adherent";
315 $sql .=
" WHERE ip = '".$db->escape($adh->ip).
"'";
316 $sql .=
" AND datec > '".$db->idate($minmonthpost).
"'";
317 $resql = $db->query($sql);
319 $num = $db->num_rows($resql);
323 $obj = $db->fetch_object($resql);
324 $nb_post_ip = $obj->nb_adh;
331 $extrafields->fetch_name_optionals_label($adh->table_element);
332 $ret = $extrafields->setOptionalsFromPost(
null, $adh);
335 $errmsg .= $adh->error;
338 if ($nb_post_max > 0 && $nb_post_ip >= $nb_post_max) {
340 $errmsg .= $langs->trans(
"AlreadyTooMuchPostOnThisIPAdress");
341 array_push($adh->errors, $langs->trans(
"AlreadyTooMuchPostOnThisIPAdress"));
345 $result = $adh->create($user);
347 require_once DOL_DOCUMENT_ROOT.
'/core/class/CMailFile.class.php';
358 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formmail.class.php';
362 $outputlangs->setDefaultLang(empty(
$object->thirdparty->default_lang) ? $mysoc->default_lang :
$object->thirdparty->default_lang);
364 $outputlangs->loadLangs(array(
"main",
"members"));
366 $arraydefaultmessage =
null;
369 if (!empty($labeltouse)) {
370 $arraydefaultmessage = $formmail->getEMailTemplate($db,
'member', $user, $outputlangs, 0, 1, $labeltouse);
373 if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) {
374 $subject = $arraydefaultmessage->topic;
375 $msg = $arraydefaultmessage->content;
383 if ($subjecttosend && $texttosend) {
384 $moreinheader =
'X-Dolibarr-Info: send_an_email by public/members/new.php'.
"\r\n";
386 $result =
$object->sendEmail($texttosend, $subjecttosend, array(), array(), array(),
"",
"", 0, -1,
'', $moreinheader);
398 $appli = constant(
'DOL_APPLICATION_TITLE');
401 if (preg_match(
'/\d\.\d/', $appli)) {
402 if (!preg_match(
'/'.preg_quote(DOL_VERSION).
'/', $appli)) {
403 $appli .=
" (".DOL_VERSION.
")";
406 $appli .=
" ".DOL_VERSION;
409 $appli .=
" ".DOL_VERSION;
412 $to = $adh->makeSubstitution($conf->global->MAIN_INFO_SOCIETE_MAIL);
418 $adh->makeSubstitution($conf->global->ADHERENT_AUTOREGISTER_NOTIF_MAIL),
428 if (!$mailfile->sendfile()) {
429 dol_syslog($langs->trans(
"ErrorFailedToSendMail", $from, $to), LOG_ERR);
436 $result = $company->create_from_member($adh);
439 $errmsg .= implode(
'<br>', $company->errors);
443 if (!empty($backtopage)) {
444 $urlback = $backtopage;
449 $urlback = $_SERVER[
"PHP_SELF"].
"?action=added&token=".
newToken();
453 if (empty($adht->caneditamount)) {
458 $urlback = getOnlinePaymentUrl(0,
'member', $adh->ref, (
float)
price2num(
GETPOST(
'amount',
'alpha'),
'MT'),
'', 0);
461 $urlback .=
'&email='.urlencode(
GETPOST(
'email'));
464 $urlback .=
'&paymentmethod='.urlencode(
getDolGlobalString(
'MEMBER_NEWFORM_PAYONLINE'));
467 if (!empty($entity)) {
468 $urlback .=
'&entity='.((int) $entity);
473 $errmsg .= implode(
'<br>', $adh->errors);
481 header(
"Location: ".$urlback);
493if (empty($reshook) && $action ==
'added') {
498 print
'<div class="center">';
499 print $langs->trans(
"NewMemberbyWeb");
512$form =
new Form($db);
515$extrafields->fetch_name_optionals_label(
$object->table_element);
521print
load_fiche_titre(
img_picto(
'',
'member_nocolor',
'class="pictofixedwidth"').
' '.$langs->trans(
"NewSubscription"),
'',
'', 0,
'',
'center');
524print
'<div align="center">';
525print
'<div id="divsubscribe">';
527print
'<div class="center subscriptionformhelptext opacitymedium justify">';
531 print $langs->trans(
"NewSubscriptionDesc",
getDolGlobalString(
"MAIN_INFO_SOCIETE_MAIL")).
"<br>\n";
539print
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="POST" name="newmember">'.
"\n";
540print
'<input type="hidden" name="token" value="'.newToken().
'" />';
541print
'<input type="hidden" name="entity" value="'.$entity.
'" />';
542print
'<input type="hidden" name="page_y" value="" />';
545 print
'<input type="hidden" name="action" value="add" />';
548 $messagemandatory =
'<span class="">'.$langs->trans(
"FieldsWithAreMandatory",
'*').
'</span>';
554 print
'<script type="text/javascript">
555 jQuery(document).ready(function () {
556 jQuery(document).ready(function () {
557 function initmorphy()
559 console.log("Call initmorphy");
560 if (jQuery("#morphy").val() == \'phy\') {
561 jQuery("#trcompany").hide();
563 if (jQuery("#morphy").val() == \'mor\') {
564 jQuery("#trcompany").show();
568 jQuery("#morphy").change(function() {
571 jQuery("#selectcountry_id").change(function() {
572 document.newmember.action.value="create";
573 document.newmember.submit();
575 jQuery("#typeid").change(function() {
576 document.newmember.action.value="create";
577 document.newmember.submit();
584 print
'<table class="border" summary="form to subscribe" id="tablesubscribe">'.
"\n";
588 $listoftype = $adht->liste_array();
589 $tmp = array_keys($listoftype);
592 if (count($listoftype) == 1) {
593 $defaulttype = $tmp[0];
596 print
'<tr><td class="titlefield classfortooltip" title="'.dol_escape_htmltag($messagemandatory).
'">'.$langs->trans(
"Type").
' <span class="star">*</span></td><td>';
597 print $form->selectarray(
"typeid", $adht->liste_array(1),
GETPOST(
'typeid') ?
GETPOST(
'typeid') : $defaulttype, $isempty);
598 print
'</td></tr>'.
"\n";
601 print
'<input type="hidden" id="typeid" name="typeid" value="' .
getDolGlobalString(
'MEMBER_NEWFORM_FORCETYPE').
'">';
606 $morphys[
"phy"] = $langs->trans(
"Physical");
607 $morphys[
"mor"] = $langs->trans(
"Moral");
609 print
'<tr class="morphy"><td class="titlefield classfortooltip" title="'.dol_escape_htmltag($messagemandatory).
'">'.$langs->trans(
'MemberNature').
' <span class="star">*</span></td><td>'.
"\n";
610 print $form->selectarray(
"morphy", $morphys,
GETPOST(
'morphy'), 1);
611 print
'</td></tr>'.
"\n";
614 print
'<input type="hidden" id="morphy" name="morphy" value="' .
getDolGlobalString(
'MEMBER_NEWFORM_FORCEMORPHY').
'">';
618 print
'<tr id="trcompany" class="trcompany"><td>'.$langs->trans(
"Company").
'</td><td>';
619 print
img_picto(
'',
'company',
'class="pictofixedwidth paddingright"');
620 print
'<input type="text" name="societe" class="minwidth150 widthcentpercentminusx" value="'.dol_escape_htmltag(
GETPOST(
'societe')).
'"></td></tr>'.
"\n";
624 print
'<tr><td class="titlefield">'.$langs->trans(
'UserTitle').
'</td><td>';
625 print $formcompany->select_civility(
GETPOST(
'civility_id'),
'civility_id').
'</td></tr>'.
"\n";
629 print
'<tr><td class="classfortooltip" title="'.dol_escape_htmltag($messagemandatory).
'">'.$langs->trans(
"Firstname").
' <span class="star">*</span></td><td><input type="text" name="firstname" class="minwidth150" value="'.
dol_escape_htmltag(
GETPOST(
'firstname')).
'"></td></tr>'.
"\n";
632 print
'<tr><td class="classfortooltip" title="'.dol_escape_htmltag($messagemandatory).
'">'.$langs->trans(
"Lastname").
' <span class="star">*</span></td><td><input type="text" name="lastname" class="minwidth150" value="'.
dol_escape_htmltag(
GETPOST(
'lastname')).
'"></td></tr>'.
"\n";
635 print
'<tr><td class="'.(getDolGlobalString(
"ADHERENT_MAIL_REQUIRED") ?
'classfortooltip' :
'').
'" title="'.
dol_escape_htmltag($messagemandatory).
'">'.$langs->trans(
"Email").(getDolGlobalString(
"ADHERENT_MAIL_REQUIRED") ?
' <span class="star">*</span>' :
'').
'</td><td>';
637 print
'<input type="email" name="email" maxlength="255" class="minwidth200" value="'.dol_escape_htmltag(
GETPOST(
'email',
"aZ09arobase")).
'"></td></tr>'.
"\n";
641 print
'<tr><td>'.$langs->trans(
"Login").
' <span class="star">*</span></td><td><input type="text" name="login" maxlength="50" class="minwidth100"value="'.
dol_escape_htmltag(
GETPOST(
'login')).
'"></td></tr>'.
"\n";
642 print
'<tr><td>'.$langs->trans(
"Password").
' <span class="star">*</span></td><td><input type="password" maxlength="128" name="pass1" class="minwidth100" value="'.
dol_escape_htmltag(
GETPOST(
"pass1",
"none", 2)).
'"></td></tr>'.
"\n";
643 print
'<tr><td>'.$langs->trans(
"PasswordRetype").
' <span class="star">*</span></td><td><input type="password" maxlength="128" name="pass2" class="minwidth100" value="'.
dol_escape_htmltag(
GETPOST(
"pass2",
"none", 2)).
'"></td></tr>'.
"\n";
647 print
'<tr><td>'.$langs->trans(
"Gender").
'</td>';
649 $arraygender = array(
'man' => $langs->trans(
"Genderman"),
'woman' => $langs->trans(
"Genderwoman"),
'other' => $langs->trans(
"Genderother"));
650 print $form->selectarray(
'gender', $arraygender,
GETPOST(
'gender',
'alphanohtml'), 1, 0, 0,
'', 0, 0, 0,
'',
'', 1);
654 print
'<tr><td>'.$langs->trans(
"Address").
'</td><td>'.
"\n";
655 print
'<textarea name="address" id="address" wrap="soft" class="quatrevingtpercent" rows="'.ROWS_3.
'">'.
dol_escape_htmltag(
GETPOST(
'address',
'restricthtml'), 0, 1).
'</textarea></td></tr>'.
"\n";
658 print
'<tr><td>'.$langs->trans(
'Zip').
' / '.$langs->trans(
'Town').
'</td><td>';
659 print $formcompany->select_ziptown(
GETPOST(
'zipcode'),
'zipcode', array(
'town',
'selectcountry_id',
'state_id'), 0, 1,
'',
'width75');
661 print $formcompany->select_ziptown(
GETPOST(
'town'),
'town', array(
'zipcode',
'selectcountry_id',
'state_id'), 0, 1);
665 print
'<tr><td>'.$langs->trans(
'Country').
'</td><td>';
666 print
img_picto(
'',
'country',
'class="pictofixedwidth paddingright"');
669 $country_id =
getCountry($conf->global->MEMBER_NEWFORM_FORCECOUNTRYCODE,
'2', $db, $langs);
671 if (!$country_id && !empty($conf->geoipmaxmind->enabled)) {
675 $new_country_id =
getCountry($country_code,
'3', $db, $langs);
677 if ($new_country_id) {
678 $country_id = $new_country_id;
682 $country_code =
getCountry($country_id,
'2', $db, $langs);
683 print $form->select_country($country_id,
'country_id');
688 print
'<tr><td>'.$langs->trans(
'State').
'</td><td>';
690 print
img_picto(
'',
'state',
'class="pictofixedwidth paddingright"');
691 print $formcompany->select_state(
GETPOST(
"state_id"), $country_code);
697 print
'<tr id="trbirth" class="trbirth"><td>'.$langs->trans(
"DateOfBirth").
'</td><td>';
698 print $form->selectDate(!empty($birthday) ? $birthday :
"",
'birth', 0, 0, 1,
"newmember", 1, 0);
699 print
'</td></tr>'.
"\n";
702 print
'<tr><td>'.$langs->trans(
"URLPhoto").
'</td><td><input type="text" name="photo" class="minwidth200" value="'.
dol_escape_htmltag(
GETPOST(
'photo')).
'"></td></tr>'.
"\n";
706 $linkofpubliclist = DOL_MAIN_URL_ROOT.
'/public/members/public_list.php'.((isModEnabled(
'multicompany')) ?
'?entity='.$conf->entity :
'');
707 $publiclabel = $langs->trans(
"Public",
getDolGlobalString(
'MAIN_INFO_SOCIETE_NOM'), $linkofpubliclist);
708 print
'<tr><td>'.$form->textwithpicto($langs->trans(
"MembershipPublic"), $publiclabel).
'</td><td><input type="checkbox" name="public"></td></tr>'.
"\n";
712 $parameters[
'tpl_context'] =
'public';
713 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_add.tpl.php';
717 print
'<td class="tdtop">'.$langs->trans(
"Comments").
'</td>';
718 print
'<td class="tdtop"><textarea name="note_private" id="note_private" wrap="soft" class="quatrevingtpercent" rows="'.ROWS_3.
'">'.
dol_escape_htmltag(
GETPOST(
'note_private',
'restricthtml'), 0, 1).
'</textarea></td>';
724 $arraybudget = array(
'50' =>
'<= 100 000',
'100' =>
'<= 200 000',
'200' =>
'<= 500 000',
'300' =>
'<= 1 500 000',
'600' =>
'<= 3 000 000',
'1000' =>
'<= 5 000 000',
'2000' =>
'5 000 000+');
725 print
'<tr id="trbudget" class="trcompany"><td>'.$langs->trans(
"TurnoverOrBudget").
' <span class="star">*</span></td><td>';
726 print $form->selectarray(
'budget', $arraybudget,
GETPOST(
'budget'), 1);
729 print
'<script type="text/javascript">
730 jQuery(document).ready(function () {
732 jQuery("#morphy").change(function() {
735 jQuery("#budget").change(function() {
736 if (jQuery("#budget").val() > 0) { jQuery(".amount").val(jQuery("#budget").val()); }
737 else { jQuery("#budget").val(\'\'); }
739 /*jQuery("#typeid").change(function() {
740 if (jQuery("#typeid").val()==1) { jQuery("#morphy").val(\'mor\'); }
741 if (jQuery("#typeid").val()==2) { jQuery("#morphy").val(\'phy\'); }
742 if (jQuery("#typeid").val()==3) { jQuery("#morphy").val(\'mor\'); }
743 if (jQuery("#typeid").val()==4) { jQuery("#morphy").val(\'mor\'); }
746 function initturnover() {
747 console.log("Switch mor/phy");
748 if (jQuery("#morphy").val()==\'phy\') {
749 jQuery(".amount").val(20);
750 jQuery("#trbudget").hide();
751 jQuery("#trcompany").hide();
753 if (jQuery("#morphy").val()==\'mor\') {
754 jQuery(".amount").val(\'\');
755 jQuery("#trcompany").show();
756 jQuery("#trbirth").hide();
757 jQuery("#trbudget").show();
758 jQuery(".hideifautoturnover").hide();
759 if (jQuery("#budget").val() > 0) { jQuery(".amount").val(jQuery("#budget").val()); }
760 else { jQuery("#budget").val(\'\'); }
765 print
'</td></tr>'.
"\n";
771 $adht->fetch($typeid);
772 $caneditamount = $adht->caneditamount;
773 $amountbytype = $adht->amountByType(1);
777 $amount = empty($amountbytype[$typeid]) ? 0 : $amountbytype[$typeid];
783 if (empty($amount)) {
787 $amount = max(0, (
float) $amount, (
float)
getDolGlobalInt(
"MEMBER_MIN_AMOUNT"));
791 $showedamount = $amount > 0 ? $amount : 0;
793 print
'<tr><td>'.$langs->trans(
"Subscription");
795 print
' - <a href="' .
getDolGlobalString(
'MEMBER_EXT_URL_SUBSCRIPTION_INFO').
'" rel="external" target="_blank" rel="noopener noreferrer">'.$langs->trans(
"SeeHere").
'</a>';
797 print
'</td><td class="nowrap">';
803 if ($caneditamount) {
804 print
'<input type="text" name="amount" id="amount" class="flat amount width50" value="'.$showedamount.
'">';
805 print
' '.$langs->trans(
"Currency".$conf->currency).
'<span class="opacitymedium hideifautoturnover"> - ';
806 print $amount > 0 ? $langs->trans(
"AnyAmountWithAdvisedAmount",
price($amount, 0, $langs, 1, -1, -1, $conf->currency)) : $langs->trans(
"AnyAmountWithoutAdvisedAmount");
809 print
'<input type="hidden" name="amount" id="amount" class="flat amount" value="'.$showedamount.
'">';
810 print
'<input type="text" name="amount" id="amounthidden" class="flat amount width50" disabled value="'.$showedamount.
'">';
811 print
' '.$langs->trans(
"Currency".$conf->currency);
818 require_once DOL_DOCUMENT_ROOT.
'/core/lib/security2.lib.php';
819 print
'<tr><td class="titlefield"><label><span class="fieldrequired">'.$langs->trans(
"SecurityCode").
'</span></label></td><td>';
820 print
'<span class="span-icon-security inline-block">';
821 print
'<input id="securitycode" placeholder="'.$langs->trans(
"SecurityCode").
'" class="flat input-icon-security width150" type="text" maxlength="5" name="code" tabindex="3" />';
823 print
'<span class="nowrap inline-block">';
824 print
'<img class="inline-block valignmiddle" src="'.DOL_URL_ROOT.
'/core/antispamimage.php" border="0" width="80" height="32" id="img_securitycode" />';
825 print
'<a class="inline-block valignmiddle" href="'.$php_self.
'" tabindex="4" data-role="button">'.
img_picto($langs->trans(
"Refresh"),
'refresh',
'id="captcha_refresh_img"').
'</a>';
835 print
'<div class="center">';
836 print
'<input type="submit" value="'.$langs->trans(
"GetMembershipButtonLabel").
'" id="submitsave" class="button">';
837 if (!empty($backtopage)) {
838 print
' <input type="submit" value="'.$langs->trans(
"Cancel").
'" id="submitcancel" class="button button-cancel">';
845 print
'</div></div>';
848 $measuringUnits =
new CUnits($db);
849 $result = $measuringUnits->fetchAll(
'',
'', 0, 0, array(
't.active' => 1));
851 foreach ($measuringUnits->records as $lines) {
852 $units[$lines->short_label] = $langs->trans(ucfirst($lines->label));
858 $sql =
"SELECT d.rowid, d.libelle as label, d.subscription, d.amount, d.caneditamount, d.vote, d.note, d.duration, d.statut as status, d.morphy,";
859 $sql .=
" COUNT(a.rowid) AS membercount";
860 $sql .=
" FROM ".MAIN_DB_PREFIX.
"adherent_type as d";
861 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"adherent as a";
862 $sql .=
" ON d.rowid = a.fk_adherent_type AND a.statut > 0";
863 $sql .=
" WHERE d.entity IN (".getEntity(
'member_type').
")";
864 $sql .=
" AND d.statut=1";
865 $sql .=
" GROUP BY d.rowid, d.libelle, d.subscription, d.amount, d.caneditamount, d.vote, d.note, d.duration, d.statut, d.morphy";
867 $result = $db->query($sql);
869 $num = $db->num_rows($result);
871 print
'<br><div class="div-table-responsive">';
872 print
'<table class="tagtable liste">'.
"\n";
873 print
'<input type="hidden" name="action" value="create">';
875 print
'<tr class="liste_titre">';
876 print
'<th>'.$langs->trans(
"Label").
'</th>';
877 print
'<th class="center">'.$langs->trans(
"MembershipDuration").
'</th>';
878 print
'<th class="center">'.$langs->trans(
"Amount").
'</th>';
879 print
'<th class="center">'.$langs->trans(
"MembersNature").
'</th>';
880 if (empty($hidevoteallowed)) {
881 print
'<th class="center">'.$langs->trans(
"VoteAllowed").
'</th>';
883 if ($publiccounters) {
884 print
'<th class="center">'.$langs->trans(
"Members").
'</th>';
886 print
'<th class="center">'.$langs->trans(
"NewSubscription").
'</th>';
891 $objp = $db->fetch_object($result);
893 $caneditamount = $objp->caneditamount;
894 $amountbytype = $adht->amountByType(1);
896 print
'<tr class="oddeven">';
898 print
'<td>'.dol_escape_htmltag($objp->label).
'</td>';
900 print
'<td class="center">';
901 $unit = preg_replace(
"/[^a-zA-Z]+/",
"", $objp->duration);
902 print max(1, intval($objp->duration)).
' '.$units[$unit];
905 print
'<td class="center"><span class="amount nowrap">';
909 $amount = empty($amountbytype[$objp->rowid]) ? 0 : $amountbytype[$objp->rowid];
915 if (empty($amount)) {
919 $amount = max(0, (
float) $amount, (
float)
getDolGlobalInt(
"MEMBER_MIN_AMOUNT"));
921 $displayedamount = $amount;
923 if ($objp->subscription) {
924 if ($displayedamount > 0 || !$caneditamount) {
925 print
price($displayedamount, 1, $langs, 1, 0, -1, $conf->currency);
927 if ($caneditamount && $displayedamount > 0) {
928 print $form->textwithpicto(
'', $langs->transnoentities(
"CanEditAmountShortForValues"), 1,
'help',
'', 0, 3);
929 } elseif ($caneditamount) {
930 print $langs->transnoentities(
"CanEditAmountShort");
935 print
'</span></td>';
936 print
'<td class="center">';
937 if ($objp->morphy ==
'phy') {
938 print $langs->trans(
"Physical");
939 } elseif ($objp->morphy ==
'mor') {
940 print $langs->trans(
"Moral");
942 print $langs->trans(
"MorAndPhy");
945 if (empty($hidevoteallowed)) {
946 print
'<td class="center">'.yn($objp->vote).
'</td>';
948 $membercount = $objp->membercount > 0 ? $objp->membercount :
"–";
949 if ($publiccounters) {
950 print
'<td class="center">'.$membercount.
'</td>';
952 print
'<td class="center"><button class="button button-save reposition" name="typeid" type="submit" name="submit" value="'.$objp->rowid.
'">'.$langs->trans(
"GetMembershipButtonLabel").
'</button></td>';
960 print
'<tr><td colspan="'.$colspan.
'" class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</td></tr>';
top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs=array(), $arrayofcss=array(), $disableforlogin=0, $disablenofollow=0, $disablenoindex=0)
Output html header of a page.