Olivier (si je tombe sur toi... tu connais mon site et problème)

J'ai un souci avec ma classe date... tu peux le visualiser sur 3w.jecrapahute.fr
Si je rentre une date, j'affiche bien EN DISPLAY en sortie la date encodée.
Mais dans le fiedset date, j'ai toujours la date du jour...
Je ne comprends pas d'où vient cette erreur....

Voici le code de ma classe date (à savoir que toutes les propriétés sont définies dans la class Kernel enfant de Form.... )

Les parties du code que je crois importantes et que j'ai ajoutées pour solutionner ce problème sont en gras !

Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
<?php
/**
* 	DATE[validation] constructor
*
*/	
class Date extends Form
{	protected $name, $must, $legend, $defaut, $date, $dd, $mm, $yy, $day, $mon, $year ;
	private   $month   = array	(	"01"   =>  "Jan" , 	"02"   =>  "Fev" ,	"03"  =>  "Mar" ,	"04"   	=>  "Avr" ,
									"05"   =>  "Mai" ,	"06"   =>  "Jui" ,	"07"  =>  "Jul" ,	"08"	=>  "Aou" ,
									"09"   =>  "Ssp" ,	"10"   =>  "Oct" ,	"11"  =>  "Nov" ,	"12"  	=>  "Dec" 
								) ;

	function __construct($name, $must, $legend=NULL, $default=NULL)
	{	$this->name   = $name ;
		$this->must   = $must ;
		$this->legend = $legend ;
				
		$this->value = (isset( $_POST["$this->name"] ) ) ? trim($_POST["$this->name"]) : NULL ;
		if ($default == NULL)
			$this->date = date("dmY") ;
		$this->dd	= $this->fill(substr($this->date,0,2),2) ;  	// 	ddmmyyyy
		$this->mm	= $this->fill(substr($this->date,2,2),2) ;  	//	01234567 	
		$this->yy	= $this->fill(substr($this->date,4,4),4) ;		//	========
	}
	
	function __destruct()
	{}
	
	function execute()
	{	if ($this->debug)
			user_error("Date[execute] [".$this->name."][".$this->value."][".$this->type."]" , E_USER_NOTICE) ;
	}

/**
*	ifFilled
*	=======
*/	
	function ifFilled()
	{	$filled = empty($this->value) ? false : true ;
		if ($this->debug)
			user_error("ifFilled[".$filled."][".$this->name."][".$this->value."][".$this->len."]" , E_USER_NOTICE) ;
		return( $filled ) ;
	}

/**
* 	mustFill
*
*/	
	function mustFill() 
	{	$must = $this->must && empty($this->value) ? true : false ;
		if ($this->debug)
			user_error("mustFill[".$this->name."][".$must."]" , E_USER_NOTICE) ;
		return( $must ) ; 
	}
	
/**
*	fill
*	====
*/
	
	function fill($str,$len)
	{	for ($i = 0 ; (strlen($str) < $len) ; $i++)
			$str = "0" . $str ;
		return($str) ;
	}
	
/**
*	validate
*	========
*/
	function validate()
	{	var_dump($this->mon,$this->day,$this->year) ;
		$rc = checkdate($this->mon, $this->day,  $this->year ) ;
		var_dump($rc) ;
		return( $rc ? OK : ERRDATE) ;  
	}
	
/**
*	display
*	=======
*
*/	
	function pickup($start,$end,$frmfld,$default=0)
	{	echo "<select name='" . $frmfld . "' id='" . $frmfld . "'>\n";
		for ($i = $start ; $i <= $end ; $i++)
		{	$d = $this->fill($i,2) ;
			if (strcmp($default,$d) == 0)
				echo '  <option value="' . $d . '" selected">' . $d. "</option>\n" ;
			else
				echo '  <option value="' . $d .           '">' . $d . "</option>\n" ;
		}
		echo "</select>\n" ;
	}
	
	function select($valarray,$frmfld,$default=0)
	{	echo "<select name='" . $frmfld . "' id='" . $frmfld . "'>\n";
		foreach ($valarray as $key => $value)
		{	if (strcmp($default,$key) == 0)
				echo '  <option value="' . $key . '" selected">' . $value . "</option>\n" ;
			else
				echo '  <option value="' . $key .           '">' . $value . "</option>\n" ;
		}
		echo "</select>\n" ;
	}
	
/**
*	getFieldName
*	============
*
*/	
	function getFieldName()
	{	return($this->name) ; }
	
/**
*	getFieldLegend
*	==============
*
*/	
	function getFieldLegend()
	{	return($this->legend) ; }
	
/**
*	getFieldValue
*	=============
*
*/	
	function getFieldValue()
	{	return( $this->value ) ; }

/**
*	display
*	=======
*
*/	
	function display()
	{	echo "<fieldset><legend  class='form_lbl'>" ;
		echo $this->legend ;
		echo "</legend>" ;
		echo '<span class="form_fld fieldset">' ;
		$this->pickup(1,31, $name="dd",$default=$this->dd) ;
		echo '</span>' ;    	
		echo '<span class="form_bkg fieldset">' ;
		echo "-" ;
		echo '</span>' ;    	
		echo '<span class="form_fld fieldset">'  ;
		$this->select($this->month, $name="mm",$default=$this->mm) ;
		echo '</span>' ;    	
		echo '<span class="form_bkg">' ;
		echo "-" ;
		echo '</span>' ;    	
		echo '<span class="form_fld">'  ;
		$this->pickup(1920,2020, $name="yy",$default=$this->yy) ;
		echo '</span>' ;    	
		echo "</fieldset>" ;
		
		$this->day  = (isset($_POST["dd"])) ? $_POST["dd"] : date("d") ;
		$this->mon  = (isset($_POST["mm"])) ? $_POST["mm"] : date("m") ;  
		$this->year = (isset($_POST["yy"])) ? $_POST["yy"] : date("Y") ; 
		var_dump($this->mon,$this->day,$this->year) ;
	}


}
	
