[ 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/adsl/ -> history.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: history.php,v 1.3 2005/08/19 14:15:36 rodolphe Exp $
  19   * $Source: /cvsroot/dolibarr/dolibarr/htdocs/telephonie/adsl/history.php,v $
  20   *
  21   */
  22  
  23  require ("./pre.inc.php");
  24  
  25  if (!$user->rights->telephonie->adsl->lire) accessforbidden();
  26  
  27  $mesg = '';
  28  
  29  llxHeader("","","Historique Liaison ADSL");
  30  
  31  /*
  32   * Affichage
  33   *
  34   */
  35  
  36  if ($_GET["id"])
  37  {
  38    if ($_GET["action"] <> 're-edit')
  39      {
  40        $ligne = new LigneADSL($db);
  41        
  42        $result = $ligne->fetch_by_id($_GET["id"]);            
  43      }
  44    
  45    if ( $result )
  46      { 
  47        $h=0;
  48        $head[$h][0] = DOL_URL_ROOT."/telephonie/adsl/fiche.php?id=".$ligne->id;
  49        $head[$h][1] = $langs->trans("Liaison ADSL");
  50        $h++;
  51        
  52        $head[$h][0] = DOL_URL_ROOT."/telephonie/adsl/history.php?id=".$ligne->id;
  53        $head[$h][1] = $langs->trans('Historique');
  54        $hselected = $h;
  55        $h++;
  56        
  57        dolibarr_fiche_head($head, $hselected, 'Liaison ADSL : '.$ligne->numero);
  58  
  59        print '<table class="border" width="100%" cellspacing="0" cellpadding="4">';
  60  
  61        print '<tr><td width="20%">Numéro de support</td><td colspan="2">'.dolibarr_print_phone($ligne->numero).'</td></tr>';
  62  
  63                     
  64        $client = new Societe($db, $ligne->client_id);
  65        $client->fetch($ligne->client_id);
  66  
  67        print '<tr><td width="20%">Client</td><td colspan="2">'.$client->nom.'</td></tr>';
  68  
  69        print '<tr><td width="20%">Statut</td><td colspan="2">';
  70        print '<img src="./statut'.$ligne->statut.'.png">&nbsp;';
  71        print $ligne->statuts[$ligne->statut];
  72        print '</td></tr>';
  73  
  74        print '<tr class="liste_titre"><td colspan="3">Historique</td></tr>';
  75  
  76        /* historique */
  77           
  78        $sql = "SELECT ".$db->pdate("l.tms").", l.statut, l.fk_user, u.name, u.firstname, l.comment";
  79        $sql .= " FROM ".MAIN_DB_PREFIX."telephonie_adsl_ligne_statut as l";
  80        $sql .= ",".MAIN_DB_PREFIX."user as u";
  81        $sql .= " WHERE u.rowid = l.fk_user AND l.fk_ligne = ".$ligne->id;
  82        $sql .= " ORDER BY l.tms DESC ";
  83  
  84        $resql = $db->query($sql);
  85  
  86        if ( $resql )
  87      {
  88        $num = $db->num_rows($resql);
  89        if ( $num > 0 )
  90          {
  91            $i = 0;
  92            while ($i < $num)
  93          {
  94            $row = $db->fetch_row($resql);
  95  
  96            print '<tr><td valign="top" width="20%">'.strftime("%a %d %B %Y %H:%M:%S",$row[0]).'</td>';
  97  
  98            print '<td><img src="./statut'.$row[1].'.png">&nbsp;';
  99            print $ligne->statuts[$row[1]];
 100            if ($row[5])
 101              {
 102                print '<br />'.$row[5];
 103              }
 104  
 105            print '</td><td>'.$row[4] . " " . $row[3] . "</td></tr>";
 106            $i++;
 107          }
 108          }
 109        $db->free($resql);
 110      }
 111        else
 112      {
 113        print $sql;
 114      }
 115        
 116        /* Fin Contacts */
 117  
 118        print "</table>";
 119      }
 120  
 121    /*
 122     *
 123     *
 124     *
 125     */
 126  
 127  }
 128  else
 129  {
 130    print "Error";
 131  }
 132  
 133  $db->close();
 134  
 135  llxFooter("<em>Derni&egrave;re modification $Date: 2005/08/19 14:15:36 $ r&eacute;vision $Revision: 1.3 $</em>");
 136  ?>


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