40 if (!defined(
'NOLOGIN')) define(
"NOLOGIN", 1);
41 if (!defined(
'NOCSRFCHECK')) define(
"NOCSRFCHECK", 1);
42 if (!defined(
'NOIPCHECK')) define(
'NOIPCHECK',
'1');
43 if (!defined(
'NOBROWSERNOTIF')) define(
'NOBROWSERNOTIF',
'1');
44 if (!defined(
'NOIPCHECK')) define(
'NOIPCHECK',
'1');
49 $entity = (!empty($_GET[
'entity']) ? (int) $_GET[
'entity'] : (!empty($_POST[
'entity']) ? (int) $_POST[
'entity'] : 1));
50 if (is_numeric($entity)) define(
"DOLENTITY", $entity);
52 require
'../../main.inc.php';
53 require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
54 require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent.class.php';
55 require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent_type.class.php';
56 require_once DOL_DOCUMENT_ROOT.
'/core/class/extrafields.class.php';
57 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcompany.class.php';
63 $backtopage =
GETPOST(
'backtopage',
'alpha');
64 $action =
GETPOST(
'action',
'aZ09');
67 $langs->loadLangs(array(
"main",
"members",
"companies",
"install",
"other"));
72 if (empty($conf->global->MEMBER_ENABLE_PUBLIC)) {
73 print $langs->trans(
"Auto subscription form for public visitors has not been enabled");
78 $hookmanager->initHooks(array(
'publicnewmembercard',
'globalcard'));
84 $user->loadDefaultValues();
98 function llxHeaderVierge($title, $head =
"", $disablejs = 0, $disablehead = 0, $arrayofjs =
'', $arrayofcss =
'')
100 global $user, $conf, $langs, $mysoc;
102 top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss);
104 print '<body id="mainbody" class="publicnewmemberform">';
107 $urllogo = DOL_URL_ROOT.
'/theme/common/login_logo.png';
109 if (!empty($mysoc->logo_small) && is_readable($conf->mycompany->dir_output.
'/logos/thumbs/'.$mysoc->logo_small)) {
110 $urllogo = DOL_URL_ROOT.
'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode(
'logos/thumbs/'.$mysoc->logo_small);
111 } elseif (!empty($mysoc->logo) && is_readable($conf->mycompany->dir_output.
'/logos/'.$mysoc->logo)) {
112 $urllogo = DOL_URL_ROOT.
'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode(
'logos/'.$mysoc->logo);
113 } elseif (is_readable(DOL_DOCUMENT_ROOT.
'/theme/dolibarr_logo.svg')) {
114 $urllogo = DOL_URL_ROOT.
'/theme/dolibarr_logo.svg';
117 print '<div class="center">';
120 print '<div class="backgreypublicpayment">';
121 print '<div class="logopublicpayment">';
122 print '<img id="dolpaymentlogo" src="'.$urllogo.
'"';
125 if (empty($conf->global->MAIN_HIDE_POWERED_BY)) {
126 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>';
132 print '<div class="divmainbodylarge">';
155 $parameters = array();
157 $reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
163 if (empty($reshook) && $action ==
'add') {
170 if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) {
173 $errmsg .= $langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Login")).
"<br>\n";
175 $sql =
"SELECT login FROM ".MAIN_DB_PREFIX.
"adherent WHERE login='".$db->escape(
GETPOST(
'login')).
"'";
176 $result = $db->query($sql);
178 $num = $db->num_rows($result);
182 $langs->load(
"errors");
183 $errmsg .= $langs->trans(
"ErrorLoginAlreadyExists").
"<br>\n";
187 $langs->load(
"errors");
188 $errmsg .= $langs->trans(
"ErrorPasswordsMustMatch").
"<br>\n";
192 $errmsg .= $langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"EMail")).
"<br>\n";
197 $errmsg .= $langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Type")).
"<br>\n";
199 if (!in_array(
GETPOST(
'morphy'), array(
'mor',
'phy'))) {
201 $errmsg .= $langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
'Nature')).
"<br>\n";
203 if (empty($_POST[
"lastname"])) {
205 $errmsg .= $langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Lastname")).
"<br>\n";
207 if (empty($_POST[
"firstname"])) {
209 $errmsg .= $langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Firstname")).
"<br>\n";
213 $langs->load(
"errors");
214 $errmsg .= $langs->trans(
"ErrorBadEMail",
GETPOST(
"email")).
"<br>\n";
216 $birthday =
dol_mktime($_POST[
"birthhour"], $_POST[
"birthmin"], $_POST[
"birthsec"], $_POST[
"birthmonth"], $_POST[
"birthday"], $_POST[
"birthyear"]);
217 if ($_POST[
"birthmonth"] && empty($birthday)) {
219 $langs->load(
"errors");
220 $errmsg .= $langs->trans(
"ErrorBadDateFormat").
"<br>\n";
222 if (!empty($conf->global->MEMBER_NEWFORM_DOLIBARRTURNOVER)) {
225 $errmsg .= $langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"TurnoverOrBudget")).
"<br>\n";
229 if (isset($public)) $public = 1;
236 $adh->public = $public;
237 $adh->firstname = $_POST[
"firstname"];
238 $adh->lastname = $_POST[
"lastname"];
239 $adh->gender = $_POST[
"gender"];
240 $adh->civility_id = $_POST[
"civility_id"];
241 $adh->societe = $_POST[
"societe"];
242 $adh->address = $_POST[
"address"];
243 $adh->zip = $_POST[
"zipcode"];
244 $adh->town = $_POST[
"town"];
245 $adh->email = $_POST[
"email"];
246 if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) {
247 $adh->login = $_POST[
"login"];
248 $adh->pass = $_POST[
"pass1"];
250 $adh->photo = $_POST[
"photo"];
251 $adh->country_id = $_POST[
"country_id"];
252 $adh->state_id = $_POST[
"state_id"];
253 $adh->typeid = $_POST[
"type"];
254 $adh->note_private = $_POST[
"note_private"];
255 $adh->morphy = $_POST[
"morphy"];
256 $adh->birth = $birthday;
260 $extrafields->fetch_name_optionals_label($adh->table_element);
261 $ret = $extrafields->setOptionalsFromPost(null, $adh);
262 if ($ret < 0) $error++;
264 $result = $adh->create($user);
266 require_once DOL_DOCUMENT_ROOT.
'/core/class/CMailFile.class.php';
270 $adht->fetch($object->typeid);
272 if ($object->email) {
277 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formmail.class.php';
281 $outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang);
283 $outputlangs->loadLangs(array(
"main",
"members"));
285 $arraydefaultmessage = null;
286 $labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_AUTOREGISTER;
288 if (!empty($labeltouse)) $arraydefaultmessage = $formmail->getEMailTemplate($db,
'member', $user, $outputlangs, 0, 1, $labeltouse);
290 if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) {
291 $subject = $arraydefaultmessage->topic;
292 $msg = $arraydefaultmessage->content;
300 if ($subjecttosend && $texttosend) {
301 $moreinheader =
'X-Dolibarr-Info: send_an_email by public/members/new.php'.
"\r\n";
303 $result = $object->send_an_email($texttosend, $subjecttosend, array(), array(), array(),
"",
"", 0, -1,
'', $moreinheader);
312 if (!empty($conf->global->MAIN_INFO_SOCIETE_MAIL) && !empty($conf->global->ADHERENT_AUTOREGISTER_NOTIF_MAIL_SUBJECT) &&
313 !empty($conf->global->ADHERENT_AUTOREGISTER_NOTIF_MAIL)) {
315 $appli = constant(
'DOL_APPLICATION_TITLE');
316 if (!empty($conf->global->MAIN_APPLICATION_TITLE)) {
317 $appli = $conf->global->MAIN_APPLICATION_TITLE;
318 if (preg_match(
'/\d\.\d/', $appli)) {
319 if (!preg_match(
'/'.preg_quote(DOL_VERSION).
'/', $appli)) $appli .=
" (".DOL_VERSION.
")";
320 }
else $appli .=
" ".DOL_VERSION;
322 $appli .=
" ".DOL_VERSION;
325 $to = $adh->makeSubstitution($conf->global->MAIN_INFO_SOCIETE_MAIL);
326 $from = $conf->global->ADHERENT_MAIL_FROM;
328 '['.$appli.
'] '.$conf->global->ADHERENT_AUTOREGISTER_NOTIF_MAIL_SUBJECT,
331 $adh->makeSubstitution($conf->global->ADHERENT_AUTOREGISTER_NOTIF_MAIL),
341 if (!$mailfile->sendfile()) {
342 dol_syslog($langs->trans(
"ErrorFailedToSendMail", $from, $to), LOG_ERR);
346 if (!empty($backtopage)) {
347 $urlback = $backtopage;
348 } elseif (!empty($conf->global->MEMBER_URL_REDIRECT_SUBSCRIPTION)) {
349 $urlback = $conf->global->MEMBER_URL_REDIRECT_SUBSCRIPTION;
352 $urlback =
$_SERVER[
"PHP_SELF"].
"?action=added";
355 if (!empty($conf->global->MEMBER_NEWFORM_PAYONLINE) && $conf->global->MEMBER_NEWFORM_PAYONLINE !=
'-1') {
356 if ($conf->global->MEMBER_NEWFORM_PAYONLINE ==
'all') {
357 $urlback = DOL_MAIN_URL_ROOT.
'/public/payment/newpayment.php?from=membernewform&source=membersubscription&ref='.urlencode($adh->ref);
359 if (
GETPOST(
'email')) $urlback .=
'&email='.urlencode(
GETPOST(
'email'));
360 if (!empty($conf->global->PAYMENT_SECURITY_TOKEN)) {
361 if (!empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) {
362 $urlback .=
'&securekey='.urlencode(
dol_hash($conf->global->PAYMENT_SECURITY_TOKEN.
'membersubscription'.$adh->ref, 2));
364 $urlback .=
'&securekey='.urlencode($conf->global->PAYMENT_SECURITY_TOKEN);
367 } elseif ($conf->global->MEMBER_NEWFORM_PAYONLINE ==
'paybox') {
368 $urlback = DOL_MAIN_URL_ROOT.
'/public/paybox/newpayment.php?from=membernewform&source=membersubscription&ref='.urlencode($adh->ref);
370 if (
GETPOST(
'email')) $urlback .=
'&email='.urlencode(
GETPOST(
'email'));
371 if (!empty($conf->global->PAYMENT_SECURITY_TOKEN)) {
372 if (!empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) {
373 $urlback .=
'&securekey='.urlencode(
dol_hash($conf->global->PAYMENT_SECURITY_TOKEN.
'membersubscription'.$adh->ref, 2));
375 $urlback .=
'&securekey='.urlencode($conf->global->PAYMENT_SECURITY_TOKEN);
378 } elseif ($conf->global->MEMBER_NEWFORM_PAYONLINE ==
'paypal') {
379 $urlback = DOL_MAIN_URL_ROOT.
'/public/paypal/newpayment.php?from=membernewform&source=membersubscription&ref='.urlencode($adh->ref);
381 if (
GETPOST(
'email')) $urlback .=
'&email='.urlencode(
GETPOST(
'email'));
382 if (!empty($conf->global->PAYMENT_SECURITY_TOKEN)) {
383 if (!empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) {
384 $urlback .=
'&securekey='.urlencode(
dol_hash($conf->global->PAYMENT_SECURITY_TOKEN.
'membersubscription'.$adh->ref, 2));
386 $urlback .=
'&securekey='.urlencode($conf->global->PAYMENT_SECURITY_TOKEN);
389 } elseif ($conf->global->MEMBER_NEWFORM_PAYONLINE ==
'stripe') {
390 $urlback = DOL_MAIN_URL_ROOT.
'/public/stripe/newpayment.php?from=membernewform&source=membersubscription&ref='.$adh->ref;
392 if (
GETPOST(
'email')) $urlback .=
'&email='.urlencode(
GETPOST(
'email'));
393 if (!empty($conf->global->PAYMENT_SECURITY_TOKEN)) {
394 if (!empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) {
395 $urlback .=
'&securekey='.urlencode(
dol_hash($conf->global->PAYMENT_SECURITY_TOKEN.
'membersubscription'.$adh->ref, 2));
397 $urlback .=
'&securekey='.urlencode($conf->global->PAYMENT_SECURITY_TOKEN);
401 dol_print_error(
'',
"Autosubscribe form is setup to ask an online payment for a not managed online payment");
406 if (!empty($entity)) $urlback .=
'&entity='.$entity;
407 dol_syslog(
"member ".$adh->ref.
" was created, we redirect to ".$urlback);
410 $errmsg .= join(
'<br>', $adh->errors);
417 Header(
"Location: ".$urlback);
427 if (empty($reshook) && $action ==
'added') {
432 print
'<div class="center">';
433 print $langs->trans(
"NewMemberbyWeb");
446 $form =
new Form($db);
449 $extrafields->fetch_name_optionals_label(
'adherent');
455 print
load_fiche_titre($langs->trans(
"NewSubscription"),
'',
'', 0, 0,
'center');
458 print
'<div align="center">';
459 print
'<div id="divsubscribe">';
461 print
'<div class="center subscriptionformhelptext justify">';
462 if (!empty($conf->global->MEMBER_NEWFORM_TEXT)) {
463 print $langs->trans($conf->global->MEMBER_NEWFORM_TEXT).
"<br>\n";
465 print $langs->trans(
"NewSubscriptionDesc", $conf->global->MAIN_INFO_SOCIETE_MAIL).
"<br>\n";
472 print
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="POST" name="newmember">'.
"\n";
473 print
'<input type="hidden" name="token" value="'.newToken().
'" / >';
474 print
'<input type="hidden" name="entity" value="'.$entity.
'" />';
475 print
'<input type="hidden" name="action" value="add" />';
479 print
'<br><span class="opacitymedium">'.$langs->trans(
"FieldsWithAreMandatory",
'*').
'</span><br>';
484 print
'<script type="text/javascript">
485 jQuery(document).ready(function () {
486 jQuery(document).ready(function () {
487 function initmorphy()
489 if (jQuery("#morphy").val()==\'phy\') {
490 jQuery("#trcompany").hide();
492 if (jQuery("#morphy").val()==\'mor\') {
493 jQuery("#trcompany").show();
497 jQuery("#morphy").click(function() {
500 jQuery("#selectcountry_id").change(function() {
501 document.newmember.action.value="create";
502 document.newmember.submit();
509 print
'<table class="border" summary="form to subscribe" id="tablesubscribe">'.
"\n";
512 if (empty($conf->global->MEMBER_NEWFORM_FORCETYPE)) {
513 $listoftype = $adht->liste_array();
514 $tmp = array_keys($listoftype);
517 if (count($listoftype) == 1) {
518 $defaulttype = $tmp[0];
521 print
'<tr><td class="titlefield">'.$langs->trans(
"Type").
' <FONT COLOR="red">*</FONT></td><td>';
522 print $form->selectarray(
"type", $adht->liste_array(),
GETPOST(
'type') ?
GETPOST(
'type') : $defaulttype, $isempty);
523 print
'</td></tr>'.
"\n";
525 $adht->fetch($conf->global->MEMBER_NEWFORM_FORCETYPE);
526 print
'<input type="hidden" id="type" name="type" value="'.$conf->global->MEMBER_NEWFORM_FORCETYPE.
'">';
529 $morphys[
"phy"] = $langs->trans(
"Physical");
530 $morphys[
"mor"] = $langs->trans(
"Moral");
531 if (empty($conf->global->MEMBER_NEWFORM_FORCEMORPHY)) {
532 print
'<tr class="morphy"><td class="titlefield">'.$langs->trans(
'MemberNature').
' <FONT COLOR="red">*</FONT></td><td>'.
"\n";
533 print $form->selectarray(
"morphy", $morphys,
GETPOST(
'morphy'), 1);
534 print
'</td></tr>'.
"\n";
536 print $morphys[$conf->global->MEMBER_NEWFORM_FORCEMORPHY];
537 print
'<input type="hidden" id="morphy" name="morphy" value="'.$conf->global->MEMBER_NEWFORM_FORCEMORPHY.
'">';
540 print
'<tr><td class="titlefield">'.$langs->trans(
'UserTitle').
'</td><td>';
541 print $formcompany->select_civility(
GETPOST(
'civility_id'),
'civility_id').
'</td></tr>'.
"\n";
543 print
'<tr><td>'.$langs->trans(
"Lastname").
' <FONT COLOR="red">*</FONT></td><td><input type="text" name="lastname" class="minwidth150" value="'.
dol_escape_htmltag(
GETPOST(
'lastname')).
'"></td></tr>'.
"\n";
545 print
'<tr><td>'.$langs->trans(
"Firstname").
' <FONT COLOR="red">*</FONT></td><td><input type="text" name="firstname" class="minwidth150" value="'.
dol_escape_htmltag(
GETPOST(
'firstname')).
'"></td></tr>'.
"\n";
547 print
'<tr><td>'.$langs->trans(
"Gender").
'</td>';
549 $arraygender = array(
'man'=>$langs->trans(
"Genderman"),
'woman'=>$langs->trans(
"Genderwoman"));
550 print $form->selectarray(
'gender', $arraygender,
GETPOST(
'gender') ?
GETPOST(
'gender') : $object->gender, 1);
553 print
'<tr id="trcompany" class="trcompany"><td>'.$langs->trans(
"Company").
'</td><td><input type="text" name="societe" class="minwidth150" value="'.
dol_escape_htmltag(
GETPOST(
'societe')).
'"></td></tr>'.
"\n";
555 print
'<tr><td>'.$langs->trans(
"Address").
'</td><td>'.
"\n";
556 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";
558 print
'<tr><td>'.$langs->trans(
'Zip').
' / '.$langs->trans(
'Town').
'</td><td>';
559 print $formcompany->select_ziptown(
GETPOST(
'zipcode'),
'zipcode', array(
'town',
'selectcountry_id',
'state_id'), 6, 1);
561 print $formcompany->select_ziptown(
GETPOST(
'town'),
'town', array(
'zipcode',
'selectcountry_id',
'state_id'), 0, 1);
564 print
'<tr><td>'.$langs->trans(
'Country').
'</td><td>';
565 $country_id =
GETPOST(
'country_id');
566 if (!$country_id && !empty($conf->global->MEMBER_NEWFORM_FORCECOUNTRYCODE)) {
567 $country_id =
getCountry($conf->global->MEMBER_NEWFORM_FORCECOUNTRYCODE, 2, $db, $langs);
569 if (!$country_id && !empty($conf->geoipmaxmind->enabled)) {
573 $new_country_id =
getCountry($country_code, 3, $db, $langs);
575 if ($new_country_id) $country_id = $new_country_id;
578 $country_code =
getCountry($country_id, 2, $db, $langs);
579 print $form->select_country($country_id,
'country_id');
582 if (empty($conf->global->SOCIETE_DISABLE_STATE)) {
583 print
'<tr><td>'.$langs->trans(
'State').
'</td><td>';
584 if ($country_code) print $formcompany->select_state(
GETPOST(
"state_id"), $country_code);
589 print
'<tr><td>'.$langs->trans(
"Email").
' <FONT COLOR="red">*</FONT></td><td><input type="text" name="email" maxlength="255" class="minwidth150" value="'.
dol_escape_htmltag(
GETPOST(
'email')).
'"></td></tr>'.
"\n";
591 if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) {
592 print
'<tr><td>'.$langs->trans(
"Login").
' <FONT COLOR="red">*</FONT></td><td><input type="text" name="login" maxlength="50" class="minwidth100"value="'.
dol_escape_htmltag(
GETPOST(
'login')).
'"></td></tr>'.
"\n";
593 print
'<tr><td>'.$langs->trans(
"Password").
' <FONT COLOR="red">*</FONT></td><td><input type="password" maxlength="128" name="pass1" class="minwidth100" value="'.
GETPOST(
"pass1").
'"></td></tr>'.
"\n";
594 print
'<tr><td>'.$langs->trans(
"PasswordAgain").
' <FONT COLOR="red">*</FONT></td><td><input type="password" maxlength="128" name="pass2" class="minwidth100" value="'.
GETPOST(
"pass2").
'"></td></tr>'.
"\n";
597 print
'<tr id="trbirth" class="trbirth"><td>'.$langs->trans(
"DateToBirth").
'</td><td>';
598 print $form->selectDate($birthday,
'birth', 0, 0, 1,
"newmember", 1, 0);
599 print
'</td></tr>'.
"\n";
601 print
'<tr><td>'.$langs->trans(
"URLPhoto").
'</td><td><input type="text" name="photo" class="minwidth150" value="'.
dol_escape_htmltag(
GETPOST(
'photo')).
'"></td></tr>'.
"\n";
603 print
'<tr><td>'.$langs->trans(
"Public").
'</td><td><input type="checkbox" name="public"></td></tr>'.
"\n";
605 $tpl_context =
'public';
606 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_add.tpl.php';
609 print
'<td class="tdtop">'.$langs->trans(
"Comments").
'</td>';
610 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>';
614 if (!empty($conf->global->MEMBER_NEWFORM_DOLIBARRTURNOVER)) {
615 $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+');
616 print
'<tr id="trbudget" class="trcompany"><td>'.$langs->trans(
"TurnoverOrBudget").
' <FONT COLOR="red">*</FONT></td><td>';
617 print $form->selectarray(
'budget', $arraybudget,
GETPOST(
'budget'), 1);
620 print
'<script type="text/javascript">
621 jQuery(document).ready(function () {
623 jQuery("#morphy").click(function() {
626 jQuery("#budget").change(function() {
627 if (jQuery("#budget").val() > 0) { jQuery(".amount").val(jQuery("#budget").val()); }
628 else { jQuery("#budget").val(\'\'); }
630 /*jQuery("#type").change(function() {
631 if (jQuery("#type").val()==1) { jQuery("#morphy").val(\'mor\'); }
632 if (jQuery("#type").val()==2) { jQuery("#morphy").val(\'phy\'); }
633 if (jQuery("#type").val()==3) { jQuery("#morphy").val(\'mor\'); }
634 if (jQuery("#type").val()==4) { jQuery("#morphy").val(\'mor\'); }
637 function initturnover() {
638 if (jQuery("#morphy").val()==\'phy\') {
639 jQuery(".amount").val(20);
640 jQuery("#trbudget").hide();
641 jQuery("#trcompany").hide();
643 if (jQuery("#morphy").val()==\'mor\') {
644 jQuery(".amount").val(\'\');
645 jQuery("#trcompany").show();
646 jQuery("#trbirth").hide();
647 jQuery("#trbudget").show();
648 if (jQuery("#budget").val() > 0) { jQuery(".amount").val(jQuery("#budget").val()); }
649 else { jQuery("#budget").val(\'\'); }
654 print
'</td></tr>'.
"\n";
656 if (!empty($conf->global->MEMBER_NEWFORM_AMOUNT) || !empty($conf->global->MEMBER_NEWFORM_PAYONLINE)) {
659 if (!empty($conf->global->MEMBER_NEWFORM_AMOUNT)) {
660 $amount = $conf->global->MEMBER_NEWFORM_AMOUNT;
663 if (!empty($conf->global->MEMBER_NEWFORM_PAYONLINE)) {
664 $amount =
GETPOST(
'amount') ?
GETPOST(
'amount') : $conf->global->MEMBER_NEWFORM_AMOUNT;
667 print
'<tr><td>'.$langs->trans(
"Subscription").
'</td><td class="nowrap">';
668 if (!empty($conf->global->MEMBER_NEWFORM_EDITAMOUNT)) {
669 print
'<input type="text" name="amount" id="amount" class="flat amount" size="6" value="'.$amount.
'">';
671 print
'<input type="text" name="amount" id="amounthidden" class="flat amount" disabled size="6" value="'.$amount.
'">';
672 print
'<input type="hidden" name="amount" id="amount" class="flat amount" size="6" value="'.$amount.
'">';
674 print
' '.$langs->trans(
"Currency".$conf->currency);
682 print
'<div class="center">';
683 print
'<input type="submit" value="'.$langs->trans(
"Submit").
'" id="submitsave" class="button">';
684 if (!empty($backtopage)) {
685 print
' <input type="submit" value="'.$langs->trans(
"Cancel").
'" id="submitcancel" class="button button-cancel">';
692 print
'</div></div>';
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_hash($chain, $type= '0')
Returns a hash of a string.
dol_mktime($hour, $minute, $second, $month, $day, $year, $gm= 'auto', $check=1)
Return a timestamp date built from detailed informations (by default a local PHP server timestamp) Re...
printCommonFooter($zone= 'private')
Print common footer : conf->global->MAIN_HTML_FOOTER js for switch of menu hider js for conf->global-...
top_htmlhead($head, $title= '', $disablejs=0, $disablehead=0, $arrayofjs= '', $arrayofcss= '', $disablejmobile=0, $disablenofollow=0)
Ouput html header of a page.
dol_concatdesc($text1, $text2, $forxml=false, $invert=false)
Concat 2 descriptions with a new line between them (second operand after first one with appropriate n...
getCommonSubstitutionArray($outputlangs, $onlykey=0, $exclude=null, $object=null)
Return array of possible common substitutions.
setEventMessages($mesg, $mesgs, $style= 'mesgs', $messagekey= '')
Set event messages in dol_events session object.
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname.
load_fiche_titre($titre, $morehtmlright= '', $picto= 'generic', $pictoisfullpath=0, $id= '', $morecssontable= '', $morehtmlcenter= '')
Load a title with picto.
price2num($amount, $rounding= '', $option=0)
Function that return a number with universal decimal format (decimal separator is '...
Class to send emails (with attachments or not) Usage: $mailfile = new CMailFile($subject,$sendto,$replyto,$message,$filepath,$mimetype,$filename,$cc,$ccc,$deliveryreceipt,$msgishtml,$errors_to,$css,$trackid,$moreinheader,$sendcontext,$replyto); $mailfile->sendfile();.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename= '', $restricttologhandler= '', $logcontext=null)
Write log message into outputs.
Class to manage members of a foundation.
accessforbidden($message= '', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program Calling this function terminate execution ...
Class to manage translations.
dol_user_country()
Return country code for current user.
Class to manage members type.
print $_SERVER["PHP_SELF"]
Edit parameters.
dol_get_fiche_head($links=array(), $active= '', $title= '', $notab=0, $picto= '', $pictoisfullpath=0, $morehtmlright= '', $morecss= '', $limittoshow=0, $moretabssuffix= '')
Show tabs of a record.
llxHeaderVierge()
Header function.
print
Draft customers invoices.
llxFooterVierge()
Footer function.
dol_print_error($db= '', $error= '', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
dol_get_fiche_end($notab=0)
Return tab footer of a card.
make_substitutions($text, $substitutionarray, $outputlangs=null)
Make substitution into a text string, replacing keys with vals from $substitutionarray (oldval=>newva...
dol_htmloutput_errors($mesgstring= '', $mesgarray=array(), $keepembedded=0)
Print formated error messages to output (Used to show messages on html output).
isValidEmail($address, $acceptsupervisorkey=0)
Return true if email syntax is ok.
getCountry($searchkey, $withcode= '', $dbtouse=0, $outputlangs= '', $entconv=1, $searchlabel= '')
Return country label, code or id from an id, code or label.
complete_substitutions_array(&$substitutionarray, $outputlangs, $object=null, $parameters=null, $callfunc="completesubstitutionarray")
Complete the $substitutionarray with more entries coming from external module that had set the "subst...
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $keepmoretags= '', $escapeonlyhtmltags=0)
Returns text escaped for inclusion in HTML alt or title tags, or into values of HTML input fields...