Bonjour,

Je travaille sur un projet,je veux afficher une page pour la gestion des ventes,et voila le problème qui me donne durant l'exécution:
Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[42S22]: Column not found: 1054 Unknown column 'categories' in 'where clause'' in C:\wamp\www\Opticien\library\Zend\Db\Statement\Pdo.php:228
Stack trace:
#0 C:\wamp\www\Opticien\library\Zend\Db\Statement\Pdo.php(228): PDOStatement->execute(Array)
#1 C:\wamp\www\Opticien\library\Zend\Db\Statement.php(300): Zend_Db_Statement_Pdo->_execute(Array)
#2 C:\wamp\www\Opticien\library\Zend\Db\Adapter\Abstract.php(468): Zend_Db_Statement->execute(Array)
#3 C:\wamp\www\Opticien\library\Zend\Db\Adapter\Pdo\Abstract.php(238): Zend_Db_Adapter_Abstract->query(Object(Zend_Db_Table_Select), Array)
#4 C:\wamp\www\Opticien\library\Zend\Db\Table\Abstract.php(1505): Zend_Db_Adapter_Pdo_Abstract->query(Object(Zend_Db_Table_Select))
#5 C:\wamp\www\Opticien\library\Zend\Db\Table\Abstract.php(1321): Zend_Db_Table_Abstract->_fetch(Object(Zend_Db_Table_Select))
#6 C:\wamp\www\Opticien\application\default\controllers\VenteController.php(34): Zend_Db_Table_Abstract->fetchAll(Object(Z in C:\wamp\www\Opticien\library\Zend\Db\Statement\Pdo.php on line 234
et voici les codes sources:
pour les views:
il y'a 4 fichiers:index.phtml,modifier.phtml,detailler.phtml,supprimer.phtml
index.phtml
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
 
<?php
	$this->headTitle('~OPTICIEN ~ liste des ventes');
?>
 
 
 
<table width="80%">
 
<tr>
 
<td align="center"><h2>Gestion des clients monture</h2></td>
</tr>
<tr>
<td><br><br><br></td>
</tr>
 
<tr>
<td><table cellpadding="0" cellspacing="0" border="0" class="display" id="example">
									<thead>
										<tr >
											<th  style="color:black;">Nom</th>
											<th  style="color:black;">Prenom</th>											
											<th  style="color:black;">Date Visite</th>					
											<th style="color:black;">Modifier</th>
											<th style="color:black;">Supprimer</th>
											<th style="color:black;">D&eacute;tails</th>
 
										</tr>
									</thead>
									<tbody>
											<?php
 
 
											foreach ($this->ventes as $Ventes){
											?>
											<tr>
 
 
												<td class="classtableligne" align="center"><?php echo $Ventes->nom_cl;?></td>
												<td class="classtableligne" align="center"><?php echo $Ventes->prenom_cl ;?></td>
												<td class="classtableligne" align="center"><?php echo $Ventes->date_vente ;?></td>  
 
 
 
												<td align="center"><a href="<?php echo $this->url(array('controller'=>'vente',
           															 'action'=>'modifier', 'id'=>$Ventes->id_vente,'idmodif'=>'modif'));?>"><img alt="Modifier" src="<?php echo $this->baseUrl(); ?>/images/mod.png" /></a></td>
												<td align="center"><a href="<?php echo $this->url(array('controller'=>'vente',
            															'action'=>'supprimer', 'id'=>$Ventes->id_vente,'idsupp'=>'supp'));?>"><img alt="Supprimer" src="<?php echo $this->baseUrl(); ?>/images/sup.png" /></a></td>
												<td align="center"><a href="<?php echo $this->url(array('controller'=>'vente',
           																 'action'=>'detailler', 'id'=>$Ventes->id_vente,'iddet'=>'detaill'));?>"><img alt="details" src="<?php echo $this->baseUrl(); ?>/images/det.png" /></a></td>
 
 
 
											</tr>
 
 
										<?php } ?>
									</tbody>
									<tfoot>
										<tr>
											<th  style="color:black;">Nom</th>
											<th  style="color:black;">Prenom</th>											
											<th  style="color:black;">Date Visite</th>
 
											<th style="color:black;">Modifier</th>
											<th style="color:black;">Supprimer</th>
											<th style="color:black;">D&eacute;tails</th>
 
										</tr>
									</tfoot>
								</table></td>
