[ 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/commande/ -> index.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: index.php,v 1.4 2005/09/02 11:37:49 rodolphe Exp $
  19   * $Source: /cvsroot/dolibarr/dolibarr/htdocs/telephonie/ligne/commande/index.php,v $
  20   *
  21   */
  22  require ("./pre.inc.php");
  23  
  24  $page = $_GET["page"];
  25  $sortorder = $_GET["sortorder"];
  26  
  27  if (!$user->rights->telephonie->ligne_commander)
  28    accessforbidden();
  29  
  30  llxHeader('','Telephonie - Ligne - Commande');
  31  
  32  
  33  
  34  /*
  35   * Sécurité accés client
  36   */
  37  if ($user->societe_id > 0) 
  38  {
  39    $action = '';
  40    $socidp = $user->societe_id;
  41  }
  42  
  43  /*
  44   * Mode Liste
  45   *
  46   *
  47   *
  48   */
  49  
  50  print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">';
  51  
  52  print '<tr><td width="30%" valign="top">';
  53  
  54  
  55  $sql = "SELECT distinct statut, count(*) as cc";
  56  $sql .= " FROM ".MAIN_DB_PREFIX."telephonie_societe_ligne as l";
  57  $sql .= " GROUP BY statut";
  58  
  59  if ($db->query($sql))
  60  {
  61    $num = $db->num_rows();
  62    $i = 0;
  63    $ligne = new LigneTel($db);
  64    print_titre("Commandes");
  65  
  66    print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">';
  67    print '<tr class="liste_titre"><td>Lignes Statuts</td><td valign="center">Nb</td>';
  68    print "</tr>\n";
  69    $var=True;
  70  
  71    while ($i < min($num,$conf->liste_limit))
  72      {
  73        $obj = $db->fetch_object($i);    
  74        $var=!$var;
  75  
  76        print "<tr $bc[$var]>";
  77        print "<td>".$ligne->statuts[$obj->statut]."</td>\n";
  78        print "<td>".$obj->cc."</td>\n";
  79        print "</tr>\n";
  80        $i++;
  81      }
  82    print "</table>";
  83    $db->free();
  84  }
  85  else 
  86  {
  87    print $db->error() . ' ' . $sql;
  88  }
  89  
  90  if ($user->rights->telephonie->ligne_commander)
  91  {
  92    print '<br>';
  93  
  94    print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">';
  95    print '<tr class="liste_titre"><td>Nouvelle commande</td>';
  96    print "</tr><tr $bc[1]>";
  97    print '<td><a href="fiche.php">'.img_edit().'</a>';
  98    print '&nbsp;<a href="fiche.php">Créer une nouvelle commande</a></td>';
  99    print "</tr>\n";
 100    print '</table>';
 101  }
 102  
 103  print '</td><td valign="top">';
 104  
 105  /*
 106   * Seconde colonne
 107   *
 108   */
 109  $sql = "SELECT ";
 110  $sql .= " cli,mode,situation,date_mise_service,date_resiliation,motif_resiliation,commentaire,fichier, traite ";
 111  
 112  $sql .= " FROM ".MAIN_DB_PREFIX."telephonie_commande_retour";
 113  $sql .= " WHERE traite = 0 AND mode = 'PRESELECTION'";
 114  
 115  if ($db->query($sql))
 116  {
 117    $num = $db->num_rows();
 118    $i = 0;
 119  
 120    print_titre("Retour");
 121  
 122    print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">';
 123    print '<tr class="liste_titre"><td>Lignes Statuts</td><td align="center">Resultat</td>';
 124    print '<td align="center">Date</td><td>Commentaire</td>';
 125    print "</tr>\n";
 126    $var=True;
 127  
 128    while ($i < $num)
 129      {
 130        $obj = $db->fetch_object();
 131        $var=!$var;
 132  
 133        $ligne = new LigneTel($db);
 134  
 135        if ( $ligne->fetch($obj->cli) == 1);
 136        {
 137      print "<tr $bc[$var]><td>";
 138      print '<img src="'.DOL_URL_ROOT.'/telephonie/ligne/graph'.$ligne->statut.'.png">&nbsp;';
 139      print '<a href="'.DOL_URL_ROOT.'/telephonie/ligne/fiche.php?numero='.$obj->cli.'">';
 140      print $obj->cli."</a></td>\n";
 141      print '<td align="center">'.$obj->situation."</td>\n";
 142      print '<td align="center">'.$obj->date_mise_service."</td>\n";
 143      print '<td>'.$obj->commentaire."</td>\n";
 144      print "</tr>\n";
 145        }
 146        $i++;
 147      }
 148    print "</table>";
 149    $db->free();
 150  }
 151  else 
 152  {
 153    print $db->error() . ' ' . $sql;
 154  }
 155  
 156  
 157  print '</td></tr>';
 158  print '</table>';
 159  
 160  $db->close();
 161  
 162  llxFooter("<em>Derni&egrave;re modification $Date: 2005/09/02 11:37:49 $ r&eacute;vision $Revision: 1.4 $</em>");
 163  ?>


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