dolibarr 20.0.2
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 Frédéric France <frederic.france@netlogic.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
31// Load translation files required by the page
32$langs->load("opensurvey");
33
34// Security check
35if (!$user->hasRight('opensurvey', 'read')) {
37}
38
39$hookmanager = new HookManager($db);
40
41// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array
42$hookmanager->initHooks(array('opensurveyindex'));
43
44
45/*
46 * View
47 */
48
49$nbsondages = 0;
50$sql = 'SELECT COUNT(*) as nb';
51$sql .= ' FROM '.MAIN_DB_PREFIX.'opensurvey_sondage';
52$sql .= ' WHERE entity IN ('.getEntity('survey').')';
53$resql = $db->query($sql);
54if ($resql) {
55 $obj = $db->fetch_object($resql);
56 $nbsondages = $obj->nb;
57} else {
58 dol_print_error($db, '');
59}
60
61
62$title = $langs->trans("OpenSurveyArea");
63llxHeader('', $title);
64
65print load_fiche_titre($title, '', 'poll');
66
67
68print '<div class="fichecenter"><div class="fichethirdleft">';
69
70print '<div class="div-table-responsive-no-min">';
71print '<table class="noborder centpercent">';
72print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("OpenSurveyArea").'</td></tr>';
73print '<tr class="oddeven">';
74print '<td>'.$langs->trans("NbOfSurveys").'</td><td class="right"><a href="list.php">'.$nbsondages.'</a></td>';
75print "</tr>";
76//print '<tr class="liste_total"><td>'.$langs->trans("Total").'</td><td class="right">';
77//print $total;
78//print '</td></tr>';
79print '</table>';
80print '</div>';
81
82print '</div></div>';
83
84$parameters = array('user' => $user);
85$reshook = $hookmanager->executeHooks('dashboardOpenSurvey', $parameters, $object); // Note that $action and $object may have been modified by hook
86
87// End of page
88llxFooter();
89$db->close();
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader()
Empty header.
Definition wrapper.php:55
llxFooter()
Empty footer.
Definition wrapper.php:69
Class to manage hooks.
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.