index.php 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. <?php
  2. /* Copyright (C) 2013-2014 Laurent Destailleur <eldy@users.sourceforge.net>
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License as published by
  6. * the Free Software Foundation; either version 3 of the License, or
  7. * (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  16. */
  17. /**
  18. * \file htdocs/opensurvey/index.php
  19. * \ingroup opensurvey
  20. * \brief Home page of opensurvey area
  21. */
  22. require '../main.inc.php';
  23. require_once DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php";
  24. require_once DOL_DOCUMENT_ROOT."/core/lib/files.lib.php";
  25. // Security check
  26. if (!$user->rights->opensurvey->read) accessforbidden();
  27. /*
  28. * View
  29. */
  30. // Load translation files required by the page
  31. $langs->load("opensurvey");
  32. llxHeader();
  33. $nbsondages=0;
  34. $sql='SELECT COUNT(*) as nb FROM '.MAIN_DB_PREFIX.'opensurvey_sondage';
  35. $resql=$db->query($sql);
  36. if ($resql)
  37. {
  38. $obj=$db->fetch_object($resql);
  39. $nbsondages=$obj->nb;
  40. }
  41. else dol_print_error($db,'');
  42. print load_fiche_titre($langs->trans("OpenSurveyArea"));
  43. print '<div class="fichecenter"><div class="fichethirdleft">';
  44. $nbsondages=0;
  45. $sql='SELECT COUNT(*) as nb FROM '.MAIN_DB_PREFIX.'opensurvey_sondage';
  46. $resql=$db->query($sql);
  47. if ($resql)
  48. {
  49. $obj=$db->fetch_object($resql);
  50. $nbsondages=$obj->nb;
  51. }
  52. else dol_print_error($db,'');
  53. print '<table class="noborder" width="100%">';
  54. print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("OpenSurveyArea").'</td></tr>';
  55. print "<tr ".$bc[0].">";
  56. print '<td>'.$langs->trans("NbOfSurveys").'</td><td align="right"><a href="list.php">'.$nbsondages.'</a></td>';
  57. print "</tr>";
  58. //print '<tr class="liste_total"><td>'.$langs->trans("Total").'</td><td align="right">';
  59. //print $total;
  60. //print '</td></tr>';
  61. print '</table>';
  62. print '</div></div></div>';
  63. // End of page
  64. llxFooter();
  65. $db->close();