dolibarr  13.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 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 (!$user->rights->opensurvey->read) accessforbidden();
35 
36 $hookmanager = new HookManager($db);
37 
38 // Initialize technical object to manage hooks. Note that conf->hooks_modules contains array
39 $hookmanager->initHooks(array('opensurveyindex'));
40 
41 
42 /*
43  * View
44  */
45 
46 $nbsondages = 0;
47 $sql = 'SELECT COUNT(*) as nb';
48 $sql .= ' FROM '.MAIN_DB_PREFIX.'opensurvey_sondage';
49 $sql .= ' WHERE entity IN ('.getEntity('survey').')';
50 $resql = $db->query($sql);
51 if ($resql)
52 {
53  $obj = $db->fetch_object($resql);
54  $nbsondages = $obj->nb;
55 } else dol_print_error($db, '');
56 
57 
58 $title = $langs->trans("OpenSurveyArea");
59 llxHeader('', $title);
60 
61 print load_fiche_titre($title, '', 'poll');
62 
63 
64 print '<div class="fichecenter"><div class="fichethirdleft">';
65 
66 print '<div class="div-table-responsive-no-min">';
67 print '<table class="noborder centpercent">';
68 print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("OpenSurveyArea").'</td></tr>';
69 print '<tr class="oddeven">';
70 print '<td>'.$langs->trans("NbOfSurveys").'</td><td class="right"><a href="list.php">'.$nbsondages.'</a></td>';
71 print "</tr>";
72 //print '<tr class="liste_total"><td>'.$langs->trans("Total").'</td><td class="right">';
73 //print $total;
74 //print '</td></tr>';
75 print '</table>';
76 print '</div>';
77 
78 print '</div></div>';
79 
80 $parameters = array('user' => $user);
81 $reshook = $hookmanager->executeHooks('dashboardOpenSurvey', $parameters, $object); // Note that $action and $object may have been modified by hook
82 
83 // End of page
84 llxFooter();
85 $db->close();
llxHeader()
Empty header.
Definition: wrapper.php:45
Class to manage hooks.
load_fiche_titre($titre, $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 Calling this function terminate execution ...
print
Draft customers invoices.
Definition: index.php:89
if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if((!empty($conf->fournisseur->enabled)&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)||!empty($conf->supplier_invoice->enabled))&&$user->rights->fournisseur->facture->lire) if(!empty($conf->don->enabled)&&$user->rights->don->lire) if(!empty($conf->tax->enabled)&&$user->rights->tax->charges->lire) if(!empty($conf->facture->enabled)&&!empty($conf->commande->enabled)&&$user->rights->commande->lire &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if((!empty($conf->fournisseur->enabled)&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)||!empty($conf->supplier_invoice->enabled))&&$user->rights->fournisseur->facture->lire) $resql
Social contributions to pay.
Definition: index.php:1232
dol_print_error($db= '', $error= '', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
llxFooter()
Empty footer.
Definition: wrapper.php:59