Qual: Les pages de gestion des critiques du module OSCommerces 1 sont mises dans le rep du module
This commit is contained in:
parent
5c0e65bbea
commit
a6b032cc67
@ -1,83 +0,0 @@
|
||||
<?php
|
||||
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2003 Éric Seigne <erics@rycks.com>
|
||||
*
|
||||
* 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");
|
||||
|
||||
llxHeader();
|
||||
|
||||
if ($sortfield == "") {
|
||||
$sortfield="rat";
|
||||
}
|
||||
if ($sortorder == "") {
|
||||
$sortorder="DESC";
|
||||
}
|
||||
|
||||
|
||||
if ($page == -1) { $page = 0 ; }
|
||||
$limit = $conf->liste_limit;
|
||||
$offset = $limit * $page ;
|
||||
|
||||
|
||||
print_barre_liste("Liste des produits classés pas critiques", $page, "bestproduct.php");
|
||||
|
||||
$sql = "SELECT sum(r.reviews_rating)/count(r.reviews_rating) as rat, r.products_id, p.products_model, p.products_quantity, p.products_status";
|
||||
$sql .= " FROM ".OSC_DB_NAME.".reviews as r,".OSC_DB_NAME.".products as p ";
|
||||
$sql .= " WHERE r.products_id = p.products_id";
|
||||
$sql .= " GROUP BY r.products_id, p.products_model, p.products_quantity, p.products_status";
|
||||
|
||||
$sql .= " ORDER BY $sortfield $sortorder ";
|
||||
$sql .= $db->plimit( $limit ,$offset);
|
||||
|
||||
print "<p><TABLE border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"4\">";
|
||||
print "<TR class=\"liste_titre\"><td>".$langs->trans("Ref");
|
||||
print '</td><TD align="center">Indice critiques</TD>';
|
||||
print '</td><td align="center">Quantité';
|
||||
print '</td><td align="center">Status</TD>';
|
||||
print "</TR>\n";
|
||||
|
||||
if ( $db->query($sql) ) {
|
||||
$num = $db->num_rows();
|
||||
$i = 0;
|
||||
|
||||
$var=True;
|
||||
while ($i < $num) {
|
||||
$objp = $db->fetch_object( $i);
|
||||
$var=!$var;
|
||||
print "<TR $bc[$var]>";
|
||||
print '<TD><a href="'.DOL_URL_ROOT.'/boutique/livre/fiche.php?oscid='.$objp->products_id.'">'.$objp->products_model.'</a></TD>';
|
||||
print '<TD align="center">'.$objp->rat."</TD>\n";
|
||||
print '<TD align="center">'.$objp->products_quantity."</TD>\n";
|
||||
print '<TD align="center">'.$objp->products_status."</TD>\n";
|
||||
print "</TR>\n";
|
||||
$i++;
|
||||
}
|
||||
$db->free();
|
||||
}
|
||||
|
||||
print "</TABLE>";
|
||||
|
||||
|
||||
$db->close();
|
||||
|
||||
llxFooter("<em>Dernière modification $Date$ révision $Revision$</em>");
|
||||
?>
|
||||
@ -1,72 +0,0 @@
|
||||
<?php
|
||||
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
*
|
||||
* 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$
|
||||
*
|
||||
*/
|
||||
|
||||
class Critique {
|
||||
var $db ;
|
||||
|
||||
var $id ;
|
||||
var $nom;
|
||||
|
||||
function Critique($DB, $id=0) {
|
||||
$this->db = $DB;
|
||||
$this->id = $id ;
|
||||
}
|
||||
/*
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
function fetch ($id) {
|
||||
|
||||
|
||||
$sql = "SELECT r.reviews_id, r.reviews_rating, d.reviews_text, p.products_name";
|
||||
|
||||
$sql .= " FROM ".OSC_DB_NAME.".reviews as r, ".OSC_DB_NAME.".reviews_description as d";
|
||||
$sql .= " ,".OSC_DB_NAME.".products_description as p";
|
||||
|
||||
$sql .= " WHERE r.reviews_id = d.reviews_id AND r.products_id=p.products_id";
|
||||
$sql .= " AND p.language_id = ".OSC_LANGUAGE_ID. " AND d.languages_id=".OSC_LANGUAGE_ID;
|
||||
$sql .= " AND r.reviews_id=$id";
|
||||
|
||||
$result = $this->db->query($sql) ;
|
||||
|
||||
if ( $result )
|
||||
{
|
||||
$result = $this->db->fetch_array();
|
||||
|
||||
$this->id = $result["reviews_id"];
|
||||
$this->product_name = stripslashes($result["products_name"]);
|
||||
$this->text = stripslashes($result["reviews_text"]);
|
||||
|
||||
$this->db->free();
|
||||
}
|
||||
else
|
||||
{
|
||||
print $this->db->error();
|
||||
print "<p>$sql";
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
@ -1,74 +0,0 @@
|
||||
<?php
|
||||
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
*
|
||||
* 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");
|
||||
|
||||
llxHeader();
|
||||
|
||||
if ($id)
|
||||
{
|
||||
|
||||
$critique = new Critique($db);
|
||||
$result = $critique->fetch($id);
|
||||
|
||||
if ( $result )
|
||||
{
|
||||
|
||||
print '<div class="titre">Fiche Critique</div><br>';
|
||||
|
||||
print '<table border="1" width="100%" cellspacing="0" cellpadding="4">';
|
||||
print "<tr>";
|
||||
print '<td width="20%">Produit</td><td width="80%">'.$critique->product_name.'</td></tr>';
|
||||
|
||||
print '<tr><td width="20%">Texte</td><td width="80%">'.nl2br($critique->text).'</td></tr>';
|
||||
print "</table>";
|
||||
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
print "Fetch failed";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* Barre d'action */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
print '<br><table width="100%" border="1" cellspacing="0" cellpadding="3">';
|
||||
print '<td width="20%" align="center">-</td>';
|
||||
print '<td width="20%" align="center">-</td>';
|
||||
print '<td width="20%" align="center">-</td>';
|
||||
print '<td width="20%" align="center">-</td>';
|
||||
print '<td width="20%" align="center">-</td>';
|
||||
print '</table><br>';
|
||||
|
||||
|
||||
|
||||
$db->close();
|
||||
|
||||
llxFooter("<em>Dernière modification $Date$ révision $Revision$</em>");
|
||||
?>
|
||||
@ -1,79 +0,0 @@
|
||||
<?php
|
||||
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
*
|
||||
* 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");
|
||||
|
||||
llxHeader();
|
||||
|
||||
if ($sortfield == "") {
|
||||
$sortfield="date_added";
|
||||
}
|
||||
if ($sortorder == "") {
|
||||
$sortorder="DESC";
|
||||
}
|
||||
|
||||
|
||||
if ($page == -1) { $page = 0 ; }
|
||||
$limit = $conf->liste_limit;
|
||||
$offset = $limit * $page ;
|
||||
|
||||
print_barre_liste("Critiques", $page, "index.php");
|
||||
|
||||
$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";
|
||||
$sql .= " WHERE r.reviews_id = d.reviews_id AND r.products_id=p.products_id";
|
||||
$sql .= " AND p.language_id = ".OSC_LANGUAGE_ID. " AND d.languages_id=".OSC_LANGUAGE_ID;
|
||||
$sql .= " ORDER BY $sortfield $sortorder ";
|
||||
$sql .= $db->plimit( $limit ,$offset);
|
||||
|
||||
print "<p><TABLE border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"4\">";
|
||||
print '<TR class="liste_titre">';
|
||||
print "<td>Produit</td>";
|
||||
print "<td>Critique</td>";
|
||||
print "<td align=\"center\">Note</td>";
|
||||
print "<TD align=\"right\"></TD>";
|
||||
print "</TR>\n";
|
||||
|
||||
if ( $db->query($sql) ) {
|
||||
$num = $db->num_rows();
|
||||
$i = 0;
|
||||
|
||||
$var=True;
|
||||
while ($i < $num) {
|
||||
$objp = $db->fetch_object( $i);
|
||||
$var=!$var;
|
||||
print "<TR $bc[$var]>";
|
||||
print "<TD>".substr($objp->products_name, 0, 30)."</TD>\n";
|
||||
print '<TD><a href="fiche.php?id='.$objp->reviews_id.'">'.substr($objp->reviews_text, 0, 40)." ...</a></td>\n";
|
||||
print "<td align=\"center\">$objp->reviews_rating</TD>\n";
|
||||
print "</TR>\n";
|
||||
$i++;
|
||||
}
|
||||
$db->free();
|
||||
}
|
||||
|
||||
print "</TABLE>";
|
||||
|
||||
|
||||
$db->close();
|
||||
|
||||
llxFooter("<em>Dernière modification $Date$ révision $Revision$</em>");
|
||||
?>
|
||||
@ -1,47 +0,0 @@
|
||||
<?php
|
||||
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
*
|
||||
* 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("../../main.inc.php");
|
||||
require("./critique.class.php");
|
||||
|
||||
function llxHeader($head = "", $urlp = "") {
|
||||
global $user, $conf;
|
||||
|
||||
/*
|
||||
*
|
||||
*
|
||||
*/
|
||||
top_menu($head);
|
||||
|
||||
$menu = new Menu();
|
||||
|
||||
$menu->add("index.php", "Critiques");
|
||||
|
||||
$menu->add_submenu("bestproduct.php", "Meilleurs produits");
|
||||
|
||||
left_menu($menu->liste);
|
||||
/*
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
}
|
||||
?>
|
||||
Loading…
Reference in New Issue
Block a user