dolibarr 24.0.0-beta
index.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2013-2014 Laurent Destailleur <eldy@users.sourceforge.net>
3 * Copyright (C) 2019 Nicolas ZABOURI <info@inovea-conseil.com>
4 * Copyright (C) 2019-2026 Frédéric France <frederic.france@free.fr>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <https://www.gnu.org/licenses/>.
18 */
19
26// Load Dolibarr environment
27require '../main.inc.php';
35require_once DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php";
36require_once DOL_DOCUMENT_ROOT."/core/lib/files.lib.php";
37
38// Load translation files required by the page
39$langs->load("opensurvey");
40
41// Security check
42if (!$user->hasRight('opensurvey', 'read')) {
44}
45
46// Initialize a technical object to manage hooks. Note that conf->hooks_modules contains array
47$hookmanager->initHooks(array('opensurveyindex'));
48
49
50/*
51 * View
52 */
53
54$nbsondages = 0;
55$sql = 'SELECT COUNT(*) as nb';
56$sql .= ' FROM '.MAIN_DB_PREFIX.'opensurvey_sondage';
57$sql .= ' WHERE entity IN ('.getEntity('survey').')';
58$resql = $db->query($sql);
59if ($resql) {
60 $obj = $db->fetch_object($resql);
61 $nbsondages = $obj->nb;
62} else {
64}
65
66
67$title = $langs->trans("OpenSurveyArea");
68llxHeader('', $title);
69
70print load_fiche_titre($title, '', 'poll');
71
72
73print '<div class="fichecenter"><div class="fichethirdleft">';
74
75print '<div class="div-table-responsive-no-min">';
76print '<table class="noborder centpercent">';
77print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("OpenSurveyArea").'</td></tr>';
78print '<tr class="oddeven">';
79print '<td>'.$langs->trans("NbOfSurveys").'</td><td class="right"><a href="list.php">'.$nbsondages.'</a></td>';
80print "</tr>";
81//print '<tr class="liste_total"><td>'.$langs->trans("Total").'</td><td class="right">';
82//print $total;
83//print '</td></tr>';
84print '</table>';
85print '</div>';
86
87print '</div></div>';
88
89$parameters = array('user' => $user);
90$reshook = $hookmanager->executeHooks('dashboardOpenSurvey', $parameters, $object); // Note that $action and $object may have been modified by hook
91
92// End of page
93llxFooter();
94$db->close();
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
Definition wrapper.php:91
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:73
if(!isModEnabled('ai')||!getDolGlobalString('AI_ASSISTANT_ENABLED')) global $db
API class for accounts.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='', $morecssonpicto='widthpictotitle')
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.