Intgration du patch de Jean Heimburger (suite du module oscommerce par webservice)

This commit is contained in:
Laurent Destailleur 2006-08-11 23:20:32 +00:00
parent 78e1b4730c
commit bc5ba2f116
18 changed files with 1139 additions and 54 deletions

View File

@ -0,0 +1,148 @@
<?php
/* Copyright (C) 2006 Jean Heimburger <jean@tiaris.info>
*
*
* 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.
*
* $Source$
*
*/
require("./pre.inc.php");
require_once(DOL_DOCUMENT_ROOT."/societe.class.php");
require_once("../includes/configure.php");
llxHeader();
if ($action == '' && !$cancel) {
if ($_GET['custid'])
{
$osc_cust = new Osc_customer($_GET['custid']);
$result = $osc_cust->fetch($_GET['custid']);
if ( !$result)
{
print '<div class="titre">Fiche client OSC : '.$osc_cust->osc_custfirstname.' '.$osc_cust->osc_custlastname.'</div><br>';
print '<table border="1" width="100%" cellspacing="0" cellpadding="4">';
print '<tr></tr><td width="20%">Ville</td><td width="80%">'.$osc_cust->osc_custcity.'</td></tr>';
print '<tr></tr><td width="20%">Pays</td><td width="80%">'.$osc_cust->osc_custcountry.'</td></tr>';
print '<tr></tr><td width="20%">Id OSC</td><td width="80%">'.$osc_cust->osc_custid.'</td></tr>';
print '<tr></tr><td width="20%">Téléphone</td><td width="80%">'.$osc_cust->osc_custtel.'</td></tr>';
print '<tr></tr><td width="20%">E-mail</td><td width="80%">'.$osc_cust->osc_custmail.'</td></tr>';
print "</table>";
/* ************************************************************************** */
/* */
/* Barre d'action */
/* */
/* ************************************************************************** */
print "\n<div class=\"tabsAction\">\n";
if ( $user->rights->societe->creer) {
print '<a class="tabAction" href="fiche.php?action=import&amp;custid='.$osc_cust->osc_custid.'">'.$langs->trans("Import").'</a>';
}
print "\n</div><br>\n";
// seule action importer
}
else
{
print "<p>ERROR 1c</p>\n";
dolibarr_print_error('',"erreur webservice ".$osc_cust->error);
}
}
else
{
print "<p>ERROR 1b</p>\n";
print "Error";
}
}
/* action Import création de l'objet product de dolibarr
*
*/
if (($_GET["action"] == 'import' ) && ( $_GET["custid"] != '' ) && $user->rights->produit->creer)
{
$osc_cust = new Osc_customer();
$result = $osc_cust->fetch($_GET['custid']);
if ( !$result )
{
$societe = new Societe($db);
if ($_error == 1)
{
print '<br>erreur 1</br>';
exit;
}
/* initialisation */
$societe->nom = $osc_cust->osc_custsoc.' '.$osc_cust->osc_custlastname;
$societe->adresse = $osc_cust->osc_cutstreet;
$societe->cp = $osc_cust->osc_custpostcode;
$societe->ville = $osc_cust->osc_custcity;
$societe->departement_id = 0;
$societe->pays_code = $osc_cust->osc_custcodecountry;
$societe->tel = $osc_cust->osc_custtel;
$societe->fax = $osc_cust->osc_custfax;
$societe->email = $osc_cust->osc_custmail;
/* on force */
$societe->url = '';
$societe->siren = '';
$societe->siret = '';
$societe->ape = '';
$societe->client = 1; // mettre 0 si prospect
}
$id = $societe->create($user);
if ($id == 0)
{
print '<br>création réussie nouveau client/prospect '.$id.' nom : '.$societe->nom.'</br>';
}
else
{
if ($id == -3)
{
$_error = 1;
$_GET["action"] = "create";
$_GET["type"] = $_POST["type"];
}
if ($id == -2)
{
/* la référence existe on fait un update */
$societe_control = new Societe($db);
if ($_error == 1)
{
print '<br>erreur 1</br>';
exit;
}
$idp = $societe_control->fetch($socid = $osc_cust->osc_ref);
if ($idp > 0)
{
$res = $societe->update($idp, $user);
if ($res < 0) print '<br>Erreur update '.$idp.'</br>';
$res = $osc_cust->transcode($osc_cust->custid,$idp);
if ($res < 0) print '<br>Erreur update '.$idp.'</br>';
}
else print '<br>update impossible $id : '.$idp.' </br>';
}
}
}
llxFooter('$Date$ - $Revision$');
?>

View File

