[ Index ] |
|
Code source de Dolibarr 2.0.1 |
1 <?php 2 /* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org> 3 * 4 * This program is free software; you can redistribute it and/or modify 5 * it under the terms of the GNU General Public License as published by 6 * the Free Software Foundation; either version 2 of the License, or 7 * (at your option) any later version. 8 * 9 * This program is distributed in the hope that it will be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 * GNU General Public License for more details. 13 * 14 * You should have received a copy of the GNU General Public License 15 * along with this program; if not, write to the Free Software 16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 * 18 * $Id: index.php,v 1.6 2005/07/09 14:34:44 eldy Exp $ 19 * $Source: /cvsroot/dolibarr/dolibarr/htdocs/product/critiques/index.php,v $ 20 * 21 */ 22 23 require ("./pre.inc.php"); 24 25 llxHeader(); 26 27 if ($sortfield == "") { 28 $sortfield="date_added"; 29 } 30 if ($sortorder == "") { 31 $sortorder="DESC"; 32 } 33 34 35 if ($page == -1) { $page = 0 ; } 36 $limit = $conf->liste_limit; 37 $offset = $limit * $page ; 38 39 print_barre_liste("Critiques", $page, "index.php"); 40 41 $sql = "SELECT r.reviews_id, r.reviews_rating, d.reviews_text, p.products_name FROM ".OSC_DB_NAME.".reviews as r, ".OSC_DB_NAME.".reviews_description as d, ".OSC_DB_NAME.".products_description as p"; 42 $sql .= " WHERE r.reviews_id = d.reviews_id AND r.products_id=p.products_id"; 43 $sql .= " AND p.language_id = ".OSC_LANGUAGE_ID. " AND d.languages_id=".OSC_LANGUAGE_ID; 44 $sql .= " ORDER BY $sortfield $sortorder "; 45 $sql .= $db->plimit( $limit ,$offset); 46 47 print "<p><TABLE border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"4\">"; 48 print '<TR class="liste_titre">'; 49 print "<td>Produit</td>"; 50 print "<td>Critique</td>"; 51 print "<td align=\"center\">Note</td>"; 52 print "<TD align=\"right\"></TD>"; 53 print "</TR>\n"; 54 55 if ( $db->query($sql) ) { 56 $num = $db->num_rows(); 57 $i = 0; 58 59 $var=True; 60 while ($i < $num) { 61 $objp = $db->fetch_object( $i); 62 $var=!$var; 63 print "<TR $bc[$var]>"; 64 print "<TD>".substr($objp->products_name, 0, 30)."</TD>\n"; 65 print '<TD><a href="fiche.php?id='.$objp->reviews_id.'">'.substr($objp->reviews_text, 0, 40)." ...</a></td>\n"; 66 print "<td align=\"center\">$objp->reviews_rating</TD>\n"; 67 print "</TR>\n"; 68 $i++; 69 } 70 $db->free(); 71 } 72 73 print "</TABLE>"; 74 75 76 $db->close(); 77 78 llxFooter("<em>Dernière modification $Date: 2005/07/09 14:34:44 $ révision $Revision: 1.6 $</em>"); 79 ?>
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 |
![]() |