コード例 #1
0
function substitadresse($texte)
{
    global $adresse;
    $tadresse = new Adresse();
    if ($tadresse->charger(intval($adresse))) {
        $raisondesc = new Raisondesc();
        $raisondesc->charger($tadresse->raison);
        $paysdesc = new Paysdesc();
        $paysdesc->charger($tadresse->pays);
        $texte = str_replace("#ADRESSE_RAISONID", $tadresse->raison, $texte);
        $texte = str_replace("#ADRESSE_IDPAYS", $tadresse->pays, $texte);
        $texte = str_replace("#ADRESSE_ID", $tadresse->id, $texte);
        $texte = str_replace("#ADRESSE_LIBELLE", $tadresse->libelle, $texte);
        $texte = str_replace("#ADRESSE_RAISON", $raisondesc->long, $texte);
        $texte = str_replace("#ADRESSE_ENTREPRISE", $tadresse->entreprise, $texte);
        $texte = str_replace("#ADRESSE_NOM", $tadresse->nom, $texte);
        $texte = str_replace("#ADRESSE_PRENOM", $tadresse->prenom, $texte);
        $texte = str_replace("#ADRESSE_ADRESSE1", $tadresse->adresse1, $texte);
        $texte = str_replace("#ADRESSE_ADRESSE2", $tadresse->adresse2, $texte);
        $texte = str_replace("#ADRESSE_ADRESSE3", $tadresse->adresse3, $texte);
        $texte = str_replace("#ADRESSE_CPOSTAL", $tadresse->cpostal, $texte);
        $texte = str_replace("#ADRESSE_VILLE", $tadresse->ville, $texte);
        $texte = str_replace("#ADRESSE_PAYS", $paysdesc->titre, $texte);
        $texte = str_replace("#ADRESSE_TEL", $tadresse->tel, $texte);
    }
    $texte = str_replace("#ADRESSE_ACTIVE", "" . $_SESSION['navig']->adresse . "", $texte);
    return $texte;
}
コード例 #2
0
function substitclient($texte)
{
    // Les #CLIENT_RAISONnF
    $raisons = CacheBase::getCache()->query("select id from raison");
    if ($raisons) {
        foreach ($raisons as $raison) {
            $sel = $_SESSION['navig']->client->raison == $raison->id ? 'selected="selected"' : '';
            $texte = str_replace("#CLIENT_RAISON" . $raison->id . "F", $sel, $texte);
        }
    }
    $paysdesc = new Paysdesc();
    $paysdesc->charger($_SESSION['navig']->client->pays);
    $raisondesc = new Raisondesc();
    $raisondesc->charger($_SESSION['navig']->client->raison);
    $texte = str_replace("#CLIENT_IDPAYS", $_SESSION['navig']->client->pays, $texte);
    $texte = str_replace("#CLIENT_ID", intval($_SESSION['navig']->client->id), $texte);
    $texte = str_replace("#CLIENT_REF", $_SESSION['navig']->client->ref, $texte);
    $texte = str_replace("#CLIENT_RAISONID", $_SESSION['navig']->client->raison, $texte);
    $texte = str_replace("#CLIENT_RAISON", $raisondesc->long, $texte);
    $texte = str_replace("#CLIENT_ENTREPRISE", $_SESSION['navig']->client->entreprise, $texte);
    $texte = str_replace("#CLIENT_SIRET", $_SESSION['navig']->client->siret, $texte);
    $texte = str_replace("#CLIENT_INTRACOM", $_SESSION['navig']->client->intracom, $texte);
    $texte = str_replace("#CLIENT_NOM", $_SESSION['navig']->client->nom, $texte);
    $texte = str_replace("#CLIENT_PRENOM", $_SESSION['navig']->client->prenom, $texte);
    $texte = str_replace("#CLIENT_ADRESSE1", $_SESSION['navig']->client->adresse1, $texte);
    $texte = str_replace("#CLIENT_ADRESSE2", $_SESSION['navig']->client->adresse2, $texte);
    $texte = str_replace("#CLIENT_ADRESSE3", $_SESSION['navig']->client->adresse3, $texte);
    $texte = str_replace("#CLIENT_CPOSTAL", $_SESSION['navig']->client->cpostal, $texte);
    $texte = str_replace("#CLIENT_VILLE", $_SESSION['navig']->client->ville, $texte);
    $texte = str_replace("#CLIENT_PAYS", $paysdesc->titre, $texte);
    $texte = str_replace("#CLIENT_EMAIL", $_SESSION['navig']->client->email, $texte);
    $texte = str_replace("#CLIENT_TELFIXE", $_SESSION['navig']->client->telfixe, $texte);
    $texte = str_replace("#CLIENT_TELPORT", $_SESSION['navig']->client->telport, $texte);
    $texte = str_replace("#CLIENT_TYPE", $_SESSION['navig']->client->type, $texte);
    return $texte;
}
コード例 #3
0
ファイル: pays.php プロジェクト: anti-conformiste/thelia1
 function edition()
 {
     $id = intval(lireParam('pays', 'int'));
     $maj = $id > 0;
     $pays = new Pays();
     if ($maj) {
         $pays->charger($id);
     } else {
         $pays->lang = 0;
         $pays->defaut = 0;
     }
     $pays->tva = intval($_REQUEST['tva']) != 0 ? 1 : 0;
     $pays->zone = intval($_REQUEST['zone']);
     $pays->isocode = intval($_REQUEST['isocode']);
     $pays->isoalpha2 = $_REQUEST['isoalpha2'];
     $pays->isoalpha3 = $_REQUEST['isoalpha3'];
     if ($maj) {
         $pays->maj();
     } else {
         $id = $pays->add();
     }
     if ($id > 0) {
         foreach ($_REQUEST['langue'] as $langue) {
             $paysdesc = new Paysdesc();
             if ($maj) {
                 $paysdesc->charger($id, $langue);
             }
             $paysdesc->pays = $id;
             $paysdesc->lang = $langue;
             $paysdesc->titre = $_REQUEST['titre'][$langue];
             $paysdesc->chapo = $_REQUEST['chapo'][$langue];
             $paysdesc->description = $_REQUEST['description'][$langue];
             if ($maj) {
                 $paysdesc->maj();
             } else {
                 $paysdesc->add();
             }
         }
     }
 }
