24 if (!defined(
'NOLOGIN')) {
27 if (!defined(
'NOCSRFCHECK')) {
28 define(
"NOCSRFCHECK", 1);
30 if (!defined(
'NOIPCHECK')) {
31 define(
'NOIPCHECK',
'1');
33 if (!defined(
'NOBROWSERNOTIF')) {
34 define(
'NOBROWSERNOTIF',
'1');
39 $entity = (!empty($_GET[
'entity']) ? (int) $_GET[
'entity'] : (!empty($_POST[
'entity']) ? (int) $_POST[
'entity'] : (!empty($_GET[
'e']) ? (int) $_GET[
'e'] : (!empty($_POST[
'e']) ? (int) $_POST[
'e'] : 1))));
40 if (is_numeric($entity)) {
41 define(
"DOLENTITY", $entity);
44 require
'../../main.inc.php';
45 require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
46 require_once DOL_DOCUMENT_ROOT.
'/core/lib/payments.lib.php';
47 require_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
48 require_once DOL_DOCUMENT_ROOT.
'/product/class/product.class.php';
49 require_once DOL_DOCUMENT_ROOT.
'/societe/class/societeaccount.class.php';
50 require_once DOL_DOCUMENT_ROOT.
'/compta/facture/class/facture.class.php';
51 require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
53 include_once DOL_DOCUMENT_ROOT.
'/core/class/hookmanager.class.php';
55 $hookmanager->initHooks(array(
'newpayment'));
58 $langs->loadLangs(array(
"other",
"dict",
"bills",
"companies",
"errors",
"paybox",
"paypal",
"stripe"));
63 $action =
GETPOST(
'action',
'aZ09');
65 $securekeyreceived =
GETPOST(
"securekey",
'alpha');
66 $securekeytocompare =
dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.
'conferenceorbooth'.$id,
'md5');
68 if ($securekeytocompare != $securekeyreceived) {
69 print $langs->trans(
'MissingOrBadSecureKey');
76 $urlwithroot = DOL_MAIN_URL_ROOT;
79 $resultproject = $project->fetch($id);
80 if ($resultproject < 0) {
82 $errmsg .= $project->error;
86 if (empty($conf->project->enabled)) {
96 header(
"Location: ".
dol_buildpath(
'/public/project/suggestbooth.php', 1).
'?id='.$id.
"&securekey=".$securekeyreceived);
100 if (
GETPOST(
'suggestconference')) {
101 header(
"Location: ".
dol_buildpath(
'/public/project/suggestconference.php', 1).
'?id='.$id.
"&securekey=".$securekeyreceived);
106 header(
"Location: ".
dol_buildpath(
'/public/project/viewandvote.php', 1).
'?id='.$id.
"&securekey=".$securekeyreceived);
118 if (!empty($conf->global->ONLINE_PAYMENT_CSS_URL)) {
119 $head =
'<link rel="stylesheet" type="text/css" href="'.$conf->global->ONLINE_PAYMENT_CSS_URL.
'?lang='.$langs->defaultlang.
'">'.
"\n";
122 $conf->dol_hide_topmenu = 1;
123 $conf->dol_hide_leftmenu = 1;
125 $replacemainarea = (empty($conf->dol_hide_leftmenu) ?
'<div>' :
'').
'<div>';
126 llxHeader($head, $langs->trans(
"SuggestForm"),
'',
'', 0, 0,
'',
'',
'',
'onlinepaymentbody', $replacemainarea);
128 print
'<span id="dolpaymentspan"></span>'.
"\n";
129 print
'<div class="center">'.
"\n";
130 print
'<form id="dolpaymentform" class="center" name="paymentform" action="'.$_SERVER[
"PHP_SELF"].
'" method="POST">'.
"\n";
131 print
'<input type="hidden" name="token" value="'.newToken().
'">'.
"\n";
132 print
'<input type="hidden" name="action" value="dopayment">'.
"\n";
133 print
'<input type="hidden" name="tag" value="'.GETPOST(
"tag",
'alpha').
'">'.
"\n";
135 print
'<input type="hidden" name="id" value="'.dol_escape_htmltag($id).
'">'.
"\n";
136 print
'<input type="hidden" name="securekey" value="'.dol_escape_htmltag($securekeyreceived).
'">'.
"\n";
137 print
'<input type="hidden" name="e" value="'.$entity.
'" />';
138 print
'<input type="hidden" name="forcesandbox" value="'.GETPOST(
'forcesandbox',
'int').
'" />';
144 $logosmall = $mysoc->logo_small;
145 $logo = $mysoc->logo;
146 $paramlogo =
'ONLINE_PAYMENT_LOGO_'.$suffix;
147 if (!empty($conf->global->$paramlogo)) {
148 $logosmall = $conf->global->$paramlogo;
149 } elseif (!empty($conf->global->ONLINE_PAYMENT_LOGO)) {
150 $logosmall = $conf->global->ONLINE_PAYMENT_LOGO;
156 if (!empty($logosmall) && is_readable($conf->mycompany->dir_output.
'/logos/thumbs/'.$logosmall)) {
157 $urllogo = DOL_URL_ROOT.
'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.
'&file='.urlencode(
'logos/thumbs/'.$logosmall);
158 $urllogofull = $dolibarr_main_url_root.
'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.
'&file='.urlencode(
'logos/thumbs/'.$logosmall);
159 } elseif (!empty($logo) && is_readable($conf->mycompany->dir_output.
'/logos/'.$logo)) {
160 $urllogo = DOL_URL_ROOT.
'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.
'&file='.urlencode(
'logos/'.$logo);
161 $urllogofull = $dolibarr_main_url_root.
'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.
'&file='.urlencode(
'logos/'.$logo);
166 print
'<div class="backgreypublicpayment">';
167 print
'<div class="logopublicpayment">';
168 print
'<img id="dolpaymentlogo" src="'.$urllogo.
'"';
171 if (empty($conf->global->MAIN_HIDE_POWERED_BY)) {
172 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>';
177 if (!empty($conf->global->PROJECT_IMAGE_PUBLIC_ORGANIZEDEVENT)) {
178 print
'<div class="backimagepublicorganizedevent">';
179 print
'<img id="idPROJECT_IMAGE_PUBLIC_ORGANIZEDEVENT" src="'.$conf->global->PROJECT_IMAGE_PUBLIC_ORGANIZEDEVENT.
'">';
187 print
'<div class="center">';
188 print
'<span class="large">'.$project->title.
'</span><br>';
189 print
img_picto(
'',
'calendar',
'class="pictofixedwidth"').$langs->trans(
"Date").
': ';
191 if ($project->date_end && $project->date_start != $project->date_end) {
192 print
' - '.dol_print_date($project->date_end,
'daytext');
194 print
'<br><br>'.
"\n";
195 print $langs->trans(
"EvntOrgRegistrationWelcomeMessage").
"\n";
196 print $project->note_public.
"\n";
203 print
'<table id="dolpaymenttable" summary="Payment form" class="center">'.
"\n";
208 print
'<tr><td align="center">';
224 if ($project->accept_booth_suggestions) {
226 print
'<input type="submit" value="'.$langs->trans(
"SuggestBooth").
'" id="suggestbooth" name="suggestbooth" class="button width500">';
229 if ($project->accept_conference_suggestions == 1 || $project->accept_conference_suggestions == 2) {
231 print
'<input type="submit" value="'.$langs->trans(
"SuggestConference").
'" id="suggestconference" name="suggestconference" class="button width500">';
234 if ($project->accept_conference_suggestions == 2 || $project->accept_conference_suggestions == 3) {
236 print
'<input type="submit" value="'.$langs->trans(
"ViewAndVote").
'" id="viewandvote" name="viewandvote" class="button width500">';
239 if (! $foundaction) {
240 print
'<span class="opacitymedium">'.$langs->trans(
"NoPublicActionsAllowedForThisEvent").
'</span>';
243 print
'</td></tr>'.
"\n";
245 print
'</table>'.
"\n";
247 print
'</form>'.
"\n";
252 htmlPrintOnlinePaymentFooter($mysoc, $langs, 1, $suffix, $object);