39 $head[0][0] =
'card.php?id='.$object->id_sondage;
40 $head[0][1] = $langs->trans(
"Survey");
41 $head[0][2] =
'general';
44 $head[1][0] =
'results.php?id='.$object->id_sondage;
45 $head[1][1] = $langs->trans(
"SurveyResults");
46 $nbVotes = $object->countVotes();
48 $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.($nbVotes).
'</span>';
50 $head[1][2] =
'preview';
76function llxHeaderSurvey($title, $head =
"", $disablejs = 0, $disablehead = 0, $arrayofjs =
'', $arrayofcss =
'', $numsondage =
'')
78 global $conf, $langs, $mysoc;
79 global $dolibarr_main_url_root;
83 top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss, 0, 1);
85 print
'<body id="mainbody" class="publicnewmemberform">';
87 print
'<span id="dolpaymentspan"></span>'.
"\n";
88 print
'<div class="center">'.
"\n";
89 print
'<form name="formulaire" action="studs.php?sondage='.urlencode($numsondage).
'#bas" method="POST">'.
"\n";
90 print
'<input type="hidden" name="sondage" value="'.$numsondage.
'"/>';
91 print
'<input type="hidden" name="token" value="'.newToken().
'">'.
"\n";
96 $logosmall = $mysoc->logo_small;
102 if (!empty($logosmall) && is_readable($conf->mycompany->dir_output.
'/logos/thumbs/'.$logosmall)) {
103 $urllogo = DOL_URL_ROOT.
'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.
'&file='.urlencode(
'logos/thumbs/'.$logosmall);
104 $urllogofull = $dolibarr_main_url_root.
'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.
'&file='.urlencode(
'logos/thumbs/'.$logosmall);
105 } elseif (!empty($logo) && is_readable($conf->mycompany->dir_output.
'/logos/'.$logo)) {
106 $urllogo = DOL_URL_ROOT.
'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.
'&file='.urlencode(
'logos/'.$logo);
107 $urllogofull = $dolibarr_main_url_root.
'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.
'&file='.urlencode(
'logos/'.$logo);
112 print
'<div class="backgreypublicpayment">';
113 print
'<div class="logopublicpayment">';
114 print
'<img id="dolpaymentlogo" src="'.$urllogo.
'"';
118 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 src="'.DOL_URL_ROOT.
'/theme/dolibarr_logo.svg" width="80px"></a></div>';
124 print
'<div class="backimagepublicopensurvey">';
125 print
'<img id="idOPENSURVEY_IMAGE_PUBLIC_INTERFACE" src="' .
getDolGlobalString(
'OPENSURVEY_IMAGE_PUBLIC_INTERFACE').
'">';
129 print
'<div class="survey_borders"><br><br>';
137function llxFooterSurvey()
157function get_server_name()
159 global $dolibarr_main_url_root;
161 $urlwithouturlroot = preg_replace(
'/'.preg_quote(DOL_URL_ROOT,
'/').
'$/i',
'', trim($dolibarr_main_url_root));
165 $url = $urlwithouturlroot.dol_buildpath(
'/opensurvey/', 1);
167 if (!preg_match(
"|/$|", $url)) {
181function issetAndNoEmpty($name, $tableau =
null)
183 if ($tableau ===
null) {
187 return (isset($tableau[$name]) ===
true && empty($tableau[$name]) ===
false);
198function getUrlSondage($id, $admin =
false)
200 if ($admin ===
true) {
201 $url = get_server_name().
'results.php?id='.$id;
203 $url = get_server_name().
'/public/studs.php?sondage='.$id;
216function dol_survey_random($car)
219 $chaine =
"abcdefghijklmnopqrstuvwxyz123456789";
220 mt_srand((
float) microtime() * 1000000);
221 for ($i = 0; $i < $car; $i++) {
222 $string .= $chaine[mt_rand() % strlen($chaine)];
232function ajouter_sondage()
236 require_once DOL_DOCUMENT_ROOT.
'/opensurvey/class/opensurveysondage.class.php';
238 $sondage = dol_survey_random(16);
240 $allow_comments = empty($_SESSION[
'allow_comments']) ? 0 : 1;
241 $allow_spy = empty($_SESSION[
'allow_spy']) ? 0 : 1;
245 $opensurveysondage->id_sondage = $sondage;
246 $opensurveysondage->description = $_SESSION[
'description'];
247 $opensurveysondage->mail_admin = $_SESSION[
'adresse'];
248 $opensurveysondage->nom_admin = $_SESSION[
'nom'];
249 $opensurveysondage->title = $_SESSION[
'title'];
250 $opensurveysondage->date_fin = $_SESSION[
'champdatefin'];
251 $opensurveysondage->format = $_SESSION[
'formatsondage'];
252 $opensurveysondage->mailsonde = $_SESSION[
'mailsonde'];
253 $opensurveysondage->allow_comments = $allow_comments;
254 $opensurveysondage->allow_spy = $allow_spy;
255 $opensurveysondage->sujet = $_SESSION[
'toutchoix'];
257 $res = $opensurveysondage->create($user);
263 unset($_SESSION[
"title"]);
264 unset($_SESSION[
"nom"]);
265 unset($_SESSION[
"adresse"]);
266 unset($_SESSION[
"description"]);
267 unset($_SESSION[
"mailsonde"]);
268 unset($_SESSION[
'allow_comments']);
269 unset($_SESSION[
'allow_spy']);
270 unset($_SESSION[
'toutchoix']);
271 unset($_SESSION[
'totalchoixjour']);
272 unset($_SESSION[
'champdatefin']);
274 $urlback =
dol_buildpath(
'/opensurvey/card.php', 1).
'?id='.$sondage;
276 header(
"Location: ".$urlback);
Put here description of your class.
dol_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
printCommonFooter($zone='private')
Print common footer : conf->global->MAIN_HTML_FOOTER js for switch of menu hider js for conf->global-...
dol_htmloutput_events($disabledoutputofmessages=0)
Print formated messages to output (Used to show messages on html output).
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
complete_head_from_modules($conf, $langs, $object, &$head, &$h, $type, $mode='add', $filterorigmodule='')
Complete or removed entries into a head array (used to build tabs).
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs=array(), $arrayofcss=array(), $disableforlogin=0, $disablenofollow=0, $disablenoindex=0)
Ouput html header of a page.