2004-10-19 21:31:11 +02:00
|
|
|
<?php
|
2006-09-03 15:49:00 +02:00
|
|
|
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
2010-03-27 03:29:49 +01:00
|
|
|
* Copyright (C) 2003-2005 Eric Seigne <eric.seigne@ryxeo.com>
|
2006-09-03 15:49:00 +02:00
|
|
|
* Copyright (C) 2004-2006 Laurent Destailleur <eldy@users.sourceforge.net>
|
2003-03-25 22:41:16 +01:00
|
|
|
*
|
|
|
|
|
* 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
|
2013-01-16 15:36:08 +01:00
|
|
|
* the Free Software Foundation; either version 3 of the License, or
|
2003-03-25 22:41:16 +01:00
|
|
|
* (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
|
2011-08-03 02:45:22 +02:00
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2003-03-25 22:41:16 +01:00
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
|
2006-09-03 15:49:00 +02:00
|
|
|
/**
|
2011-08-27 16:24:16 +02:00
|
|
|
* \file htdocs/boutique/commande/fiche.php
|
|
|
|
|
* \ingroup boutique
|
|
|
|
|
* \brief Page fiche commande OSCommerce
|
2010-04-27 10:22:48 +02:00
|
|
|
*/
|
2006-09-03 15:49:00 +02:00
|
|
|
|
2012-08-22 23:24:21 +02:00
|
|
|
require '../../main.inc.php';
|
2012-08-22 23:11:24 +02:00
|
|
|
require_once DOL_DOCUMENT_ROOT.'/boutique/osc_master.inc.php';
|
2012-08-23 02:04:35 +02:00
|
|
|
include_once DOL_DOCUMENT_ROOT.'/boutique/commande/class/boutiquecommande.class.php';
|
2003-03-25 22:41:16 +01:00
|
|
|
|
2004-10-23 18:55:07 +02:00
|
|
|
$langs->load("products");
|
|
|
|
|
|
2012-10-13 10:39:16 +02:00
|
|
|
$id=GETPOST('id', 'int');
|
2010-03-27 03:29:49 +01:00
|
|
|
|
2010-04-27 10:22:48 +02:00
|
|
|
/*
|
|
|
|
|
* View
|
|
|
|
|
*/
|
|
|
|
|
|
2003-03-25 22:41:16 +01:00
|
|
|
llxHeader();
|
|
|
|
|
|
|
|
|
|
|
2012-10-13 10:39:16 +02:00
|
|
|
if ($id > 0)
|
2003-03-25 22:41:16 +01:00
|
|
|
{
|
2010-04-27 10:22:48 +02:00
|
|
|
$commande = new BoutiqueCommande($db);
|
2012-10-13 10:39:16 +02:00
|
|
|
$result = $commande->fetch($id);
|
|
|
|
|
if ($result)
|
2010-04-27 10:22:48 +02:00
|
|
|
{
|
|
|
|
|
print '<div class="titre">'.$langs->trans("OrderCard").': '.$commande->id.'</div><br>';
|
2003-04-24 18:39:16 +02:00
|
|
|
|
2010-04-27 10:22:48 +02:00
|
|
|
print '<table border="1" width="100%" cellspacing="0" cellpadding="4">';
|
|
|
|
|
print '<tr><td width="20%">Date</td><td width="80%" colspan="2">'.$commande->date.'</td></tr>';
|
|
|
|
|
print '<td width="20%">Client</td><td width="80%" colspan="2"><a href="'.DOL_URL_ROOT.'/boutique/client/fiche.php?id='.$commande->client_id.'">'.$commande->client_name.'</a></td></tr>';
|
2003-03-27 18:41:13 +01:00
|
|
|
|
2010-04-27 10:22:48 +02:00
|
|
|
print '<td width="20%">Paiement</td><td width="80%" colspan="2">'.$commande->payment_method.'</td></tr>';
|
2003-04-24 18:39:16 +02:00
|
|
|
|
2011-08-20 17:11:31 +02:00
|
|
|
print "<tr><td>".$langs->trans("Address")."</td><td>".$langs->trans("Delivery")."</td><td>".$langs->trans("Invoice")."</td></tr>";
|
2003-03-27 18:41:13 +01:00
|
|
|
|
2013-02-24 17:08:52 +01:00
|
|
|
print "<td> </td><td>".$commande->delivery_adr->name."<br>".$commande->delivery_adr->street."<br>".$commande->delivery_adr->zip."<br>".$commande->delivery_adr->city."<br>".$commande->delivery_adr->country."</td>";
|
|
|
|
|
print "<td>".$commande->billing_adr->name."<br>".$commande->billing_adr->street."<br>".$commande->billing_adr->zip."<br>".$commande->billing_adr->city."<br>".$commande->billing_adr->country."</td>";
|
2010-04-27 10:22:48 +02:00
|
|
|
print "</tr>";
|
2003-03-27 18:41:13 +01:00
|
|
|
|
2010-04-27 10:22:48 +02:00
|
|
|
print "</table>";
|
2003-04-24 18:39:16 +02:00
|
|
|
|
2010-04-27 10:22:48 +02:00
|
|
|
print "<br>";
|
2009-01-31 02:17:53 +01:00
|
|
|
|
2010-04-27 10:22:48 +02:00
|
|
|
/*
|
|
|
|
|
* Produits
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
$sql = "SELECT orders_id, products_id, products_model, products_name, products_price, final_price, products_quantity";
|
|
|
|
|
$sql .= " FROM ".$conf->global->OSC_DB_NAME.".".$conf->global->OSC_DB_TABLE_PREFIX."orders_products";
|
2012-10-13 10:39:16 +02:00
|
|
|
$sql .= " WHERE orders_id = " . $commande->id;
|
2010-04-27 10:22:48 +02:00
|
|
|
//$commande->id;
|
|
|
|
|
// echo $sql;
|
2010-08-09 17:42:57 +02:00
|
|
|
$resql=$dbosc->query($sql);
|
|
|
|
|
if ($resql)
|
2010-04-27 10:22:48 +02:00
|
|
|
{
|
2010-08-09 17:42:57 +02:00
|
|
|
$num = $dbosc->num_rows($resql);
|
|
|
|
|
$i = 0;
|
|
|
|
|
print '<table class="noborder" width="100%">';
|
|
|
|
|
print '<tr class="liste_titre"><td align="left" width="40%">'.$langs->trans("Products").'</td>';
|
|
|
|
|
print '<td align="center">'.$langs->trans("Number").'</td><td align="right">'.$langs->trans("Price").'</td><td align="right">Prix final</td>';
|
|
|
|
|
print "</tr>\n";
|
|
|
|
|
$var=True;
|
|
|
|
|
while ($i < $num)
|
|
|
|
|
{
|
|
|
|
|
$objp = $dbosc->fetch_object($resql);
|
|
|
|
|
$var=!$var;
|
2013-06-20 09:18:12 +02:00
|
|
|
print "<tr ".$bc[$var].">";
|
2010-08-09 17:42:57 +02:00
|
|
|
print '<td align="left" width="40%">';
|
|
|
|
|
print '<a href="fiche.php?id='.$objp->products_id.'"><img src="/theme/'.$conf->theme.'/img/filenew.png" border="0" width="16" height="16" alt="Fiche livre"></a>';
|
|
|
|
|
|
|
|
|
|
print '<a href="fiche.php?id='.$objp->products_id.'">'.$objp->products_name.'</a>';
|
|
|
|
|
print "</td>";
|
|
|
|
|
|
|
|
|
|
print '<td align="center"><a href="fiche.php?id='.$objp->rowid."\">$objp->products_quantity</a></TD>\n";
|
|
|
|
|
print "<td align=\"right\"><a href=\"fiche.php?id=$objp->rowid\">".price($objp->products_price)."</a></TD>\n";
|
|
|
|
|
print "<td align=\"right\"><a href=\"fiche.php?id=$objp->rowid\">".price($objp->final_price)."</a></TD>\n";
|
|
|
|
|
|
|
|
|
|
print "</tr>\n";
|
|
|
|
|
$i++;
|
|
|
|
|
}
|
|
|
|
|
print "</table>";
|
|
|
|
|
$dbosc->free();
|
2010-04-27 10:22:48 +02:00
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2010-08-09 17:42:57 +02:00
|
|
|
print $dbosc->error();
|
2010-04-27 10:22:48 +02:00
|
|
|
}
|
2003-04-24 18:39:16 +02:00
|
|
|
|
2010-04-27 10:22:48 +02:00
|
|
|
/*
|
|
|
|
|
*
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
print "<br>";
|
2003-04-24 18:39:16 +02:00
|
|
|
|
2010-04-27 10:22:48 +02:00
|
|
|
print '<table border="1" width="100%" cellspacing="0" cellpadding="4">';
|
|
|
|
|
print "<tr>";
|
|
|
|
|
print '<td width="20%">Frais d\'expeditions</td><td width="80%">'.price($commande->total_ot_shipping).' EUR</td></tr>';
|
|
|
|
|
print '<td width="20%">'.$langs->trans("Lastname").'</td><td width="80%">'.price($commande->total_ot_total).' EUR</td></tr>';
|
|
|
|
|
print "</table>";
|
2003-03-27 18:41:13 +01:00
|
|
|
|
2009-01-31 02:17:53 +01:00
|
|
|
|
|
|
|
|
|
2010-04-27 10:22:48 +02:00
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
print "Fetch failed";
|
|
|
|
|
}
|
2003-03-25 22:41:16 +01:00
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2010-04-27 10:22:48 +02:00
|
|
|
print "Error";
|
2003-03-25 22:41:16 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* ************************************************************************** */
|
2009-01-31 02:17:53 +01:00
|
|
|
/* */
|
|
|
|
|
/* Barre d'action */
|
|
|
|
|
/* */
|
2003-03-25 22:41:16 +01:00
|
|
|
/* ************************************************************************** */
|
|
|
|
|
|
|
|
|
|
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>';
|
2009-01-31 02:17:53 +01:00
|
|
|
print '<td width="20%" align="center">-</td>';
|
|
|
|
|
print '<td width="20%" align="center">-</td>';
|
2003-03-25 22:41:16 +01:00
|
|
|
print '</table><br>';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-09-03 15:49:00 +02:00
|
|
|
$dbosc->close();
|
2003-03-25 22:41:16 +01:00
|
|
|
|
2011-08-27 16:24:16 +02:00
|
|
|
llxFooter();
|
2003-03-25 22:41:16 +01:00
|
|
|
?>
|