</tr>
</table>
detailler.phtml
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
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
 
<?php
	$this->headTitle('~ORDONA ~ Détails de la vente monture');
	$this->setEncoding('UTF-8');
	require_once 'persistances/Client.php';
	require_once 'persistances/Vente.php';
	require_once 'persistances/Mesure.php';
?>
 
	              <?php $id = $this->iddeta;?>
	              <?php if ($id ==null) : ?>
	              <table class="tableaub" width="900px"  border="5" style="margin:10px auto  5px auto " >      
				  <tr><td>
 
				  <table class="tableaub" width="900px""  border="0" style="margin:10px auto  5px auto " >  				      
				  <tr><td class="infose"><div align="center">ESPACE ORTHOPTICAL </div></td> </tr>  
				  <tr><td class="infose"><p align="center">CABINET D ORTHOPTIE EXAMEN ET REEDUCATION DES YEUX</td></tr>     
				  <tr><td class="infose"><div align="center">Sana LAHBIL </div></td></tr>   
				  <tr><td class="infose"><div align="center">Opticienne - Orthoptiste </div></td></tr> 
				  <tr><td class="infose"><div align="center">Diplomee de la Faculte de Medecine de Paris - France . </div></td> </tr> 
				  </table>		
 
				  	<p align="center">
					<font face="verdana" size="1"  color="#c0c0c0">__________________________________________________________________________________________
 
					</font></p>
 
				  <table class="list" style="margin:10px auto  5px auto " >
				  <tr class="header">
				  <td colspan="4" class="page" style="text-align: center;"></td>
				  <td style="text-align: right;"></td></tr><tr></tr></table></td>       
				  </tr>      
				  <tr><td>
 
				  <table class="tableaub" style="margin:10px auto  5px auto  "  width="900px" >
				  <tr><td  align="right" infose">Vente n° : </td><td class="infoseg"><?php echo $this->escape($this->cliente->id_cli); ?></td><td align="right" class="infose">Emplyo&eacute; : </td> <td  class="infoseg"><?php echo $this->escape($this->cliente->nom_emp).' '.  $this->escape($this->cliente->prenom_emp); ?> </td></tr>
				  <tr><td  align="right" class="infose">Nom : </td><td class="infoseg"><?php echo $this->escape($this->cliente->nom_cl); ?></td><td align="right" class="infose">Prenom : </td> <td  class="infoseg"><?php echo $this->escape($this->cliente->prenom_cl); ?> </td></tr>
				  <tr><td  align="right" class="infose">TEL : </td><td class="infoseg"><?php echo $this->escape($this->cliente->tel_cl); ?></td><td align="right" class="infose">Adresse : </td> <td class="infoseg"><?php echo $this->escape($this->cliente->adr_cl); ?></td></tr>
				  <tr><td align="right" class="infose">Date : </td> <td class="infoseg"><?php echo $this->escape($this->ventes->date_vente); ?></td><td align="right" class="infose">Suivi par : </td> <td class="infoseg"><?php echo $this->escape($this->cliente->nom_doc).' '.  $this->escape($this->cliente->prenom_doc); ?></td></tr>
				  </table>
 
				  <p align="center">
					<font face="verdana" size="1"  color="#c0c0c0">__________________________________________________________________________________________
				</font></p>
 
				  <table class="list" style="margin:15px auto 15px auto " border="3">
				  <tr class="header"><td colspan="4" class="page" style="text-align: center;"></td><td style="text-align: right;"></td></tr>
				  <tr></tr></table>
 
				  <h3>OD</h3>
				  <table class="list" style="margin:15px auto 15px auto " border="3">
				  <tr class="header"><td colspan="4" class="page" style="text-align: center;"></td><td style="text-align: right;"></td></tr>
				  <tr></tr></table> </td> </tr> 
 
				  <tr> <td>				  
				  <table class="tableaub" style="margin:15px auto 15px auto "  width="900px" border="3">
				  <tr><td class="infoseg">Axe </td><td class="infoseg">Cylindre </td><td class="infoseg">Sphere </td><td class="infoseg">Prisme </td>
				  <td class="infoseg">Ecart  </td><td class="infoseg"> Hauteur</td></tr>
				  <tr><td class="infoseg"><input class="infoseg" type="text" name="od_axe"  value="<?php echo $this->escape($this->mesure->oda); ?>" readonly> 
				  </td><td class="infoseg"><input class="infoseg" type="text" name="od_cylindre"  value=" <?php echo $this->escape($this->mesure->odc); ?>"readonly> 
				  </td><td class="infoseg"><input class="infoseg" type="text" name="od_sphere" value="<?php echo $this->escape($this->mesure->ods); ?>"   readonly> 
				  </td><td class="infoseg"><input class="infoseg" type="text" name="od_prisme" value="<?php echo $this->escape($this->mesure->prismeod); ?>"  readonly> 
				  </td><td class="infoseg"><input class="infoseg" type="text" name="od_ecart"  value="<?php echo $this->escape($this->mesure->eod); ?>"readonly> 
				  </td><td class="infoseg"><input class="infoseg" type="text" name="od_hauteur" value="<?php echo $this->escape($this->mesure->hod ); ?>"  readonly> 
 
				  </td></tr></table>
				 	  <p align="center">
					<font face="verdana" size="1"  color="#c0c0c0">__________________________________________________________________________________________
				</font></p>
 
				  <table class="list" style="margin:15px auto 15px auto " border="3">
				  <tr class="header"><td colspan="4" class="page" style="text-align: center;"></td><td style="text-align: right;"></td></tr>
				  <tr></tr></table>
				  <h3>OG</h3>
				  <table class="list" style="margin:15px auto 15px auto " border="3">
				  <tr class="header"><td colspan="4" class="page" style="text-align: center;"></td><td style="text-align: right;"></td></tr>
				  <tr></tr>				  
				  </table></td></tr>     
				  <tr><td>
 
				  <table border="3" class="tableaub" style="margin:15px auto 15px auto "  width="900px" ><tr><td class="infoseg">Axe </td>
				  <td class="infoseg">Cylindre </td><td class="infoseg">Sphere </td><td class="infoseg">Prisme </td>
				  <td class="infoseg">Ecart  </td><td class="infoseg"> Hauteur</td></tr>
				  <tr><td class="infoseg"><input class="infoseg" type="text" name="og_axe"  value="<?php echo $this->escape($this->mesure->oga); ?>" readonly> </td>
				  <td class="infoseg"><input class="infoseg" type="text" name="og_cylindre"  value="<?php echo $this->escape($this->mesure->ogc); ?> "readonly> </td>
				  <td class="infoseg"><input class="infoseg" type="text" name="og_sphere" value=" <?php echo $this->escape($this->mesure->ogs); ?>"   readonly> </td>
				  <td class="infoseg"><input class="infoseg" type="text" name="og_prisme" value="<?php echo $this->escape($this->mesure->prismeog); ?>"  readonly> </td>
				  <td class="infoseg"><input class="infoseg" type="text" name="og_ecart"  value="<?php echo $this->escape($this->mesure->eog); ?>"readonly> </td>
				  <td class="infoseg"><input class="infoseg" type="text" name="og_hauteur" value="<?php echo $this->escape($this->mesure->hog); ?>"  readonly> </td></tr>
				  <tr class="header"><td colspan="4" class="page" style="text-align: center;"></td><td style="text-align: right;"></td></tr>
 
 
				  <tr><td class="infoseg">Addition :</td>
				  <td class="infoseg"><input class="infoseg" type="text" name="addition"  value="<?php echo $this->escape($this->mesure->add); ?>"readonly> </td>
				  <td class="infoseg">Notes :</td>
				  <td  colspan="" class="infoseg"><input class="infoseg" type="text" name="commentaire_or" value="<?php echo $this->escape($this->mesure->notes); ?>"  readonly size="70px" > </td></tr></table>
 
				  	  <p align="center">
					<font face="verdana" size="1"  color="#c0c0c0">__________________________________________________________________________________________
				</font></p>
 
				  <table class="list" style="margin:15px auto 15px auto " border="3">
				  <tr class="header"><td colspan="4" class="page" style="text-align: center;"></td>
				  <td style="text-align: right;"></td></tr><tr></tr></table>
 
 
				  <h3 >Commande</h3>				 
				  <table class="list" style="margin:15px auto 15px auto " border="3">
				  <tr class="header"><td colspan="4" class="page" style="text-align: center;"></td>
				  <td style="text-align: right;"></td></tr>
				  <tr></tr></table>
 
				  <table  class="tableaub" style="margin:15px auto 15px auto "  width="900px" border="3">
				  <tr>  
				   <th align="left"  class="infoseg">Verre</th></tr>
 
 
				   <tr  align="left"><td class="in_entet" width="20% ">Type</td><td class="in_entet" width="20% ">Caracteristique</td>
				   <td class="in_entet" width=" 20%">Matiere</td><td class="in_entet" width=" 20%">Prix</td></tr>
 
				  <tr align="left">
				  <td class="infoseg"><input class="infoseg" type="text" name="type_verre" value="<?php echo $this->escape($this->ventes->type_v); ?>"  readonly> </td>
				  <td class="infoseg"><input class="infoseg" type="text" name="carac_vegrre"   value="<?php echo $this->escape($this->ventes->caract_v ); ?>"readonly> </td>
				  <td class="infoseg"><input class="infoseg" type="text" name="mat_verre"   value="<?php echo $this->escape($this->ventes->matiere_v); ?>"readonly> </td>
				  <td class="infoseg"><input class="infoseg" type="text" name="carac_verre"   value="<?php echo $this->escape($this->ventes->prix_v  ); ?>"readonly> </td></tr>
				  </table> 
 
				   <table class="tableaub" style="margin:15px auto 15px auto"  width="900px" border="3">  	 	
				   <tr>   <th align="left"  colspan="" class="infoseg">Lentille</th></tr>
				   <tr align="left">  <td  width="20%" colspan="2" class="in_entet">Type</td><td width="20%" class="in_entet">Caracteristique</td><td class="in_entet" width="20%">Prix</td><td class="in_entet" width="20%"></td></tr>
				   <tr align="left">
				   <td class="infoseg" colspan="2"><input class="infoseg" type="text" name="type_lentille"  value="<?php echo $this->escape($this->ventes->type_l  ); ?>" readonly> </td>
				   <td class="infoseg"><input class="infoseg" type="text" name="carac_lentille"  value="<?php echo $this->escape($this->ventes->caract_l  ); ?>" readonly> </td>
				   <td class="infoseg"><input class="infoseg" type="text" name="carac_lentille"  value="<?php echo $this->escape($this->ventes->prix_l  ); ?>" readonly> </td></tr>
				   </table> 
 
				   <table class="tableaub" style="margin:15px auto 15px auto"  width="900px" border="3">
 
				   <tr> <th align="left" colspan="3" class="infoseg">Monture</th></tr>
				   <tr align="left"><td class="in_entet" width="20%" colspan="2">Reference</td>
				   <td class="in_entet" width="20%">Marque</td><td class="in_entet" width="20%">Prix</td><td class="in_entet" width="20%">  </td></tr>
				   <tr align="left"><td class="infoseg" colspan="2"><input class="infoseg" type="text" name="ref_monture"  value="<?php echo $this->escape($this->ventes->ref_article  ); ?>" readonly> </td>
				   <td class="infoseg"><input class="infoseg" type="text" name="marque_monture"  value="<?php echo $this->escape($this->ventes->marque  ); ?>" readonly> </td>
				   <td class="infoseg"><input class="infoseg" type="text" name="marque_monture"  value="<?php echo $this->escape($this->ventes->prix_article  ); ?>" readonly> </td></tr>
				   </table>
 
