osc-languages.php 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. <?php
  2. /* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
  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/admin/osc-languages.php
  19. * \ingroup boutique
  20. * \brief Page d'administration/configuration du module Boutique
  21. */
  22. require '../main.inc.php';
  23. $langs->load("admin");
  24. if (!$user->admin)
  25. accessforbidden();
  26. llxHeader();
  27. if (! dol_strlen(OSC_DB_NAME))
  28. {
  29. print "Non dispo";
  30. llxFooter();
  31. }
  32. if ($sortfield == "") {
  33. $sortfield="lower(p.label),p.price";
  34. }
  35. if ($sortorder == "") {
  36. $sortorder="ASC";
  37. }
  38. if ($page == -1) { $page = 0 ; }
  39. $limit = $conf->liste_limit;
  40. $offset = $limit * $page ;
  41. print_barre_liste("Liste des langues oscommerce", $page, "osc-languages.php");
  42. $sql = "SELECT l.languages_id, l.name, l.code FROM ".$conf->global->OSC_DB_NAME.".".$conf->global->OSC_DB_TABLE_PREFIX."languages as l";
  43. $sql.= $db->plimit($limit, $offset);
  44. print "<p><TABLE border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"4\">";
  45. print "<tr class=\"liste_titre\">";
  46. print "<td>id</td>";
  47. print "<td>Name</td>";
  48. print "<td>Code</td>";
  49. print "</TR>\n";
  50. $resql=$db->query($sql);
  51. if ($resql)
  52. {
  53. $num = $db->num_rows($resql);
  54. $i = 0;
  55. $var=True;
  56. while ($i < $num) {
  57. $objp = $db->fetch_object($resql);
  58. $var=!$var;
  59. print "<tr ".$bc[$var].">";
  60. print "<TD>$objp->languages_id</TD>\n";
  61. print "<TD>$objp->name</TD>\n";
  62. print "<TD>$objp->code</TD>\n";
  63. print "</TR>\n";
  64. $i++;
  65. }
  66. $db->free();
  67. }
  68. print "</TABLE>";
  69. $db->close();
  70. llxFooter();