コード例 #4
0
    $errorCode = $e->getCode();
    switch ($errorCode) {
        case TheliaAdminException::CLIENT_ADD_ADRESS:
            $addError = 1;
            break;
        case TheliaAdminException::CLIENT_ADRESS_EDIT_ERROR:
            $editAddressError[$request->get("id")] = 1;
            break;
    }
}
$raisondesc = new Raisondesc($client->raison);
if ($client->parrain) {
    $parrain = new Client();
    $parrain->charger_id($client->parrain);
}
$paysdesc = new Paysdesc();
$paysdesc->charger($client->pays);
?>
<!DOCTYPE html>
<html lang="fr">
<head>
<?php 
require_once "title.php";
?>
</head>

<body>
<?php 
ActionsAdminModules::instance()->inclure_module_admin("client_visualiser");
$menu = "client";
$breadcrumbs = Breadcrumb::getInstance()->getSimpleList(trad('Gestion_clients', 'admin'), "client.php");
コード例 #5
0
<?php

require_once "auth.php";
if (!est_autorise("acces_commandes")) {
    exit;
}
use Symfony\Component\HttpFoundation\Request;
$request = Request::createFromGlobals();
$client = new Client();
$client->charger_ref($ref_client);
$paysFacturation = new Paysdesc();
$paysLivraison = new Paysdesc();
$raisonFacturation = new Raisondesc();
$raisonLivraison = new Raisondesc();
try {
    ActionsAdminOrder::getInstance()->action($request);
} catch (TheliaAdminException $e) {
    $errorCode = $e->getCode();
    switch ($errorCode) {
        case TheliaAdminException::ORDER_ADD_ERROR:
            $createError = 1;
            break;
        case TheliaAdminException::EMAIL_FORMAT_ERROR:
            $createError = 1;
            $emailBadFormat = 1;
            break;
        case TheliaAdminException::EMAIL_ALREADY_EXISTS:
            $createError = 1;
            $emailAlreadyExists = 1;
            break;
    }
コード例 #6
0
ファイル: zone.php プロジェクト: anti-conformiste/thelia1
function modifier_pays_zone($idzone)
{
    $zone = new Zone();
    $zone->charger($idzone);
    $pays = new Pays();
    $query = "select * from {$pays->table} where zone=\"-1\"";
    $resul = $pays->query($query);
    ?>
	<div class="entete_liste_config" style="margin-top:15px;">
		<div class="titre"><?php 
    echo trad('MODIFICATION_ZONE', 'admin');
    ?>
</div>
	</div>

	<ul class="ligne1">
		<li style="width:250px;">
			<select class="form_select" id="pays">
			<?php 
    while ($resul && ($row = $pays->fetch_object($resul))) {
        $paysdesc = new Paysdesc();
        if ($paysdesc->charger($row->id)) {
            ?>
	     	<option value="<?php 
            echo $paysdesc->pays;
            ?>
"><?php 
            echo $paysdesc->titre;
            ?>
</option>
			<?php 
        }
    }
    ?>
			</select>
		</li>
		<li><a href="javascript:ajouter($('#pays').val())"><?php 
    echo trad('AJOUTER_PAYS', 'admin');
    ?>
</a></li>
	</ul>

<?php 
    $pays = new Pays();
    $query = "select * from {$pays->table} where zone=\"" . $idzone . "\"";
    $resul = $pays->query($query);
    while ($resul && ($row = $pays->fetch_object($resul))) {
        $paysdesc = new Paysdesc();
        $paysdesc->charger($row->id);
        $fond = "ligne_" . ($i++ % 2 ? "fonce" : "claire") . "_BlocDescription";
        ?>
		<ul class="<?php 
        echo $fond;
        ?>
">
			<li style="width:492px;"><?php 
        echo $paysdesc->titre;
        ?>
</li>
			<li style="width:32px;"><a href="javascript:supprimer(<?php 
        echo $row->id;
        ?>
)"><?php 
        echo trad('Supprimer', 'admin');
        ?>
</a></li>
		</ul>
<?php 
    }
    ?>
	<ul class="ligne1">
			<li><?php 
    echo trad('Forfait transport: ', 'admin');
    ?>
<input type="text" class="form_inputtext" id="forfait" onclick="this.value=''" value="<?php 
    echo htmlspecialchars($zone->unite);
    ?>
" /></li>
			<li><a href="javascript:forfait($('#forfait').val())"><?php 
    echo trad('VALIDER', 'admin');
    ?>
</a></li>
	</ul>
<?php 
}
コード例 #7
0
ファイル: boucles.php プロジェクト: anti-conformiste/thelia1
function bouclePays($texte, $args)
{
    $id = lireTag($args, "id", "int");
    $zone = lireTag($args, "zone", "int");
    $zdefinie = lireTag($args, "zdefinie", "int");
    $select = lireTag($args, "select", "int");
    $defaut = lireTag($args, "defaut", "int");
    $exclusion = lireTag($args, "exclusion", "int_list");
    $search = "";
    $res = "";
    $pays = new Pays();
    $paysdesc = new Paysdesc();
    // preparation de la requete
    if ($id != "") {
        $search .= " and {$pays->table}.id=\"{$id}\"";
    }
    if ($zone != "") {
        $search .= " and {$pays->table}.zone=\"{$zone}\"";
    }
    if ($zdefinie != "") {
        $search .= " and {$pays->table}.zone<>\"-1\"";
    }
    if ($defaut != "") {
        $search .= " and {$pays->table}.defaut=\"1\"";
    }
    if ($exclusion != "") {
        $search .= " and {$pays->table}.id not in({$exclusion})";
    }
    if (ActionsLang::instance()->get_action_si_trad_absente() == ActionsLang::UTILISER_LANGUE_INDIQUEE) {
        // On retourne uniquement les pays traduites
        $search .= " and {$paysdesc->table}.id is not null";
    }
    $query = "\n\t\t\t\t\tselect {$pays->table}.id from {$pays->table}\n\t\t\t\t\tleft join {$paysdesc->table} on {$paysdesc->table}.pays = {$pays->table}.id and {$paysdesc->table}.lang = " . ActionsLang::instance()->get_id_langue_courante() . "\n\t\t\t\t\twhere 1 {$search}\n\t\t\t\t\torder by {$paysdesc->table}.titre\n\t\t\t\t";
    $resul = CacheBase::getCache()->query($query);
    if (empty($resul)) {
        return "";
    }
    foreach ($resul as $row) {
        $paysdesc->charger($row->id);
        $pays->charger($row->id);
        $temp = str_replace("#ID", "{$pays->id}", $texte);
        $temp = str_replace("#TITRE", "{$paysdesc->titre}", $temp);
        $temp = str_replace("#CHAPO", "{$paysdesc->chapo}", $temp);
        $temp = str_replace("#DESCRIPTION", "{$paysdesc->description}", $temp);
        if (($_SESSION['navig']->formcli->pays == $pays->id || $_SESSION['navig']->client->pays == $pays->id) && $select == "") {
            $temp = str_replace("#SELECTED", "selected=\"selected\"", $temp);
        }
        if ($select != "" && $select == $pays->id) {
            $temp = str_replace("#SELECTED", "selected=\"selected\"", $temp);
        } else {
            $temp = str_replace("#SELECTED", "", $temp);
        }
        if ($pays->defaut == "1") {
            $temp = str_replace("#DEFAUT", "selected=\"selected\"", $temp);
        } else {
            $temp = str_replace("#DEFAUT", "", $temp);
        }
        $temp = str_replace("#TVA", $pays->tva, $temp);
        $temp = str_replace("#NUMEROISO", $pays->isocode, $temp);
        $temp = str_replace("#CODEISO2", $pays->isoalpha2, $temp);
        $temp = str_replace("#CODEISO3", $pays->isoalpha3, $temp);
        $res .= $temp;
    }
    return $res;
}
コード例 #8
0
}
function supprcmd($id)
{
    $tempcmd = new Commande();
    if ($tempcmd->charger($id)) {
        $tempcmd->annuler();
    }
}
$client = new Client();
$client->charger_ref($ref);
$raisondesc = new Raisondesc($client->raison);
if ($client->parrain) {
    $parrain = new Client();
    $parrain->charger_id($client->parrain);
}
$paysdesc = new Paysdesc();
$paysdesc->charger($client->pays);
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<?php 
require_once "title.php";
?>