@ -0,0 +1,98 @@
<?php
/* Copyright (C) 2006 Jean Heimburger <jean@tiaris.info>
*
* 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.
*
*
*/
require("./pre.inc.php");
$langs->load("companies");
llxHeader();
if ($page == -1) { $page = 0 ; }
$limit = $conf->liste_limit;
$offset = $limit * $page ;
print_barre_liste("Liste des clients 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("custid"=>"0");
// Set the WebService URL
$client = new soapclient(OSCWS_DIR."ws_customers.php");
$result = $client->call("get_Client",$parameters );
// echo '<h2>Result</h2><pre>'; print_r($result); echo '</pre>';
if ($client->fault) {
dolibarr_print_error('',"erreur de connection ");
}
elseif (!($err = $client->getError()) )
{
$num=0;
if ($result) $num = sizeof($result);
$var=True;
$i=0;
if ($num > 0) {
print "<p><TABLE border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"4\">";
print '<TR class="liste_titre">';
print "<td>id</td>";
print '<TD align="center">Société</TD>';
print "<td>Nom</td>";
print "<td>Ville</td>";
print "<td>Pays</td>";
print '<td align="center">Téléphone</td>';
print "</TR>\n";
while ($i < $num) {
$var=!$var;
print "<TR $bc[$var]>";
print '<TD><a href="fiche.php?custid='.$result[$i][customers_id].'">'.$result[$i][customers_id]."</TD>\n";
print "<TD>".$result[$i][entry_company]."</TD>\n";
print "<TD>".$result[$i][entry_lastname]."</TD>\n";
print "<TD>".$result[$i][entry_city]."</TD>\n";
print '<TD align="center">'.$result[$i][countries_name]."</TD>\n";
print '<TD align="center">'.$result[$i][customers_telephone]."</TD>\n";
print "</TR>\n";
$i++;
}
print "</table></p>";
}
else {
dolibarr_print_error('',"Aucun client trouvé");
}
}
else {
dolibarr_print_error('',"Erreur service web ".$err);
}
print "</TABLE>";
llxFooter('$Date$ - $Revision$');
?>

View File

@ -0,0 +1,174 @@
<?php
/* Copyright (C) 2006 Jean Heimburger <jean@tiaris.info>
*
* 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$
*/
/**
\file htdocs/oscommerce_ws/clients/osc_customer.class.php
\ingroup oscommerce_ws/clients
\brief Fichier de la classe des clients issus de OsCommerce
\version $Revision$
*/
/**
\class Osc_customer
\brief Classe permettant la gestion des clients/prospects issus d'une base OSC
*/
class Osc_customer
{
var $db;
var $osc_custid;
var $osc_custsoc;
var $osc_custfirstname;
var $osc_custlastname;
var $osc_custstreet;
var $osc_custpostcode;
var $osc_custcity;
var $osc_custtel;
var $osc_custfax;
var $osc_custmail;
var $osc_custidcountry;
var $osc_custcodecountry;
var $osc_custcountry;
var $error;
/**
* \brief Constructeur de la classe
* \param id Id client (0 par defaut)
*/
function Osc_customer($id=0) {
global $langs;
$this->osc_custid = $id ;
/* les initialisations nécessaires */
}
/**
* \brief Charge le client OsC en mémoire
* \param id Id du client dans OsC
* \return int <0 si ko, >0 si ok
*/
function fetch($id='')
{
global $langs;
global $conf;
$this->error = '';
dolibarr_syslog("Osc_customer::fetch $id=$id ref=$ref");
// Verification parametres
if (! $id )
{
$this->error=$langs->trans('ErrorWrongParameters');
return -1;
}
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("custid"=>$id);
// Set the WebService URL
$client = new soapclient(OSCWS_DIR."/ws_customers.php");
// Call the WebSeclient->fault)rvice and store its result in $obj
$obj = $client->call("get_Client",$parameters );
// Attention c'est un tableau !!
if ($client->fault) {
$this->error="Fault detected ".$client->getError();
return -1;
}
elseif (!($err=$client->getError()) ) {
$this->osc_custid = $obj[0][customers_id];
$this->osc_custsoc = $obj[0][entry_company];
$this->osc_custfirstname = $obj[0][entry_firstname];
$this->osc_custlastname = $obj[0][entry_lastname];
$this->osc_custstreet = $obj[0][entry_street_address];
$this->osc_custpostcode = $obj[0][entry_postcode];
$this->osc_custcity = $obj[0][entry_city];
$this->osc_custtel = $obj[0][customers_telephone];
$this->osc_custfax = $obj[0][customers_fax];
$this->osc_custmail = $obj[0][customers_email_address];
$this->osc_custidcountry = $obj[0][entry_country_id];
$this->osc_custcodecountry = $obj[0][countries_iso_code_2];
$this->osc_custcountry = $obj[0][countries_name];
}
else {
$this->error = 'Erreur '.$err ;
return -1;
}
return 0;
}
/**
* \brief Mise à jour de la table de transition
* \param oscid Id du client dans OsC
* \param socidp champ société.idp
* \return int <0 si ko, >0 si ok
*/
function transcode($oscid, $socidp)
{
global $conf;
/* suppression et insertion */
$sql = "DELETE FROM ".MAIN_DB_PREFIX." osc_customer WHERE osc_custid = ".$oscid;
$this->$db = $DB;
$result=$this->db->query($sql);
if ($result)
{
print "suppression ok ".$result;
}
else
{
print "suppression rate ".$result;
dolibarr_syslog("osc_customer::transcode echec suppression");
// $this->db->rollback();
// return -1;
}
$sql = "INSERT INTO ".MAIN_DB_PREFIX." osc_customer VALUES (".$oscid." , CURDATE() , ".$socidp.")";
$this->$db = $DB;
$result=$this->db->query($sql);
if ($result)
{
print "insertion ok ". $sql." ". $result;
}
else
{
print "insertion rate ".$sql." , ".$result;
dolibarr_syslog("osc_customer::transcode echec insert");
// $this->db->rollback();
// return -1;
}
return 0;
}
}
?>

View File

@ -0,0 +1,50 @@
<?php
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2006 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2006 Jean Heimburger <jean@tiaris.info>
*
* 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$
*/
/**
\file htdocs/oscommerce_ws/clients/pre.inc.php
\brief Fichier gestionnaire du menu de gauche
\version $Revision$
*/
require("../../main.inc.php");
require("./osc_customer.class.php");
function llxHeader($head = "", $urlp = "")
{
global $user, $conf, $langs;
$langs->load("shop");
top_menu($head);
$menu = new Menu();
$menu->add(DOL_URL_ROOT."/oscommerce_ws/index.php", $langs->trans("OSCommerceShop"));
$menu->add_submenu(DOL_URL_ROOT."/oscommerce_ws/produits/", $langs->trans("Products"));
$menu->add_submenu(DOL_URL_ROOT."/oscommerce_ws/clients/", $langs->trans("Clients"));
$menu->add_submenu(DOL_URL_ROOT."/oscommerce_ws/commandes/", $langs->trans("Commandes"));
left_menu($menu->liste);
}
?>

View File

@ -0,0 +1,146 @@
<?php
/* Copyright (C) 2006 Jean Heimburger <jean@tiaris.info>
*
*
* 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.
*
* $Source$
*
*/
require("./pre.inc.php");
require_once(DOL_DOCUMENT_ROOT."/commande/commande.class.php");
require_once("../includes/configure.php");
llxHeader();
if ($action == '' && !$cancel) {
if ($_GET["orderid"])
{
$osc_order = new Osc_order($_GET["orderid"]);
$result = $osc_order->fetch($_GET["orderid"]);
if ( !$result)
{
print '<div class="titre">Fiche commande OSC : '.$osc_order->osc_orderid.'</div><br>';
print '<table border="1" width="100%" cellspacing="0" cellpadding="4">';
print '<tr></tr><td width="20%">client OSC</td><td width="80%">'.$osc_order->osc_custid.'</td></tr>';
print '<tr></tr><td width="20%">Nom client</td><td width="80%">'.$osc_order->osc_custname.'</td></tr>';
print '<tr></tr><td width="20%">Montant</td><td width="80%">'.$osc_order->osc_ordertotal.'</td></tr>';
print '<tr></tr><td width="20%">Date commande</td><td width="80%">'.$osc_order->osc_orderdate.'</td></tr>';
print '<tr></tr><td width="20%">Méthode de paiement</td><td width="80%">'.$osc_order->osc_orderpaymet.'</td></tr>';
print "</table>";
/* ************************************************************************** */
/* */
/* Barre d'action */
/* */
/* ************************************************************************** */
print "\n<div class=\"tabsAction\">\n";
if ( $user->rights->commande->creer) {
print '<a class="tabAction" href="fiche.php?action=import&amp;orderid='.$osc_order->osc_orderid.'">'.$langs->trans("Import").'</a>';
}
print "\n</div><br>\n";
// seule action importer
}
else
{
print "<p>ERROR 1c</p>\n";
dolibarr_print_error('',"erreur webservice ".$osc_order->error);
}
}
else
{
print "<p>ERROR 1b</p>\n";
print "Error";
}
}
/* action Import création de l'objet product de dolibarr
*
*/
if (($_GET["action"] == 'import' ) && ( $_GET["orderid"] != '' ) && $user->rights->commande->creer)
{
$osc_order = new osc_order();
$result = $osc_order->fetch($_GET["orderid"]);
print '<br>on passe 1</br>';
if ( !$result )
{
$commande = new Commande($db);
if ($_error == 1)
{
print '<br>erreur 1</br>';
exit;
}
print '<br>on passe 2</br>';
/* initialisation */
$societe->nom = $osc_order->osc_ordersoc.' '.$osc_order->osc_orderlastname;
$societe->adresse = $osc_order->osc_cutstreet;
$societe->cp = $osc_order->osc_orderpostcode;
$societe->ville = $osc_order->osc_ordercity;
$societe->departement_id = 0;
$societe->pays_code = $osc_order->osc_ordercodecountry;
$societe->tel = $osc_order->osc_ordertel;
$societe->fax = $osc_order->osc_orderfax;
$societe->email = $osc_order->osc_ordermail;
/* on force */
$societe->url = '';
$societe->siren = '';
$societe->siret = '';
$societe->ape = '';
$societe->client = 1; // mettre 0 si prospect
}
print '<br>on passe 3</br>';
$id = $societe->create($user);
if ($id > 0)
{
print '<br>création réussie nouveau client/prospect '.$id.' nom : '.$societe->nom.'</br>';
if ($id > 0) exit;
}
else
{
if ($id == -3)
{
$_error = 1;
$_GET["action"] = "create";
$_GET["type"] = $_POST["type"];
}
if ($id == -2)
{
/* la référence existe on fait un update */
$societe_control = new Societe($db);
if ($_error == 1)
{
print '<br>erreur 1</br>';
exit;
}
$id = $societe_control->fetch($ref = $osc_order->osc_ref);
if ($id > 0)
{
$id = $societe->update($id, $user);
if ($id < 0) print '<br>Erreur update '.$id.'</br>';
}
else print '<br>update impossible $id : '.$id.' </br>';
}
}
}
llxFooter('$Date$ - $Revision$');
?>

View File

@ -0,0 +1,98 @@
<?php
/* Copyright (C) 2006 Jean Heimburger <jean@tiaris.info>
*
* 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.
*
*
*/
require("./pre.inc.php");
$langs->load("companies");
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
$client = new soapclient(OSCWS_DIR."ws_orders.php");
$result = $client->call("get_Order",$parameters );
// echo '<h2>Result</h2><pre>'; print_r($result); echo '</pre>';
if ($client->fault) {
dolibarr_print_error('',"erreur de connection ");
}
elseif (!($err = $client->getError()) )
{
$num=0;
if ($result) $num = sizeof($result);
$var=True;
$i=0;
if ($num > 0) {
print "<p><TABLE border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"4\">";
print '<TR class="liste_titre">';
print "<td>id</td>";
print '<TD align="center">Commande</TD>';
print "<td>Client</td>";
print "<td>Date</td>";
print "<td>Montant</td>";
print '<td align="center">Paiement</td>';
print "</TR>\n";
while ($i < $num) {
$var=!$var;
print "<TR $bc[$var]>";
print '<TD><a href="fiche.php?orderid='.$result[$i][orders_id].'">'.$result[$i][orders_id]."</TD>\n";
print "<TD>".$result[$i][customers_name]."</TD>\n";
print "<TD>".$result[$i][date_purchased]."</TD>\n";
print "<TD>".$result[$i][value]."</TD>\n";
print '<TD align="center">'.$result[$i][payment_method]."</TD>\n";
// print '<TD align="center">'/*.$result[$i][customers_telephone]*/."</TD>\n";
print "</TR>\n";
$i++;
}
print "</table></p>";
}
else {
dolibarr_print_error('',"Aucune commande trouvée");
}
}
else {
dolibarr_print_error('',"Erreur service web ".$err);
}
print "</TABLE>";
llxFooter('$Date$ - $Revision$');
?>

View File

@ -0,0 +1,115 @@
<?php
/* Copyright (C) 2006 Jean Heimburger <jean@tiaris.info>
*
* 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$
*/
/**
\file htdocs/oscommerce_ws/orders/osc_order.class.php
\ingroup oscommerce_ws/orders
\brief Fichier de la classe des commandes issus de OsCommerce
\version $Revision$
*/
/**
\class Osc_order
\brief Classe permettant la gestion des commandes issues d'une base OSC
*/
class Osc_order
{
var $osc_orderid;
var $osc_custid; //identifant du client osc
var $osc_custname;
var $osc_orderdate;
var $osc_ordertotal;
var $osc_orderpaymet;
var $error;
/**
* \brief Constructeur de la classe
* \param id Id client (0 par defaut)
*/
function Osc_order($id=0) {
global $langs;
$this->osc_orderid = $id ;
/* les initialisations nécessaires */
}
/**
* \brief Charge la commande OsC en mémoire
* \param id Id de la commande dans OsC
* \return int <0 si ko, >0 si ok
*/
function fetch($id='')
{
global $langs;
global $conf;
$this->error = '';
dolibarr_syslog("Osc_order::fetch $id=$id ");
// Verification parametres
if (! $id )
{
$this->error=$langs->trans('ErrorWrongParameters');
return -1;
}
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"=>$id);
// Set the WebService URL
$client = new soapclient(OSCWS_DIR."/ws_orders.php");
// Call the WebSeclient->fault)rvice and store its result in $obj
$obj = $client->call("get_Order",$parameters );
if ($client->fault) {
$this->error="Fault detected ".$client->getError();
return -1;
}
elseif (!($err=$client->getError()) ) {
$this->osc_orderid = $obj[0][orders_id];
$this->osc_custname = $obj[0][customers_name];
$this->osc_custid = $obj[0][customers_id];
$this->osc_orderdate = $obj[0][date_purchased];
$this->osc_ordertotal = $obj[0][value];
$this->osc_orderpaymet = $obj[0][payment_method];
}
else {
$this->error = 'Erreur '.$err ;
return -1;
}
return 0;
}
}
?>

View File

@ -0,0 +1,50 @@
<?php
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2006 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2006 Jean Heimburger <jean@tiaris.info>
*
* 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$
*/
/**
\file htdocs/oscommerce_ws/clients/pre.inc.php
\brief Fichier gestionnaire du menu de gauche
\version $Revision$
*/
require("../../main.inc.php");
require("./osc_order.class.php");
function llxHeader($head = "", $urlp = "")
{
global $user, $conf, $langs;
$langs->load("shop");
top_menu($head);
$menu = new Menu();
$menu->add(DOL_URL_ROOT."/oscommerce_ws/index.php", $langs->trans("OSCommerceShop"));
$menu->add_submenu(DOL_URL_ROOT."/oscommerce_ws/produits/", $langs->trans("Products"));
$menu->add_submenu(DOL_URL_ROOT."/oscommerce_ws/clients/", $langs->trans("Clients"));
$menu->add_submenu(DOL_URL_ROOT."/oscommerce_ws/commandes/", $langs->trans("Commandes"));
left_menu($menu->liste);
}
?>

View File

@ -7,8 +7,8 @@
----------------------------------------------*/
//base url des webservices
//define(OSCWS_DIR,'http://osc-tiaris/ws_OSC/');
define(OSCWS_DIR,'http://osc.tiaris.info/ws_OSC/');
define(OSCWS_DIR,'http://osc-tiaris/ws_OSC/');
//define(OSCWS_DIR,'http://osc.tiaris.info/ws_OSC/');
//affichages dans la page d'accueil
define(OSC_MAXNBCOM, 5);
define(OSC_ORDWAIT,'4'); // code du statut de commande en attente

View File

@ -66,7 +66,7 @@ print '<td align="right">'.$langs->trans("Total").'</td></tr>';
// Call the WebService and store its result in $result.
$result = $client->call("get_CAmensuel",$parameters );
if ($client->fault) {
dolibarr_print_error("Erreur de connection ");
dolibarr_print_error('',"Erreur de connection ");
}
elseif (!($err = $client->getError()) )
{
@ -90,7 +90,7 @@ elseif (!($err = $client->getError()) )
}
else
{
dolibarr_print_error("Erreur du service web ".$err);
dolibarr_print_error('',"Erreur du service web ".$err);
}
@ -113,7 +113,7 @@ $parameters = array("limit"=>OSC_MAXNBCOM);
$result = $client->call("get_orders",$parameters );
if ($client->fault) {
dolibarr_print_error("Erreur de connection ");
dolibarr_print_error('',"Erreur de connection ");
}
elseif (!($err = $client->getError()) ) {
$num=0;
@ -133,7 +133,7 @@ elseif (!($err = $client->getError()) ) {
}
}
else {
dolibarr_print_error("Erreur du service web ".$err);
dolibarr_print_error('',"Erreur du service web ".$err);
}
print "</table><br>";
@ -150,7 +150,7 @@ $parameters = array("limit"=>OSC_MAXNBCOM, "status"=>OSC_ORDWAIT);
$result = $client->call("get_orders",$parameters );
if ($client->fault) {
dolibarr_print_error("Erreur webservice ".$client->faultstring);
dolibarr_print_error('',"Erreur webservice ".$client->faultstring);
}
elseif (!($err = $client->getError()) ) {
$var=True;
@ -171,7 +171,7 @@ elseif (!($err = $client->getError()) ) {
}
}
else {
dolibarr_print_error("Erreur du service web ".$err);
dolibarr_print_error('',"Erreur du service web ".$err);
}
print "</table><br>";
@ -187,7 +187,7 @@ $parameters = array("limit"=>OSC_MAXNBCOM, "status"=>OSC_ORDPROCESS);
$result = $client->call("get_orders",$parameters );
if ($client->fault) {
dolibarr_print_error("Erreur webservice ".$client->faultstring);
dolibarr_print_error('',"Erreur webservice ".$client->faultstring);
}
elseif (!($err = $client->getError()) ) {
$var=True;
@ -208,7 +208,7 @@ elseif (!($err = $client->getError()) ) {
}
}
else {
dolibarr_print_error("Erreur du service web ".$err);
dolibarr_print_error('',"Erreur du service web ".$err);
}
print "</table><br>";
@ -226,7 +226,7 @@ $parameters = array("limit"=>OSC_MAXNBCOM);
$result = $client->call("get_lastOrderClients",$parameters );
if ($client->fault) {
dolibarr_print_error("Erreur webservice ".$client->faultstring);
dolibarr_print_error('',"Erreur webservice ".$client->faultstring);
}
elseif (!($err = $client->getError()) ) {
$var=True;
@ -248,12 +248,12 @@ elseif (!($err = $client->getError()) ) {
}
}
else {
dolibarr_print_error("Erreur du service web ".$err);
dolibarr_print_error('',"Erreur du service web ".$err);
}
print '</tr></table>';
llxFooter("<em>Derni&egrave;re modification $Date$ r&eacute;vision $Revision$</em>");
llxFooter('$Date$ - $Revision$');
?>

View File

@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2006 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2006 Jean Heimburger <jean@tiaris.info>
*
* 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
@ -38,7 +39,9 @@ function llxHeader($head = "", $urlp = "")
$menu = new Menu();
$menu->add(DOL_URL_ROOT."/oscommerce_ws/index.php", $langs->trans("OSCommerceShop"));
$menu->add_submenu(DOL_URL_ROOT."/oscommerce_ws/produits/", $langs->trans("Products"));
$menu->add_submenu(DOL_URL_ROOT."/oscommerce_ws/produits/index.php", $langs->trans("Products"));
$menu->add_submenu(DOL_URL_ROOT."/oscommerce_ws/clients/index.php", $langs->trans("Clients"));
$menu->add_submenu(DOL_URL_ROOT."/oscommerce_ws/commandes/index.php", $langs->trans("Commandes"));
left_menu($menu->liste);
}

