[ 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/config/concurrents/ -> liste.php (source)

   1  <?PHP
   2  /* Copyright (C) 2004 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.1 2005/01/26 12:49:52 rodolphe Exp $
  19   * $Source: /cvsroot/dolibarr/dolibarr/htdocs/telephonie/config/concurrents/liste.php,v $
  20   *
  21   */
  22  require ("./pre.inc.php");
  23  
  24  
  25  $page = $_GET["page"];
  26  $sortorder = $_GET["sortorder"];
  27  $sortfield = $_GET["sortfield"];
  28  
  29  llxHeader('','Telephonie - Ligne - Liste');
  30  /*
  31   * Sécurité accés client
  32   */
  33  if ($user->societe_id > 0) 
  34  {
  35    $action = '';
  36    $socidp = $user->societe_id;
  37  }
  38  
  39  if ($sortorder == "") {
  40    $sortorder="ASC";
  41  }
  42  if ($sortfield == "") {
  43    $sortfield="c.nom";
  44  }
  45  
  46  /*
  47   * Recherche
  48   *
  49   *
  50   */
  51  
  52  if ($page == -1) { $page = 0 ; }
  53  
  54  $offset = $conf->liste_limit * $page ;
  55  $pageprev = $page - 1;
  56  $pagenext = $page + 1;
  57  
  58  /*
  59   * Mode Liste
  60   *
  61   *
  62   *
  63   */
  64  
  65  $sql = "SELECT c.rowid, c.nom";
  66  $sql .= " FROM ".MAIN_DB_PREFIX."telephonie_concurrents as c";
  67  $sql .= " WHERE active = 1";
  68  
  69  if ($_GET["search_ligne"])
  70  {
  71    $sel =urldecode($_GET["search_ligne"]);
  72    $sel = ereg_replace("\.","",$sel);
  73    $sel = ereg_replace(" ","",$sel);
  74    $sql .= " AND l.ligne LIKE '%".$sel."%'";
  75  }
  76  
  77  if ($_GET["search_client"])
  78  {
  79    $sel =urldecode($_GET["search_client"]);
  80    $sql .= " AND s.nom LIKE '%".$sel."%'";
  81  }
  82  
  83  if (strlen($_GET["statut"]))
  84  {
  85    $sql .= " AND l.statut = ".$_GET["statut"];
  86  }
  87  
  88  $sql .= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit+1, $offset);
  89  
  90  $result = $db->query($sql);
  91  if ($result)
  92  {
  93    $num = $db->num_rows();
  94    $i = 0;
  95    
  96    $urladd= "&amp;statut=".$_GET["statut"];
  97  
  98    print_barre_liste("Concurrents", $page, "liste.php", $urladd, $sortfield, $sortorder, '', $num);
  99  
 100    print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">';
 101    print '<tr class="liste_titre"><td>Nom</td>';
 102  
 103  
 104    print "</tr>\n";
 105  
 106  
 107    $var=True;
 108  
 109    $ligne = new LigneTel($db);
 110  
 111    while ($i < min($num,$conf->liste_limit))
 112      {
 113        $obj = $db->fetch_object($i);    
 114        $var=!$var;
 115  
 116        print "<tr $bc[$var]><td>";
 117  
 118        print $obj->nom."</td>\n";
 119  
 120  
 121        print "</tr>\n";
 122        $i++;
 123      }
 124    print "</table>";
 125    $db->free();
 126  }
 127  else 
 128  {
 129    print $db->error() . ' ' . $sql;
 130  }
 131  
 132  $db->close();
 133  
 134  llxFooter("<em>Derni&egrave;re modification $Date: 2005/01/26 12:49:52 $ r&eacute;vision $Revision: 1.1 $</em>");
 135  ?>


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