Début finalisation modèle tigre

This commit is contained in:
Regis Houssin 2007-09-19 05:40:59 +00:00
parent f00a4ea221
commit 50d996f755

View File

@ -193,6 +193,7 @@ class mod_codeclient_tigre extends ModeleThirdPartyCode
$substrEnd = 0; $substrEnd = 0;
$maskRebuild = ''; $maskRebuild = '';
$error = 0; $error = 0;
$this->searchcode = '';
for ($i = 0; $i < count($maskElement); $i++) for ($i = 0; $i < count($maskElement); $i++)
{ {
@ -200,6 +201,7 @@ class mod_codeclient_tigre extends ModeleThirdPartyCode
if ($maskElement[$i] == '{dd}') if ($maskElement[$i] == '{dd}')
{ {
$maskRebuild .= strftime("%d",time()); $maskRebuild .= strftime("%d",time());
$this->searchcode .= strftime("%d",time());
if ($foundCounter==0) if ($foundCounter==0)
{ {
$substrBegin += 2; $substrBegin += 2;
@ -218,6 +220,7 @@ class mod_codeclient_tigre extends ModeleThirdPartyCode
if ($maskElement[$i] == '{mm}') if ($maskElement[$i] == '{mm}')
{ {
$maskRebuild .= strftime("%m",time()); $maskRebuild .= strftime("%m",time());
$this->searchcode .= strftime("%m",time());
if ($foundCounter==0) if ($foundCounter==0)
{ {
$substrBegin += 2; $substrBegin += 2;
@ -236,6 +239,7 @@ class mod_codeclient_tigre extends ModeleThirdPartyCode
if ($maskElement[$i] == '{aa}') if ($maskElement[$i] == '{aa}')
{ {
$maskRebuild .= substr(strftime("%Y",time()),2); $maskRebuild .= substr(strftime("%Y",time()),2);
$this->searchcode .= substr(strftime("%Y",time()),2);
if ($foundCounter==0) if ($foundCounter==0)
{ {
$substrBegin += 2; $substrBegin += 2;
@ -248,6 +252,7 @@ class mod_codeclient_tigre extends ModeleThirdPartyCode
else if ($maskElement[$i] == '{aaaa}') else if ($maskElement[$i] == '{aaaa}')
{ {
$maskRebuild .= strftime("%Y",time()); $maskRebuild .= strftime("%Y",time());
$this->searchcode .= strftime("%Y",time());
if ($foundCounter==0) if ($foundCounter==0)
{ {
$substrBegin += 4; $substrBegin += 4;
@ -266,6 +271,7 @@ class mod_codeclient_tigre extends ModeleThirdPartyCode
if (is_object($objsoc) && $objsoc->prefix_comm && $maskElement[$i] == '{pre}') if (is_object($objsoc) && $objsoc->prefix_comm && $maskElement[$i] == '{pre}')
{ {
$maskRebuild .= strtoupper($objsoc->prefix_comm); $maskRebuild .= strtoupper($objsoc->prefix_comm);
$this->searchcode .= strtoupper($objsoc->prefix_comm);
$prefixLength = strlen($objsoc->prefix_comm); $prefixLength = strlen($objsoc->prefix_comm);
if ($foundCounter==0) if ($foundCounter==0)
{ {
@ -297,6 +303,7 @@ class mod_codeclient_tigre extends ModeleThirdPartyCode
if (eregi('[\/-]{1}',$maskElement[$i])) if (eregi('[\/-]{1}',$maskElement[$i]))
{ {
$maskRebuild .= $maskElement[$i]; $maskRebuild .= $maskElement[$i];
$this->searchcode .= $maskElement[$i];
if ($foundCounter==0) if ($foundCounter==0)
{ {
$substrBegin++; $substrBegin++;
@ -315,6 +322,7 @@ class mod_codeclient_tigre extends ModeleThirdPartyCode
if (eregi('^[0-9A-Z]+$',$maskElement[$i])) if (eregi('^[0-9A-Z]+$',$maskElement[$i]))
{ {
$maskRebuild .= strtoupper($maskElement[$i]); $maskRebuild .= strtoupper($maskElement[$i]);
$this->searchcode .= strtoupper($maskElement[$i]);
$MaskElementLength = strlen($maskElement[$i]); $MaskElementLength = strlen($maskElement[$i]);
if ($foundCounter==0) if ($foundCounter==0)
{ {
@ -332,7 +340,7 @@ class mod_codeclient_tigre extends ModeleThirdPartyCode
// Défini le nombre de chiffres du compteur // Défini le nombre de chiffres du compteur
$this->numbitcounter = strlen(substr($maskElement[$i],1,-1)); $this->numbitcounter = strlen(substr($maskElement[$i],1,-1));
// Permettra d'effectuer une recherche dans la table // Permettra d'effectuer une recherche dans la table
$this->searchcode = $maskRebuild . '([0-9]{'.$this->numbitcounter.'})'; $this->searchcode .= '([0-9]{'.$this->numbitcounter.'})';
$maskRebuild .= $maskElement[$i]; $maskRebuild .= $maskElement[$i];
$foundCounter = 1; $foundCounter = 1;
@ -341,11 +349,13 @@ class mod_codeclient_tigre extends ModeleThirdPartyCode
{ {
$error++; $error++;
} }
//print 'searchcodeTemp='.$this->searchcode.'<br>';
} }
$this->substrBegin = $substrBegin; $this->substrBegin = $substrBegin;
$this->substrEnd = $substrEnd; $this->substrEnd = $substrEnd;
//print 'begin='.$this->substrBegin.'<br>'; //print 'begin='.$this->substrBegin.'<br>';
//print 'end='.$this->substrEnd.'<br>'; //print 'end='.$this->substrEnd.'<br>';
//print 'searchcode='.$this->searchcode.'<br>';
return $maskRebuild; return $maskRebuild;
} }