Fix: Plantage requete sql

This commit is contained in:
Laurent Destailleur 2005-04-28 20:33:30 +00:00
parent a9771a9951
commit a396ff68b9
2 changed files with 16 additions and 17 deletions

View File

@ -1,7 +1,7 @@
<?php <?php
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2003 Éric Seigne <erics@rycks.com> * Copyright (C) 2003 Éric Seigne <erics@rycks.com>
* Copyright (C) 2004 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2005 Laurent Destailleur <eldy@users.sourceforge.net>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -22,7 +22,7 @@
* *
*/ */
/*! /**
\file htdocs/fourn/fiche.php \file htdocs/fourn/fiche.php
\ingroup fournisseur, facture \ingroup fournisseur, facture
\brief Page de fiche fournisseur \brief Page de fiche fournisseur

View File

@ -58,6 +58,11 @@ if ($_POST["button_removefilter"] == $langs->trans("RemoveFilter")) {
$snom=""; $snom="";
} }
if ($_GET["fourn_id"] > 0)
{
$fourn_id = $_GET["fourn_id"];
}
if (isset($_REQUEST['catid'])) if (isset($_REQUEST['catid']))
{ {
$catid = $_REQUEST['catid']; $catid = $_REQUEST['catid'];
@ -76,12 +81,6 @@ $sql .= ", min(ppf.price) as price";
$sql .= ", s.nom"; $sql .= ", s.nom";
$sql .= " FROM ".MAIN_DB_PREFIX."product as p"; $sql .= " FROM ".MAIN_DB_PREFIX."product as p";
if ($_GET["fourn_id"] > 0)
{
$fourn_id = $_GET["fourn_id"];
$sql .= ", ".MAIN_DB_PREFIX."product_fournisseur as pf";
}
if ($catid) if ($catid)
{ {
$sql .= ", ".MAIN_DB_PREFIX."categorie_product as cp"; $sql .= ", ".MAIN_DB_PREFIX."categorie_product as cp";