2006-08-12 01:20:32 +02:00
|
|
|
|
<?php
|
2007-08-11 00:00:35 +02:00
|
|
|
|
/* Copyright (C) 2006 Jean Heimburger <jean@tiaris.info>
|
|
|
|
|
|
* Copyright (C) 2007 Laurent Destailleur <eldy@users.sourceforge.net>
|
2006-08-12 01:20:32 +02: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
|
|
|
|
|
|
* 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.
|
2007-10-06 22:16:42 +02:00
|
|
|
|
*
|
|
|
|
|
|
* $Id$
|
2006-08-12 01:20:32 +02:00
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
require("./pre.inc.php");
|
|
|
|
|
|
|
|
|
|
|
|
$langs->load("companies");
|
2007-08-11 00:00:35 +02:00
|
|
|
|
$langs->load("orders");
|
|
|
|
|
|
|
2006-08-12 01:20:32 +02:00
|
|
|
|
|
|
|
|
|
|
llxHeader();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ($page == -1) { $page = 0 ; }
|
|
|
|
|
|
$limit = $conf->liste_limit;
|
|
|
|
|
|
$offset = $limit * $page ;
|
|
|
|
|
|
|
|
|
|
|
|
print_barre_liste("Liste des commandes de la boutique web", $page, "index.php");
|
|
|
|
|
|
|
|
|
|
|
|
set_magic_quotes_runtime(0);
|
|
|
|
|
|
|
|
|
|
|
|
//WebService Client.
|
|
|
|
|
|
require_once(NUSOAP_PATH."nusoap.php");
|
|
|
|
|
|
require_once("../includes/configure.php");
|
|
|
|
|
|
|
|
|
|
|
|
// Set the parameters to send to the WebService
|
|
|
|
|
|
$parameters = array("orderid"=>"0");
|
|
|
|
|
|
|
|
|
|
|
|
// Set the WebService URL
|
2007-08-10 23:48:06 +02:00
|
|
|
|
$client = new soapclient_nusoap(OSCWS_DIR."ws_orders.php");
|
2006-08-12 01:20:32 +02:00
|
|
|
|
|
|
|
|
|
|
$result = $client->call("get_Order",$parameters );
|
|
|
|
|
|
|
|
|
|
|
|
// echo '<h2>Result</h2><pre>'; print_r($result); echo '</pre>';
|
|
|
|
|
|
|
|
|
|
|
|
if ($client->fault) {
|
2007-09-09 12:40:17 +02:00
|
|
|
|
dolibarr_print_error('',"erreur de connexion ");
|
2006-08-12 01:20:32 +02:00
|
|
|
|
}
|
|
|
|
|
|
elseif (!($err = $client->getError()) )
|
|
|
|
|
|
{
|
|
|
|
|
|
$num=0;
|
|
|
|
|
|
if ($result) $num = sizeof($result);
|
|
|
|
|
|
$var=True;
|
|
|
|
|
|
$i=0;
|
|
|
|
|
|
|
2007-02-01 23:23:29 +01:00
|
|
|
|
// une commande osc
|
|
|
|
|
|
$OscOrder = new Osc_Order($db);
|
|
|
|
|
|
|
2006-08-12 01:20:32 +02:00
|
|
|
|
if ($num > 0) {
|
2007-08-11 00:00:35 +02:00
|
|
|
|
print "<TABLE width=\"100%\" class=\"noborder\">";
|
2006-08-12 01:20:32 +02:00
|
|
|
|
print '<TR class="liste_titre">';
|
2007-08-11 00:00:35 +02:00
|
|
|
|
print "<td>Id</td>";
|
|
|
|
|
|
print '<TD align="center">'.$langs->trans("Order").'</TD>';
|
|
|
|
|
|
print '<td>'.$langs->trans("Customer").'</td>';
|
|
|
|
|
|
print '<td>'.$langs->trans("Date").'</td>';
|
|
|
|
|
|
print '<td>'.$langs->trans("Amount").'</td>';
|
2006-08-12 01:20:32 +02:00
|
|
|
|
print '<td align="center">Paiement</td>';
|
2007-03-16 22:26:26 +01:00
|
|
|
|
print '<td align="center">Statut</td>';
|
2006-12-12 20:25:30 +01:00
|
|
|
|
print '<TD align="center">Importer</TD>';
|
2006-08-12 01:20:32 +02:00
|
|
|
|
print "</TR>\n";
|
|
|
|
|
|
|
|
|
|
|
|
while ($i < $num) {
|
|
|
|
|
|
$var=!$var;
|
|
|
|
|
|
|
2007-02-01 23:23:29 +01:00
|
|
|
|
$ordid = $OscOrder->get_orderid($result[$i][orders_id]);
|
2006-08-12 01:20:32 +02:00
|
|
|
|
print "<TR $bc[$var]>";
|
|
|
|
|
|
print '<TD><a href="fiche.php?orderid='.$result[$i][orders_id].'">'.$result[$i][orders_id]."</TD>\n";
|
2007-02-01 23:23:29 +01:00
|
|
|
|
print '<TD><a href="../../commande/fiche.php?id='.$ordid.'">'.$ordid."</a> </TD>\n";
|
2006-08-12 01:20:32 +02:00
|
|
|
|
print "<TD>".$result[$i][customers_name]."</TD>\n";
|
|
|
|
|
|
print "<TD>".$result[$i][date_purchased]."</TD>\n";
|
2007-03-16 22:26:26 +01:00
|
|
|
|
$tot = convert_price($result[$i][total]) + convert_price($result[$i][port]);
|
|
|
|
|
|
print "<TD>".$tot."</TD>\n";
|
2006-12-12 20:25:30 +01:00
|
|
|
|
print '<TD align="center">'.' '.$result[$i][payment_method]."</TD>\n";
|
2007-03-16 22:26:26 +01:00
|
|
|
|
print '<TD align="center">'.$result[$i][statut]."</TD>\n";
|
2007-02-01 23:23:29 +01:00
|
|
|
|
if ($ordid) $lib = "modifier";
|
|
|
|
|
|
else $lib = "<u>importer</u>";
|
|
|
|
|
|
print '<TD align="center"><a href="fiche.php?action=import&orderid='.$result[$i][orders_id].'">'.$lib."</a></TD>\n";
|
2006-08-12 01:20:32 +02:00
|
|
|
|
print "</TR>\n";
|
|
|
|
|
|
$i++;
|
|
|
|
|
|
}
|
|
|
|
|
|
print "</table></p>";
|
|
|
|
|
|
}
|
|
|
|
|
|
else {
|
|
|
|
|
|
dolibarr_print_error('',"Aucune commande trouv<75>e");
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
else {
|
|
|
|
|
|
dolibarr_print_error('',"Erreur service web ".$err);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
print "</TABLE>";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
llxFooter('$Date$ - $Revision$');
|
|
|
|
|
|
?>
|