[ 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/fourn/commande/ -> index.php (source)

   1  <?PHP
   2  /* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
   3   * Copyright (C) 2004-2005 Laurent Destailleur  <eldy@users.sourceforge.net>
   4   *
   5   * This program is free software; you can redistribute it and/or modify
   6   * it under the terms of the GNU General Public License as published by
   7   * the Free Software Foundation; either version 2 of the License, or
   8   * (at your option) any later version.
   9   *
  10   * This program is distributed in the hope that it will be useful,
  11   * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13   * GNU General Public License for more details.
  14   *
  15   * You should have received a copy of the GNU General Public License
  16   * along with this program; if not, write to the Free Software
  17   * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  18   *
  19   * $Id: index.php,v 1.8 2005/09/07 21:50:10 eldy Exp $
  20   * $Source: /cvsroot/dolibarr/dolibarr/htdocs/fourn/commande/index.php,v $
  21   *
  22   */
  23  
  24  /**
  25              \file       htdocs/fourn/commande/index.php
  26              \ingroup    commande
  27              \brief      Page accueil commandes fournisseurs
  28              \version    $Revision: 1.8 $
  29  */
  30  
  31  require ("./pre.inc.php");
  32  require_once (DOL_DOCUMENT_ROOT."/contact.class.php");
  33  
  34  llxHeader('',"Commandes Fournisseurs");
  35  
  36  // Sécurité accés client
  37  if ($user->societe_id > 0) 
  38  {
  39    $action = '';
  40    $socidp = $user->societe_id;
  41  }
  42  
  43  $commande = new CommandeFournisseur($db);
  44  
  45  
  46  
  47  print_barre_liste($langs->trans("SuppliersOrders"), $page, "index.php", "", $sortfield, $sortorder, '', $num);
  48  
  49  
  50  print '<table class="noborder" width="100%">';
  51  print '<tr valign="top"><td width="30%">';
  52  
  53  $sql = "SELECT count(cf.rowid), fk_statut,";
  54  $sql.= " cf.rowid,cf.ref";
  55  $sql.= " FROM ".MAIN_DB_PREFIX."societe as s,";
  56  $sql.= " ".MAIN_DB_PREFIX."commande_fournisseur as cf";
  57  $sql.= " WHERE cf.fk_soc = s.idp ";
  58  $sql.= " GROUP BY cf.fk_statut";
  59  
  60  $resql = $db->query($sql);
  61  if ($resql)
  62  {
  63    $num = $db->num_rows($resql);
  64    $i = 0;
  65    
  66    print '<table class="liste" width="100%">';
  67    print '<tr class="liste_titre"><td>'.$langs->trans("Status").'</td><td align="center">'.$langs->trans("Nb").'</td><td>&nbsp;</td>';
  68    print "</tr>\n";
  69    $var=True;
  70  
  71    while ($i < $num)
  72      {
  73        $row = $db->fetch_row($resql);
  74        $var=!$var;
  75  
  76        print "<tr $bc[$var]>";
  77        print '<td>'.$commande->statuts[$row[1]].'</td>';
  78        print '<td align="center">'.$row[0].'</td>';
  79        print '<td align="center"><a href="liste.php?statut='.$row[1].'"><img src="statut'.$row[1].'.png" border="0" alt="Statut"></a></td>';
  80  
  81        print "</tr>\n";
  82        $i++;
  83      }
  84    print "</table>";
  85    $db->free($resql);
  86  }
  87  else 
  88  {
  89    dolibarr_print_error($db);
  90  }
  91  
  92  print '</td><td witdh="70%" valign="top">';
  93  
  94  $sql = "SELECT u.name, u.firstname";
  95  $sql .= " FROM ".MAIN_DB_PREFIX."user as u";
  96  $sql .= " , ".MAIN_DB_PREFIX."user_rights as ur";
  97  $sql .= " WHERE u.rowid = ur.fk_user";
  98  $sql .= " AND ur.fk_id = 184";
  99  
 100  $resql = $db->query($sql);
 101  if ($resql)
 102  {
 103    $num = $db->num_rows($resql);
 104    $i = 0;
 105    
 106    print '<table class="liste" width="100%">';
 107    print '<tr class="liste_titre"><td>Personnes habilitées à approuver les commandes</td>';
 108    print "</tr>\n";
 109    $var=True;
 110  
 111    while ($i < $num)
 112      {
 113        $row = $db->fetch_row($resql);
 114        $var=!$var;
 115  
 116        print "<tr $bc[$var]>";
 117        print '<td>'.$row[1].' '.$row[0].'</td>';
 118        print "</tr>\n";
 119        $i++;
 120      }
 121    print "</table>";
 122    $db->free($resql);
 123  }
 124  else 
 125  {
 126    dolibarr_print_error($db);
 127  }
 128  
 129  
 130  print '</td></tr></table>';
 131  
 132  
 133  $db->close();
 134  
 135  llxFooter('$Date: 2005/09/07 21:50:10 $ - $Revision: 1.8 $');
 136  ?>


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