<?php else :?>
	              <table class="tableaub" width="900px"  border="5" style="margin:10px auto  5px auto " >      
				  <tr><td>
 
				  <table class="tableaub" width="900px""  border="0" style="margin:10px auto  5px auto " >  				      
				  <tr><td class="infose"><div align="center">ESPACE ORTHOPTICAL </div></td> </tr>  
				  <tr><td class="infose"><p align="center">CABINET D ORTHOPTIE EXAMEN ET REEDUCATION DES YEUX</td></tr>     
				  <tr><td class="infose"><div align="center">Sana LAHBIL </div></td></tr>   
				  <tr><td class="infose"><div align="center">Opticienne - Orthoptiste </div></td></tr> 
				  <tr><td class="infose"><div align="center">Diplomee de la Faculte de Medecine de Paris - France . </div></td> </tr> 
				  </table>		
 
				  	<p align="center">
					<font face="verdana" size="1"  color="#c0c0c0">__________________________________________________________________________________________
 
					</font></p>
 
				  <table class="list" style="margin:10px auto  5px auto " >
				  <tr class="header">
				  <td colspan="4" class="page" style="text-align: center;"></td>
				  <td style="text-align: right;"></td></tr><tr></tr></table></td>       
				  </tr>      
				  <tr><td>
 
				  <table class="tableaub" style="margin:10px auto  5px auto  "  width="900px" >
				  <tr><td  align="right" infose">Vente n° : </td><td class="infoseg"><?php echo $this->escape($this->cliente->id_cli); ?></td><td align="right" class="infose">Emplyo&eacute; : </td> <td  class="infoseg"><?php echo $this->escape($this->cliente->nom_emp).' '.  $this->escape($this->cliente->prenom_emp); ?> </td></tr>
				  <tr><td  align="right" class="infose">Nom : </td><td class="infoseg"><?php echo $this->escape($this->cliente->nom_cl); ?></td><td align="right" class="infose">Prenom : </td> <td  class="infoseg"><?php echo $this->escape($this->cliente->prenom_cl); ?> </td></tr>
				  <tr><td  align="right" class="infose">TEL : </td><td class="infoseg"><?php echo $this->escape($this->cliente->tel_cl); ?></td><td align="right" class="infose">Adresse : </td> <td class="infoseg"><?php echo $this->escape($this->cliente->adr_cl); ?></td></tr>
				  <tr><td align="right" class="infose">Date : </td> <td class="infoseg"><?php echo $this->escape($this->ventes->date_vente); ?></td><td align="right" class="infose"> </td> <td class="infoseg"></td></tr>
				  </table>
 
				  <p align="center">
					<font face="verdana" size="1"  color="#c0c0c0">__________________________________________________________________________________________
				</font></p>
 
				  <table class="list" style="margin:15px auto 15px auto " border="3">
				  <tr class="header"><td colspan="4" class="page" style="text-align: center;"></td><td style="text-align: right;"></td></tr>
				  <tr></tr></table>
 
 
				  </td> </tr> 
 
 
				  <tr><td>
 
 
				  <table class="list" style="margin:15px auto 15px auto " border="3">
				  <tr class="header"><td colspan="4" class="page" style="text-align: center;"></td>
				  <td style="text-align: right;"></td></tr><tr></tr></table>
 
 
				  <h3 >Commande</h3>				 
				  <table class="list" style="margin:15px auto 15px auto " border="3">
				  <tr class="header"><td colspan="4" class="page" style="text-align: center;"></td>
				  <td style="text-align: right;"></td></tr>
				  <tr></tr></table>
 
				  <table  class="tableaub" style="margin:15px auto 15px auto "  width="900px" border="3">
				  <tr>  
				   <th align="left"  class="infoseg">Verre</th></tr>
 
 
				   <tr  align="left"><td class="in_entet" width="20% ">Type</td><td class="in_entet" width="20% ">Caracteristique</td>
				   <td class="in_entet" width=" 20%">Matiere</td><td class="in_entet" width=" 20%">Prix</td></tr>
 
				  <tr align="left">
				  <td class="infoseg"><input class="infoseg" type="text" name="type_verre" value="<?php echo $this->escape($this->ventes->type_v); ?>"  readonly> </td>
				  <td class="infoseg"><input class="infoseg" type="text" name="carac_vegrre"   value="<?php echo $this->escape($this->ventes->caract_v ); ?>"readonly> </td>
				  <td class="infoseg"><input class="infoseg" type="text" name="mat_verre"   value="<?php echo $this->escape($this->ventes->matiere_v); ?>"readonly> </td>
				  <td class="infoseg"><input class="infoseg" type="text" name="carac_verre"   value="<?php echo $this->escape($this->ventes->prix_v  ); ?>"readonly> </td></tr>
				  </table> 
 
				   <table class="tableaub" style="margin:15px auto 15px auto"  width="900px" border="3">  	 	
				   <tr>   <th align="left"  colspan="" class="infoseg">Lentille</th></tr>
				   <tr align="left">  <td  width="20%" colspan="2" class="in_entet">Type</td><td width="20%" class="in_entet">Caracteristique</td><td class="in_entet" width="20%">Prix</td><td class="in_entet" width="20%"></td></tr>
				   <tr align="left">
				   <td class="infoseg" colspan="2"><input class="infoseg" type="text" name="type_lentille"  value="<?php echo $this->escape($this->ventes->type_l  ); ?>" readonly> </td>
				   <td class="infoseg"><input class="infoseg" type="text" name="carac_lentille"  value="<?php echo $this->escape($this->ventes->caract_l  ); ?>" readonly> </td>
				   <td class="infoseg"><input class="infoseg" type="text" name="carac_lentille"  value="<?php echo $this->escape($this->ventes->prix_l  ); ?>" readonly> </td></tr>
				   </table> 
 
				   <table class="tableaub" style="margin:15px auto 15px auto"  width="900px" border="3">
 
				   <tr> <th align="left" colspan="3" class="infoseg">Monture</th></tr>
				   <tr align="left"><td class="in_entet" width="20%" colspan="2">Reference</td>
				   <td class="in_entet" width="20%">Marque</td><td class="in_entet" width="20%">Prix</td><td class="in_entet" width="20%">  </td></tr>
				   <tr align="left"><td class="infoseg" colspan="2"><input class="infoseg" type="text" name="ref_monture"  value="<?php echo $this->escape($this->ventes->ref_article  ); ?>" readonly> </td>
				   <td class="infoseg"><input class="infoseg" type="text" name="marque_monture"  value="<?php echo $this->escape($this->ventes->marque  ); ?>" readonly> </td>
				   <td class="infoseg"><input class="infoseg" type="text" name="marque_monture"  value="<?php echo $this->escape($this->ventes->prix_article  ); ?>" readonly> </td></tr>
				   </table>
