1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
|
<?php
$lesChamps = array
(
'avoNom' => $lAvocat->getNom(),
'avoPrenom' => $lAvocat->getPrenom(),
'avoTel' => $lAvocat->getTel(),
'avoFax' => $lAvocat->getFax(),
'avoGsm' => $lAvocat->getGsm(),
'avoEmail' => $lAvocat->getEmail(),
'avoIbanPro' => $lAvocat->getIbanPro(),
'avoIbanTiers' => $lAvocat->getIbanTiers(),
'cabNom' => $leCabinet->getNom(),
'cabAdresse' => $leCabinet->getAdresse(),
'cabPostal' => $leCabinet->getPostal(),
'cabVille' => $leCabinet->getVille(),
'dossRef' => $leDoss->getNosRef(),
'dossObjet' => $leDoss->getObjet(),
'dossRole' => $leDoss->getRole(),
'dossJusti' => $leDoss->getJusticiablesPr(),
'dossBranche' => $leDoss->getBrancheFr(),
'dossPrest' => number_format($leDoss->getSommePrest(true), 2, '.', ' ').' €',
'dossProv' => number_format($leDoss->getSommeProv(true), 2, '.', ' ').' €',
'dossTiers' => number_format($leDoss->getBalTiers(), 2, '.', ' ').' €',
'dossPoints' => number_format($leDoss->getNbPoints(), 2, '.', ' ')
);
function champsValeurs($pChaine, $pChamps)
{
if(substr_count($pChaine, '{') == substr_count($pChaine, '}'))
{
$pChaine = preg_replace_callback
(
'/\{[a-zA-Z]*\}/',
function($matches) use ($pChamps)
{
$clef = preg_replace('/\{|\}/', '', $matches[0]);
$valeur = $pChamps[$clef];
return($valeur);
},
$pChaine
);
}
return($pChaine);
}
?> |