[ 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/ -> vendus.php (source)

   1  <?PHP
   2  /* Copyright (C) 2004-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: vendus.php,v 1.3 2005/09/02 11:47:09 rodolphe Exp $
  19   * $Source: /cvsroot/dolibarr/dolibarr/htdocs/telephonie/service/vendus.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="l.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  $sql = "SELECT s.rowid, idp as socidp, sf.idp as sfidp, sf.nom as nom_facture,s.nom, l.ligne, f.nom as fournisseur, l.statut, l.rowid, l.remise";
  68  $sql .= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."telephonie_societe_ligne as l";
  69  $sql .= " ,  ".MAIN_DB_PREFIX."societe as sf";
  70  $sql .= " , ".MAIN_DB_PREFIX."telephonie_fournisseur as f";
  71  $sql .= " WHERE l.fk_soc = s.idp AND l.fk_fournisseur = f.rowid";
  72  $sql .= " AND l.fk_soc_facture = sf.idp";
  73  
  74  if ($_GET["search_ligne"])
  75  {
  76    $sel =urldecode($_GET["search_ligne"]);
  77    $sel = ereg_replace("\.","",$sel);
  78    $sel = ereg_replace(" ","",$sel);
  79    $sql .= " AND l.ligne LIKE '%".$sel."%'";
  80  }
  81  
  82  if ($_GET["search_client"])
  83  {
  84    $sel =urldecode($_GET["search_client"]);
  85    $sql .= " AND s.nom LIKE '%".$sel."%'";
  86  }
  87  
  88  if ($_GET["search_client_facture"])
  89  {
  90    $sel =urldecode($_GET["search_client_facture"]);
  91    $sql .= " AND sf.nom LIKE '%".$sel."%'";
  92  }
  93  
  94  if (strlen($_GET["statut"]))
  95  {
  96    $sql .= " AND l.statut = ".$_GET["statut"];
  97  }
  98  
  99  $sql .= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit+1, $offset);
 100  
 101  $result = $db->query($sql);
 102  if ($result)
 103  {
 104    $num = $db->num_rows();
 105    $i = 0;
 106    
 107    $urladd= "&amp;statut=".$_GET["statut"];
 108  
 109    print_barre_liste("Contrats", $page, "liste.php", $urladd, $sortfield, $sortorder, '', $num);
 110    print"\n<!-- debut table -->\n";
 111    print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">';
 112    print '<tr class="liste_titre">';
 113  
 114    print_liste_field_titre("Ligne","liste.php","l.ligne");
 115    print_liste_field_titre("Client (Agence/Filiale)","liste.php","s.nom");
 116  
 117    print '<td>Client facturé</td>';
 118    print '<td align="center">Statut</td>';
 119  
 120    print_liste_field_titre("Remise LMN","liste.php","l.remise","","",' align="center"');
 121  
 122    print '<td>Fournisseur</td>';
 123  
 124    print "</tr>\n";
 125  
 126    print '<tr class="liste_titre">';
 127    print '<form action="liste.php" method="GET">';
 128    print '<td><input type="text" name="search_ligne" value="'. $_GET["search_ligne"].'" size="10"></td>'; 
 129    print '<td><input type="text" name="search_client" value="'. $_GET["search_client"].'" size="10"></td>';
 130    print '<td><input type="text" name="search_client_facture" value="'. $_GET["search_client_facture"].'" size="10"></td>';
 131  
 132    print '<td><input type="submit" class="button" value="'.$langs->trans("Search").'"></td>';
 133  
 134  
 135    print '<td>&nbsp;</td>';
 136    print '<td>&nbsp;</td>';
 137  
 138    print '</form>';
 139    print '</tr>';
 140  
 141  
 142    $var=True;
 143  
 144    $ligne = new LigneTel($db);
 145  
 146    while ($i < min($num,$conf->liste_limit))
 147      {
 148        $obj = $db->fetch_object($i);    
 149        $var=!$var;
 150  
 151        print "<tr $bc[$var]><td>";
 152  
 153        print '<img src="./graph'.$obj->statut.'.png">&nbsp;';
 154        
 155        print '<a href="'.DOL_URL_ROOT.'/telephonie/ligne/fiche.php?id='.$obj->rowid.'">';
 156        print img_file();      
 157        print '</a>&nbsp;';
 158  
 159        print '<a href="fiche.php?id='.$obj->rowid.'">'.dolibarr_print_phone($obj->ligne)."</a></td>\n";
 160  
 161        print '<td><a href="'.DOL_URL_ROOT.'/telephonie/client/fiche.php?id='.$obj->socidp.'">'.stripslashes($obj->nom).'</a></td>';
 162        print '<td><a href="'.DOL_URL_ROOT.'/soc.php?socid='.$obj->sfidp.'">'.stripslashes($obj->nom_facture).'</a></td>';
 163  
 164        print '<td align="center">'.$ligne->statuts[$obj->statut]."</td>\n";
 165  
 166        print '<td align="center">'.$obj->remise." %</td>\n";
 167        print "<td>".$obj->fournisseur."</td>\n";
 168        print "</tr>\n";
 169        $i++;
 170      }
 171    print "</table>";
 172    $db->free();
 173  }
 174  else 
 175  {
 176    print $db->error() . ' ' . $sql;
 177  }
 178  
 179  $db->close();
 180  
 181  llxFooter("<em>Derni&egrave;re modification $Date: 2005/09/02 11:47:09 $ r&eacute;vision $Revision: 1.3 $</em>");
 182  ?>


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