<?php endif;?>
 
 
				   <table border="3"><tr style="height:200px;"><td colspan="2">  </td></tr></table></td></tr>
				   <tr><td class="infose">
<input type="submit" value="Imprimer" class="infofiche" id="noimprime" onclick="javascript:window.print()"/>
</td><td>       </td>       </tr>      
				  </table>
modifier.phtml
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
<?php
	$this->headTitle('~opticien~ Modifier un docteur ');
?>
	 <div align="center"><h2>Gestion des ventes</h2></div>
	<div align=center >
	       <fieldset style="width:59%;"><legend>Modifier une vente</legend>
	            	<?php echo $this->form; ?>
           </fieldset>
          </div>
supprimer.phtml
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
<?php
    $this->headTitle('~Opticien~Suppression d\'un docteur');
?>
 
<div align="center"><h2>Gestion des docteurs</h2></div>
 
<?php if ($this->docteur) :?>
<p>&Ecirc;tes-vous s&ucirc;r de vouloir <font color="#FF0000">supprimer le docteur</font>
    '<?php echo $this->escape($this->docteur->nom_doc); ?>'?
</p>
<form action="<?php echo $this->url(array('controller'=>'docteur','action'=>'supprimer')); ?>" method="post">
<div>
    <input type="hidden" name="id_objet" value="<?php echo $this->docteur->id_doc; ?>" />
    <input type="submit" name="del" value="Oui" />
    <input type="submit" name="del" value="Non" />
