175 global
$conf, $langs;
181 if (!empty(
$conf->use_javascript_ajax)) {
182 print
"\n".
'<!-- Includes JS Footer of Dolibarr -->'.
"\n";
183 print
'<script src="'.DOL_URL_ROOT.
'/core/js/lib_foot.js.php?lang='.$langs->defaultlang.
'"></script>'.
"\n";
196$parameters = array();
198$reshook = $hookmanager->executeHooks(
'doActions', $parameters,
$object, $action);
204if (empty($reshook) && $action ==
'add') {
214 $errmsg .= $langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Login")).
"<br>\n";
216 $sql =
"SELECT login FROM ".MAIN_DB_PREFIX.
"adherent WHERE login = '".$db->escape(
GETPOST(
'login')).
"'";
217 $result = $db->query($sql);
219 $num = $db->num_rows($result);
223 $langs->load(
"errors");
224 $errmsg .= $langs->trans(
"ErrorLoginAlreadyExists").
"<br>\n";
226 if (!GETPOSTISSET(
"pass1") || !GETPOSTISSET(
"pass2") ||
GETPOST(
"pass1",
'none') ==
'' ||
GETPOST(
"pass2",
'none') ==
'' ||
GETPOST(
"pass1",
'none') !=
GETPOST(
"pass2",
'none')) {
228 $langs->load(
"errors");
229 $errmsg .= $langs->trans(
"ErrorPasswordsMustMatch").
"<br>\n";
233 $errmsg .= $langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"EMail")).
"<br>\n";
238 $errmsg .= $langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Type")).
"<br>\n";
240 if (!in_array(
GETPOST(
'morphy'), array(
'mor',
'phy'))) {
242 $errmsg .= $langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
'Nature')).
"<br>\n";
246 $errmsg .= $langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Lastname")).
"<br>\n";
250 $errmsg .= $langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Firstname")).
"<br>\n";
254 $errmsg .= $langs->trans(
'ErrorFieldRequired', $langs->transnoentitiesnoconv(
'Email')).
"<br>\n";
256 $langs->load(
'errors');
258 $errmsg .= $langs->trans(
"ErrorBadEMail",
GETPOST(
"email",
"aZ09arobase")).
"<br>\n";
261 if (
GETPOST(
"birthmonth") && empty($birthday)) {
263 $langs->load(
"errors");
264 $errmsg .= $langs->trans(
"ErrorBadDateFormat").
"<br>\n";
269 $errmsg .= $langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"TurnoverOrBudget")).
"<br>\n";
275 $sessionkey =
'dol_antispam_value';
276 $ok = (array_key_exists($sessionkey, $_SESSION) && (strtolower($_SESSION[$sessionkey]) == strtolower(
GETPOST(
'code'))));
279 $errmsg .= $langs->trans(
"ErrorBadValueForCode").
"<br>\n";
284 $public = GETPOSTISSET(
'public') ? 1 : 0;
291 $adh->public = $public;
292 $adh->firstname =
GETPOST(
'firstname');
293 $adh->lastname =
GETPOST(
'lastname');
294 $adh->gender =
GETPOST(
'gender');
295 $adh->civility_id =
GETPOST(
'civility_id');
296 $adh->company =
GETPOST(
'societe');
297 $adh->societe = $adh->company;
298 $adh->address =
GETPOST(
'address');
299 $adh->zip =
GETPOST(
'zipcode');
301 $adh->email =
GETPOST(
'email',
'aZ09arobase');
303 $adh->login =
GETPOST(
'login');
304 $adh->pass =
GETPOST(
'pass1',
'password');
306 $adh->photo =
GETPOST(
'photo');
310 $adh->note_private =
GETPOST(
'note_private');
312 $adh->birth = $birthday;
316 $nb_post_max =
getDolGlobalInt(
"MAIN_SECURITY_MAX_POST_ON_PUBLIC_PAGES_BY_IP_ADDRESS", 200);
321 if ($nb_post_max > 0) {
322 $sql =
"SELECT COUNT(ref) as nb_adh";
323 $sql .=
" FROM ".MAIN_DB_PREFIX.
"adherent";
324 $sql .=
" WHERE ip = '".$db->escape($adh->ip).
"'";
325 $sql .=
" AND datec > '".$db->idate($minmonthpost).
"'";
326 $resql = $db->query($sql);
328 $num = $db->num_rows($resql);
332 $obj = $db->fetch_object($resql);
333 $nb_post_ip = $obj->nb_adh;
340 $extrafields->fetch_name_optionals_label($adh->table_element);
341 $ret = $extrafields->setOptionalsFromPost(
null, $adh);
344 $errmsg .= $adh->error;
347 if ($nb_post_max > 0 && $nb_post_ip >= $nb_post_max) {
349 $errmsg .= $langs->trans(
"AlreadyTooMuchPostOnThisIPAdress");
350 array_push($adh->errors, $langs->trans(
"AlreadyTooMuchPostOnThisIPAdress"));
354 $result = $adh->create($user);
356 require_once DOL_DOCUMENT_ROOT.
'/core/class/CMailFile.class.php';
367 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formmail.class.php';
371 $outputlangs->setDefaultLang(empty(
$object->thirdparty->default_lang) ? $mysoc->default_lang :
$object->thirdparty->default_lang);
373 $outputlangs->loadLangs(array(
"main",
"members"));
375 $arraydefaultmessage =
null;
378 if (!empty($labeltouse)) {
379 $arraydefaultmessage = $formmail->getEMailTemplate($db,
'member', $user, $outputlangs, 0, 1, $labeltouse);
382 if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) {
383 $subject = $arraydefaultmessage->topic;
384 $msg = $arraydefaultmessage->content;
392 if ($subjecttosend && $texttosend) {
393 $moreinheader =
'X-Dolibarr-Info: send_an_email by public/members/new.php'.
"\r\n";
395 $result =
$object->sendEmail($texttosend, $subjecttosend, array(), array(), array(),
"",
"", 0, -1,
'', $moreinheader);
407 $appli = constant(
'DOL_APPLICATION_TITLE');
410 if (preg_match(
'/\d\.\d/', $appli)) {
411 if (!preg_match(
'/'.preg_quote(DOL_VERSION).
'/', $appli)) {
412 $appli .=
" (".DOL_VERSION.
")";
415 $appli .=
" ".DOL_VERSION;
418 $appli .=
" ".DOL_VERSION;
421 $to = $adh->makeSubstitution(
$conf->global->MAIN_INFO_SOCIETE_MAIL);
427 $adh->makeSubstitution(
$conf->global->ADHERENT_AUTOREGISTER_NOTIF_MAIL),
437 if (!$mailfile->sendfile()) {
438 dol_syslog($langs->trans(
"ErrorFailedToSendMail", $from, $to), LOG_ERR);
445 $result = $company->create_from_member($adh);
448 $errmsg .= implode(
'<br>', $company->errors);
452 if (!empty($backtopage)) {
453 $urlback = $backtopage;
458 $urlback = $_SERVER[
"PHP_SELF"].
"?action=added&token=".
newToken();
462 if (empty($adht->caneditamount)) {
467 $urlback = getOnlinePaymentUrl(0,
'member', $adh->ref, (
float)
price2num(
GETPOST(
'amount',
'alpha'),
'MT'),
'', 0);
470 $urlback .=
'&email='.urlencode(
GETPOST(
'email'));
473 $urlback .=
'&paymentmethod='.urlencode(
getDolGlobalString(
'MEMBER_NEWFORM_PAYONLINE'));
476 if (!empty($entity)) {
477 $urlback .=
'&entity='.((int) $entity);
482 $errmsg .= implode(
'<br>', $adh->errors);
490 header(
"Location: ".$urlback);
502if (empty($reshook) && $action ==
'added') {
507 print
'<div class="center">';
508 print $langs->trans(
"NewMemberbyWeb");
521$form =
new Form($db);
524$extrafields->fetch_name_optionals_label(
$object->table_element);
530print
load_fiche_titre(
img_picto(
'',
'member_nocolor',
'class="pictofixedwidth"').
' '.$langs->trans(
"NewSubscription"),
'',
'', 0,
'',
'center');
533print
'<div align="center">';
534print
'<div id="divsubscribe">';
536print
'<div class="center subscriptionformhelptext opacitymedium justify">';
540 print $langs->trans(
"NewSubscriptionDesc",
getDolGlobalString(
"MAIN_INFO_SOCIETE_MAIL")).
"<br>\n";
548print
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="POST" name="newmember">'.
"\n";
549print
'<input type="hidden" name="token" value="'.newToken().
'" />';
550print
'<input type="hidden" name="entity" value="'.$entity.
'" />';
551print
'<input type="hidden" name="page_y" value="" />';
554 print
'<input type="hidden" name="action" value="add" />';
557 $messagemandatory =
'<span class="">'.$langs->trans(
"FieldsWithAreMandatory",
'*').
'</span>';
563 print
'<script type="text/javascript">
564 jQuery(document).ready(function () {
565 jQuery(document).ready(function () {
566 function initmorphy()
568 console.log("Call initmorphy");
569 if (jQuery("#morphy").val() == \'phy\') {
570 jQuery("#trcompany").hide();
572 if (jQuery("#morphy").val() == \'mor\') {
573 jQuery("#trcompany").show();
577 jQuery("#morphy").change(function() {
580 jQuery("#selectcountry_id").change(function() {
581 document.newmember.action.value="create";
582 document.newmember.submit();
584 jQuery("#typeid").change(function() {
585 document.newmember.action.value="create";
586 document.newmember.submit();
593 print
'<table class="border" summary="form to subscribe" id="tablesubscribe">'.
"\n";
597 $listoftype = $adht->liste_array();
598 $tmp = array_keys($listoftype);
601 if (count($listoftype) == 1) {
602 $defaulttype = $tmp[0];
605 print
'<tr><td class="titlefield classfortooltip" title="'.dol_escape_htmltag($messagemandatory).
'">'.$langs->trans(
"Type").
' <span class="star">*</span></td><td>';
606 print $form->selectarray(
"typeid", $adht->liste_array(1),
GETPOST(
'typeid') ?
GETPOST(
'typeid') : $defaulttype, $isempty);
607 print
'</td></tr>'.
"\n";
610 print
'<input type="hidden" id="typeid" name="typeid" value="' .
getDolGlobalString(
'MEMBER_NEWFORM_FORCETYPE').
'">';
615 $morphys[
"phy"] = $langs->trans(
"Physical");
616 $morphys[
"mor"] = $langs->trans(
"Moral");
618 print
'<tr class="morphy"><td class="titlefield classfortooltip" title="'.dol_escape_htmltag($messagemandatory).
'">'.$langs->trans(
'MemberNature').
' <span class="star">*</span></td><td>'.
"\n";
619 print $form->selectarray(
"morphy", $morphys,
GETPOST(
'morphy'), 1);
620 print
'</td></tr>'.
"\n";
623 print
'<input type="hidden" id="morphy" name="morphy" value="' .
getDolGlobalString(
'MEMBER_NEWFORM_FORCEMORPHY').
'">';
627 print
'<tr id="trcompany" class="trcompany"><td>'.$langs->trans(
"Company").
'</td><td>';
628 print
img_picto(
'',
'company',
'class="pictofixedwidth paddingright"');
629 print
'<input type="text" name="societe" class="minwidth150 widthcentpercentminusx" value="'.dol_escape_htmltag(
GETPOST(
'societe')).
'"></td></tr>'.
"\n";
633 print
'<tr><td class="titlefield">'.$langs->trans(
'UserTitle').
'</td><td>';
634 print $formcompany->select_civility(
GETPOST(
'civility_id'),
'civility_id').
'</td></tr>'.
"\n";
638 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";
641 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";
644 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>';
646 print
'<input type="email" name="email" maxlength="255" class="minwidth200" value="'.dol_escape_htmltag(
GETPOST(
'email',
"aZ09arobase")).
'"></td></tr>'.
"\n";
650 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";
651 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";
652 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";
656 print
'<tr><td>'.$langs->trans(
"Gender").
'</td>';
658 $arraygender = array(
'man' => $langs->trans(
"Genderman"),
'woman' => $langs->trans(
"Genderwoman"),
'other' => $langs->trans(
"Genderother"));
659 print $form->selectarray(
'gender', $arraygender,
GETPOST(
'gender',
'alphanohtml'), 1, 0, 0,
'', 0, 0, 0,
'',
'', 1);
663 print
'<tr><td>'.$langs->trans(
"Address").
'</td><td>'.
"\n";
664 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";
667 print
'<tr><td>'.$langs->trans(
'Zip').
' / '.$langs->trans(
'Town').
'</td><td>';
668 print $formcompany->select_ziptown(
GETPOST(
'zipcode'),
'zipcode', array(
'town',
'selectcountry_id',
'state_id'), 0, 1,
'',
'width75');
670 print $formcompany->select_ziptown(
GETPOST(
'town'),
'town', array(
'zipcode',
'selectcountry_id',
'state_id'), 0, 1);
674 print
'<tr><td>'.$langs->trans(
'Country').
'</td><td>';
675 print
img_picto(
'',
'country',
'class="pictofixedwidth paddingright"');
678 $country_id =
getCountry(
$conf->global->MEMBER_NEWFORM_FORCECOUNTRYCODE,
'2', $db, $langs);
680 if (!$country_id && !empty(
$conf->geoipmaxmind->enabled)) {
684 $new_country_id =
getCountry($country_code,
'3', $db, $langs);
686 if ($new_country_id) {
687 $country_id = $new_country_id;
691 $country_code =
getCountry($country_id,
'2', $db, $langs);
692 print $form->select_country($country_id,
'country_id');
697 print
'<tr><td>'.$langs->trans(
'State').
'</td><td>';
699 print
img_picto(
'',
'state',
'class="pictofixedwidth paddingright"');
700 print $formcompany->select_state(
GETPOST(
"state_id"), $country_code);
706 print
'<tr id="trbirth" class="trbirth"><td>'.$langs->trans(
"DateOfBirth").
'</td><td>';
707 print $form->selectDate(!empty($birthday) ? $birthday :
"",
'birth', 0, 0, 1,
"newmember", 1, 0);
708 print
'</td></tr>'.
"\n";
711 print
'<tr><td>'.$langs->trans(
"URLPhoto").
'</td><td><input type="text" name="photo" class="minwidth200" value="'.
dol_escape_htmltag(
GETPOST(
'photo')).
'"></td></tr>'.
"\n";
715 $linkofpubliclist = DOL_MAIN_URL_ROOT.
'/public/members/public_list.php'.((isModEnabled(
'multicompany')) ?
'?entity='.
$conf->entity :
'');
716 $publiclabel = $langs->trans(
"Public",
getDolGlobalString(
'MAIN_INFO_SOCIETE_NOM'), $linkofpubliclist);
717 print
'<tr><td>'.$form->textwithpicto($langs->trans(
"MembershipPublic"), $publiclabel).
'</td><td><input type="checkbox" name="public"></td></tr>'.
"\n";
721 $parameters[
'tpl_context'] =
'public';
722 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_add.tpl.php';
726 print
'<td class="tdtop">'.$langs->trans(
"Comments").
'</td>';
727 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>';
733 $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+');
734 print
'<tr id="trbudget" class="trcompany"><td>'.$langs->trans(
"TurnoverOrBudget").
' <span class="star">*</span></td><td>';
735 print $form->selectarray(
'budget', $arraybudget,
GETPOST(
'budget'), 1);
738 print
'<script type="text/javascript">
739 jQuery(document).ready(function () {
741 jQuery("#morphy").change(function() {
744 jQuery("#budget").change(function() {
745 if (jQuery("#budget").val() > 0) { jQuery(".amount").val(jQuery("#budget").val()); }
746 else { jQuery("#budget").val(\'\'); }
748 /*jQuery("#typeid").change(function() {
749 if (jQuery("#typeid").val()==1) { jQuery("#morphy").val(\'mor\'); }
750 if (jQuery("#typeid").val()==2) { jQuery("#morphy").val(\'phy\'); }
751 if (jQuery("#typeid").val()==3) { jQuery("#morphy").val(\'mor\'); }
752 if (jQuery("#typeid").val()==4) { jQuery("#morphy").val(\'mor\'); }
755 function initturnover() {
756 console.log("Switch mor/phy");
757 if (jQuery("#morphy").val()==\'phy\') {
758 jQuery(".amount").val(20);
759 jQuery("#trbudget").hide();
760 jQuery("#trcompany").hide();
762 if (jQuery("#morphy").val()==\'mor\') {
763 jQuery(".amount").val(\'\');
764 jQuery("#trcompany").show();
765 jQuery("#trbirth").hide();
766 jQuery("#trbudget").show();
767 jQuery(".hideifautoturnover").hide();
768 if (jQuery("#budget").val() > 0) { jQuery(".amount").val(jQuery("#budget").val()); }
769 else { jQuery("#budget").val(\'\'); }
774 print
'</td></tr>'.
"\n";
780 $adht->fetch($typeid);
781 $caneditamount = $adht->caneditamount;
782 $amountbytype = $adht->amountByType(1);
786 $amount = empty($amountbytype[$typeid]) ? 0 : $amountbytype[$typeid];
792 if (empty($amount)) {
796 $amount = max(0, (
float) $amount, (
float)
getDolGlobalInt(
"MEMBER_MIN_AMOUNT"));
800 $showedamount = $amount > 0 ? $amount : 0;
802 print
'<tr><td>'.$langs->trans(
"Subscription");
804 print
' - <a href="' .
getDolGlobalString(
'MEMBER_EXT_URL_SUBSCRIPTION_INFO').
'" rel="external" target="_blank" rel="noopener noreferrer">'.$langs->trans(
"SeeHere").
'</a>';
806 print
'</td><td class="nowrap">';
812 if ($caneditamount) {
813 print
'<input type="text" name="amount" id="amount" class="flat amount width50" value="'.$showedamount.
'">';
814 print
' '.$langs->trans(
"Currency".
$conf->currency).
'<span class="opacitymedium hideifautoturnover"> - ';
815 print $amount > 0 ? $langs->trans(
"AnyAmountWithAdvisedAmount",
price($amount, 0, $langs, 1, -1, -1,
$conf->currency)) : $langs->trans(
"AnyAmountWithoutAdvisedAmount");
818 print
'<input type="hidden" name="amount" id="amount" class="flat amount" value="'.$showedamount.
'">';
819 print
'<input type="text" name="amount" id="amounthidden" class="flat amount width50" disabled value="'.$showedamount.
'">';
820 print
' '.$langs->trans(
"Currency".
$conf->currency);
827 require_once DOL_DOCUMENT_ROOT.
'/core/lib/security2.lib.php';
828 print
'<tr><td class="titlefield"><label><span class="fieldrequired">'.$langs->trans(
"SecurityCode").
'</span></label></td><td>';
829 print
'<span class="span-icon-security inline-block">';
830 print
'<input id="securitycode" placeholder="'.$langs->trans(
"SecurityCode").
'" class="flat input-icon-security width150" type="text" maxlength="5" name="code" tabindex="3" />';
832 print
'<span class="nowrap inline-block">';
833 print
'<img class="inline-block valignmiddle" src="'.DOL_URL_ROOT.
'/core/antispamimage.php" border="0" width="80" height="32" id="img_securitycode" />';
834 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>';
844 print
'<div class="center">';
845 print
'<input type="submit" value="'.$langs->trans(
"GetMembershipButtonLabel").
'" id="submitsave" class="button">';
846 if (!empty($backtopage)) {
847 print
' <input type="submit" value="'.$langs->trans(
"Cancel").
'" id="submitcancel" class="button button-cancel">';
854 print
'</div></div>';
857 $measuringUnits =
new CUnits($db);
858 $result = $measuringUnits->fetchAll(
'',
'', 0, 0, array(
't.active' => 1));
860 foreach ($measuringUnits->records as $lines) {
861 $units[$lines->short_label] = $langs->trans(ucfirst($lines->label));
867 $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,";
868 $sql .=
" COUNT(a.rowid) AS membercount";
869 $sql .=
" FROM ".MAIN_DB_PREFIX.
"adherent_type as d";
870 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"adherent as a";
871 $sql .=
" ON d.rowid = a.fk_adherent_type AND a.statut > 0";
872 $sql .=
" WHERE d.entity IN (".getEntity(
'member_type').
")";
873 $sql .=
" AND d.statut=1";
874 $sql .=
" GROUP BY d.rowid, d.libelle, d.subscription, d.amount, d.caneditamount, d.vote, d.note, d.duration, d.statut, d.morphy";
876 $result = $db->query($sql);
878 $num = $db->num_rows($result);
880 print
'<br><div class="div-table-responsive">';
881 print
'<table class="tagtable liste">'.
"\n";
882 print
'<input type="hidden" name="action" value="create">';
884 print
'<tr class="liste_titre">';
885 print
'<th>'.$langs->trans(
"Label").
'</th>';
886 print
'<th class="center">'.$langs->trans(
"MembershipDuration").
'</th>';
887 print
'<th class="center">'.$langs->trans(
"Amount").
'</th>';
888 print
'<th class="center">'.$langs->trans(
"MembersNature").
'</th>';
889 if (empty($hidevoteallowed)) {
890 print
'<th class="center">'.$langs->trans(
"VoteAllowed").
'</th>';
892 if ($publiccounters) {
893 print
'<th class="center">'.$langs->trans(
"Members").
'</th>';
895 print
'<th class="center">'.$langs->trans(
"NewSubscription").
'</th>';
900 $objp = $db->fetch_object($result);
902 $caneditamount = $objp->caneditamount;
903 $amountbytype = $adht->amountByType(1);
905 print
'<tr class="oddeven">';
907 print
'<td>'.dol_escape_htmltag($objp->label).
'</td>';
909 print
'<td class="center">';
910 $unit = preg_replace(
"/[^a-zA-Z]+/",
"", $objp->duration);
911 print max(1, intval($objp->duration)).
' '.$units[$unit];
914 print
'<td class="center"><span class="amount nowrap">';
918 $amount = empty($amountbytype[$objp->rowid]) ? 0 : $amountbytype[$objp->rowid];
924 if (empty($amount)) {
928 $amount = max(0, (
float) $amount, (
float)
getDolGlobalInt(
"MEMBER_MIN_AMOUNT"));
930 $displayedamount = $amount;
932 if ($objp->subscription) {
933 if ($displayedamount > 0 || !$caneditamount) {
934 print
price($displayedamount, 1, $langs, 1, 0, -1,
$conf->currency);
936 if ($caneditamount && $displayedamount > 0) {
937 print $form->textwithpicto(
'', $langs->transnoentities(
"CanEditAmountShortForValues"), 1,
'help',
'', 0, 3);
938 } elseif ($caneditamount) {
939 print $langs->transnoentities(
"CanEditAmountShort");
944 print
'</span></td>';
945 print
'<td class="center">';
946 if ($objp->morphy ==
'phy') {
947 print $langs->trans(
"Physical");
948 } elseif ($objp->morphy ==
'mor') {
949 print $langs->trans(
"Moral");
951 print $langs->trans(
"MorAndPhy");
954 if (empty($hidevoteallowed)) {
955 print
'<td class="center">'.yn($objp->vote).
'</td>';
957 $membercount = $objp->membercount > 0 ? $objp->membercount :
"–";
958 if ($publiccounters) {
959 print
'<td class="center">'.$membercount.
'</td>';
961 print
'<td class="center"><button class="button button-save reposition" name="typeid" type="submit" name="submit" value="'.$objp->rowid.
'">'.$langs->trans(
"GetMembershipButtonLabel").
'</button></td>';
969 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.