dolibarr 21.0.0-beta
index.php
1<?php
2/* Copyright (C) 2013 Laurent Destailleur <eldy@users.sourceforge.net>
3 * Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
4 * Copyright (C) 2016 Regis Houssin <regis.houssin@inodbox.com>
5 * Copyright (C) 2019-2024 Frédéric France <frederic.france@free.fr>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <https://www.gnu.org/licenses/>.
19 */
20
21
22if (!defined('NOTOKENRENEWAL')) {
23 define('NOTOKENRENEWAL', '1');
24}
25
26// Load Dolibarr environment
27require '../../main.inc.php';
28require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
29require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
30require_once DOL_DOCUMENT_ROOT.'/opensurvey/lib/opensurvey.lib.php';
31
40// Security check
41if (!$user->hasRight('opensurvey', 'write')) {
43}
44
45$langs->load("opensurvey");
46
47
48/*
49 * View
50 */
51
52$arrayofjs = array();
53$arrayofcss = array('/opensurvey/css/style.css');
54llxHeader('', $langs->trans("Survey"), '', "", 0, 0, $arrayofjs, $arrayofcss);
55
56print load_fiche_titre($langs->trans("CreatePoll"), '', 'poll');
57
58print '<form name="formulaire" action="create_survey.php" method="POST">';
59print '<input type="hidden" name="token" value="'.newToken().'">';
60print '<div class="center">';
61print '<p>'.$langs->trans("OrganizeYourMeetingEasily").'</p>';
62print '<div class="corps">';
63print '<br>';
64print '<div class="index_date">';
65print '<div><img class="opacity imgopensurveywizard" src="../img/date.png" onclick="document.formulaire.date.click()"></div>';
66print '<button id="date" name="choix_sondage" value="date" type="submit" class="button orange bigrounded">';
67print '<img src="../img/calendar-32.png" alt="'.dol_escape_htmltag($langs->trans("CreateSurveyDate")).'" style="padding-right: 4px" class="inline-block valignmiddle">';
68print '<div class="inline-block valignmiddle">'.dol_escape_htmltag($langs->trans("CreateSurveyDate")).'</div></button>';
69print '</div>';
70print '<div class="index_sondage">';
71print '<div><img class="opacity imgopensurveywizard" src="../img/sondage2.png" onclick="document.formulaire.autre.click()"></div>';
72print '<button id="autre" name="choix_sondage" value="autre" type="submit" class="button blue bigrounded">';
73print '<img src="../img/chart-32.png" alt="'.dol_escape_htmltag($langs->trans("CreateSurveyStandard")).'" style="padding-right: 4px" class="inline-block valignmiddle">';
74print '<div class="inline-block valignmiddle">'.dol_escape_htmltag($langs->trans("CreateSurveyStandard")).'</div></button>';
75print '</div>';
76print '<div class="clearboth"></div>';
77print '<br>';
78print '</div>';
79print '</div></form>';
80
81// Clean session variables
82
83$i = 0;
84unset($_SESSION["nbrecases"]);
85while ($i < 100) {
86 unset($_SESSION["choix".$i]);
87 unset($_SESSION["typecolonne".$i]);
88 $i++;
89}
90
91
92// End of page
93llxFooter();
94$db->close();
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
Definition wrapper.php:71
llxFooter()
Footer empty.
Definition document.php:107
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.