</div>
</form>
<?php else: ?>
<p>Votre Opération n'est pas effectué.</p>
<?php endif;?>
pour le modèle:

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
 
<?php
class Vente extends Zend_Db_Table
{
    protected $_name = 'vente';
    protected $_primary = 'id_vente';
 
     protected $_referenceMap = array('idcli'=>array('columns'=>array('id_cli'),'refTableClass'=>'Client','refColumns'=>array('id_cli'),'onDelete'=>self::CASCADE),
 
						              'refarticle'=>array('columns'=>array('id_produit'),'refTableClass'=>'Produit','refColumns'=>array('id_produit'),'onDelete'=>self::CASCADE),
                                      'idemp'=>array('columns'=>array('id_emp'),'refTableClass'=>'Employe','refColumns'=>array('id_emp'),'onDelete'=>self::CASCADE));
 
 
}
?>
et pour le controller voici le code:
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
 
<?php
 
/**
 * IndexController - The default controller class
 * 
 * @author
 * @version 
 */
 
require_once 'Zend/Controller/Action.php';
 
require_once 'persistances/Client.php';
require_once 'persistances/Vente.php';
require_once 'persistances/Mesure.php';
 
class VenteController extends Zend_Controller_Action 
{
	/**
	 * The default action - show the home page
	 */
    public function indexAction() 
    {
 
    	        // TODO Auto-generated IndexController::indexAction() action
 
 
 
   //  $idmontre = $this->_request->getParam('idmontre', 0);	
 
 
       	$table = new Vente();
	$select = $table->select()->from($table)
	->where('categories = ?','monture');
	$users = $table->fetchAll($select);
	$this->view->ventes= $users;
 
 
 
    }
 
