[ Index ] |
|
Code source de Dolibarr 2.0.1 |
1 <?php 2 /* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org> 3 * Copyright (C) 2004-2005 Laurent Destailleur <eldy@users.sourceforge.net> 4 * Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com> 5 * 6 * This program is free software; you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License as published by 8 * the Free Software Foundation; either version 2 of the License, or 9 * (at your option) any later version. 10 * 11 * This program is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 * GNU General Public License for more details. 15 * 16 * You should have received a copy of the GNU General Public License 17 * along with this program; if not, write to the Free Software 18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 19 * 20 * $Id: popuprop.php,v 1.16 2005/12/07 22:34:28 eldy Exp $ 21 * $Source: /cvsroot/dolibarr/dolibarr/htdocs/product/popuprop.php,v $ 22 */ 23 24 /** \file htdocs/product/popuprop.php 25 \ingroup propal, produit 26 \brief Liste des produits/services par popularité 27 \version $Revision: 1.16 $ 28 */ 29 30 require ("./pre.inc.php"); 31 require_once(DOL_DOCUMENT_ROOT.'/product.class.php'); 32 33 $sortfield = isset($_GET["sortfield"])?$_GET["sortfield"]:$_POST["sortfield"]; 34 $sortorder = isset($_GET["sortorder"])?$_GET["sortorder"]:$_POST["sortorder"]; 35 $page = $_GET["page"]; 36 if ($page < 0) $page = 0; 37 if (! $sortfield) $sortfield="c"; 38 if (! $sortorder) $sortorder="DESC"; 39 40 if ($page == -1) { $page = 0 ; } 41 $limit = $conf->liste_limit; 42 $offset = $limit * $page ; 43 44 45 $staticproduct=new Product($db); 46 47 48 llxHeader(); 49 50 //On n'affiche le lien page suivante que s'il y a une page suivante ... 51 $sql = "select count(*) as c from ".MAIN_DB_PREFIX."product"; 52 $result=$db->query($sql); 53 if ($result) 54 { 55 $obj = $db->fetch_object($result); 56 $num = $obj->c; 57 } 58 59 print_barre_liste("Liste des produits et services par popularité", $page, "popuprop.php","","","","",$num); 60 61 print '<table class="noborder" width="100%">'; 62 63 print "<tr class=\"liste_titre\">"; 64 print_liste_field_titre($langs->trans("Ref"),"popuprop.php", "p.ref","","","",$sortfield); 65 print_liste_field_titre($langs->trans("Type"),"popuprop.php", "p.type","","","",$sortfield); 66 print_liste_field_titre($langs->trans("Label"),"popuprop.php", "p.label","","","",$sortfield); 67 print_liste_field_titre("Nb. de proposition","popuprop.php", "c","","",'align="right"',$sortfield); 68 print "</tr>\n"; 69 70 $sql = "SELECT p.rowid, p.label, p.ref, fk_product_type, count(*) as c"; 71 $sql .= " FROM ".MAIN_DB_PREFIX."propaldet as pd, ".MAIN_DB_PREFIX."product as p"; 72 $sql .= " WHERE p.rowid = pd.fk_product group by (p.rowid)"; 73 $sql .= " ORDER BY $sortfield $sortorder "; 74 $sql .= $db->plimit( $limit ,$offset); 75 76 $result=$db->query($sql) ; 77 if ($result) 78 { 79 $num = $db->num_rows($result); 80 $i = 0; 81 82 $var=True; 83 while ($i < $num) 84 { 85 $objp = $db->fetch_object($result); 86 $var=!$var; 87 print "<tr $bc[$var]>"; 88 print '<td><a href="'.DOL_URL_ROOT.'/product/stats/fiche.php?id='.$objp->rowid.'">'; 89 if ($objp->fk_product_type) print img_object($langs->trans("ShowService"),"service"); 90 else print img_object($langs->trans("ShowProduct"),"product"); 91 print " "; 92 print $objp->ref.'</a></td>'; 93 print '<td>'.$staticproduct->typeprodser[$objp->fk_product_type].'</td>'; 94 print '<td>'.$objp->label.'</td>'; 95 print '<td align="right">'.$objp->c.'</td>'; 96 print "</tr>\n"; 97 $i++; 98 } 99 $db->free(); 100 } 101 print "</table>"; 102 103 $db->close(); 104 105 llxFooter('$Date: 2005/12/07 22:34:28 $ - $Revision: 1.16 $'); 106 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Mon Nov 26 12:29:37 2007 | par Balluche grâce à PHPXref 0.7 |
![]() |