[ 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/tarifs/ -> fiche.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: fiche.php,v 1.1 2005/05/11 13:11:36 rodolphe Exp $
  19   * $Source: /cvsroot/dolibarr/dolibarr/htdocs/telephonie/tarifs/fiche.php,v $
  20   *
  21   */
  22  
  23  require ("./pre.inc.php");
  24  
  25  $mesg = '';
  26  
  27  llxHeader("","","Fiche Tarif");
  28  
  29  if ($cancel == $langs->trans("Cancel"))
  30  {
  31    $action = '';
  32  }
  33  /*
  34   * Affichage
  35   *
  36   */
  37  /*
  38   * Création
  39   *
  40   */
  41  
  42  
  43  if ($_GET["id"])
  44  {
  45    
  46    
  47    $h=0;
  48    $head[$h][0] = DOL_URL_ROOT."/telephonie/tarifs/fiche.php?id=".$soc->id;
  49    $head[$h][1] = $langs->trans("Lignes");
  50    $hselected = $h;
  51    $h++;
  52    
  53    dolibarr_fiche_head($head, $hselected, 'Tarif : '.$soc->nom);
  54    
  55    print '<table class="border" cellpadding="3" cellspacing="0" width="100%">';
  56    print '<tr><td width="20%">'.$langs->trans('Name').'</td><td>'.$soc->nom.'</td><td>'.$langs->trans('Prefix').'</td><td>'.$soc->prefix_comm.'</td></tr>';
  57    
  58    print "<tr><td valign=\"top\">".$langs->trans('Address')."</td><td colspan=\"3\">".nl2br($soc->adresse)."<br>".$soc->cp." ".$soc->ville." ".$soc->pays."</td></tr>";
  59    
  60    print '<tr><td>'.$langs->trans('Phone').'</td><td>'.dolibarr_print_phone($soc->tel).'</td>';
  61    print '<td>'.$langs->trans('Fax').'</td><td>'.dolibarr_print_phone($soc->fax).'</td></tr>';
  62    print '<tr><td>'.$langs->trans('Web').'</td><td colspan="3">';
  63    if ($soc->url) { print '<a href="http://'.$soc->url.'">http://'.$soc->url.'</a>'; }
  64    print '</td></tr>';
  65    
  66    print '<tr><td><a href="'.DOL_URL_ROOT.'/societe/rib.php?socid='.$soc->id.'">'.img_edit() ."</a>&nbsp;";
  67    print $langs->trans('RIB').'</td><td colspan="3">';
  68    print $soc->display_rib();
  69    print '</td></tr>';
  70    
  71    print '</table><br />';
  72    
  73    print '<table class="border" width="100%" cellspacing="0" cellpadding="4">';
  74        
  75        //print '<tr><td width="20%">Numéro</td><td>'.dolibarr_print_phone($ligne->numero).'</td>';
  76        //print '<td>Facturée : '.$ligne->facturable.'</td></tr>';
  77        
  78        /* Lignes */
  79           
  80        $sql = "SELECT s.idp as socidp, s.nom, l.ligne, f.nom as fournisseur, l.statut, l.rowid, l.remise";
  81        $sql .= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."telephonie_societe_ligne as l";
  82        $sql .= " , ".MAIN_DB_PREFIX."telephonie_fournisseur as f";
  83        $sql .= " WHERE l.fk_soc = s.idp AND l.fk_fournisseur = f.rowid";
  84        $sql .= " AND s.idp = ".$soc->id;
  85        
  86        if ( $db->query( $sql) )
  87          {
  88            $num = $db->num_rows();
  89            if ( $num > 0 )
  90          {
  91            $i = 0;
  92  
  93            $ligne = new LigneTel($db);
  94  
  95            print '<tr class="liste_titre"><td width="15%" valign="center">Ligne';
  96            print '</td><td align="center">Statut</td><td align="center">Remise LMN';
  97            print '</td><td>Fournisseur</td>';
  98  
  99            print "</tr>\n";
 100  
 101            while ($i < $num)
 102              {
 103                $obj = $db->fetch_object($i);    
 104                $var=!$var;
 105  
 106                print "<tr $bc[$var]><td>";
 107  
 108                print '<img src="./graph'.$obj->statut.'.png">&nbsp;';
 109        
 110                print '<a href="'.DOL_URL_ROOT.'/telephonie/ligne/fiche.php?id='.$obj->rowid.'">';
 111                print img_file();
 112        
 113                print '</a>&nbsp;';
 114  
 115                print '<a href="'.DOL_URL_ROOT.'/telephonie/ligne/fiche.php?id='.$obj->rowid.'">'.dolibarr_print_phone($obj->ligne)."</a></td>\n";
 116  
 117                print '<td align="center">'.$ligne->statuts[$obj->statut]."</td>\n";
 118  
 119                print '<td align="center">'.$obj->remise." %</td>\n";
 120                print "<td>".$obj->fournisseur."</td>\n";
 121                print "</tr>\n";
 122                $i++;
 123              }
 124          }
 125            $db->free();     
 126            
 127          }
 128        else
 129          {
 130            print $sql;
 131          }
 132        
 133        print "</table>";
 134  }
 135  else
 136  {
 137    print "Error";
 138  }
 139  
 140  
 141  print '</div>';
 142  
 143  /* ************************************************************************** */
 144  /*                                                                            */ 
 145  /* Barre d'action                                                             */ 
 146  /*                                                                            */ 
 147  /* ************************************************************************** */
 148  
 149  $db->close();
 150  
 151  llxFooter("<em>Derni&egrave;re modification $Date: 2005/05/11 13:11:36 $ r&eacute;vision $Revision: 1.1 $</em>");
 152  ?>


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