 public function detaillerAction(){
 
    	   $iddetaille = $this->_request->getParam('iddet', 0);
     $this->view->iddeta= $iddetaille;	
    if($this->_request->isGet()) {
			$clients=new Client() ;
			$id_ventes=$this->_request->getParam('id');
			$where='id_cli='.$id_ventes;
			$this->view->cliente=$clients->fetchRow($where);
 
			$ventes=new Vente() ;			
			$where2='id_vente='.$id_ventes;
			$this->view->ventes=$ventes->fetchRow($where2);
 
			$mesures=new Mesure() ;
			$where3='id_mesure='.$id_ventes;
			$this->view->mesure=$mesures->fetchRow($where3);
		}
 
    }
 
	public function ajouterAction() 
    {
        // TODO Auto-generated IndexController::indexAction() action
 
    $this->view->title = "Ajouter une posologie";
        $form = new FormulairePosologie();
        $form->submit->setLabel('Ajouter');
        $this->view->form = $form;
        if ($this->_request->isPost()) {
            $formData = $this->_request->getPost();
            if ($form->isValid($formData)) {
                $posologies = new posologie();
                $row = $posologies->createRow();
                $row->lib_poso = $form->getValue('lib_poso');
             	$row->lib_poso=strtoupper($row->lib_poso);
                $row->save();
 
                $this->_redirect('/posologie');
            } else {
                $form->populate($formData);
            }
        }
    }
	public function modifierAction() 
    {
        // TODO Auto-generated IndexController::indexAction() action
 
    $this->view->title = "Modifier une posologie";
        $form = new FormulairePosologie();
        $form->submit->setLabel('Mise A Jour');
        $this->view->form = $form;
 
        if($this->_request->isPost()) {
            $formulaire=$this->_request->getPost();
            if($form->isValid($formulaire)) {
                $posologies=new posologie();
                $id_poso=(int)$form->getValue('id_poso');
                $ligne=$posologies->fetchRow('id_poso='.$id_poso);
                $ligne->lib_poso=$form->getValue('lib_poso');
                $ligne->lib_poso=strtoupper($ligne->lib_poso);
                $ligne->save();
                $ligne->lib_poso=strtoupper($ligne->lib_poso);
                $this->_redirect('/posologie');
            }            
 
            else {
                $form->populate($formulaire);
            }
        } else {
            // L'id de l'album est attendu dans $params['id']
            $id = (int)$this->_request->getParam('id', 0);
            if ($id > 0) {
                $posologies = new posologie();
                $poso = $posologies->fetchRow('id_poso='.$id);
                $form->populate($poso->toArray());
            }
        }
    }
	public function supprimerAction() 
    {
        // TODO Auto-generated IndexController::indexAction() action
 
    $this->view->title = "Supprimer une posologie ";
 
        if ($this->_request->isPost()) {
            $id_poso = (int)$this->_request->getPost('id_poso');
            $del = $this->_request->getPost('del');
            if ($del == 'Oui' && $id_poso > 0) {
                $posologies = new posologie();
                $where = 'id_poso = ' . $id_poso;
                $posologies->delete($where);
            }
            $this->_redirect('/posologie');
        } else {
            $id_poso = (int)$this->_request->getParam('id');
            if ($id_poso > 0) {
                $posologies = new posologie();
                $this->view->posologie = $posologies->fetchRow('id_poso='.$id_poso);
            }
        }
    }
}
?>
Ou est donc le problème?