42 if (!defined(
'NOLOGIN')) {
45 if (!defined(
'NOCSRFCHECK')) {
46 define(
"NOCSRFCHECK", 1);
48 if (!defined(
'NOIPCHECK')) {
49 define(
'NOIPCHECK',
'1');
51 if (!defined(
'NOBROWSERNOTIF')) {
52 define(
'NOBROWSERNOTIF',
'1');
54 if (!defined(
'NOIPCHECK')) {
55 define(
'NOIPCHECK',
'1');
60 $entity = (!empty($_GET[
'entity']) ? (int) $_GET[
'entity'] : (!empty($_POST[
'entity']) ? (int) $_POST[
'entity'] : 1));
61 if (is_numeric($entity)) {
62 define(
"DOLENTITY", $entity);
65 require
'../../main.inc.php';
66 require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
67 require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent.class.php';
68 require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent_type.class.php';
69 require_once DOL_DOCUMENT_ROOT.
'/core/class/extrafields.class.php';
70 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcompany.class.php';
76 $backtopage =
GETPOST(
'backtopage',
'alpha');
77 $action =
GETPOST(
'action',
'aZ09');
80 $langs->loadLangs(array(
"main",
"members",
"companies",
"install",
"other"));
83 if (empty($conf->adherent->enabled)) {
87 if (empty($conf->global->MEMBER_ENABLE_PUBLIC)) {
88 print $langs->trans(
"Auto subscription form for public visitors has not been enabled");
93 $hookmanager->initHooks(array(
'publicnewmembercard',
'globalcard'));
99 $user->loadDefaultValues();
113 function llxHeaderVierge($title, $head =
"", $disablejs = 0, $disablehead = 0, $arrayofjs =
'', $arrayofcss =
'')
115 global $user, $conf, $langs, $mysoc;
117 top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss);
119 print
'<body id="mainbody" class="publicnewmemberform">';
122 $urllogo = DOL_URL_ROOT.
'/theme/common/login_logo.png';
124 if (!empty($mysoc->logo_small) && is_readable($conf->mycompany->dir_output.
'/logos/thumbs/'.$mysoc->logo_small)) {
125 $urllogo = DOL_URL_ROOT.
'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode(
'logos/thumbs/'.$mysoc->logo_small);
126 } elseif (!empty($mysoc->logo) && is_readable($conf->mycompany->dir_output.
'/logos/'.$mysoc->logo)) {
127 $urllogo = DOL_URL_ROOT.
'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode(
'logos/'.$mysoc->logo);
128 } elseif (is_readable(DOL_DOCUMENT_ROOT.
'/theme/dolibarr_logo.svg')) {
129 $urllogo = DOL_URL_ROOT.
'/theme/dolibarr_logo.svg';
132 print
'<div class="center">';
136 print
'<div class="backgreypublicpayment">';
137 print
'<div class="logopublicpayment">';
138 print
'<img id="dolpaymentlogo" src="'.$urllogo.
'">';
140 if (empty($conf->global->MAIN_HIDE_POWERED_BY)) {
141 print
'<div class="poweredbypublicpayment opacitymedium right"><a class="poweredbyhref" href="https://www.dolibarr.org?utm_medium=website&utm_source=poweredby" target="dolibarr" rel="noopener">'.$langs->trans(
"PoweredBy").
'<br><img class="poweredbyimg" src="'.DOL_URL_ROOT.
'/theme/dolibarr_logo.svg" width="80px"></a></div>';
146 if (!empty($conf->global->MEMBER_IMAGE_PUBLIC_REGISTRATION)) {
147 print
'<div class="backimagepublicregistration">';
148 print
'<img id="idEVENTORGANIZATION_IMAGE_PUBLIC_INTERFACE" src="'.$conf->global->MEMBER_IMAGE_PUBLIC_REGISTRATION.
'">';
154 print
'<div class="divmainbodylarge">';
178 $parameters = array();
180 $reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
186 if (empty($reshook) && $action ==
'add') {
193 if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) {
196 $errmsg .= $langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Login")).
"<br>\n";
198 $sql =
"SELECT login FROM ".MAIN_DB_PREFIX.
"adherent WHERE login='".$db->escape(
GETPOST(
'login')).
"'";
199 $result = $db->query($sql);
201 $num = $db->num_rows($result);
205 $langs->load(
"errors");
206 $errmsg .= $langs->trans(
"ErrorLoginAlreadyExists").
"<br>\n";
210 $langs->load(
"errors");
211 $errmsg .= $langs->trans(
"ErrorPasswordsMustMatch").
"<br>\n";
215 $errmsg .= $langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"EMail")).
"<br>\n";
220 $errmsg .= $langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Type")).
"<br>\n";
222 if (!in_array(
GETPOST(
'morphy'), array(
'mor',
'phy'))) {
224 $errmsg .= $langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
'Nature')).
"<br>\n";
228 $errmsg .= $langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Lastname")).
"<br>\n";
232 $errmsg .= $langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Firstname")).
"<br>\n";
234 if (!empty($conf->global->ADHERENT_MAIL_REQUIRED) && empty(
GETPOST(
'email'))) {
236 $errmsg .= $langs->trans(
'ErrorFieldRequired', $langs->transnoentitiesnoconv(
'Email')).
"<br>\n";
238 $langs->load(
'errors');
240 $errmsg .= $langs->trans(
"ErrorBadEMail",
GETPOST(
"email")).
"<br>\n";
242 $birthday =
dol_mktime(
GETPOST(
"birthhour",
'int'),
GETPOST(
"birthmin",
'int'),
GETPOST(
"birthsec",
'int'),
GETPOST(
"birthmonth",
'int'),
GETPOST(
"birthday",
'int'),
GETPOST(
"birthyear",
'int'));
243 if (
GETPOST(
"birthmonth") && empty($birthday)) {
245 $langs->load(
"errors");
246 $errmsg .= $langs->trans(
"ErrorBadDateFormat").
"<br>\n";
248 if (!empty($conf->global->MEMBER_NEWFORM_DOLIBARRTURNOVER)) {
251 $errmsg .= $langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"TurnoverOrBudget")).
"<br>\n";
261 $adh->public = $public;
262 $adh->firstname =
GETPOST(
'firstname');
263 $adh->lastname =
GETPOST(
'lastname');
264 $adh->gender =
GETPOST(
'gender');
265 $adh->civility_id =
GETPOST(
'civility_id');
266 $adh->societe =
GETPOST(
'societe');
267 $adh->address =
GETPOST(
'address');
268 $adh->zip =
GETPOST(
'zipcode');
270 $adh->email =
GETPOST(
'email');
271 if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) {
272 $adh->login =
GETPOST(
'login');
275 $adh->photo =
GETPOST(
'photo');
276 $adh->country_id = $conf->global->MEMBER_NEWFORM_FORCECOUNTRYCODE ? $conf->global->MEMBER_NEWFORM_FORCECOUNTRYCODE :
GETPOST(
'country_id',
'int');
277 $adh->state_id =
GETPOST(
'state_id',
'int');
278 $adh->typeid = $conf->global->MEMBER_NEWFORM_FORCETYPE ? $conf->global->MEMBER_NEWFORM_FORCETYPE :
GETPOST(
'typeid',
'int');
279 $adh->note_private =
GETPOST(
'note_private');
280 $adh->morphy = $conf->global->MEMBER_NEWFORM_FORCEMORPHY ? $conf->global->MEMBER_NEWFORM_FORCEMORPHY :
GETPOST(
'morphy');
281 $adh->birth = $birthday;
285 $extrafields->fetch_name_optionals_label($adh->table_element);
286 $ret = $extrafields->setOptionalsFromPost(
null, $adh);
292 $result = $adh->create($user);
294 require_once DOL_DOCUMENT_ROOT.
'/core/class/CMailFile.class.php';
298 $adht->fetch($object->typeid);
300 if ($object->email) {
305 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formmail.class.php';
309 $outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang);
311 $outputlangs->loadLangs(array(
"main",
"members"));
313 $arraydefaultmessage =
null;
314 $labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_AUTOREGISTER;
316 if (!empty($labeltouse)) {
317 $arraydefaultmessage = $formmail->getEMailTemplate($db,
'member', $user, $outputlangs, 0, 1, $labeltouse);
320 if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) {
321 $subject = $arraydefaultmessage->topic;
322 $msg = $arraydefaultmessage->content;
330 if ($subjecttosend && $texttosend) {
331 $moreinheader =
'X-Dolibarr-Info: send_an_email by public/members/new.php'.
"\r\n";
333 $result = $object->send_an_email($texttosend, $subjecttosend, array(), array(), array(),
"",
"", 0, -1,
'', $moreinheader);
342 if (!empty($conf->global->MAIN_INFO_SOCIETE_MAIL) && !empty($conf->global->ADHERENT_AUTOREGISTER_NOTIF_MAIL_SUBJECT) &&
343 !empty($conf->global->ADHERENT_AUTOREGISTER_NOTIF_MAIL)) {
345 $appli = constant(
'DOL_APPLICATION_TITLE');
346 if (!empty($conf->global->MAIN_APPLICATION_TITLE)) {
347 $appli = $conf->global->MAIN_APPLICATION_TITLE;
348 if (preg_match(
'/\d\.\d/', $appli)) {
349 if (!preg_match(
'/'.preg_quote(DOL_VERSION).
'/', $appli)) {
350 $appli .=
" (".DOL_VERSION.
")";
353 $appli .=
" ".DOL_VERSION;
356 $appli .=
" ".DOL_VERSION;
359 $to = $adh->makeSubstitution($conf->global->MAIN_INFO_SOCIETE_MAIL);
360 $from = $conf->global->ADHERENT_MAIL_FROM;
362 '['.$appli.
'] '.$conf->global->ADHERENT_AUTOREGISTER_NOTIF_MAIL_SUBJECT,
365 $adh->makeSubstitution($conf->global->ADHERENT_AUTOREGISTER_NOTIF_MAIL),
375 if (!$mailfile->sendfile()) {
376 dol_syslog($langs->trans(
"ErrorFailedToSendMail", $from, $to), LOG_ERR);
380 if (!empty($backtopage)) {
381 $urlback = $backtopage;
382 } elseif (!empty($conf->global->MEMBER_URL_REDIRECT_SUBSCRIPTION)) {
383 $urlback = $conf->global->MEMBER_URL_REDIRECT_SUBSCRIPTION;
386 $urlback = $_SERVER[
"PHP_SELF"].
"?action=added&token=".
newToken();
389 if (!empty($conf->global->MEMBER_NEWFORM_PAYONLINE) && $conf->global->MEMBER_NEWFORM_PAYONLINE !=
'-1') {
390 if (empty($conf->global->MEMBER_NEWFORM_EDITAMOUNT)) {
395 $urlback = getOnlinePaymentUrl(0,
'member', $adh->ref,
price2num(
GETPOST(
'amount',
'alpha'),
'MT'),
'', 0);
398 $urlback .=
'&email='.urlencode(
GETPOST(
'email'));
400 if ($conf->global->MEMBER_NEWFORM_PAYONLINE !=
'-1' && $conf->global->MEMBER_NEWFORM_PAYONLINE !=
'all') {
401 $urlback .=
'&paymentmethod='.urlencode($conf->global->MEMBER_NEWFORM_PAYONLINE);
404 if (!empty($entity)) {
405 $urlback .=
'&entity='.((int) $entity);
409 dol_syslog(
"member ".$adh->ref.
" was created, we redirect to ".$urlback);
412 $errmsg .= join(
'<br>', $adh->errors);
420 Header(
"Location: ".$urlback);
430 if (empty($reshook) && $action ==
'added') {
435 print
'<div class="center">';
436 print $langs->trans(
"NewMemberbyWeb");
452 $extrafields->fetch_name_optionals_label($object->table_element);
458 print
load_fiche_titre($langs->trans(
"NewSubscription"),
'',
'', 0, 0,
'center');
461 print
'<div align="center">';
462 print
'<div id="divsubscribe">';
464 print
'<div class="center subscriptionformhelptext justify">';
465 if (!empty($conf->global->MEMBER_NEWFORM_TEXT)) {
466 print $langs->trans($conf->global->MEMBER_NEWFORM_TEXT).
"<br>\n";
468 print $langs->trans(
"NewSubscriptionDesc", $conf->global->MAIN_INFO_SOCIETE_MAIL).
"<br>\n";
476 print
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="POST" name="newmember">'.
"\n";
477 print
'<input type="hidden" name="token" value="'.newToken().
'" / >';
478 print
'<input type="hidden" name="entity" value="'.$entity.
'" />';
479 print
'<input type="hidden" name="action" value="add" />';
480 print
'<input type="hidden" name="page_y" value="" />';
484 print
'<br><span class="opacitymedium">'.$langs->trans(
"FieldsWithAreMandatory",
'*').
'</span><br>';
489 print
'<script type="text/javascript">
490 jQuery(document).ready(function () {
491 jQuery(document).ready(function () {
492 function initmorphy()
494 console.log("Call initmorphy");
495 if (jQuery("#morphy").val() == \'phy\') {
496 jQuery("#trcompany").hide();
498 if (jQuery("#morphy").val() == \'mor\') {
499 jQuery("#trcompany").show();
503 jQuery("#morphy").change(function() {
506 jQuery("#selectcountry_id").change(function() {
507 document.newmember.action.value="create";
508 document.newmember.submit();
510 jQuery("#typeid").change(function() {
511 document.newmember.action.value="create";
512 document.newmember.submit();
519 print
'<table class="border" summary="form to subscribe" id="tablesubscribe">'.
"\n";
522 if (empty($conf->global->MEMBER_NEWFORM_FORCETYPE)) {
523 $listoftype = $adht->liste_array();
524 $tmp = array_keys($listoftype);
527 if (count($listoftype) == 1) {
528 $defaulttype = $tmp[0];
531 print
'<tr><td class="titlefield">'.$langs->trans(
"Type").
' <span style="color: red">*</span></td><td>';
532 print
$form->selectarray(
"typeid", $adht->liste_array(1),
GETPOST(
'typeid') ?
GETPOST(
'typeid') : $defaulttype, $isempty);
533 print
'</td></tr>'.
"\n";
535 $adht->fetch($conf->global->MEMBER_NEWFORM_FORCETYPE);
536 print
'<input type="hidden" id="typeid" name="typeid" value="'.$conf->global->MEMBER_NEWFORM_FORCETYPE.
'">';
540 $morphys[
"phy"] = $langs->trans(
"Physical");
541 $morphys[
"mor"] = $langs->trans(
"Moral");
542 if (empty($conf->global->MEMBER_NEWFORM_FORCEMORPHY)) {
543 print
'<tr class="morphy"><td class="titlefield">'.$langs->trans(
'MemberNature').
' <span style="color: red">*</span></td><td>'.
"\n";
544 print
$form->selectarray(
"morphy", $morphys,
GETPOST(
'morphy'), 1);
545 print
'</td></tr>'.
"\n";
547 print
'<input type="hidden" id="morphy" name="morphy" value="'.$conf->global->MEMBER_NEWFORM_FORCEMORPHY.
'">';
551 print
'<tr id="trcompany" class="trcompany"><td>'.$langs->trans(
"Company").
'</td><td>';
552 print
img_picto(
'',
'company',
'class="pictofixedwidth"');
553 print
'<input type="text" name="societe" class="minwidth150 widthcentpercentminusx" value="'.dol_escape_htmltag(
GETPOST(
'societe')).
'"></td></tr>'.
"\n";
555 print
'<tr><td class="titlefield">'.$langs->trans(
'UserTitle').
'</td><td>';
556 print $formcompany->select_civility(
GETPOST(
'civility_id'),
'civility_id').
'</td></tr>'.
"\n";
558 print
'<tr><td>'.$langs->trans(
"Lastname").
' <span style="color: red">*</span></td><td><input type="text" name="lastname" class="minwidth150" value="'.
dol_escape_htmltag(
GETPOST(
'lastname')).
'"></td></tr>'.
"\n";
560 print
'<tr><td>'.$langs->trans(
"Firstname").
' <span style="color: red">*</span></td><td><input type="text" name="firstname" class="minwidth150" value="'.
dol_escape_htmltag(
GETPOST(
'firstname')).
'"></td></tr>'.
"\n";
562 print
'<tr><td>'.$langs->trans(
"Email").($conf->global->ADHERENT_MAIL_REQUIRED ?
' <span style="color:red;">*</span>' :
'').
'</td><td>';
564 print
'<input type="text" name="email" maxlength="255" class="minwidth200" value="'.dol_escape_htmltag(
GETPOST(
'email')).
'"></td></tr>'.
"\n";
566 if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) {
567 print
'<tr><td>'.$langs->trans(
"Login").
' <span style="color: red">*</span></td><td><input type="text" name="login" maxlength="50" class="minwidth100"value="'.
dol_escape_htmltag(
GETPOST(
'login')).
'"></td></tr>'.
"\n";
568 print
'<tr><td>'.$langs->trans(
"Password").
' <span style="color: red">*</span></td><td><input type="password" maxlength="128" name="pass1" class="minwidth100" value="'.
dol_escape_htmltag(
GETPOST(
"pass1",
"none", 2)).
'"></td></tr>'.
"\n";
569 print
'<tr><td>'.$langs->trans(
"PasswordRetype").
' <span style="color: red">*</span></td><td><input type="password" maxlength="128" name="pass2" class="minwidth100" value="'.
dol_escape_htmltag(
GETPOST(
"pass2",
"none", 2)).
'"></td></tr>'.
"\n";
572 print
'<tr><td>'.$langs->trans(
"Gender").
'</td>';
574 $arraygender = array(
'man'=>$langs->trans(
"Genderman"),
'woman'=>$langs->trans(
"Genderwoman"));
575 print
$form->selectarray(
'gender', $arraygender,
GETPOST(
'gender') ?
GETPOST(
'gender') : $object->gender, 1);
578 print
'<tr><td>'.$langs->trans(
"Address").
'</td><td>'.
"\n";
579 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";
581 print
'<tr><td>'.$langs->trans(
'Zip').
' / '.$langs->trans(
'Town').
'</td><td>';
582 print $formcompany->select_ziptown(
GETPOST(
'zipcode'),
'zipcode', array(
'town',
'selectcountry_id',
'state_id'), 0, 1,
'',
'width75');
584 print $formcompany->select_ziptown(
GETPOST(
'town'),
'town', array(
'zipcode',
'selectcountry_id',
'state_id'), 0, 1);
587 print
'<tr><td>'.$langs->trans(
'Country').
'</td><td>';
588 print
img_picto(
'',
'country',
'class="pictofixedwidth"');
589 $country_id =
GETPOST(
'country_id',
'int');
590 if (!$country_id && !empty($conf->global->MEMBER_NEWFORM_FORCECOUNTRYCODE)) {
591 $country_id =
getCountry($conf->global->MEMBER_NEWFORM_FORCECOUNTRYCODE, 2, $db, $langs);
593 if (!$country_id && !empty($conf->geoipmaxmind->enabled)) {
597 $new_country_id =
getCountry($country_code, 3, $db, $langs);
599 if ($new_country_id) {
600 $country_id = $new_country_id;
604 $country_code =
getCountry($country_id, 2, $db, $langs);
605 print
$form->select_country($country_id,
'country_id');
608 if (empty($conf->global->SOCIETE_DISABLE_STATE)) {
609 print
'<tr><td>'.$langs->trans(
'State').
'</td><td>';
611 print $formcompany->select_state(
GETPOST(
"state_id"), $country_code);
616 print
'<tr id="trbirth" class="trbirth"><td>'.$langs->trans(
"DateOfBirth").
'</td><td>';
617 print
$form->selectDate($birthday,
'birth', 0, 0, 1,
"newmember", 1, 0);
618 print
'</td></tr>'.
"\n";
620 print
'<tr><td>'.$langs->trans(
"URLPhoto").
'</td><td><input type="text" name="photo" class="minwidth150" value="'.
dol_escape_htmltag(
GETPOST(
'photo')).
'"></td></tr>'.
"\n";
622 print
'<tr><td>'.$langs->trans(
"Public").
'</td><td><input type="checkbox" name="public"></td></tr>'.
"\n";
624 $tpl_context =
'public';
625 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_add.tpl.php';
628 print
'<td class="tdtop">'.$langs->trans(
"Comments").
'</td>';
629 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>';
634 if (!empty($conf->global->MEMBER_NEWFORM_DOLIBARRTURNOVER)) {
635 $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+');
636 print
'<tr id="trbudget" class="trcompany"><td>'.$langs->trans(
"TurnoverOrBudget").
' <span style="color: red">*</span></td><td>';
637 print
$form->selectarray(
'budget', $arraybudget,
GETPOST(
'budget'), 1);
640 print
'<script type="text/javascript">
641 jQuery(document).ready(function () {
643 jQuery("#morphy").click(function() {
646 jQuery("#budget").change(function() {
647 if (jQuery("#budget").val() > 0) { jQuery(".amount").val(jQuery("#budget").val()); }
648 else { jQuery("#budget").val(\'\'); }
650 /*jQuery("#typeid").change(function() {
651 if (jQuery("#typeid").val()==1) { jQuery("#morphy").val(\'mor\'); }
652 if (jQuery("#typeid").val()==2) { jQuery("#morphy").val(\'phy\'); }
653 if (jQuery("#typeid").val()==3) { jQuery("#morphy").val(\'mor\'); }
654 if (jQuery("#typeid").val()==4) { jQuery("#morphy").val(\'mor\'); }
657 function initturnover() {
658 if (jQuery("#morphy").val()==\'phy\') {
659 jQuery(".amount").val(20);
660 jQuery("#trbudget").hide();
661 jQuery("#trcompany").hide();
663 if (jQuery("#morphy").val()==\'mor\') {
664 jQuery(".amount").val(\'\');
665 jQuery("#trcompany").show();
666 jQuery("#trbirth").hide();
667 jQuery("#trbudget").show();
668 if (jQuery("#budget").val() > 0) { jQuery(".amount").val(jQuery("#budget").val()); }
669 else { jQuery("#budget").val(\'\'); }
674 print
'</td></tr>'.
"\n";
677 if (!empty($conf->global->MEMBER_NEWFORM_PAYONLINE)) {
679 $typeid = $conf->global->MEMBER_NEWFORM_FORCETYPE ? $conf->global->MEMBER_NEWFORM_FORCETYPE :
GETPOST(
'typeid',
'int');
683 $amountbytype = $adht->amountByType(1);
684 $amount = empty($amountbytype[$typeid]) ? (isset($amount) ? $amount : 0) : $amountbytype[$typeid];
686 if (empty($amount) && !empty($conf->global->MEMBER_NEWFORM_AMOUNT)) {
687 $amount = $conf->global->MEMBER_NEWFORM_AMOUNT;
690 if (empty($amount)) {
698 print
'<tr><td>'.$langs->trans(
"Subscription").
'</td><td class="nowrap">';
699 if (!empty($conf->global->MEMBER_NEWFORM_EDITAMOUNT)) {
700 print
'<input type="text" name="amount" id="amount" class="flat amount width50" value="'.$amount.
'">';
702 print
'<input type="text" name="amount" id="amounthidden" class="flat amount width50" disabled value="'.$amount.
'">';
703 print
'<input type="hidden" name="amount" id="amount" class="flat amount" value="'.$amount.
'">';
705 print
' '.$langs->trans(
"Currency".$conf->currency);
714 print
'<div class="center">';
715 print
'<input type="submit" value="'.$langs->trans(
"Submit").
'" id="submitsave" class="button">';
716 if (!empty($backtopage)) {
717 print
' <input type="submit" value="'.$langs->trans(
"Cancel").
'" id="submitcancel" class="button button-cancel">';
724 print
'</div></div>';