[ 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/ligne/ -> listecommande.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: listecommande.php,v 1.5 2005/11/09 16:10:55 rodolphe Exp $
  19   * $Source: /cvsroot/dolibarr/dolibarr/htdocs/telephonie/ligne/listecommande.php,v $
  20   *
  21   */
  22  
  23  /**            \file       htdocs/telephonie/ligne/listecommande.php
  24              \ingroup    telephonie
  25              \brief      Liste commandes
  26              \version    $Revision: 1.5 $
  27  */
  28  
  29  require ("./pre.inc.php");
  30  
  31  
  32  $page = $_GET["page"];
  33  $sortorder = $_GET["sortorder"];
  34  $sortfield = $_GET["sortfield"];
  35  
  36  llxHeader('','Telephonie - Ligne - Liste');
  37  /*
  38   * Sécurité accés client
  39   */
  40  if ($user->societe_id > 0) 
  41  {
  42    $action = '';
  43    $socidp = $user->societe_id;
  44  }
  45  
  46  if ($sortorder == "") {
  47    $sortorder="ASC";
  48  }
  49  if ($sortfield == "") {
  50    $sortfield="l.date_commande_last";
  51  }
  52  
  53  /*
  54   * Recherche
  55   *
  56   *
  57   */
  58  
  59  if ($page == -1) { $page = 0 ; }
  60  
  61  $offset = $conf->liste_limit * $page ;
  62  $pageprev = $page - 1;
  63  $pagenext = $page + 1;
  64  
  65  /*
  66   * Mode Liste
  67   *
  68   *
  69   *
  70   */
  71  
  72  $sql = "SELECT s.idp as socidp, l.date_commande_last, s.nom, l.ligne, f.nom as fournisseur, l.statut, l.rowid, l.remise";
  73  $sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
  74  $sql .= " ,".MAIN_DB_PREFIX."telephonie_societe_ligne as l";
  75  $sql .= " , ".MAIN_DB_PREFIX."telephonie_fournisseur as f";
  76  $sql .= " WHERE l.statut = 2 AND l.fk_soc = s.idp AND l.fk_fournisseur = f.rowid";
  77  
  78  if ($_GET["search_ligne"])
  79  {
  80    $sel =urldecode($_GET["search_ligne"]);
  81    $sel = ereg_replace("\.","",$sel);
  82    $sel = ereg_replace(" ","",$sel);
  83    $sql .= " AND l.ligne LIKE '%".$sel."%'";
  84  }
  85  
  86  if ($_GET["search_client"])
  87  {
  88    $sel =urldecode($_GET["search_client"]);
  89    $sql .= " AND s.nom LIKE '%".$sel."%'";
  90  }
  91  
  92  $sql .= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit+1, $offset);
  93  
  94  $resql = $db->query($sql);
  95  if ($resql)
  96  {
  97    $num = $db->num_rows($resql);
  98    $i = 0;
  99    
 100    print_barre_liste("Lignes", $page, "listecommande.php", "", $sortfield, $sortorder, '', $num);
 101  
 102    print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">';
 103    print '<tr class="liste_titre">';
 104    print_liste_field_titre("Ligne","listecommande.php","l.ligne");
 105    print_liste_field_titre("Client (Agence/Filiale)","listecommande.php","s.nom");
 106  
 107    print '<td align="center">Date</td>';
 108    print '<td>Fournisseur</td>';
 109  
 110    print "</tr>\n";
 111  
 112    print '<tr class="liste_titre">';
 113    print '<form action="listecommande.php" method="GET">';
 114    print '<td><input type="text" name="search_ligne" value="'. $_GET["search_ligne"].'" size="12"></td>';  print '<td><input type="text" name="search_client" value="'. $_GET["search_client"].'" size="20"></td>';
 115  
 116    print '<td><input type="submit" class="button" value="'.$langs->trans("Search").'"></td>';
 117  
 118    print '<td>&nbsp;</td>';
 119    print '<td>&nbsp;</td>';
 120    print '</form>';
 121    print '</tr>';
 122  
 123  
 124    $var=True;
 125  
 126    $ligne = new LigneTel($db);
 127  
 128    while ($i < min($num,$conf->liste_limit))
 129      {
 130        $obj = $db->fetch_object($resql);    
 131        $var=!$var;
 132  
 133        print "<tr $bc[$var]><td>";
 134  
 135        print '<img src="./graph'.$obj->statut.'.png">&nbsp;';
 136        
 137        print '<a href="'.DOL_URL_ROOT.'/telephonie/ligne/fiche.php?id='.$obj->rowid.'">';
 138        print img_file();
 139        
 140        print '</a>&nbsp;';
 141  
 142        print '<a href="fiche.php?id='.$obj->rowid.'">'.dolibarr_print_phone($obj->ligne)."</a></td>\n";
 143        print '<td><a href="'.DOL_URL_ROOT.'/soc.php?socid='.$obj->socidp.'">'.$obj->nom.'</a></td>';
 144        print '<td align="center">'.$obj->date_commande_last."</td>\n";
 145  
 146        print "<td>".$obj->fournisseur."</td>\n";
 147        print "</tr>\n";
 148        $i++;
 149      }
 150    print "</table>";
 151    $db->free();
 152  }
 153  else 
 154  {
 155    print $db->error() . ' ' . $sql;
 156  }
 157  
 158  $db->close();
 159  
 160  llxFooter("<em>Derni&egrave;re modification $Date: 2005/11/09 16:10:55 $ r&eacute;vision $Revision: 1.5 $</em>");
 161  ?>


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