View File

@ -1,6 +1,5 @@
<?php
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2003-2005 Éric Seigne <eric.seigne@ryxeo.com>
/* Copyright (C) 2006 Jean Heimburger <jean@tiaris.info>
*
* 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
@ -62,7 +61,7 @@ if ($action == '' && !$cancel) {
else
{
print "<p>ERROR 1</p>\n";
dolibarr_print_error("erreur webservice ".$osc_prod->error);
dolibarr_print_error('',"erreur webservice ".$osc_prod->error);
}
}
else
@ -143,5 +142,5 @@ if ($action == '' && !$cancel) {
}
llxFooter("<em>Derni&egrave;re modification $Date$ r&eacute;vision $Revision$</em>");
llxFooter('$Date$ - $Revision$');
?>

View File

@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004 Laurent Destailleur <eldy@users.sourceforge.net>
/* Copyright (C) 2006 Jean Heimburger <jean@tiaris.info>
*
*
* 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
@ -48,7 +48,7 @@ $client = new soapclient(OSCWS_DIR."ws_articles.php");
$result = $client->call("get_listearticles",$parameters );
if ($client->fault) {
dolibarr_print_error("erreur de connection ");
dolibarr_print_error('',"erreur de connection ");
}
elseif (!($err = $client->getError()) )
{
@ -84,15 +84,15 @@ elseif (!($err = $client->getError()) )
print "</table></p>";
}
else {
dolibarr_print_error("Aucun article trouvé");
dolibarr_print_error('',"Aucun article trouvé");
}
}
else {
dolibarr_print_error("Erreur service web ".$err);
dolibarr_print_error('',"Erreur service web ".$err);
}
print "</TABLE>";
llxFooter("<em>Derni&egrave;re modification $Date$ r&eacute;vision $Revision$</em>");
llxFooter('$Date$ - $Revision$');
?>

View File

@ -1,9 +1,5 @@
<?php
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2006 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2006 Regis Houssin <regis.houssin@cap-networks.com>
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
* Copyright (C) 2006 Jean Heimburger <jean@tiaris.info>
/* Copyright (C) 2006 Jean Heimburger <jean@tiaris.info>
*
* 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
@ -24,9 +20,9 @@
*/
/**
\file htdocs/product.class.php
\ingroup produit
\brief Fichier de la classe des produits prédéfinis
\file htdocs/oscommerce_ws/produits/osc_product.class.php
\ingroup oscommerce_ws/produits/
\brief Fichier de la classe des produits issus de OSC
\version $Revision$
*/
@ -64,9 +60,9 @@ class Osc_product
}
/**
* \brief Charge le produit/service en mémoire
* \param id Id du produit/service à charger
* \param ref Ref du produit/service à charger
* \brief Charge le produit OsC en mémoire
* \param id Id du produit dans OsC
* \param ref Ref du produit dans OsC (doit être unique dans OsC)
* \return int <0 si ko, >0 si ok
*/
function fetch($id='',$ref='')

