Suppression de fichiers inutiles
This commit is contained in:
parent
d7b7a2da94
commit
12f5ae8fbc
@ -1,324 +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 Album {
|
||||
var $db ;
|
||||
|
||||
var $id ;
|
||||
var $oscid ;
|
||||
var $ref;
|
||||
var $annee;
|
||||
var $titre;
|
||||
var $description;
|
||||
var $price ;
|
||||
var $status ;
|
||||
|
||||
function Album($DB, $id=0) {
|
||||
$this->db = $DB;
|
||||
$this->id = $id ;
|
||||
}
|
||||
/*
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
function create($user) {
|
||||
|
||||
if (strlen($this->annee))
|
||||
{
|
||||
$this->annee = 0;
|
||||
}
|
||||
|
||||
$sql = "INSERT INTO ".OSC_DB_NAME.".products (products_quantity, products_model, products_image, products_price, products_date_available, products_weight, products_status, products_tax_class_id, manufacturers_id, products_date_added) ";
|
||||
$sql .= "VALUES ('', '', 'Array', '', null, '', '0', '0', '8', now())";
|
||||
|
||||
if ($this->db->query($sql) )
|
||||
{
|
||||
$idosc = $this->db->last_insert_id(OSC_DB_NAME.".products");
|
||||
|
||||
$sql = "INSERT INTO ".OSC_DB_NAME.".products_to_categories (products_id, categories_id) VALUES ($idosc, 0)";
|
||||
|
||||
if ($this->db->query($sql) )
|
||||
{
|
||||
|
||||
$sql = "INSERT INTO ".OSC_DB_NAME.".products_description (products_name, products_description, products_url, products_id, language_id) VALUES ('".trim($this->titre)."', '".trim($this->description)."', '', $idosc, '1')";
|
||||
|
||||
if ($this->db->query($sql) )
|
||||
{
|
||||
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."album (osc_id, fk_user_author) VALUES ($idosc, ".$user->id.")";
|
||||
|
||||
if ($this->db->query($sql) )
|
||||
{
|
||||
$id = $this->db->last_insert_id(MAIN_DB_PREFIX."album");
|
||||
|
||||
if ( $this->update($id, $user) )
|
||||
{
|
||||
return $id;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
print $this->db->error() . ' in ' . $sql;
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
print $this->db->error() . ' in ' . $sql;
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
print $this->db->error() . ' in ' . $sql;
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
print $this->db->error() . ' in ' . $sql;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
function linkga($id, $gaid)
|
||||
{
|
||||
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."album_to_groupart (fk_album, fk_groupart) VALUES ($id, $gaid)";
|
||||
|
||||
if ( $this->db->query($sql) ) {
|
||||
return 1;
|
||||
} else {
|
||||
print $this->db->error() . ' in ' . $sql;
|
||||
}
|
||||
}
|
||||
/*
|
||||
*
|
||||
*
|
||||
*/
|
||||
function liste_groupart()
|
||||
{
|
||||
$ga = array();
|
||||
|
||||
$sql = "SELECT g.rowid, g.nom FROM ".MAIN_DB_PREFIX."groupart as g, ".MAIN_DB_PREFIX."album_to_groupart as l";
|
||||
$sql .= " WHERE g.rowid = l.fk_groupart AND l.fk_album = ".$this->id;
|
||||
$sql .= " ORDER BY g.nom";
|
||||
|
||||
$result=$this->db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
$nump = $this->db->num_rows($result);
|
||||
|
||||
if ($nump)
|
||||
{
|
||||
$i = 0;
|
||||
while ($i < $nump)
|
||||
{
|
||||
$obj = $this->db->fetch_object($result);
|
||||
|
||||
$ga[$obj->rowid] = $obj->nom;
|
||||
$i++;
|
||||
}
|
||||
$this->db->free($result);
|
||||
}
|
||||
return $ga;
|
||||
}
|
||||
else
|
||||
{
|
||||
print $this->db->error();
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
/*
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
function updateosc()
|
||||
{
|
||||
|
||||
$sql = "UPDATE ".OSC_DB_NAME.".products_description ";
|
||||
|
||||
$sql .= " SET products_name = '".$this->titre."'";
|
||||
|
||||
$desc .= '<br>Info supplémentaires';
|
||||
$ga = array();
|
||||
$ga = $this->liste_groupart();
|
||||
if (sizeof($ga) == 1)
|
||||
{
|
||||
foreach ($ga as $key => $value)
|
||||
{
|
||||
$gaid = $key;
|
||||
}
|
||||
|
||||
|
||||
$groupart = new Groupart($this->db);
|
||||
$result = $groupart->fetch($gaid);
|
||||
|
||||
if ( $result )
|
||||
{
|
||||
|
||||
$desc = $groupart->nom."<p>";
|
||||
|
||||
$desc .= addslashes($this->description);
|
||||
|
||||
$desc .= "<p><b>Autres albums</b> : ";
|
||||
|
||||
$gas = $groupart->liste_albums();
|
||||
$i = 0;
|
||||
$sizegas = sizeof($gas) - 1;
|
||||
foreach ($gas as $key => $value)
|
||||
{
|
||||
if ($key <> $this->id)
|
||||
{
|
||||
|
||||
$otha = new Album($this->db);
|
||||
$otha->fetch($key);
|
||||
|
||||
$desc .= '<a href="'.OSC_CATALOG_URL.'product_info.php?products_id='.$otha->oscid.'">'.$value."</a>";
|
||||
$i++;
|
||||
if ($sizegas > $i)
|
||||
{
|
||||
$desc .= ", ";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$sql .= ", products_description = '$desc'";
|
||||
|
||||
$sql .= " WHERE products_id = " . $this->oscid;
|
||||
|
||||
if ( $this->db->query($sql) ) {
|
||||
return 1;
|
||||
} else {
|
||||
print $this->db->error() . ' in ' . $sql;
|
||||
}
|
||||
}
|
||||
/*
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
function update($id, $user)
|
||||
{
|
||||
|
||||
if (strlen($this->annee)==0)
|
||||
{
|
||||
$this->annee = 0;
|
||||
}
|
||||
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."album ";
|
||||
$sql .= " SET title = '" . trim($this->titre) ."'";
|
||||
$sql .= ", ref = '" . trim(strtoupper($this->ref)) ."'";
|
||||
$sql .= ", annee = " . $this->annee ;
|
||||
$sql .= ",description = '" . trim($this->description) ."'";
|
||||
|
||||
$sql .= " WHERE rowid = " . $id;
|
||||
|
||||
if ( $this->db->query($sql) ) {
|
||||
return 1;
|
||||
} else {
|
||||
print $this->db->error() . ' in ' . $sql;
|
||||
}
|
||||
}
|
||||
/*
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
function fetch ($id) {
|
||||
|
||||
$sql = "SELECT rowid, ref, annee, osc_id, title, description FROM ".MAIN_DB_PREFIX."album WHERE rowid = $id";
|
||||
|
||||
$result = $this->db->query($sql) ;
|
||||
|
||||
if ( $result )
|
||||
{
|
||||
$result = $this->db->fetch_array();
|
||||
|
||||
$this->id = $result["rowid"];
|
||||
$this->ref = $result["ref"];
|
||||
$this->annee = $result["annee"];
|
||||
$this->titre = $result["title"];
|
||||
$this->description = $result["description"];
|
||||
$this->oscid = $result["osc_id"];
|
||||
|
||||
$this->db->free();
|
||||
|
||||
|
||||
$sql = "SELECT products_quantity, products_model, products_image, products_price, products_date_available, products_weight, products_status, products_tax_class_id, manufacturers_id, products_date_added";
|
||||
$sql .= " FROM ".OSC_DB_NAME.".products WHERE products_id = " . $this->oscid;
|
||||
|
||||
$result = $this->db->query($sql) ;
|
||||
|
||||
if ( $result )
|
||||
{
|
||||
$result = $this->db->fetch_array();
|
||||
|
||||
$this->status = $result["products_status"];
|
||||
$this->price = $result["products_price"];
|
||||
|
||||
$this->db->free();
|
||||
}
|
||||
else
|
||||
{
|
||||
print $this->db->error();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
print $this->db->error();
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
*
|
||||
*
|
||||
*/
|
||||
function delete($user) {
|
||||
|
||||
$sql = "DELETE FROM ".OSC_DB_NAME.".products WHERE products_id = $idosc ";
|
||||
|
||||
$sql = "DELETE FROM ".OSC_DB_NAME.".products_to_categories WHERE products_id = $idosc";
|
||||
|
||||
$sql = "DELETE FROM ".OSC_DB_NAME.".products_description WHERE products_id = $idosc";
|
||||
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."album WHERE rowid = $id";
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
?>
|
||||
@ -1,214 +0,0 @@
|
||||
<?php
|
||||
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* 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 ($action == 'add') {
|
||||
$album = new Album($db);
|
||||
|
||||
$album->titre = $titre;
|
||||
$album->ref = $ref;
|
||||
$album->annee = $annee;
|
||||
$album->description = $desc;
|
||||
|
||||
$id = $album->create($user);
|
||||
}
|
||||
|
||||
if ($action == 'addga') {
|
||||
$album = new Album($db);
|
||||
|
||||
$album->linkga($id, $ga);
|
||||
}
|
||||
|
||||
|
||||
if ($action == 'update') {
|
||||
$album = new Album($db);
|
||||
|
||||
$album->titre = $titre;
|
||||
$album->ref = $ref;
|
||||
$album->annee = $annee;
|
||||
$album->description = $desc;
|
||||
|
||||
$album->update($id, $user);
|
||||
}
|
||||
|
||||
if ($action == 'updateosc') {
|
||||
$album = new Album($db);
|
||||
$result = $album->fetch($id);
|
||||
|
||||
$album->updateosc($user);
|
||||
}
|
||||
|
||||
/*
|
||||
*
|
||||
*
|
||||
*/
|
||||
if ($action == 'create')
|
||||
{
|
||||
|
||||
print "<form action=\"fiche.php?id=$id\" method=\"post\">\n";
|
||||
print "<input type=\"hidden\" name=\"action\" value=\"add\">";
|
||||
|
||||
print_fiche_titre($langs->trans("NewAlbum"));
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
print "<tr>";
|
||||
print '<td>'.$langs->trans("Ref").'</td><td><input name="ref" size="20" value=""></td></tr>';
|
||||
print '<td>Titre</td><td><input name="titre" size="40" value=""></td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Price").'</td><td><input name="price" size="10" value=""></td></tr>';
|
||||
print '<tr><td valign="top">'.$langs->trans("Description").'</td><td>';
|
||||
print '<textarea name="desc" rows="8" cols="50">';
|
||||
print "</textarea></td></tr>";
|
||||
print '<tr><td> </td><td><input type="submit" value="Créer"></td></tr>';
|
||||
print '</table>';
|
||||
print '</form>';
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($id)
|
||||
{
|
||||
|
||||
$album = new Album($db);
|
||||
$result = $album->fetch($id);
|
||||
|
||||
if ( $result )
|
||||
{
|
||||
|
||||
$gas = $album->liste_groupart();
|
||||
|
||||
|
||||
print_fiche_titre('Fiche Album : '.$album->titre);
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
print "<tr>";
|
||||
print '<td width="20%">'.$langs->trans("Ref").'</td><td width="30%">'.$album->ref.'</td>';
|
||||
print '<td width="50%" valign="top">'.$langs->trans("Description").'</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("Status")."</td><td>$album->status</td>\n";
|
||||
print '<td rowspan="6" valign="top">'.nl2br($album->description)."</td>";
|
||||
print "<tr><td>Titre</td><td>$album->titre</td></tr>\n";
|
||||
print "<tr><td>Annee</td><td>$album->annee</td></tr>\n";
|
||||
print '<tr><td>'.$langs->trans("Price").'</td><TD>'.price($album->price).'</td></tr>';
|
||||
|
||||
print '<td valign="top">Artiste/Groupe</td><td>';
|
||||
foreach ($gas as $key => $value)
|
||||
{
|
||||
print '<a href="../groupart/fiche.php?id='.$key.'">'.$value."</a><br>";
|
||||
}
|
||||
print "</td></tr>\n";
|
||||
|
||||
print "</table>";
|
||||
|
||||
|
||||
if ($action == 'edit')
|
||||
{
|
||||
print_fiche_titre('Edition de la fiche Album : '.$album->titre);
|
||||
|
||||
print "<form action=\"fiche.php?id=$id\" method=\"post\">\n";
|
||||
print "<input type=\"hidden\" name=\"action\" value=\"update\">";
|
||||
|
||||
print '<table border="1" width="100%" cellspacing="0" cellpadding="4">';
|
||||
print "<tr>";
|
||||
print '<td width="20%">'.$langs->trans("Ref").'</td><td><input name="ref" size="20" value="'.$album->ref.'"></td>';
|
||||
print '<td valign="top">'.$langs->trans("Description").'</td></tr>';
|
||||
|
||||
print '<td>Titre</td><td><input name="titre" size="40" value="'.$album->titre.'"></td>';
|
||||
print '<td valign="top" width="50%" rowspan="3"><textarea name="desc" rows="8" cols="50">';
|
||||
print $album->description;
|
||||
print "</textarea></td></tr>";
|
||||
|
||||
print '<tr><td>Année</td><TD><input name="annee" size="6" maxlenght="4" value="'.$album->annee.'"></td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Price").'</td><TD><input name="price" size="10" value="'.$album->price.'"></td></tr>';
|
||||
|
||||
print '<tr><td> </td><td><input type="submit" value="'.$langs->trans("Save").'"></td></tr>';
|
||||
|
||||
print '</form>';
|
||||
|
||||
$htmls = new Form($db);
|
||||
$ga = new Groupart($db);
|
||||
|
||||
print "<form action=\"fiche.php?id=$id\" method=\"post\">\n";
|
||||
print "<input type=\"hidden\" name=\"action\" value=\"addga\">";
|
||||
|
||||
foreach ($gas as $key => $value)
|
||||
{
|
||||
print '<tr><td>Artiste/Groupe</td>';
|
||||
print '<td><a href="../groupart/fiche.php?id='.$key.'">'.$value."</td></tr>\n";
|
||||
}
|
||||
|
||||
print "<tr><td>Artiste/Groupe</td><td>";
|
||||
$htmls->select_array("ga", $ga->liste_array());
|
||||
print "</td></tr>";
|
||||
print '<tr><td> </td><td><input type="submit" value="'.$langs->trans("Add").'"></td></tr>';
|
||||
print "</form>";
|
||||
print '</table>';
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
print "Fetch failed";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
print "Error";
|
||||
}
|
||||
}
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* 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">[<a href="fiche.php?action=updateosc&id='.$id.'">Update Osc</a>]</td>';
|
||||
|
||||
print '<td width="20%" align="center">-</td>';
|
||||
|
||||
if ($action == 'create')
|
||||
{
|
||||
print '<td width="20%" align="center">-</td>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<td width="20%" align="center">[<a href="fiche.php?action=edit&id='.$id.'">'.$langs->trans("Edit").'</a>]</td>';
|
||||
}
|
||||
print '<td width="20%" align="center">-</td>';
|
||||
print '</table><br>';
|
||||
|
||||
|
||||
|
||||
$db->close();
|
||||
|
||||
llxFooter("<em>Dernière modification $Date$ révision $Revision$</em>");
|
||||
?>
|
||||
@ -1,77 +0,0 @@
|
||||
<?php
|
||||
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* 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="lower(a.title)";
|
||||
}
|
||||
|
||||
if ($sortorder == "")
|
||||
{
|
||||
$sortorder="ASC";
|
||||
}
|
||||
|
||||
|
||||
if ($page == -1) { $page = 0 ; }
|
||||
$limit = $conf->liste_limit;
|
||||
$offset = $limit * $page ;
|
||||
|
||||
|
||||
print_barre_liste("Liste des albums", $page, "index.php");
|
||||
|
||||
$sql = "SELECT a.rowid, a.title, a.osc_id FROM ".MAIN_DB_PREFIX."album as a";
|
||||
|
||||
$sql .= " ORDER BY $sortfield $sortorder ";
|
||||
$sql .= $db->plimit( $limit ,$offset);
|
||||
|
||||
if ( $db->query($sql) ) {
|
||||
$num = $db->num_rows();
|
||||
$i = 0;
|
||||
print "<table class=\noborder\" width=\"100%\">";
|
||||
print "<tr class=\"liste_titre\">";
|
||||
print_liste_field_titre("Titre","index.php", "a.title");
|
||||
print "</td>";
|
||||
print "<td> </td>";
|
||||
print "</tr>\n";
|
||||
$var=True;
|
||||
while ($i < $num) {
|
||||
$objp = $db->fetch_object( $i);
|
||||
$var=!$var;
|
||||
print "<tr $bc[$var]>";
|
||||
print "<td><a href=\"fiche.php?id=$objp->rowid\">$objp->title</a></td>\n";
|
||||
print '<td align="right"><a href="'.OSC_CATALOG_URL.'product_info.php?products_id='.$objp->osc_id.'">url</a></td>';
|
||||
print "</tr>\n";
|
||||
$i++;
|
||||
}
|
||||
print "</table>";
|
||||
$db->free();
|
||||
}
|
||||
|
||||
|
||||
$db->close();
|
||||
|
||||
llxFooter("<em>Dernière modification $Date$ révision $Revision$</em>");
|
||||
?>
|
||||
@ -1,64 +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("./album.class.php");
|
||||
require("../groupart/groupart.class.php");
|
||||
|
||||
function llxHeader($head = "", $urlp = "") {
|
||||
global $user, $conf;
|
||||
|
||||
/*
|
||||
*
|
||||
*
|
||||
*/
|
||||
top_menu($head);
|
||||
|
||||
$menu = new Menu();
|
||||
|
||||
$menu->add(DOL_URL_ROOT."/product/album/", "Albums");
|
||||
|
||||
$menu->add_submenu("../osc-liste.php", "Osc");
|
||||
$menu->add_submenu("../osc-liste.php?reqstock=epuise", "Produits Epuisés");
|
||||
|
||||
$menu->add_submenu(DOL_URL_ROOT."/product/album/fiche.php?&action=create","Nouvel album");
|
||||
|
||||
$menu->add(DOL_URL_ROOT."/product/groupart/", "Artistes/Groupes");
|
||||
|
||||
$menu->add_submenu(DOL_URL_ROOT."/product/groupart/fiche.php?&action=create","Nouvel Artiste/Groupe");
|
||||
|
||||
$menu->add(DOL_URL_ROOT."/product/concert/", "Concerts");
|
||||
|
||||
$menu->add_submenu(DOL_URL_ROOT."/product/concert/fiche.php?&action=create","Nouveau concert");
|
||||
|
||||
$menu->add("../osc-reviews.php", "Critiques");
|
||||
|
||||
$menu->add_submenu("../osc-productsbyreviews.php", "Meilleurs produits");
|
||||
|
||||
|
||||
left_menu($menu->liste);
|
||||
/*
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
}
|
||||
?>
|
||||
@ -1,166 +0,0 @@
|
||||
<?php
|
||||
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* 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 ($action == 'add')
|
||||
{
|
||||
$groupart = new Groupart($db);
|
||||
$groupart->nom = $nom;
|
||||
$groupart->desc = $desc;
|
||||
$groupart->grar = $grar;
|
||||
$id = $groupart->create($user);
|
||||
}
|
||||
|
||||
if ($action == 'update') {
|
||||
$groupart = new Groupart($db);
|
||||
$groupart->nom = $nom;
|
||||
$groupart->desc = $desc;
|
||||
$groupart->grar = $grar;
|
||||
$groupart->update($id, $user);
|
||||
}
|
||||
|
||||
if ($action == 'updateosc') {
|
||||
$groupart = new Groupart($db);
|
||||
$result = $groupart->fetch($id);
|
||||
$groupart->updateosc($user);
|
||||
}
|
||||
|
||||
/*
|
||||
*
|
||||
*
|
||||
*/
|
||||
if ($action == 'create')
|
||||
{
|
||||
|
||||
print "<form action=\"fiche.php?id=$id\" method=\"post\">\n";
|
||||
print "<input type=\"hidden\" name=\"action\" value=\"add\">";
|
||||
|
||||
print '<div class="titre">Nouvel Artiste/Groupe</div><br>';
|
||||
|
||||
print '<table border="1" width="100%" cellspacing="0" cellpadding="4">';
|
||||
print "<tr>";
|
||||
print '<td>Nom</td><td><input name="nom" size="40" value=""></td></tr>';
|
||||
print '<tr><td>Artiste/Groupe</td><td><select name="grar"><option value="artiste">Artiste</option>';
|
||||
print '<option value="groupe">Groupe</option></select></td></tr>';
|
||||
print '<tr><td valign="top">'.$langs->trans("Description").'</td><td>';
|
||||
print '<textarea name="desc" rows="8" cols="50">';
|
||||
print "</textarea></td></tr>";
|
||||
print '<tr><td> </td><td><input type="submit" value="Créer"></td></tr>';
|
||||
print '</table>';
|
||||
print '</form>';
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($id)
|
||||
{
|
||||
|
||||
$groupart = new Groupart($db);
|
||||
$result = $groupart->fetch($id);
|
||||
|
||||
if ( $result )
|
||||
{
|
||||
print '<div class="titre">Fiche Artiste/Groupe</div><br>';
|
||||
|
||||
print '<table border="1" width="100%" cellspacing="0" cellpadding="4">';
|
||||
print "<tr>";
|
||||
print "<td>Nom</td><td>".$groupart->nom."</td></tr>\n";
|
||||
print "<tr>";
|
||||
print "<td>Groupe/Artiste</td><td>".ucfirst(strtolower(strtoupper($groupart->grar)))."</td></tr>\n";
|
||||
print '<tr><td valign="top">'.$langs->trans("Description").'</td><td>'.nl2br($groupart->desc).'</td></tr>';
|
||||
|
||||
$gas = $groupart->liste_albums();
|
||||
print '<tr><td>Album(s)</td><td><ul>';
|
||||
foreach ($gas as $key => $value)
|
||||
{
|
||||
print '<li><a href="../album/fiche.php?id='.$key.'">'.$value."</a></li>";
|
||||
}
|
||||
print "</ul></td></tr>\n";
|
||||
print "</table>";
|
||||
}
|
||||
|
||||
if ($action == 'edit')
|
||||
{
|
||||
if ($groupart->grar == 'artiste')
|
||||
{
|
||||
$grar_opt = 'Groupe';
|
||||
}
|
||||
else
|
||||
{
|
||||
$grar_opt = 'Artiste';
|
||||
}
|
||||
print '<hr><div class="titre">Edition de la fiche produit : '.$groupart->ref.'</div><br>';
|
||||
|
||||
print "<form action=\"fiche.php?id=$id\" method=\"post\">\n";
|
||||
print "<input type=\"hidden\" name=\"action\" value=\"update\">";
|
||||
|
||||
print '<table border="1" width="100%" cellspacing="0" cellpadding="4">';
|
||||
print '<tr><td>Nom</td><td><input name="nom" size="40" value="'.$groupart->nom.'"></td></tr>';
|
||||
print '<tr><td>Artiste/Groupe</td><td><select name="grar"><option value="'.ucfirst(strtolower(strtoupper($groupart->grar))).'">'.ucfirst(strtolower(strtoupper($groupart->grar))).'</option>';
|
||||
print '<option value="'.$grar_opt.'">'.$grar_opt.'</option></select></td></tr>';
|
||||
print '<tr><td valign="top">'.$langs->trans("Description").'</td><td>';
|
||||
print '<textarea name="desc" rows="8" cols="50">';
|
||||
print $groupart->desc;
|
||||
print "</textarea></td></tr>";
|
||||
print '<tr><td> </td><td><input type="submit" value="'.$langs->trans("Save").'"></td></tr>';
|
||||
print '</table>';
|
||||
print '</form>';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
print "Error";
|
||||
}
|
||||
}
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* 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">[<a href="fiche.php?action=updateosc&id='.$id.'">Update Osc</a>]</td>';
|
||||
print '<td width="20%" align="center">-</td>';
|
||||
|
||||
if ($action == 'create')
|
||||
{
|
||||
print '<td width="20%" align="center">-</td>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<td width="20%" align="center">[<a href="fiche.php?action=edit&id='.$id.'">'.$langs->trans("Edit").'</a>]</td>';
|
||||
}
|
||||
print '<td width="20%" align="center">-</td>';
|
||||
print '</table><br>';
|
||||
|
||||
|
||||
|
||||
$db->close();
|
||||
|
||||
llxFooter("<em>Dernière modification $Date$ révision $Revision$</em>");
|
||||
?>
|
||||
@ -1,234 +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$
|
||||
*
|
||||
*/
|
||||
|
||||
class Groupart {
|
||||
var $db ;
|
||||
|
||||
var $id ;
|
||||
var $nom ;
|
||||
var $desc ;
|
||||
var $grar ;
|
||||
|
||||
function Groupart($DB, $id=0) {
|
||||
$this->db = $DB;
|
||||
$this->id = $id ;
|
||||
}
|
||||
/*
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
function create($user) {
|
||||
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."groupart (fk_user_author) VALUES (".$user->id.")";
|
||||
|
||||
if ($this->db->query($sql) )
|
||||
|
||||
{
|
||||
|
||||
$id = $this->db->last_insert_id(MAIN_DB_PREFIX."groupart");
|
||||
|
||||
if ( $this->update($id, $user) )
|
||||
{
|
||||
return $id;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
print $this->db->error() . ' in ' . $sql;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
function update($id, $user)
|
||||
{
|
||||
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."groupart ";
|
||||
$sql .= " SET nom = '" . trim($this->nom) ."'";
|
||||
$sql .= " , description = '" . trim($this->desc) ."'";
|
||||
$sql .= " , groupart = '" . trim($this->grar) ."'";
|
||||
$sql .= " WHERE rowid = " . $id;
|
||||
|
||||
if ( $this->db->query($sql) ) {
|
||||
return 1;
|
||||
} else {
|
||||
print $this->db->error() . ' in ' . $sql;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
function fetch ($id)
|
||||
{
|
||||
$sql = "SELECT rowid, nom, groupart, description FROM ".MAIN_DB_PREFIX."groupart WHERE rowid = $id";
|
||||
|
||||
$result = $this->db->query($sql) ;
|
||||
|
||||
if ( $result )
|
||||
{
|
||||
$result = $this->db->fetch_array();
|
||||
|
||||
$this->id = $result["rowid"];
|
||||
$this->nom = $result["nom"];
|
||||
$this->desc = $result["description"];
|
||||
$this->grar = $result["groupart"];
|
||||
}
|
||||
$this->db->free();
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* \brief Renvoie le nom clicable
|
||||
* \param withpicto Inclut le picto dans le lien
|
||||
* \return string Chaine avec URL
|
||||
*/
|
||||
function getNomUrl($withpicto=0)
|
||||
{
|
||||
global $langs;
|
||||
|
||||
$result='';
|
||||
return '<a href="'.DOL_URL_ROOT.'/product/groupart/fiche.php?id='.$this->rowid.'">'.$this->nom.'</a>';
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
*
|
||||
*
|
||||
*/
|
||||
function liste_albums ()
|
||||
{
|
||||
$ga = array();
|
||||
|
||||
$sql = "SELECT a.rowid, a.title FROM ".MAIN_DB_PREFIX."album as a, ".MAIN_DB_PREFIX."album_to_groupart as l";
|
||||
$sql .= " WHERE a.rowid = l.fk_album AND l.fk_groupart = ".$this->id;
|
||||
$sql .= " ORDER BY a.title";
|
||||
|
||||
$result=$this->db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
$nump = $this->db->num_rows($result);
|
||||
|
||||
if ($nump)
|
||||
{
|
||||
$i = 0;
|
||||
while ($i < $nump)
|
||||
{
|
||||
$obj = $this->db->fetch_object($result);
|
||||
|
||||
$ga[$obj->rowid] = $obj->title;
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
return $ga;
|
||||
}
|
||||
else
|
||||
{
|
||||
print $this->db->error();
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
/*
|
||||
*
|
||||
*
|
||||
*/
|
||||
function updateosc()
|
||||
{
|
||||
$albs = array();
|
||||
$albs = $this->liste_albums();
|
||||
|
||||
foreach($albs as $key => $value)
|
||||
{
|
||||
$alb = new Album($this->db);
|
||||
$alb->fetch($key);
|
||||
$alb->updateosc();
|
||||
}
|
||||
}
|
||||
/*
|
||||
*
|
||||
*
|
||||
*/
|
||||
function liste_array ()
|
||||
{
|
||||
$ga = array();
|
||||
|
||||
$sql = "SELECT rowid, nom FROM ".MAIN_DB_PREFIX."groupart ORDER BY nom";
|
||||
|
||||
$result=$this->db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
$nump = $this->db->num_rows($result);
|
||||
|
||||
if ($nump)
|
||||
{
|
||||
$i = 0;
|
||||
while ($i < $nump)
|
||||
{
|
||||
$obj = $this->db->fetch_object($result);
|
||||
|
||||
$ga[$obj->rowid] = $obj->nom;
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
return $ga;
|
||||
}
|
||||
else
|
||||
{
|
||||
print $this->db->error();
|
||||
return -1;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
*
|
||||
*
|
||||
*/
|
||||
function delete($user) {
|
||||
|
||||
$sql = "DELETE FROM ".OSC_DB_NAME.".products WHERE products_id = $idosc ";
|
||||
|
||||
$sql = "DELETE FROM ".OSC_DB_NAME.".products_to_categories WHERE products_id = $idosc";
|
||||
|
||||
$sql = "DELETE FROM ".OSC_DB_NAME.".products_description WHERE products_id = $idosc";
|
||||
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."album WHERE rowid = $id";
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
?>
|
||||
@ -1,76 +0,0 @@
|
||||
<?php
|
||||
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* 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="lower(g.nom)";
|
||||
}
|
||||
if ($sortorder == "")
|
||||
{
|
||||
$sortorder="ASC";
|
||||
}
|
||||
|
||||
|
||||
if ($page == -1) { $page = 0 ; }
|
||||
$limit = $conf->liste_limit;
|
||||
$offset = $limit * $page ;
|
||||
|
||||
|
||||
print_barre_liste("Liste des Artistes/Groupes", $page, "index.php");
|
||||
|
||||
$sql = "SELECT g.rowid, g.nom, groupart FROM ".MAIN_DB_PREFIX."groupart as g";
|
||||
|
||||
$sql .= " ORDER BY $sortfield $sortorder ";
|
||||
$sql .= $db->plimit( $limit ,$offset);
|
||||
|
||||
if ( $db->query($sql) ) {
|
||||
$num = $db->num_rows();
|
||||
$i = 0;
|
||||
print "<table class=\"noborder\" width=\"100%\">";
|
||||
print "<tr class=\"liste_titre\">";
|
||||
print_liste_field_titre($langs->trans("Ref"),"index.php", "p.ref");
|
||||
print "<td> </td>";
|
||||
print "</tr>\n";
|
||||
|
||||
$var=True;
|
||||
while ($i < $num) {
|
||||
$objp = $db->fetch_object( $i);
|
||||
$var=!$var;
|
||||
print "<tr $bc[$var]>";
|
||||
print "<td><a href=\"fiche.php?id=$objp->rowid\">$objp->nom</a></td>\n";
|
||||
print "<td>".ucfirst(strtolower(strtoupper($objp->groupart)))."</td>\n";
|
||||
print "</tr>\n";
|
||||
$i++;
|
||||
}
|
||||
print "</table>";
|
||||
$db->free();
|
||||
}
|
||||
|
||||
|
||||
$db->close();
|
||||
|
||||
llxFooter("<em>Dernière modification $Date$ révision $Revision$</em>");
|
||||
?>
|
||||
@ -1,59 +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("./groupart.class.php");
|
||||
require("../album/album.class.php");
|
||||
|
||||
function llxHeader($head = "", $urlp = "") {
|
||||
global $user, $conf;
|
||||
|
||||
/*
|
||||
*
|
||||
*
|
||||
*/
|
||||
top_menu($head);
|
||||
|
||||
$menu = new Menu();
|
||||
|
||||
$menu->add(DOL_URL_ROOT."/product/album/", "Albums");
|
||||
|
||||
$menu->add_submenu("../album/fiche.php?&action=create","Nouvel album");
|
||||
|
||||
$menu->add(DOL_URL_ROOT."/product/groupart/", "Artistes/Groupes");
|
||||
|
||||
$menu->add_submenu(DOL_URL_ROOT."/product/groupart/fiche.php?&action=create","Nouvel Artiste/Groupe");
|
||||
|
||||
$menu->add(DOL_URL_ROOT."/product/concert/", "Concerts");
|
||||
|
||||
$menu->add_submenu(DOL_URL_ROOT."/product/concert/fiche.php?&action=create","Nouveau concert");
|
||||
|
||||
$menu->add("../osc-reviews.php", "Critiques");
|
||||
|
||||
|
||||
left_menu($menu->liste);
|
||||
/*
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
}
|
||||
?>
|
||||
@ -1,97 +0,0 @@
|
||||
<?php
|
||||
/* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2005 Éric Seigne <eric.seigne@ryxeo.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 ($_GET['sortfield'] == "") {
|
||||
$sortfield="lower(p.label),p.price";
|
||||
}
|
||||
if ($_GET['sortorder'] == "") {
|
||||
$sortorder="ASC";
|
||||
}
|
||||
|
||||
|
||||
if ($_GET['page'] == -1) {
|
||||
$page = 0 ;
|
||||
}
|
||||
else {
|
||||
$page = $_GET['page'];
|
||||
}
|
||||
$limit = $conf->liste_limit;
|
||||
$offset = $limit * $page ;
|
||||
|
||||
|
||||
print_barre_liste("Liste des produits oscommerce", $page, "osc-liste.php");
|
||||
|
||||
$sql = "SELECT p.products_id, p.products_model, p.products_quantity, p.products_status, d.products_name, m.manufacturers_name, m.manufacturers_id";
|
||||
$sql .= " FROM ".OSC_DB_NAME.".products as p, ".OSC_DB_NAME.".products_description as d, ".OSC_DB_NAME.".manufacturers as m";
|
||||
$sql .= " WHERE p.products_id = d.products_id AND d.language_id =" . OSC_LANGUAGE_ID;
|
||||
$sql .= " AND p.manufacturers_id=m.manufacturers_id";
|
||||
if ($_GET['reqstock']=='epuise')
|
||||
{
|
||||
$sql .= " AND p.products_quantity <= 0";
|
||||
}
|
||||
|
||||
//$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>id</td>";
|
||||
print "<td>Ref</td>";
|
||||
print "<td>Titre</td>";
|
||||
print "<td>Groupe</td>";
|
||||
print '<td align="center">Stock</td>';
|
||||
print '<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>$objp->products_id</TD>\n";
|
||||
print "<TD>$objp->products_model</TD>\n";
|
||||
print "<TD>$objp->products_name</TD>\n";
|
||||
print "<TD>$objp->manufacturers_name</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,82 +0,0 @@
|
||||
<?php
|
||||
/* Copyright (C) 2001-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="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, "osc-productsbyreviews.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>$objp->products_model</TD>\n";
|
||||
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,76 +0,0 @@
|
||||
<?php
|
||||
/* Copyright (C) 2001-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="lower(p.label),p.price";
|
||||
}
|
||||
if ($sortorder == "") {
|
||||
$sortorder="ASC";
|
||||
}
|
||||
|
||||
|
||||
if ($page == -1) { $page = 0 ; }
|
||||
$limit = $conf->liste_limit;
|
||||
$offset = $limit * $page ;
|
||||
|
||||
|
||||
print_barre_liste("Liste des produits oscommerce", $page, "osc-reviews.php");
|
||||
|
||||
$sql = "SELECT r.reviews_rating FROM ".OSC_DB_NAME.".reviews as r";
|
||||
|
||||
//$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></td>";
|
||||
print "<TD align=\"right\">Prix de vente</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>$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>");
|
||||
?>
|
||||
Loading…
Reference in New Issue
Block a user