dolibarr  16.0.5
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 require '../main.inc.php';
27 require_once DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php";
28 require_once DOL_DOCUMENT_ROOT."/core/lib/files.lib.php";
29 
30 // Load translation files required by the page
31 $langs->load("opensurvey");
32 
33 // Security check
34 if (empty($user->rights->opensurvey->read)) {
36 }
37 
38 $hookmanager = new HookManager($db);
39 
40 // Initialize technical object to manage hooks. Note that conf->hooks_modules contains array
41 $hookmanager->initHooks(array('opensurveyindex'));
42 
43 
44 /*
45  * View
46  */
47 
48 $nbsondages = 0;
49 $sql = 'SELECT COUNT(*) as nb';
50 $sql .= ' FROM '.MAIN_DB_PREFIX.'opensurvey_sondage';
51 $sql .= ' WHERE entity IN ('.getEntity('survey').')';
52 $resql = $db->query($sql);
53 if ($resql) {
54  $obj = $db->fetch_object($resql);
55  $nbsondages = $obj->nb;
56 } else {
57  dol_print_error($db, '');
58 }
59 
60 
61 $title = $langs->trans("OpenSurveyArea");
62 llxHeader('', $title);
63 
64 print load_fiche_titre($title, '', 'poll');
65 
66 
67 print '<div class="fichecenter"><div class="fichethirdleft">';
68 
69 print '<div class="div-table-responsive-no-min">';
70 print '<table class="noborder centpercent">';
71 print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("OpenSurveyArea").'</td></tr>';
72 print '<tr class="oddeven">';
73 print '<td>'.$langs->trans("NbOfSurveys").'</td><td class="right"><a href="list.php">'.$nbsondages.'</a></td>';
74 print "</tr>";
75 //print '<tr class="liste_total"><td>'.$langs->trans("Total").'</td><td class="right">';
76 //print $total;
77 //print '</td></tr>';
78 print '</table>';
79 print '</div>';
80 
81 print '</div></div>';
82 
83 $parameters = array('user' => $user);
84 $reshook = $hookmanager->executeHooks('dashboardOpenSurvey', $parameters, $object); // Note that $action and $object may have been modified by hook
85 
86 // End of page
87 llxFooter();
88 $db->close();
load_fiche_titre
load_fiche_titre($titre, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
Definition: functions.lib.php:5204
dol_print_error
dol_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
Definition: functions.lib.php:4844
llxFooter
llxFooter()
Footer empty.
Definition: index.php:71
llxHeader
if(!defined('NOTOKENRENEWAL')) if(!defined('NOLOGIN')) if(!defined('NOCSRFCHECK')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) if(!defined('NOIPCHECK')) if(!defined('NOBROWSERNOTIF')) llxHeader()
Header empty.
Definition: index.php:63
$resql
if(isModEnabled('facture') &&!empty($user->rights->facture->lire)) if((isModEnabled('fournisseur') &&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->rights->fournisseur->facture->lire)||(isModEnabled('supplier_invoice') && $user->rights->supplier_invoice->lire)) if(isModEnabled('don') &&!empty($user->rights->don->lire)) if(isModEnabled('tax') &&!empty($user->rights->tax->charges->lire)) if(isModEnabled('facture') &&isModEnabled('commande') && $user->rights->commande->lire &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) $resql
Social contributions to pay.
Definition: index.php:742
accessforbidden
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program Calling this function terminate execution ...
Definition: security.lib.php:933
HookManager
Class to manage hooks.
Definition: hookmanager.class.php:30