View File

@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2006 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2006 Jean Heimburger <jean@tiaris.info>
*
* 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
@ -27,7 +28,7 @@
*/
require("../../main.inc.php");
require_once('./osc_product.class.php');
require("./osc_product.class.php");
function llxHeader($head = "", $urlp = "")
{
@ -40,7 +41,9 @@ function llxHeader($head = "", $urlp = "")
$menu->add(DOL_URL_ROOT."/oscommerce_ws/index.php", $langs->trans("OSCommerceShop"));
$menu->add_submenu(DOL_URL_ROOT."/oscommerce_ws/produits/", $langs->trans("Products"));
$menu->add_submenu(DOL_URL_ROOT."/oscommerce_ws/clients/", $langs->trans("Clients"));
$menu->add_submenu(DOL_URL_ROOT."/oscommerce_ws/commandes/", $langs->trans("Commandes"));
left_menu($menu->liste);
}

View File

@ -1,4 +1,25 @@
<?php
/* Copyright (C) 2006 Jean Heimburger <jean@tiaris.info>
*
*
* 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.
*
* $Source$
*
*/
set_magic_quotes_runtime(0);
require_once("./includes/configure.php");
@ -17,8 +38,8 @@ $s->register('get_listearticles');
function get_article($id='',$ref='') {
//on se connecte
if (!($connexion = mysql_connect(OSC_DB_SERVER, OSC_DB_SERVER_USERNAME, OSC_DB_SERVER_PASSWORD))) return new soap_fault("Server", "MySQL 1", "connection impossible");
if (!($db = mysql_select_db(OSC_DB_DATABASE, $connexion))) return new soap_fault("Server", "MySQL 2", mysql_error());
if (!($connexion = mysql_connect(DB_SERVER, DB_SERVER_USERNAME, DB_SERVER_PASSWORD))) return new soap_fault("Server", "MySQL 1", "connection impossible");
if (!($db = mysql_select_db(DB_DATABASE, $connexion))) return new soap_fault("Server", "MySQL 2", mysql_error());
//on recherche
$sql = "SELECT p.products_id, p.products_model, p.products_quantity, p.products_status, p.products_price, d.products_name, d.products_description, m.manufacturers_name, m.manufacturers_id";
@ -49,11 +70,11 @@ return $res_article;
function get_listearticles() {
//on se connecte
if (!($connexion = mysql_connect(OSC_DB_SERVER, OSC_DB_SERVER_USERNAME, OSC_DB_SERVER_PASSWORD))) return new soap_fault("Server", "MySQL 1", "connection impossible");
if (!($db = mysql_select_db(OSC_DB_DATABASE, $connexion))) return new soap_fault("Server", "MySQL 2", mysql_error());
if (!($connexion = mysql_connect(DB_SERVER, DB_SERVER_USERNAME, DB_SERVER_PASSWORD))) return new soap_fault("Server", "MySQL 1", "connection impossible");
if (!($db = mysql_select_db(DB_DATABASE, $connexion))) return new soap_fault("Server", "MySQL 2", mysql_error());
//on recherche
$sql = "SELECT p.products_id, p.products_model, p.products_quantity, p.products_status, d.products_name, m.manufacturers_name, m.manufacturers_id";
$sql = "SELECT p.products_id as OSC_id, p.products_model as model, p.products_quantity as quantity, p.products_status as status, d.products_name as name, m.manufacturers_name as manufacturer, m.manufacturers_id";
$sql .= " FROM products as p, products_description as d, 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";

View File

@ -0,0 +1,72 @@
<?php
/* Copyright (C) 2006 Jean Heimburger <jean@tiaris.info>
*
*
* 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.
*
* $Source$
*
*/
set_magic_quotes_runtime(0);
// Soap Server.
require_once('./lib/nusoap.php');
require_once('./includes/configure.php');
// Create the soap Object
$s = new soap_server;
// Register the methods available for clients
$s->register('get_Client');
// méthodes
function get_Client($custid='') {
//on se connecte
if (!($connexion = mysql_connect(DB_SERVER, DB_SERVER_USERNAME, DB_SERVER_PASSWORD))) return new soap_fault("Server", "MySQL 1", "connection impossible");
if (!($db = mysql_select_db(DB_DATABASE, $connexion))) return new soap_fault("Server", "MySQL 2", mysql_error());
//la requête
$sql = "SELECT c.customers_id, a.entry_company, a.entry_firstname, a.entry_lastname, a.entry_street_address, a.entry_postcode, a.entry_city, c.customers_telephone, c.customers_fax, c.customers_email_address, a.entry_country_id, b.countries_iso_code_2, b.countries_name ";
$sql .= " from customers c JOIN address_book a ON a.customers_id = c.customers_id JOIN countries b ON b.countries_id = a.entry_country_id JOIN orders o ON o.customers_id = c.customers_id ";
if ($custid > 0) $sql .= "WHERE c.customers_id = ".$custid;
$sql .= " GROUP BY c.customers_id ORDER BY c.customers_id";
if (!($resquer = mysql_query($sql,$connexion))) return new soap_fault("Server", "MySQL 3 ".$sql, mysql_error());
// $result[$i] = $numrows." lignes trouvées ".$sql;
switch ($numrows = mysql_numrows($resquer)) {
case 0 :
return new soap_fault("Server", "MySQL 4", "client inexistant ".$sql);
break;
default :
$i = 0;
while ( $i < $numrows) {
$result[$i] = mysql_fetch_array($resquer, MYSQL_ASSOC);
$i++;
}
break;
}
mysql_close($connexion);
/* Sends the results to the client */
return $result;
}
// Return the results.
$s->service($HTTP_RAW_POST_DATA);
?>

View File

@ -1,11 +1,24 @@
<?php
/*---------------------------------------------
/ Webservices OSC pour dolibarr
/ gestion des commandes
/
/ Jean Heimburger juin 2006
----------------------------------------------*/
/* Copyright (C) 2006 Jean Heimburger <jean@tiaris.info>
*
*
* 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.
*
* $Source$
*
*/
set_magic_quotes_runtime(0);
// Soap Server.
@ -19,6 +32,8 @@ $s = new soap_server;
// Register the methods available for clients
$s->register('get_CAmensuel');
$s->register('get_orders');
$s->register('get_lastOrderClients');
$s->register('get_Order');
/*----------------------------------------------
* renvoie un tableau avec le CA mensuel réalisé
@ -26,8 +41,8 @@ $s->register('get_orders');
function get_CAmensuel() {
//on se connecte
if (!($connexion = mysql_connect(OSC_DB_SERVER, OSC_DB_SERVER_USERNAME, OSC_DB_SERVER_PASSWORD))) return new soap_fault("Server", "MySQL 1", "connection impossible");
if (!($db = mysql_select_db(OSC_DB_DATABASE, $connexion))) return new soap_fault("Server", "MySQL 2", mysql_error());
if (!($connexion = mysql_connect(DB_SERVER, DB_SERVER_USERNAME, DB_SERVER_PASSWORD))) return new soap_fault("Server", "MySQL 1", "connection impossible");
if (!($db = mysql_select_db(DB_DATABASE, $connexion))) return new soap_fault("Server", "MySQL 2", mysql_error());
//la requête
$sql = "SELECT sum(t.value) as value, MONTH(o.date_purchased) as mois";
@ -58,9 +73,9 @@ return $result;
function get_orders($limit='', $status='') {
//on se connecte
if (!($connexion = mysql_connect(OSC_DB_SERVER, OSC_DB_SERVER_USERNAME, OSC_DB_SERVER_PASSWORD))) return new soap_fault("Server", "MySQL 1", "connection impossible");
if (!($db = mysql_select_db(OSC_DB_DATABASE, $connexion))) return new soap_fault("Server", "MySQL 2", mysql_error());
if (!($connexion = mysql_connect(DB_SERVER, DB_SERVER_USERNAME, DB_SERVER_PASSWORD))) return new soap_fault("Server", "MySQL 1", "connection impossible");
if (!($db = mysql_select_db(DB_DATABASE, $connexion))) return new soap_fault("Server", "MySQL 2", mysql_error());
//on recherche
$sql = "SELECT o.orders_id, o.customers_name, o.date_purchased, t.value, o.payment_method";
$sql .= " FROM orders_total as t JOIN orders as o on o.orders_id = t.orders_id ";
@ -89,6 +104,103 @@ if ($limit > 0) $sql .= " LIMIT ".$limit;
return $result;
}
function get_lastOrderClients($id='',$name='',$limit='') {
//on se connecte
if (!($connexion = mysql_connect(DB_SERVER, DB_SERVER_USERNAME, DB_SERVER_PASSWORD))) return new soap_fault("Server", "MySQL 1", "connection impossible");
if (!($db = mysql_select_db(DB_DATABASE, $connexion))) return new soap_fault("Server", "MySQL 2", mysql_error());
//on recherche
$sql = "SELECT o.orders_id, o.customers_name, o.delivery_country, o.date_purchased, t.value, s.orders_status_name as statut";
$sql .= " FROM orders_total as t JOIN orders as o on o.orders_id = t.orders_id ";
$sql .= " JOIN orders_status as s on o.orders_status = s.orders_status_id and s.language_id = 1";
$sql .= " WHERE t.class = 'ot_subtotal' order by o.date_purchased desc";
if ($limit > 0) $sql .= " LIMIT ".$limit;
if (!($resquer = mysql_query($sql,$connexion))) return new soap_fault("Server", "MySQL 3 ".$sql, mysql_error());
$result ='';
switch ($numrows = mysql_numrows($resquer)) {
case 0 :
return new soap_fault("Server", "MySQL 4", "produit inexistant");
break;
default :
$i = 0;
while ( $i < $numrows) {
$result[$i] = mysql_fetch_array($resquer, MYSQL_ASSOC);
$i++;
}
break;
}
mysql_close($connexion);
/* Sends the results to the client */
return $result;
}
//renvoie la commande $id ou toute la liste des commandes si $id = 0
function get_Order($orderid="0")
{
//on se connecte
if (!($connexion = mysql_connect(DB_SERVER, DB_SERVER_USERNAME, DB_SERVER_PASSWORD))) return new soap_fault("Server", "MySQL 1", "connection impossible");
if (!($db = mysql_select_db(DB_DATABASE, $connexion))) return new soap_fault("Server", "MySQL 2", mysql_error());
//on recherche la commande
$sql = "SELECT o.orders_id, o.customers_name, o.customers_id, o.date_purchased, t.value, o.payment_method ";
$sql .= " FROM orders_total as t JOIN orders as o on o.orders_id = t.orders_id ";
$sql .= " WHERE t.class = 'ot_subtotal'";
if ($orderid > 0) $sql .= " and o.orders_id = ".$orderid;
$sql .= " ORDER BY o.date_purchased desc";
if (!($resquer = mysql_query($sql,$connexion))) return new soap_fault("Server", "MySQL 3 ".$sql, mysql_error());
$result ='';
switch ($numrows = mysql_numrows($resquer)) {
case 0 :
return new soap_fault("Server", "MySQL 4", "commande inexistante");
break;
default :
$i = 0;
while ( $i < $numrows) {
$result[$i] = mysql_fetch_array($resquer, MYSQL_ASSOC);
$i++;
}
break;
}
$j = $i--;
if ($orderid > 0)
{
//on recherche les lignes de la commande
$sql = "SELECT l.products_id, l.products_name, l.products_price, l.final_price, l.products_tax, l.products_quantity ";
$sql .= " FROM orders_products l ";
$sql .= " WHERE l.orders_id = ".$orderid;
if (!($resquer = mysql_query($sql,$connexion))) return new soap_fault("Server", "MySQL 3 ".$sql, mysql_error());
switch ($numrows = mysql_numrows($resquer)) {
case 0 :
return new soap_fault("Server", "MySQL 5", "commande sans articles");
break;
default :
while ( $i < $numrows) {
$result[$j + $i] = mysql_fetch_array($resquer, MYSQL_ASSOC);
$i++;
}
break;
}
}
mysql_close($connexion);
/* Sends the results to the client */
return $result;
}
// Return the results.
$s->service($HTTP_RAW_POST_DATA);