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")).
"<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) ===
true && (strtolower($_SESSION[$sessionkey]) == strtolower(
GETPOST(
'code'))));
270 $errmsg .= $langs->trans(
"ErrorBadValueForCode").
"<br>\n";
275 $public = GETPOSTISSET(
'public') ? 1 : 0;
281 $adh->public = $public;
282 $adh->firstname =
GETPOST(
'firstname');
283 $adh->lastname =
GETPOST(
'lastname');
284 $adh->gender =
GETPOST(
'gender');
285 $adh->civility_id =
GETPOST(
'civility_id');
286 $adh->company =
GETPOST(
'societe');
287 $adh->societe = $adh->company;
288 $adh->address =
GETPOST(
'address');
289 $adh->zip =
GETPOST(
'zipcode');
291 $adh->email =
GETPOST(
'email');
293 $adh->login =
GETPOST(
'login');
296 $adh->photo =
GETPOST(
'photo');
300 $adh->note_private =
GETPOST(
'note_private');
302 $adh->birth = $birthday;
306 $nb_post_max =
getDolGlobalInt(
"MAIN_SECURITY_MAX_POST_ON_PUBLIC_PAGES_BY_IP_ADDRESS", 200);
311 if ($nb_post_max > 0) {
312 $sql =
"SELECT COUNT(ref) as nb_adh";
313 $sql .=
" FROM ".MAIN_DB_PREFIX.
"adherent";
314 $sql .=
" WHERE ip = '".$db->escape($adh->ip).
"'";
315 $sql .=
" AND datec > '".$db->idate($minmonthpost).
"'";
316 $resql = $db->query($sql);
318 $num = $db->num_rows($resql);
322 $obj = $db->fetch_object($resql);
323 $nb_post_ip = $obj->nb_adh;
330 $extrafields->fetch_name_optionals_label($adh->table_element);
331 $ret = $extrafields->setOptionalsFromPost(
null, $adh);
334 $errmsg .= $adh->error;
337 if ($nb_post_max > 0 && $nb_post_ip >= $nb_post_max) {
339 $errmsg .= $langs->trans(
"AlreadyTooMuchPostOnThisIPAdress");
340 array_push($adh->errors, $langs->trans(
"AlreadyTooMuchPostOnThisIPAdress"));
344 $result = $adh->create($user);
346 require_once DOL_DOCUMENT_ROOT.
'/core/class/CMailFile.class.php';
357 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formmail.class.php';
361 $outputlangs->setDefaultLang(empty(
$object->thirdparty->default_lang) ? $mysoc->default_lang :
$object->thirdparty->default_lang);
363 $outputlangs->loadLangs(array(
"main",
"members"));
365 $arraydefaultmessage =
null;
368 if (!empty($labeltouse)) {
369 $arraydefaultmessage = $formmail->getEMailTemplate($db,
'member', $user, $outputlangs, 0, 1, $labeltouse);
372 if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) {
373 $subject = $arraydefaultmessage->topic;
374 $msg = $arraydefaultmessage->content;
382 if ($subjecttosend && $texttosend) {
383 $moreinheader =
'X-Dolibarr-Info: send_an_email by public/members/new.php'.
"\r\n";
385 $result =
$object->sendEmail($texttosend, $subjecttosend, array(), array(), array(),
"",
"", 0, -1,
'', $moreinheader);
397 $appli = constant(
'DOL_APPLICATION_TITLE');
400 if (preg_match(
'/\d\.\d/', $appli)) {
401 if (!preg_match(
'/'.preg_quote(DOL_VERSION).
'/', $appli)) {
402 $appli .=
" (".DOL_VERSION.
")";
405 $appli .=
" ".DOL_VERSION;
408 $appli .=
" ".DOL_VERSION;
411 $to = $adh->makeSubstitution($conf->global->MAIN_INFO_SOCIETE_MAIL);
417 $adh->makeSubstitution($conf->global->ADHERENT_AUTOREGISTER_NOTIF_MAIL),
427 if (!$mailfile->sendfile()) {
428 dol_syslog($langs->trans(
"ErrorFailedToSendMail", $from, $to), LOG_ERR);
435 $result = $company->create_from_member($adh);
438 $errmsg .= implode(
'<br>', $company->errors);
442 if (!empty($backtopage)) {
443 $urlback = $backtopage;
448 $urlback = $_SERVER[
"PHP_SELF"].
"?action=added&token=".
newToken();
452 if (empty($adht->caneditamount)) {
457 $urlback = getOnlinePaymentUrl(0,
'member', $adh->ref,
price2num(
GETPOST(
'amount',
'alpha'),
'MT'),
'', 0);
460 $urlback .=
'&email='.urlencode(
GETPOST(
'email'));
463 $urlback .=
'&paymentmethod='.urlencode(
getDolGlobalString(
'MEMBER_NEWFORM_PAYONLINE'));
466 if (!empty($entity)) {
467 $urlback .=
'&entity='.((int) $entity);
472 $errmsg .= implode(
'<br>', $adh->errors);
480 header(
"Location: ".$urlback);
492if (empty($reshook) && $action ==
'added') {
497 print
'<div class="center">';
498 print $langs->trans(
"NewMemberbyWeb");
511$form =
new Form($db);
514$extrafields->fetch_name_optionals_label(
$object->table_element);
520print
load_fiche_titre(
img_picto(
'',
'member_nocolor',
'class="pictofixedwidth"').
' '.$langs->trans(
"NewSubscription"),
'',
'', 0, 0,
'center');
523print
'<div align="center">';
524print
'<div id="divsubscribe">';
526print
'<div class="center subscriptionformhelptext opacitymedium justify">';
530 print $langs->trans(
"NewSubscriptionDesc",
getDolGlobalString(
"MAIN_INFO_SOCIETE_MAIL")).
"<br>\n";
538print
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="POST" name="newmember">'.
"\n";
539print
'<input type="hidden" name="token" value="'.newToken().
'" />';
540print
'<input type="hidden" name="entity" value="'.$entity.
'" />';
541print
'<input type="hidden" name="page_y" value="" />';
544 print
'<input type="hidden" name="action" value="add" />';
547 $messagemandatory =
'<span class="">'.$langs->trans(
"FieldsWithAreMandatory",
'*').
'</span>';
553 print
'<script type="text/javascript">
554 jQuery(document).ready(function () {
555 jQuery(document).ready(function () {
556 function initmorphy()
558 console.log("Call initmorphy");
559 if (jQuery("#morphy").val() == \'phy\') {
560 jQuery("#trcompany").hide();
562 if (jQuery("#morphy").val() == \'mor\') {
563 jQuery("#trcompany").show();
567 jQuery("#morphy").change(function() {
570 jQuery("#selectcountry_id").change(function() {
571 document.newmember.action.value="create";
572 document.newmember.submit();
574 jQuery("#typeid").change(function() {
575 document.newmember.action.value="create";
576 document.newmember.submit();
583 print
'<table class="border" summary="form to subscribe" id="tablesubscribe">'.
"\n";
587 $listoftype = $adht->liste_array();
588 $tmp = array_keys($listoftype);
591 if (count($listoftype) == 1) {
592 $defaulttype = $tmp[0];
595 print
'<tr><td class="titlefield classfortooltip" title="'.dol_escape_htmltag($messagemandatory).
'">'.$langs->trans(
"Type").
' <span class="star">*</span></td><td>';
596 print $form->selectarray(
"typeid", $adht->liste_array(1),
GETPOST(
'typeid') ?
GETPOST(
'typeid') : $defaulttype, $isempty);
597 print
'</td></tr>'.
"\n";
600 print
'<input type="hidden" id="typeid" name="typeid" value="' .
getDolGlobalString(
'MEMBER_NEWFORM_FORCETYPE').
'">';
605 $morphys[
"phy"] = $langs->trans(
"Physical");
606 $morphys[
"mor"] = $langs->trans(
"Moral");
608 print
'<tr class="morphy"><td class="titlefield classfortooltip" title="'.dol_escape_htmltag($messagemandatory).
'">'.$langs->trans(
'MemberNature').
' <span class="star">*</span></td><td>'.
"\n";
609 print $form->selectarray(
"morphy", $morphys,
GETPOST(
'morphy'), 1);
610 print
'</td></tr>'.
"\n";
613 print
'<input type="hidden" id="morphy" name="morphy" value="' .
getDolGlobalString(
'MEMBER_NEWFORM_FORCEMORPHY').
'">';
617 print
'<tr id="trcompany" class="trcompany"><td>'.$langs->trans(
"Company").
'</td><td>';
618 print
img_picto(
'',
'company',
'class="pictofixedwidth paddingright"');
619 print
'<input type="text" name="societe" class="minwidth150 widthcentpercentminusx" value="'.dol_escape_htmltag(
GETPOST(
'societe')).
'"></td></tr>'.
"\n";
623 print
'<tr><td class="titlefield">'.$langs->trans(
'UserTitle').
'</td><td>';
624 print $formcompany->select_civility(
GETPOST(
'civility_id'),
'civility_id').
'</td></tr>'.
"\n";
628 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";
631 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";
634 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>';
636 print
'<input type="text" name="email" maxlength="255" class="minwidth200" value="'.dol_escape_htmltag(
GETPOST(
'email')).
'"></td></tr>'.
"\n";
640 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";
641 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";
642 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";
646 print
'<tr><td>'.$langs->trans(
"Gender").
'</td>';
648 $arraygender = array(
'man' => $langs->trans(
"Genderman"),
'woman' => $langs->trans(
"Genderwoman"),
'other' => $langs->trans(
"Genderother"));
649 print $form->selectarray(
'gender', $arraygender,
GETPOST(
'gender',
'alphanohtml'), 1, 0, 0,
'', 0, 0, 0,
'',
'', 1);
653 print
'<tr><td>'.$langs->trans(
"Address").
'</td><td>'.
"\n";
654 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";
657 print
'<tr><td>'.$langs->trans(
'Zip').
' / '.$langs->trans(
'Town').
'</td><td>';
658 print $formcompany->select_ziptown(
GETPOST(
'zipcode'),
'zipcode', array(
'town',
'selectcountry_id',
'state_id'), 0, 1,
'',
'width75');
660 print $formcompany->select_ziptown(
GETPOST(
'town'),
'town', array(
'zipcode',
'selectcountry_id',
'state_id'), 0, 1);
664 print
'<tr><td>'.$langs->trans(
'Country').
'</td><td>';
665 print
img_picto(
'',
'country',
'class="pictofixedwidth paddingright"');
668 $country_id =
getCountry($conf->global->MEMBER_NEWFORM_FORCECOUNTRYCODE, 2, $db, $langs);
670 if (!$country_id && !empty($conf->geoipmaxmind->enabled)) {
674 $new_country_id =
getCountry($country_code, 3, $db, $langs);
676 if ($new_country_id) {
677 $country_id = $new_country_id;
681 $country_code =
getCountry($country_id, 2, $db, $langs);
682 print $form->select_country($country_id,
'country_id');
687 print
'<tr><td>'.$langs->trans(
'State').
'</td><td>';
689 print
img_picto(
'',
'state',
'class="pictofixedwidth paddingright"');
690 print $formcompany->select_state(
GETPOST(
"state_id"), $country_code);
696 print
'<tr id="trbirth" class="trbirth"><td>'.$langs->trans(
"DateOfBirth").
'</td><td>';
697 print $form->selectDate(!empty($birthday) ? $birthday :
"",
'birth', 0, 0, 1,
"newmember", 1, 0);
698 print
'</td></tr>'.
"\n";
701 print
'<tr><td>'.$langs->trans(
"URLPhoto").
'</td><td><input type="text" name="photo" class="minwidth200" value="'.
dol_escape_htmltag(
GETPOST(
'photo')).
'"></td></tr>'.
"\n";
705 $linkofpubliclist = DOL_MAIN_URL_ROOT.
'/public/members/public_list.php'.((isModEnabled(
'multicompany')) ?
'?entity='.$conf->entity :
'');
706 $publiclabel = $langs->trans(
"Public",
getDolGlobalString(
'MAIN_INFO_SOCIETE_NOM'), $linkofpubliclist);
707 print
'<tr><td>'.$form->textwithpicto($langs->trans(
"MembershipPublic"), $publiclabel).
'</td><td><input type="checkbox" name="public"></td></tr>'.
"\n";
711 $parameters[
'tpl_context'] =
'public';
712 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_add.tpl.php';
716 print
'<td class="tdtop">'.$langs->trans(
"Comments").
'</td>';
717 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>';
723 $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+');
724 print
'<tr id="trbudget" class="trcompany"><td>'.$langs->trans(
"TurnoverOrBudget").
' <span class="star">*</span></td><td>';
725 print $form->selectarray(
'budget', $arraybudget,
GETPOST(
'budget'), 1);
728 print
'<script type="text/javascript">
729 jQuery(document).ready(function () {
731 jQuery("#morphy").change(function() {
734 jQuery("#budget").change(function() {
735 if (jQuery("#budget").val() > 0) { jQuery(".amount").val(jQuery("#budget").val()); }
736 else { jQuery("#budget").val(\'\'); }
738 /*jQuery("#typeid").change(function() {
739 if (jQuery("#typeid").val()==1) { jQuery("#morphy").val(\'mor\'); }
740 if (jQuery("#typeid").val()==2) { jQuery("#morphy").val(\'phy\'); }
741 if (jQuery("#typeid").val()==3) { jQuery("#morphy").val(\'mor\'); }
742 if (jQuery("#typeid").val()==4) { jQuery("#morphy").val(\'mor\'); }
745 function initturnover() {
746 console.log("Switch mor/phy");
747 if (jQuery("#morphy").val()==\'phy\') {
748 jQuery(".amount").val(20);
749 jQuery("#trbudget").hide();
750 jQuery("#trcompany").hide();
752 if (jQuery("#morphy").val()==\'mor\') {
753 jQuery(".amount").val(\'\');
754 jQuery("#trcompany").show();
755 jQuery("#trbirth").hide();
756 jQuery("#trbudget").show();
757 jQuery(".hideifautoturnover").hide();
758 if (jQuery("#budget").val() > 0) { jQuery(".amount").val(jQuery("#budget").val()); }
759 else { jQuery("#budget").val(\'\'); }
764 print
'</td></tr>'.
"\n";
770 $adht->fetch($typeid);
771 $caneditamount = $adht->caneditamount;
772 $amountbytype = $adht->amountByType(1);
776 $amount = empty($amountbytype[$typeid]) ? 0 : $amountbytype[$typeid];
782 if (empty($amount)) {
786 $amount = max(0, (
float) $amount, (
float)
getDolGlobalInt(
"MEMBER_MIN_AMOUNT"));
790 $showedamount = $amount > 0 ? $amount : 0;
792 print
'<tr><td>'.$langs->trans(
"Subscription");
794 print
' - <a href="' .
getDolGlobalString(
'MEMBER_EXT_URL_SUBSCRIPTION_INFO').
'" rel="external" target="_blank" rel="noopener noreferrer">'.$langs->trans(
"SeeHere").
'</a>';
796 print
'</td><td class="nowrap">';
802 if ($caneditamount) {
803 print
'<input type="text" name="amount" id="amount" class="flat amount width50" value="'.$showedamount.
'">';
804 print
' '.$langs->trans(
"Currency".$conf->currency).
'<span class="opacitymedium hideifautoturnover"> - ';
805 print $amount > 0 ? $langs->trans(
"AnyAmountWithAdvisedAmount",
price($amount, 0, $langs, 1, -1, -1, $conf->currency)) : $langs->trans(
"AnyAmountWithoutAdvisedAmount");
808 print
'<input type="hidden" name="amount" id="amount" class="flat amount" value="'.$showedamount.
'">';
809 print
'<input type="text" name="amount" id="amounthidden" class="flat amount width50" disabled value="'.$showedamount.
'">';
810 print
' '.$langs->trans(
"Currency".$conf->currency);
817 require_once DOL_DOCUMENT_ROOT.
'/core/lib/security2.lib.php';
818 print
'<tr><td class="titlefield"><label for="email"><span class="fieldrequired">'.$langs->trans(
"SecurityCode").
'</span></label></td><td>';
819 print
'<span class="span-icon-security inline-block">';
820 print
'<input id="securitycode" placeholder="'.$langs->trans(
"SecurityCode").
'" class="flat input-icon-security width150" type="text" maxlength="5" name="code" tabindex="3" />';
822 print
'<span class="nowrap inline-block">';
823 print
'<img class="inline-block valignmiddle" src="'.DOL_URL_ROOT.
'/core/antispamimage.php" border="0" width="80" height="32" id="img_securitycode" />';
824 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>';
834 print
'<div class="center">';
835 print
'<input type="submit" value="'.$langs->trans(
"GetMembershipButtonLabel").
'" id="submitsave" class="button">';
836 if (!empty($backtopage)) {
837 print
' <input type="submit" value="'.$langs->trans(
"Cancel").
'" id="submitcancel" class="button button-cancel">';
844 print
'</div></div>';
847 $measuringUnits =
new CUnits($db);
848 $result = $measuringUnits->fetchAll(
'',
'', 0, 0, array(
't.active' => 1));
850 foreach ($measuringUnits->records as $lines) {
851 $units[$lines->short_label] = $langs->trans(ucfirst($lines->label));
857 $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,";
858 $sql .=
" COUNT(a.rowid) AS membercount";
859 $sql .=
" FROM ".MAIN_DB_PREFIX.
"adherent_type as d";
860 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"adherent as a";
861 $sql .=
" ON d.rowid = a.fk_adherent_type AND a.statut > 0";
862 $sql .=
" WHERE d.entity IN (".getEntity(
'member_type').
")";
863 $sql .=
" AND d.statut=1";
864 $sql .=
" GROUP BY d.rowid, d.libelle, d.subscription, d.amount, d.caneditamount, d.vote, d.note, d.duration, d.statut, d.morphy";
866 $result = $db->query($sql);
868 $num = $db->num_rows($result);
870 print
'<br><div class="div-table-responsive">';
871 print
'<table class="tagtable liste">'.
"\n";
872 print
'<input type="hidden" name="action" value="create">';
874 print
'<tr class="liste_titre">';
875 print
'<th>'.$langs->trans(
"Label").
'</th>';
876 print
'<th class="center">'.$langs->trans(
"MembershipDuration").
'</th>';
877 print
'<th class="center">'.$langs->trans(
"Amount").
'</th>';
878 print
'<th class="center">'.$langs->trans(
"MembersNature").
'</th>';
879 if (empty($hidevoteallowed)) {
880 print
'<th class="center">'.$langs->trans(
"VoteAllowed").
'</th>';
882 if ($publiccounters) {
883 print
'<th class="center">'.$langs->trans(
"Members").
'</th>';
885 print
'<th class="center">'.$langs->trans(
"NewSubscription").
'</th>';
890 $objp = $db->fetch_object($result);
892 $caneditamount = $objp->caneditamount;
893 $amountbytype = $adht->amountByType(1);
895 print
'<tr class="oddeven">';
897 print
'<td>'.dol_escape_htmltag($objp->label).
'</td>';
899 print
'<td class="center">';
900 $unit = preg_replace(
"/[^a-zA-Z]+/",
"", $objp->duration);
901 print max(1, intval($objp->duration)).
' '.$units[$unit];
904 print
'<td class="center"><span class="amount nowrap">';
908 $amount = empty($amountbytype[$objp->rowid]) ? 0 : $amountbytype[$objp->rowid];
914 if (empty($amount)) {
918 $amount = max(0, (
float) $amount, (
float)
getDolGlobalInt(
"MEMBER_MIN_AMOUNT"));
920 $displayedamount = $amount;
922 if ($objp->subscription) {
923 if ($displayedamount > 0 || !$caneditamount) {
924 print
price($displayedamount, 1, $langs, 1, 0, -1, $conf->currency);
926 if ($caneditamount && $displayedamount > 0) {
927 print $form->textwithpicto(
'', $langs->transnoentities(
"CanEditAmountShortForValues"), 1,
'help',
'', 0, 3);
928 } elseif ($caneditamount) {
929 print $langs->transnoentities(
"CanEditAmountShort");
934 print
'</span></td>';
935 print
'<td class="center">';
936 if ($objp->morphy ==
'phy') {
937 print $langs->trans(
"Physical");
938 } elseif ($objp->morphy ==
'mor') {
939 print $langs->trans(
"Moral");
941 print $langs->trans(
"MorAndPhy");
944 if (empty($hidevoteallowed)) {
945 print
'<td class="center">'.yn($objp->vote).
'</td>';
947 $membercount = $objp->membercount > 0 ? $objp->membercount :
"–";
948 if ($publiccounters) {
949 print
'<td class="center">'.$membercount.
'</td>';
951 print
'<td class="center"><button class="button button-save reposition" name="typeid" type="submit" name="submit" value="'.$objp->rowid.
'">'.$langs->trans(
"GetMembershipButtonLabel").
'</button></td>';
959 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.