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';
53 require_once DOL_DOCUMENT_ROOT .
'/comm/action/class/actioncomm.class.php';
55 include_once DOL_DOCUMENT_ROOT.
'/core/class/hookmanager.class.php';
57 $hookmanager->initHooks(array(
'newpayment'));
60 global $dolibarr_main_url_root;
63 $langs->loadLangs(array(
"main",
"other",
"dict",
"bills",
"companies",
"errors",
"paybox",
"paypal",
"stripe"));
68 $action =
GETPOST(
'action',
'aZ09');
70 $securekeyreceived =
GETPOST(
"securekey");
71 $securekeytocompare =
dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.
'conferenceorbooth'.$id,
'md5');
73 if ($securekeytocompare != $securekeyreceived) {
74 print $langs->trans(
'MissingOrBadSecureKey');
78 $listofvotes = explode(
',', $_SESSION[
"savevotes"]);
84 $urlwithroot = DOL_MAIN_URL_ROOT;
87 $resultproject = $project->fetch($id);
88 if ($resultproject < 0) {
90 $errmsg .= $project->error;
94 if (empty($conf->eventorganization->enabled)) {
103 $tmpthirdparty =
new Societe($db);
105 $listOfConferences =
'<tr><td>'.$langs->trans(
'Label').
'</td>';
106 $listOfConferences .=
'<td>'.$langs->trans(
'Type').
'</td>';
107 $listOfConferences .=
'<td>'.$langs->trans(
'ThirdParty').
'</td>';
108 $listOfConferences .=
'<td>'.$langs->trans(
'Note').
'</td></tr>';
110 $sql =
"SELECT a.id, a.fk_action, a.datep, a.datep2, a.label, a.fk_soc, a.note, ca.libelle as label
111 FROM ".MAIN_DB_PREFIX.
"actioncomm as a
112 INNER JOIN ".MAIN_DB_PREFIX.
"c_actioncomm as ca ON (a.fk_action=ca.id)
115 $sqlforconf = $sql.
" AND ca.module='conference@eventorganization'";
119 $result = $db->query($sqlforconf);
121 while ($i < $db->num_rows($result)) {
122 $obj = $db->fetch_object($result);
123 if (!empty($obj->fk_soc)) {
124 $resultthirdparty = $tmpthirdparty->fetch($obj->fk_soc);
125 if ($resultthirdparty) {
126 $thirdpartyname = $tmpthirdparty->name;
128 $thirdpartyname =
'';
131 $thirdpartyname =
'';
134 $listOfConferences .=
'<tr><td>'.$obj->label.
'</td><td>'.$obj->label.
'</td><td>'.$thirdpartyname.
'</td><td>'.$obj->note.
'</td>';
135 $listOfConferences .=
'<td><button type="submit" name="vote" value="'.$obj->id.
'" class="button">'.$langs->trans(
"Vote").
'</button></td></tr>';
164 $hashedvote =
dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.
'vote'.$idvote);
166 if (strlen($idvote)) {
167 if (in_array($hashedvote, $listofvotes)) {
173 $resultconforbooth = $conforbooth->fetch($idvote);
174 if ($resultconforbooth<=0) {
176 $errmsg .= $conforbooth->error;
179 $conforbooth->num_vote++;
180 $resupdate = $conforbooth->update($user);
183 $_SESSION[
"savevotes"] = $hashedvote.
','.(empty($_SESSION[
"savevotes"]) ?
'' : $_SESSION[
"savevotes"]);
190 if ($votestatus==
"ok") {
192 } elseif ($votestatus==
"ko") {
194 } elseif ($votestatus==
"err") {
197 header(
"Refresh:0;url=".
dol_buildpath(
'/public/project/viewandvote.php?id='.$id.
'&securekey=', 1).$securekeyreceived);
207 if (!empty($conf->global->ONLINE_PAYMENT_CSS_URL)) {
208 $head =
'<link rel="stylesheet" type="text/css" href="'.$conf->global->ONLINE_PAYMENT_CSS_URL.
'?lang='.$langs->defaultlang.
'">'.
"\n";
211 $conf->dol_hide_topmenu = 1;
212 $conf->dol_hide_leftmenu = 1;
214 $replacemainarea = (empty($conf->dol_hide_leftmenu) ?
'<div>' :
'').
'<div>';
215 llxHeader($head, $langs->trans(
"SuggestForm"),
'',
'', 0, 0,
'',
'',
'',
'onlinepaymentbody', $replacemainarea);
217 print
'<span id="dolpaymentspan"></span>'.
"\n";
218 print
'<div class="center">'.
"\n";
219 print
'<form id="dolpaymentform" class="center" name="paymentform" action="'.$_SERVER[
"PHP_SELF"].
'" method="POST">'.
"\n";
220 print
'<input type="hidden" name="token" value="'.newToken().
'">'.
"\n";
221 print
'<input type="hidden" name="action" value="dopayment">'.
"\n";
222 print
'<input type="hidden" name="tag" value="'.GETPOST(
"tag",
'alpha').
'">'.
"\n";
224 print
'<input type="hidden" name="id" value="'.dol_escape_htmltag($id).
'">'.
"\n";
225 print
'<input type="hidden" name="securekey" value="'.dol_escape_htmltag($securekeyreceived).
'">'.
"\n";
226 print
'<input type="hidden" name="e" value="'.$entity.
'" />';
227 print
'<input type="hidden" name="forcesandbox" value="'.GETPOST(
'forcesandbox',
'int').
'" />';
233 $logosmall = $mysoc->logo_small;
234 $logo = $mysoc->logo;
235 $paramlogo =
'ONLINE_PAYMENT_LOGO_'.$suffix;
236 if (!empty($conf->global->$paramlogo)) {
237 $logosmall = $conf->global->$paramlogo;
238 } elseif (!empty($conf->global->ONLINE_PAYMENT_LOGO)) {
239 $logosmall = $conf->global->ONLINE_PAYMENT_LOGO;
245 if (!empty($logosmall) && is_readable($conf->mycompany->dir_output.
'/logos/thumbs/'.$logosmall)) {
246 $urllogo = DOL_URL_ROOT.
'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.
'&file='.urlencode(
'logos/thumbs/'.$logosmall);
247 $urllogofull = $dolibarr_main_url_root.
'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.
'&file='.urlencode(
'logos/thumbs/'.$logosmall);
248 } elseif (!empty($logo) && is_readable($conf->mycompany->dir_output.
'/logos/'.$logo)) {
249 $urllogo = DOL_URL_ROOT.
'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.
'&file='.urlencode(
'logos/'.$logo);
250 $urllogofull = $dolibarr_main_url_root.
'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.
'&file='.urlencode(
'logos/'.$logo);
255 print
'<div class="backgreypublicpayment">';
256 print
'<div class="logopublicpayment">';
257 print
'<img id="dolpaymentlogo" src="'.$urllogo.
'"';
260 if (empty($conf->global->MAIN_HIDE_POWERED_BY)) {
261 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>';
266 if (!empty($conf->global->PROJECT_IMAGE_PUBLIC_SUGGEST_BOOTH)) {
267 print
'<div class="backimagepublicsuggestbooth">';
268 print
'<img id="idPROJECT_IMAGE_PUBLIC_SUGGEST_BOOTH" src="'.$conf->global->PROJECT_IMAGE_PUBLIC_SUGGEST_BOOTH.
'">';
272 print
'<table id="welcome" class="center">'.
"\n";
273 $text =
'<tr><td class="textpublicpayment"><br><strong>'.$langs->trans(
"EvntOrgRegistrationWelcomeMessage").
'</strong></td></tr>'.
"\n";
274 $text .=
'<tr><td class="textpublicpayment">'.$langs->trans(
"EvntOrgVoteHelpMessage").
' : "'.$project->title.
'".<br><br></td></tr>'.
"\n";
275 $text .=
'<tr><td class="textpublicpayment">'.$project->note_public.
'</td></tr>'.
"\n";
277 print
'</table>'.
"\n";
280 print
'<table cellpadding="10" id="conferences" border="1" class="center">'.
"\n";
281 print
'<th colspan="7">'.$langs->trans(
"ListOfSuggestedConferences").
'</th>';
282 print $listOfConferences.
'<br>';
283 print
'</table>'.
"\n";
296 htmlPrintOnlinePaymentFooter($mysoc, $langs, 1, $suffix, $object);
if(!defined('NOREQUIRESOC')) if(!defined('NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) llxHeader()
Empty header.
Class to manage agenda events (actions)
Class to manage projects.
Class to manage third parties objects (customers, suppliers, prospects...)
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
setEventMessage($mesgs, $style='mesgs')
Set event message in dol_events session object.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
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.