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);
45 require
'../../main.inc.php';
46 require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
47 require_once DOL_DOCUMENT_ROOT.
'/core/lib/payments.lib.php';
48 require_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
49 require_once DOL_DOCUMENT_ROOT.
'/product/class/product.class.php';
50 require_once DOL_DOCUMENT_ROOT.
'/societe/class/societeaccount.class.php';
51 require_once DOL_DOCUMENT_ROOT.
'/compta/facture/class/facture.class.php';
52 require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
54 include_once DOL_DOCUMENT_ROOT.
'/core/class/hookmanager.class.php';
56 $hookmanager->initHooks(array(
'newpayment'));
59 $langs->loadLangs(array(
"other",
"dict",
"bills",
"companies",
"errors",
"paybox",
"paypal",
"stripe"));
64 $action =
GETPOST(
'action',
'aZ09');
66 $securekeyreceived =
GETPOST(
"securekey",
'alpha');
67 $securekeytocompare =
dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.
'conferenceorbooth'.$id,
'md5');
69 if ($securekeytocompare != $securekeyreceived) {
70 print $langs->trans(
'MissingOrBadSecureKey');
77 $urlwithroot = DOL_MAIN_URL_ROOT;
80 $resultproject = $project->fetch($id);
81 if ($resultproject < 0) {
83 $errmsg .= $project->error;
87 if (empty($conf->project->enabled)) {
97 header(
"Location: ".
dol_buildpath(
'/public/project/suggestbooth.php', 1).
'?id='.$id.
"&securekey=".$securekeyreceived);
101 if (
GETPOST(
'suggestconference')) {
102 header(
"Location: ".
dol_buildpath(
'/public/project/suggestconference.php', 1).
'?id='.$id.
"&securekey=".$securekeyreceived);
107 header(
"Location: ".
dol_buildpath(
'/public/project/viewandvote.php', 1).
'?id='.$id.
"&securekey=".$securekeyreceived);
119 if (!empty($conf->global->ONLINE_PAYMENT_CSS_URL)) {
120 $head =
'<link rel="stylesheet" type="text/css" href="'.$conf->global->ONLINE_PAYMENT_CSS_URL.
'?lang='.$langs->defaultlang.
'">'.
"\n";
123 $conf->dol_hide_topmenu = 1;
124 $conf->dol_hide_leftmenu = 1;
126 $replacemainarea = (empty($conf->dol_hide_leftmenu) ?
'<div>' :
'').
'<div>';
127 llxHeader($head, $langs->trans(
"SuggestForm"),
'',
'', 0, 0,
'',
'',
'',
'onlinepaymentbody', $replacemainarea);
129 print
'<span id="dolpaymentspan"></span>'.
"\n";
130 print
'<div class="center">'.
"\n";
131 print
'<form id="dolpaymentform" class="center" name="paymentform" action="'.$_SERVER[
"PHP_SELF"].
'" method="POST">'.
"\n";
132 print
'<input type="hidden" name="token" value="'.newToken().
'">'.
"\n";
133 print
'<input type="hidden" name="action" value="dopayment">'.
"\n";
134 print
'<input type="hidden" name="tag" value="'.GETPOST(
"tag",
'alpha').
'">'.
"\n";
136 print
'<input type="hidden" name="id" value="'.dol_escape_htmltag($id).
'">'.
"\n";
137 print
'<input type="hidden" name="securekey" value="'.dol_escape_htmltag($securekeyreceived).
'">'.
"\n";
138 print
'<input type="hidden" name="e" value="'.$entity.
'" />';
139 print
'<input type="hidden" name="forcesandbox" value="'.GETPOST(
'forcesandbox',
'int').
'" />';
145 $logosmall = $mysoc->logo_small;
146 $logo = $mysoc->logo;
147 $paramlogo =
'ONLINE_PAYMENT_LOGO_'.$suffix;
148 if (!empty($conf->global->$paramlogo)) {
149 $logosmall = $conf->global->$paramlogo;
150 } elseif (!empty($conf->global->ONLINE_PAYMENT_LOGO)) {
151 $logosmall = $conf->global->ONLINE_PAYMENT_LOGO;
157 if (!empty($logosmall) && is_readable($conf->mycompany->dir_output.
'/logos/thumbs/'.$logosmall)) {
158 $urllogo = DOL_URL_ROOT.
'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.
'&file='.urlencode(
'logos/thumbs/'.$logosmall);
159 $urllogofull = $dolibarr_main_url_root.
'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.
'&file='.urlencode(
'logos/thumbs/'.$logosmall);
160 } elseif (!empty($logo) && is_readable($conf->mycompany->dir_output.
'/logos/'.$logo)) {
161 $urllogo = DOL_URL_ROOT.
'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.
'&file='.urlencode(
'logos/'.$logo);
162 $urllogofull = $dolibarr_main_url_root.
'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.
'&file='.urlencode(
'logos/'.$logo);
167 print
'<div class="backgreypublicpayment">';
168 print
'<div class="logopublicpayment">';
169 print
'<img id="dolpaymentlogo" src="'.$urllogo.
'"';
172 if (empty($conf->global->MAIN_HIDE_POWERED_BY)) {
173 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>';
178 if (!empty($conf->global->PROJECT_IMAGE_PUBLIC_ORGANIZEDEVENT)) {
179 print
'<div class="backimagepublicorganizedevent">';
180 print
'<img id="idPROJECT_IMAGE_PUBLIC_ORGANIZEDEVENT" src="'.$conf->global->PROJECT_IMAGE_PUBLIC_ORGANIZEDEVENT.
'">';
188 print
'<div class="center">';
189 print
'<span class="large">'.$project->title.
'</span><br>';
190 print
img_picto(
'',
'calendar',
'class="pictofixedwidth"').$langs->trans(
"Date").
': ';
192 if ($project->date_end && $project->date_start != $project->date_end) {
193 print
' - '.dol_print_date($project->date_end,
'daytext');
195 print
'<br><br>'.
"\n";
196 print $langs->trans(
"EvntOrgRegistrationWelcomeMessage").
"\n";
197 print $project->note_public.
"\n";
204 print
'<table id="dolpaymenttable" summary="Payment form" class="center">'.
"\n";
209 print
'<tr><td align="center">';
225 if ($project->accept_booth_suggestions) {
227 print
'<input type="submit" value="'.$langs->trans(
"SuggestBooth").
'" id="suggestbooth" name="suggestbooth" class="button width500">';
230 if ($project->accept_conference_suggestions == 1 || $project->accept_conference_suggestions == 2) {
232 print
'<input type="submit" value="'.$langs->trans(
"SuggestConference").
'" id="suggestconference" name="suggestconference" class="button width500">';
235 if ($project->accept_conference_suggestions == 2 || $project->accept_conference_suggestions == 3) {
237 print
'<input type="submit" value="'.$langs->trans(
"ViewAndVote").
'" id="viewandvote" name="viewandvote" class="button width500">';
240 if (! $foundaction) {
241 print
'<span class="opacitymedium">'.$langs->trans(
"NoPublicActionsAllowedForThisEvent").
'</span>';
244 print
'</td></tr>'.
"\n";
246 print
'</table>'.
"\n";
248 print
'</form>'.
"\n";
253 htmlPrintOnlinePaymentFooter($mysoc, $langs, 1, $suffix, $object);
Class to manage projects.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs='', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
if(!defined('NOTOKENRENEWAL')) if(!defined('NOLOGIN')) if(!defined('NOCSRFCHECK')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) if(!defined('NOIPCHECK')) if(!defined('NOBROWSERNOTIF')) llxHeader()
Header empty.
httponly_accessforbidden($message=1, $http_response_code=403, $stringalreadysanitized=0)
Show a message to say access is forbidden and stop program.
dol_hash($chain, $type='0')
Returns a hash (non reversible encryption) of a string.