<script type="text/javascript">

function supprimer(id){
	if(confirm("<?php 
echo trad('Voulez-vous vraiment annuler cette commande ?', 'admin');
コード例 #9
0
	<ul class="ligne_claire_BlocDescription">
		<li class="designation" style="width:290px;"><?php 
echo trad('Telephone', 'admin');
?>
</li>
		<li><?php 
echo $adr->tel;
?>
</li>
	</ul>
</div>

<?php 
$adr = new Venteadr();
$adr->charger($commande->adrlivr);
$nompays = new Paysdesc();
$nompays->charger($adr->pays);
?>
<div class="bordure_bottom" style="margin:0 0 10px 0;">
<div class="entete_liste_client">
	<div class="titre"><?php 
echo trad('ADRESSE_LIVRAISON', 'admin');
?>
</div>
</div>
	<ul class="ligne_claire_BlocDescription" style="background-image: url(gfx/degrade_ligne1.png); background-repeat: repeat-x;">
		<li class="designation" style="width:290px; background-image: url(gfx/degrade_ligne1.png); background-repeat: repeat-x;">Société</li>
		<li><?php 
echo $adr->entreprise;
?>
</li>
コード例 #10
0
?>
" size="40" /></td>
    						</tr>

    						<tr class="fonce">
    							<td class="designation"><?php 
echo trad('Pays', 'admin');
?>
</td>
    							<td><select name="pays" class="form_client">
    								<?php 
$pays = new Pays();
$query = "select * from {$pays->table}";
$resul = $pays->query($query);
while ($resul && ($row = $pays->fetch_object($resul, 'Pays'))) {
    $paysdesc = new Paysdesc();
    if ($paysdesc->charger($row->id)) {
        if ($row->id == $client->pays || $pays->defaut) {
            $selected = "selected=\"selected\"";
        } else {
            $selected = "";
        }
        ?>
    										<option value="<?php 
        echo $row->id;
        ?>
" <?php 
        echo $selected;
        ?>
><?php 
        echo $paysdesc->titre;
コード例 #11
0
 public function add($titre, $isocode, $isoalpha2, $isoalpha3, $tva, $zone)
 {
     $titre = trim($titre);
     if (empty($titre)) {
         throw new TheliaAdminException("Title can not be empty", TheliaAdminException::COUNTRY_TITLE_EMPTY);
     }
     $this->isocode = $isocode;
     $this->isoalpha2 = $isoalpha2;
     $this->isoalpha3 = $isoalpha3;
     $this->tva = $tva;
     $this->zone = $zone;
     $this->id = parent::add();
     $paysdesc = new Paysdesc();
     $paysdesc->pays = $this->id;
     $paysdesc->lang = ActionsAdminLang::instance()->get_id_langue_courante();
     $paysdesc->titre = $titre;
     $paysdesc->add();
     redirige("pays.php");
 }
コード例 #12
0
ファイル: pays.php プロジェクト: anti-conformiste/thelia1
            $id = intval(lireParam('pays', 'int'));
            $pays->query("update {$pays->table} set `boutique`=0");
            $pays->query("update {$pays->table} set `boutique`=1 where id={$id}");
            exit;
        }
    }
}
/* Afficher la forme de modif/creation de pays */
$langues = array();
$langue = new Lang();
$result = $langue->query("select * from " . $langue->table . " order by id");
while ($result && ($row = $langue->fetch_object($result))) {
    $langues[] = $row;
}
$pays = new Pays();
$paysdesc = new Paysdesc();
$id = intval(lireParam('pays', 'int'));
$pays->id = $id;
if ($id > 0) {
    $pays->charger($id);
}
?>
<div class="entete_config" style="width: auto; float: none;">
			<div class="titre"><?php 
echo trad('EDITION', 'admin');
?>
</div>
			<div class="fonction_valider"><a href="#" onclick="$('#pays_edit_form').submit(); return false;"><?php 
echo trad('VALIDER_LES_MODIFICATIONS', 'admin');
?>
</a></div>
コード例 #13
0
 public function subSendMailCreation($corps, $client, $password)
 {
     $raisondesc = new Raisondesc($client->raison, ActionsLang::instance()->get_id_langue_courante());
     $paysdesc = new Paysdesc();
     $paysdesc->charger($client->pays);
     $corps = str_replace("__NOMSITE__", Variable::lire("nomsite"), $corps);
     $corps = str_replace("__EMAIL__", $client->email, $corps);
     $corps = str_replace("__MOTDEPASSE__", $password, $corps);
     $corps = str_replace("__URLSITE__", Variable::lire("urlsite"), $corps);
     $corps = str_replace("__NOM__", $client->nom, $corps);
     $corps = str_replace("__PRENOM__", $client->prenom, $corps);
     $corps = str_replace("__ADRESSE1__", $client->adresse1, $corps);
     $corps = str_replace("__ADRESSE2__", $client->adresse2, $corps);
     $corps = str_replace("__ADRESSE3__", $client->adresse3, $corps);
     $corps = str_replace("__VILLE__", $client->ville, $corps);
     $corps = str_replace("__CPOSTAL__", $client->cpostal, $corps);
     $corps = str_replace("__TELEPHONE__", $client->telfixe, $corps);
     $corps = str_replace("__CIVILITE__", $raisondesc->court, $corps);
     $corps = str_replace("__PAYS__", $paysdesc->titre, $corps);
     return $corps;
 }
コード例 #14
0
 public function substitmail($corps, $commande)
 {
     ActionsModules::instance()->appel_module("preSubstitmail", $corps, $commande);
     $nomsite = Variable::lire("nomsite");
     $jour = substr($commande->date, 8, 2);
     $mois = substr($commande->date, 5, 2);
     $annee = substr($commande->date, 0, 4);
     $heure = substr($commande->date, 11, 2);
     $minute = substr($commande->date, 14, 2);
     $seconde = substr($commande->date, 17, 2);
     $client = new Client($commande->client);
     $paiement = new Modules($commande->paiement);
     $paiementdesc = new Modulesdesc($paiement->nom, $commande->lang);
     $transport = new Modules($commande->transport);
     $transportdesc = new Modulesdesc($transport->nom, $commande->lang);
     $total = $commande->total();
     $totcmdport = $commande->port + $total;
     $adresse = new Venteadr($commande->adrlivr);
     $raisondesc = new Raisondesc();
     $raisondesc->charger($adresse->raison, $commande->lang);
     $nom = $adresse->nom;
     $prenom = $adresse->prenom;
     $entreprise = $adresse->entreprise;
     $adresse1 = $adresse->adresse1;
     $adresse2 = $adresse->adresse2;
     $adresse3 = $adresse->adresse3;
     $cpostal = $adresse->cpostal;
     $ville = $adresse->ville;
     $pays = new Paysdesc($adresse->pays, $commande->lang);
     $corps = str_replace("__COMMANDE_REF__", $commande->ref, $corps);
     $corps = str_replace("__COMMANDE_DATE__", $jour . "/" . $mois . "/" . $annee, $corps);
     $corps = str_replace("__COMMANDE_HEURE__", $heure . ":" . $minute, $corps);
     $corps = str_replace("__COMMANDE_TRANSACTION__", $commande->transaction, $corps);
     $corps = str_replace("__COMMANDE_PAIEMENT__", $paiementdesc->titre, $corps);
     $corps = str_replace("__COMMANDE_TOTALPORT__", $totcmdport - $commande->remise, $corps);
     $corps = str_replace("__COMMANDE_TOTAL__", $total, $corps);
     $corps = str_replace("__COMMANDE_PORT__", $commande->port, $corps);
     $corps = str_replace("__COMMANDE_REMISE__", $commande->remise, $corps);
     $corps = str_replace("__COMMANDE_TRANSPORT__", $transportdesc->titre, $corps);
     $corps = str_replace("__COMMANDE_TRANSPORTCHAPO__", $transportdesc->chapo, $corps);
     $corps = str_replace("__COMMANDE_LIVRRAISON__", $raisondesc->court, $corps);
     $corps = str_replace("__COMMANDE_LIVRNOM__", $nom, $corps);
     $corps = str_replace("__COMMANDE_LIVRPRENOM__", $prenom, $corps);
     $corps = str_replace("__COMMANDE_LIVRENTREPRISE__", $entreprise, $corps);
     $corps = str_replace("__COMMANDE_LIVRADRESSE1__", $adresse1, $corps);
     $corps = str_replace("__COMMANDE_LIVRADRESSE2__", $adresse2, $corps);
     $corps = str_replace("__COMMANDE_LIVRADRESSE3__", $adresse3, $corps);
     $corps = str_replace("__COMMANDE_LIVRCPOSTAL__", $cpostal, $corps);
     $corps = str_replace("__COMMANDE_LIVRVILLE__", $ville, $corps);
     $corps = str_replace("__COMMANDE_LIVRPAYS__", $pays->titre, $corps);
     $corps = str_replace("__COMMANDE_LIVRTEL__", $adresse->tel, $corps);
     $corps = str_replace("__NOMSITE__", $nomsite, $corps);
     $corps = str_replace("__URLSITE__", urlfond(), $corps);
     $adresse = new Venteadr($commande->adrfact);
     $raisondesc = new Raisondesc();
     $raisondesc->charger($adresse->raison);
     $pays = new Paysdesc();
     $pays->charger($adresse->pays);
     $corps = str_replace("__CLIENT_REF__", $client->ref, $corps);
     $corps = str_replace("__CLIENT_RAISON__", $raisondesc->court, $corps);
     $corps = str_replace("__CLIENT_ENTREPRISE__", $client->entreprise, $corps);
     $corps = str_replace("__CLIENT_SIRET__", $client->siret, $corps);
     $corps = str_replace("__CLIENT_FACTNOM__", $adresse->nom, $corps);
     $corps = str_replace("__CLIENT_FACTPRENOM__", $adresse->prenom, $corps);
     $corps = str_replace("__CLIENT_ADRESSE1__", $adresse->adresse1, $corps);
     $corps = str_replace("__CLIENT_ADRESSE2__", $adresse->adresse2, $corps);
     $corps = str_replace("__CLIENT_ADRESSE3__", $adresse->adresse3, $corps);
     $corps = str_replace("__CLIENT_CPOSTAL__", $adresse->cpostal, $corps);
     $corps = str_replace("__CLIENT_VILLE__", $adresse->ville, $corps);
     $corps = str_replace("__CLIENT_PAYS__", $pays->titre, $corps);
     $corps = str_replace("__CLIENT_EMAIL__", $client->email, $corps);
     $corps = str_replace("__CLIENT_TELFIXE__", $client->telfixe, $corps);
     $corps = str_replace("__CLIENT_TELPORT__", $client->telport, $corps);
     $pattern = '{<VENTEPROD>((?:(?:(?!<VENTEPROD[^>]*>|</VENTEPROD>).)++|<VENTEPROD[^>]*>(?1)</VENTEPROD>)*)</VENTEPROD>}si';
     if (preg_match($pattern, $corps, $cut)) {
         $corps = str_replace("<VENTEPROD>", "", $corps);
         $corps = str_replace("</VENTEPROD>", "", $corps);
         $res = "";
         $venteprod = new Venteprod();
         $query = "select * from {$venteprod->table} where commande=\"" . $commande->id . "\"";
         $resul = $venteprod->query($query);
         while ($resul && ($row = $venteprod->fetch_object($resul))) {
             $temp = str_replace("__VENTEPROD_TITRE__", $row->titre, $cut[1]);
             $temp = str_replace("__VENTEPROD_REF__", $row->ref, $temp);
             $temp = str_replace("__VENTEPROD_CHAPO__", $row->chapo, $temp);
             $temp = str_replace("__VENTEPROD_QUANTITE__", $row->quantite, $temp);
             $temp = str_replace("__VENTEPROD_PRIXU__", $row->prixu, $temp);
             $temp = str_replace("__VENTEPROD_TOTAL__", $row->prixu * $row->quantite, $temp);
             ActionsModules::instance()->appel_module("substitutionsventeprodmailcommande", $temp, $row);
             $res .= $temp;
         }
         $corps = str_replace($cut[1], $res, $corps);
     }
     // Substitutions mail "devise"
     $devise = new Devise($commande->devise);
     ActionsDevises::instance()->subsititutions_mail($devise, $corps);
     ActionsModules::instance()->appel_module("substitutionsmailcommande", $corps, $commande);
     return $corps;
 }