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

   1  <?php
   2  /* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
   3   * Copyright (C) 2004 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.7.2.1 2005/12/26 13:45:56 hregis Exp $
  20   * $Source: /cvsroot/dolibarr/dolibarr/htdocs/societe/notify/index.php,v $
  21   */
  22  require ("./pre.inc.php");
  23  $langs->load("companies");
  24  $langs->load("banks");
  25  
  26  /*
  27   * Sécurité accés client
  28   */
  29  if ($user->societe_id > 0) 
  30  {
  31    $action = '';
  32    $socid = $user->societe_id;
  33  }
  34  
  35  
  36  llxHeader();
  37  
  38  if ($sortorder == "")
  39  {
  40    $sortorder="ASC";
  41  }
  42  if ($sortfield == "")
  43  {
  44    $sortfield="s.nom";
  45  }
  46  
  47  if ($page == -1) { $page = 0 ; }
  48  
  49  $offset = $conf->liste_limit * $page ;
  50  $pageprev = $page - 1;
  51  $pagenext = $page + 1;
  52  
  53  /*
  54   * Mode Liste
  55   *
  56   *
  57   *
  58   */
  59  print_barre_liste("Liste des societes", $page, "index.php");
  60  
  61  $sql = "SELECT s.nom, s.idp, c.name, c.firstname, a.titre,n.rowid FROM ".MAIN_DB_PREFIX."socpeople as c, ".MAIN_DB_PREFIX."action_def as a, ".MAIN_DB_PREFIX."notify_def as n, ".MAIN_DB_PREFIX."societe as s";
  62  $sql .= " WHERE n.fk_contact = c.idp AND a.rowid = n.fk_action";
  63  $sql .= " AND n.fk_soc = s.idp";
  64  
  65  if ($socid > 0) {
  66    $sql .= " AND s.idp = " . $user->societe_id;
  67  }
  68  
  69  $sql .= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit, $offset);
  70  
  71  $result = $db->query($sql);
  72  if ($result)
  73  {
  74    $num = $db->num_rows();
  75    $i = 0;
  76      
  77  
  78    print "<table class=\noborder\" width=\"100%\">";
  79    print '<tr class="liste_titre">';
  80    print_liste_field_titre($langs->trans("Company"),"index.php","s.nom","","",'valign=\"center\"');
  81    print_liste_field_titre($langs->trans("Contact"),"index.php","c.name");
  82    print_liste_field_titre($langs->trans("Action"),"index.php","a.titre");
  83    print "</tr>\n";
  84    $var=True;
  85    while ($i < $num)
  86      {
  87        $obj = $db->fetch_object( $i);
  88      
  89        $var=!$var;
  90      
  91        print "<tr $bc[$var]>";
  92        print "<td><a href=\"fiche.php?socid=$obj->idp\">$obj->nom</A></td>\n";
  93        print "<td>".$obj->firstname." ".$obj->name."</td>\n";
  94        print "<td>".$obj->titre."</td>\n";      
  95        print "</tr>\n";
  96        $i++;
  97      }
  98    print "</table>";
  99    $db->free();
 100  }
 101  else
 102  {
 103    print $db->error() . ' ' . $sql;
 104  }
 105  
 106  $db->close();
 107  
 108  llxFooter("<em>Derni&egrave;re modification $Date: 2005/12/26 13:45:56 $ r&eacute;vision $Revision: 1.7.2.1 $</em>");
 109  ?>


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