[ 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/ -> communications.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: communications.php,v 1.3 2005/02/07 20:38:33 eldy Exp $
  19   * $Source: /cvsroot/dolibarr/dolibarr/htdocs/telephonie/ligne/communications.php,v $
  20   *
  21   */
  22  require ("./pre.inc.php");
  23  
  24  
  25  $page = $_GET["page"];
  26  $sortorder = $_GET["sortorder"];
  27  
  28  llxHeader();
  29  
  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="DESC";
  41  }
  42  if ($sortfield == "") {
  43    $sortfield="l.date";
  44  }
  45  
  46  if ($page == -1) { $page = 0 ; }
  47  
  48  $offset = $conf->liste_limit * $page ;
  49  $pageprev = $page - 1;
  50  $pagenext = $page + 1;
  51  
  52  /*
  53   * Mode Liste
  54   *
  55   *
  56   *
  57   */
  58  
  59  $sql = "SELECT ligne, numero, date, fourn_cout, fourn_montant, duree, tarif_achat_temp, tarif_achat_fixe, tarif_vente_temp, tarif_vente_fixe, cout_achat, cout_vente, remise";
  60  
  61  $sql .= " FROM ".MAIN_DB_PREFIX."telephonie_communications_details as l";
  62  
  63  if ($_GET["ligne"])
  64  {
  65    $sql .= " WHERE ligne like '%".$_GET["ligne"]."%'";
  66    
  67    if ($_GET["numero"])
  68      {
  69        $sql .= " AND numero like '%".$_GET["numero"]."%'";
  70        
  71      }  
  72  }
  73  
  74  //$sql .= " WHERE fourn_montant > cout_vente AND cout_vente > 0";
  75  
  76  
  77  $sql .= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit+1, $offset);
  78  
  79  $result = $db->query($sql);
  80  if ($result)
  81  {
  82    $num = $db->num_rows();
  83    $i = 0;
  84    
  85    print_barre_liste("Communications", $page, "communications.php", '&amp;ligne='.$_GET["ligne"], $sortfield, $sortorder, '', $num);
  86  
  87    print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">';
  88    print '<tr class="liste_titre">';
  89    print_liste_field_titre("Ligne","communications.php","l.ligne");
  90    print '<td align="center">Date</td><td align="center">Numéro</td><td align="center">';
  91    print "Durée</td>";
  92    print '<td align="right">Prix Vente</td><td align="right">Cout Achat</td>';
  93  
  94    print '<td align="right">Vente /sec</td><td align="right">Vente Fixe</td>';
  95    print '<td align="right">Achat /sec</td><td align="right">Achat Fixe</td>';
  96    print '<td align="right">'.$langs->trans("Discount").'</td>';
  97    print "</tr>\n";
  98  
  99    print '<tr class="liste_titre">';
 100    print '<form action="communications.php" method="GET">';
 101    print '<td><input type="text" name="ligne" value="'. $_GET["ligne"].'" size="20"></td>';
 102    print '<td>&nbsp;</td>';
 103    print '<td align="center"><input type="text" name="numero" value="'. $_GET["numero"].'" size="12"></td>';
 104  
 105    print '<td><input type="submit" class="button" value="'.$langs->trans("Search").'"></td>';
 106  
 107  
 108  
 109    print '<td>&nbsp;</td>';
 110    print '<td align="center" colspan="6">Tarifs</td>';
 111  
 112    print '</form>';
 113    print '</tr>';
 114  
 115  
 116    $var=True;
 117  
 118    while ($i < min($num,$conf->liste_limit))
 119      {
 120        $obj = $db->fetch_object($i);    
 121        $var=!$var;
 122  
 123        print "<tr $bc[$var]>";
 124        print "<td>".$obj->ligne."</td>\n";
 125        print '<td align="center">'.$obj->date."</td>\n";
 126        print '<td align="center">'.$obj->numero."</td>\n";
 127        print '<td align="center">'.$obj->duree."</td>\n";
 128  
 129        print '<td align="right">'.sprintf("%01.4f",$obj->cout_vente)."</td>\n";
 130        print '<td align="right">'.sprintf("%01.4f",$obj->cout_achat)."</td>\n";
 131  
 132        print '<td align="right">'.sprintf("%01.4f",$obj->tarif_vente_temp)."</td>\n";
 133        print '<td align="right">'.sprintf("%01.4f",$obj->tarif_vente_fixe)."</td>\n";
 134  
 135        print '<td align="right">'.sprintf("%01.4f",$obj->tarif_achat_temp)."</td>\n";
 136        print '<td align="right">'.sprintf("%01.4f",$obj->tarif_achat_fixe)."</td>\n";
 137  
 138        print '<td align="center">'.$obj->remise." %</td>\n";
 139  
 140        print "</tr>\n";
 141        $i++;
 142      }
 143    print "</table>";
 144    $db->free();
 145  }
 146  else 
 147  {
 148    print $db->error() . ' ' . $sql;
 149  }
 150  
 151  $db->close();
 152  
 153  llxFooter("<em>Derni&egrave;re modification $Date: 2005/02/07 20:38:33 $ r&eacute;vision $Revision: 1.3 $</em>");
 154  ?>


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