/**
*	getFieldName
*	============
*
*/	
	function getFieldName()
	{	return($this->name) ; }
	
/**
*	getFieldLegend
*	==============
*
*/	
	function getFieldLegend()
	{	return($this->legend) ; }
	
/**
*	getFieldValue
*	=============
*
*/	
	function getFieldValue()
	{	return( strftime("%Y%m%d", $this->year, $this->mon, $this->day) ) ; }
/** =========================================================================================================================================================
*	End Of Class: DATE
* ======================================================================================================================================================== */
Donc - je me répète - si je rentre un autre date dans le Fieldset, je displays bien en dessous après exécution:

string(2) "03" string(2) "04" string(4) "1991"


Mais le fieldset est tjs à la date du jour....

?>

Voici les var_dump de tout mon écran:

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
Array ( 
[nom] => Array ( [0] => String [1] => Votre Nom [2] => Mathot ) 
[prenom] => Array ( [0] => String [1] => Votre prénom [2] => Etienne ) [email] => Array ( [0] => Email [1] => Votre adressse Courrielle [2] => a.b@cdf.be ) 
[cemail] => Array ( [0] => Email [1] => Confirmation de votre Courrielle [2] => a.b@cdf.be ) 
[phone] => Array ( [0] => Phone [1] => Votre numéro de téléphone [2] => 046741 ) 
[numero] => Array ( [0] => Decimal [1] => Numéro d'habitation [2] => 13 ) [boite] => Array ( [0] => String [1] => Boite éventuelle [2] => ) 
[voie] => Array ( [0] => String [1] => Nom de voie [2] => cote ) 
[zip] => Array ( [0] => Decimal [1] => Code postal [2] => 30 ) 
[naissance] => Array ( [0] => Date [1] => Date de naissance [2] => MISSING DATE HERE !!!!!!) 
[pays] => Array ( [0] => Select [1] => Pays de résidence [2] => France ) [question] => Array ( [0] => Select [1] => Question Secrète [2] => Nom de votre animal favoris ) 
[secretanswer] => Array ( [0] => String [1] => Réponse à cette question [2] => Victor ) 
[job] => Array ( [0] => Select [1] => Profession [2] => cadre commercial ) [pass] => Array ( [0] => Password [1] => Mot de passe [2] => sssssssss ) [cpass] => Array ( [0] => Password [1] => Confirmation du mot de passe [2] => ssssssssss ) 
[text] => Array ( [0] => Textarea [1] => Commentaires éventuels [2] => dddddddddddddddddddddddddddddddddddddddddddddddddd ) ) Array ( [nom] => Array ( [0] => String [1] => Votre Nom [2] => Mathot ) [prenom] => Array ( [0] => String [1] => Votre prénom [2] => Etienne ) [email] => Array ( [0] => Email [1] => Votre adressse Courrielle [2] => a.b@cdf.be ) [cemail] => Array ( [0] => Email [1] => Confirmation de votre Courrielle [2] => a.b@cdf.be ) [phone] => Array ( [0] => Phone [1] => Votre numéro de téléphone [2] => 0467694641 ) [numero] => Array ( [0] => Decimal [1] => Numéro d'habitation [2] => 1693 ) [boite] => Array ( [0] => String [1] => Boite éventuelle [2] => ) [voie] => Array ( [0] => String [1] => Nom de voie [2] => cote d Aulas ) [zip] => Array ( [0] => Decimal [1] => Code postal [2] => 30120 ) [naissance] => Array ( [0] => Date [1] => Date de naissance [2] => ) [pays] => Array ( [0] => Select [1] => Pays de résidence [2] => France ) [question] => Array ( [0] => Select [1] => Question Secrète [2] => Nom de votre animal favoris ) [secretanswer] => Array ( [0] => String [1] => Réponse à cette question [2] => Victor ) [job] => Array ( [0] => Select [1] => Profession [2] => cadre commercial ) [pass] => Array ( [0] => Password [1] => Mot de passe [2] => sssssssss ) [cpass] => Array ( [0] => Password [1] => Confirmation du mot de passe [2] => ssssssssss ) [text] => Array ( [0] => Textarea [1] => Commentaires éventuels [2] => dddddddddddddddddddddddddddddddddddddddddddddddddd ) )
Merci à ceussss qui m'aideront à sortir de là.....