dolibarr 21.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-2024 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';
28require_once DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php";
29require_once DOL_DOCUMENT_ROOT."/core/lib/files.lib.php";
30
39// Load translation files required by the page
40$langs->load("opensurvey");
41
42// Security check
43if (!$user->hasRight('opensurvey', 'read')) {
45}
46
47$hookmanager = new HookManager($db);
48
49// Initialize a technical object to manage hooks. Note that conf->hooks_modules contains array
50$hookmanager->initHooks(array('opensurveyindex'));
51
52
53/*
54 * View
55 */
56
57$nbsondages = 0;
58$sql = 'SELECT COUNT(*) as nb';
59$sql .= ' FROM '.MAIN_DB_PREFIX.'opensurvey_sondage';
60$sql .= ' WHERE entity IN ('.getEntity('survey').')';
61$resql = $db->query($sql);
62if ($resql) {
63 $obj = $db->fetch_object($resql);
64 $nbsondages = $obj->nb;
65} else {
66 dol_print_error($db, '');
67}
68
69
70$title = $langs->trans("OpenSurveyArea");
71llxHeader('', $title);
72
73print load_fiche_titre($title, '', 'poll');
74
75
76print '<div class="fichecenter"><div class="fichethirdleft">';
77
78print '<div class="div-table-responsive-no-min">';
79print '<table class="noborder centpercent">';
80print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("OpenSurveyArea").'</td></tr>';
81print '<tr class="oddeven">';
82print '<td>'.$langs->trans("NbOfSurveys").'</td><td class="right"><a href="list.php">'.$nbsondages.'</a></td>';
83print "</tr>";
84//print '<tr class="liste_total"><td>'.$langs->trans("Total").'</td><td class="right">';
85//print $total;
86//print '</td></tr>';
87print '</table>';
88print '</div>';
89
90print '</div></div>';
91
92$parameters = array('user' => $user);
93$reshook = $hookmanager->executeHooks('dashboardOpenSurvey', $parameters, $object); // Note that $action and $object may have been modified by hook
94
95// End of page
96llxFooter();
97$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
Class to manage hooks.
llxFooter()
Footer empty.
Definition document.php:107
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.