[ Index ]
 

Code source de Dolibarr 2.0.1

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/htdocs/telephonie/service/ -> liste.php (source)

   1  <?PHP
   2  /* Copyright (C) 2005 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 2 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, write to the Free Software
  16   * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  17   *
  18   * $Id: liste.php,v 1.3 2005/09/02 11:47:29 rodolphe Exp $
  19   * $Source: /cvsroot/dolibarr/dolibarr/htdocs/telephonie/service/liste.php,v $
  20   *
  21   */
  22  require ("./pre.inc.php");
  23  
  24  if (!$user->rights->telephonie->service->lire)
  25    accessforbidden();
  26  
  27  $page = $_GET["page"];
  28  $sortorder = $_GET["sortorder"];
  29  $sortfield = $_GET["sortfield"];
  30  
  31  llxHeader('','Telephonie - Services - Liste');
  32  /*
  33   * Sécurité accés client
  34   */
  35  if ($user->societe_id > 0) 
  36  {
  37    $action = '';
  38    $socidp = $user->societe_id;
  39  }
  40  
  41  if ($sortorder == "") {
  42    $sortorder="ASC";
  43  }
  44  if ($sortfield == "") {
  45    $sortfield="s.statut";
  46  }
  47  
  48  /*
  49   * Recherche
  50   *
  51   *
  52   */
  53  
  54  if ($page == -1) { $page = 0 ; }
  55  
  56  $offset = $conf->liste_limit * $page ;
  57  $pageprev = $page - 1;
  58  $pagenext = $page + 1;
  59  
  60  /*
  61   * Mode Liste
  62   *
  63   *
  64   *
  65   */
  66  
  67  $service = new TelephonieService($db);
  68  
  69  $sql = "SELECT s.rowid, s.libelle, s.montant,s.statut";
  70  $sql .= " FROM ".MAIN_DB_PREFIX."telephonie_service as s";
  71  
  72  $sql .= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit+1, $offset);
  73  
  74  $result = $db->query($sql);
  75  if ($result)
  76  {
  77    $num = $db->num_rows();
  78    $i = 0;
  79    
  80    $urladd= "&amp;statut=".$_GET["statut"];
  81  
  82    print_barre_liste("Services", $page, "liste.php", $urladd, $sortfield, $sortorder, '', $num);
  83    print"\n<!-- debut table -->\n";
  84    print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">';
  85    print '<tr class="liste_titre">';
  86  
  87    print '<td>Libellé</td>';
  88    print '<td align="right">Montant HT</td>';
  89    print '<td align="center">Statut</td>';
  90  
  91    print "</tr>\n";
  92  
  93    $var=True;
  94  
  95    while ($i < min($num,$conf->liste_limit))
  96      {
  97        $obj = $db->fetch_object();    
  98        $var=!$var;
  99  
 100        print "<tr $bc[$var]><td>";
 101  
 102        print '<a href="fiche.php?id='.$obj->rowid.'">'.stripslashes($obj->libelle)."</a></td>\n";
 103  
 104        print '<td align="right">'.price($obj->montant)."</td>\n";
 105  
 106        print '<td align="center">'.$service->statuts[$obj->statut].'</td>';
 107        print "</tr>\n";
 108        $i++;
 109      }
 110    print "</table>";
 111    $db->free();
 112  }
 113  else 
 114  {
 115    print $db->error() . ' ' . $sql;
 116  }
 117  
 118  $db->close();
 119  
 120  llxFooter("<em>Derni&egrave;re modification $Date: 2005/09/02 11:47:29 $ r&eacute;vision $Revision: 1.3 $</em>");
 121  ?>


Généré le : Mon Nov 26 12:29:37 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics