* Copyright (C) 2003 Éric Seigne * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * $Id$ * $Source$ * */ require("./pre.inc.php"); require("../contact.class.php"); llxHeader(); $socid = $_GET["socid"]; /* * Sécurité accés client */ if ($user->societe_id > 0) { $action = ''; $socid = $user->societe_id; } /* * * Mode fiche * * */ $societe = new Societe($db); if ( $societe->fetch($socid) ) { $head[0][0] = 'soc.php?socid='.$societe->id; $head[0][1] = "Fiche société"; $h = 1; $head[$h][0] = DOL_URL_ROOT.'/fourn/fiche.php?socid='.$societe->id; $head[$h][1] = 'Fiche Fournisseur'; $a = $h; $h++; $head[$h][0] = DOL_URL_ROOT.'/product/liste.php?type=0&fourn_id='.$societe->id; $head[$h][1] = 'Produits'; $h++; dolibarr_fiche_head($head, $a); print_titre("Fiche fournisseur : $societe->nom"); /* * * */ print ''; print ''; print '
'; /* * */ print ''; print ''; print ''; print '
Tél'.$societe->tel.' fax'.$societe->fax.' 
Adresse'.nl2br($societe->address).'
'.$societe->cp.' '.$societe->ville.'
'; /* * */ print '
'; /* * * Liste des factures associées * */ $sql = "SELECT p.rowid,p.libelle,p.facnumber,".$db->pdate("p.datef")." as df"; $sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as p WHERE p.fk_soc = $societe->id"; $sql .= " ORDER BY p.datef DESC LIMIT 0,4"; if ( $db->query($sql) ) { print ''; $i = 0 ; $num = $db->num_rows(); if ($num > 0) { print ''; print ""; } while ($i < $num && $i < 5) { $obj = $db->fetch_object( $i); $tag = !$tag; print ""; print ''; print ""; $i++; } $db->free(); print "
id\">liste des factures
'; print ''; print img_file(); print $obj->facnumber.' '.$obj->libelle.'".strftime("%d %b %Y", $obj->df) ."
"; } else { print $db->error(); } /* * * */ print '
' . "
\n"; /* * * Liste des contacts * */ print ''; print ""; print ''; print ""; print ""; $sql = "SELECT p.idp, p.name, p.firstname, p.poste, p.phone, p.fax, p.email, p.note"; $sql .= " FROM ".MAIN_DB_PREFIX."socpeople as p WHERE p.fk_soc = $societe->id ORDER by p.datec"; $result = $db->query($sql); $i = 0 ; $num = $db->num_rows(); $tag = True; while ($i < $num) { $obj = $db->fetch_object( $i); if ($tag) { print ""; } else { print ""; } print ""; print ""; print ''; print ''; print ''; print ""; print "\n"; $i++; $tag = !$tag; } print "
Prénom NomPosteTélFaxEmailid&action=addcontact\">Ajouter
$obj->firstname $obj->name"; if ($obj->note) { print "
".nl2br($obj->note); } print "
$obj->poste '.$obj->phone.' '.$obj->fax.' '.$obj->email.' id&action=editcontact&contactid=$obj->idp\">Modifier
"; /* * */ print '
'; print 'Nouvelle Facture'; print '
'; } else { print "Erreur"; } $db->close(); llxFooter("Dernière modification $Date$ révision $Revision$"); ?>